/* ==========================================================================
   Advanced Hero Slider — Frontend Styles
   اصل معماری: هر Layer یک عنصر مستقل با position:absolute است.
   فقط از transform/opacity/filter برای انیمیشن استفاده می‌شود (GPU-friendly).
   ========================================================================== */

.ahs-slider {
	--ahs-transition-duration: 900ms;
	position: relative;
	width: 100%;
	overflow: hidden;
	min-height: 480px;
	aspect-ratio: 16 / 8;
	background: #0f0f12;
	direction: ltr; /* موقعیت‌دهی درصدی مستقل از جهت زبان است */
}

@media (max-width: 782px) {
	.ahs-slider {
		aspect-ratio: 4 / 5;
		min-height: 420px;
	}
}

.ahs-track {
	position: relative;
	width: 100%;
	height: 100%;
}

/* ------------------------------------------------------------------------
   هر Slide یک لایه مستقل روی هم قرارگرفته است
   ------------------------------------------------------------------------ */
.ahs-slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	z-index: 1;
	transition:
		opacity var(--ahs-transition-duration) cubic-bezier(.22, .61, .36, 1),
		transform var(--ahs-transition-duration) cubic-bezier(.22, .61, .36, 1),
		filter var(--ahs-transition-duration) cubic-bezier(.22, .61, .36, 1);
	will-change: transform, opacity, filter;
}

.ahs-slide.is-active {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: none;
	filter: none;
	z-index: 2;
}

.ahs-slide.is-prev {
	opacity: 0;
	transform: translateX(-6%) scale(.94);
	filter: blur(8px);
}

.ahs-slide.is-next {
	opacity: 0;
	transform: translateX(6%) scale(.94);
	filter: blur(8px);
}

/* ------------------------------------------------------------------------
   Layer 1 — Background (کاملاً مستقل از Main Object)
   ------------------------------------------------------------------------ */
.ahs-bg {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	transform: scale(1.08);
	transition: transform calc(var(--ahs-transition-duration) * 1.35) cubic-bezier(.22, .61, .36, 1);
}

.ahs-slide.is-active .ahs-bg {
	transform: scale(1);
}

.ahs-bg-overlay {
	position: absolute;
	inset: 0;
}

/* ------------------------------------------------------------------------
   Layer 2 — Decorative Elements
   ------------------------------------------------------------------------ */
.ahs-decorations {
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 3;
}

.ahs-deco {
	position: absolute;
	left: var(--ahs-deco-x);
	top: var(--ahs-deco-y);
	width: var(--ahs-deco-w);
	height: var(--ahs-deco-w);
	transform: translate(-50%, -50%) rotate(var(--ahs-deco-r));
}

.ahs-deco-shape-circle {
	border-radius: 50%;
}

.ahs-deco-shape-line {
	height: 3px !important;
	border-radius: 3px;
}

.ahs-deco-shape-blob {
	border-radius: 62% 38% 55% 45% / 45% 55% 45% 55%;
	filter: blur(1px);
}

.ahs-deco-shape-glow {
	border-radius: 50%;
	filter: blur(30px);
}

.ahs-deco-image {
	object-fit: contain;
	height: auto;
}

.ahs-deco-anim-float {
	animation: ahs-float 6s ease-in-out infinite;
}

.ahs-deco-anim-pulse {
	animation: ahs-pulse 3.2s ease-in-out infinite;
}

.ahs-deco-anim-spin {
	animation: ahs-spin 14s linear infinite;
}

@keyframes ahs-float {
	0%, 100% { transform: translate(-50%, -50%) rotate(var(--ahs-deco-r)) translateY(0); }
	50%      { transform: translate(-50%, -50%) rotate(var(--ahs-deco-r)) translateY(-16px); }
}

@keyframes ahs-pulse {
	0%, 100% { transform: translate(-50%, -50%) rotate(var(--ahs-deco-r)) scale(1); }
	50%      { transform: translate(-50%, -50%) rotate(var(--ahs-deco-r)) scale(1.12); }
}

@keyframes ahs-spin {
	from { transform: translate(-50%, -50%) rotate(0deg); }
	to   { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ------------------------------------------------------------------------
   Layer 3 — Main Object
   نکته حیاتی: این‌جا همیشه یک <img> مستقل است، هرگز background-image نیست.
   ------------------------------------------------------------------------ */
.ahs-main-object-wrap {
	position: absolute;
	left: var(--ahs-mo-x-d);
	top: var(--ahs-mo-y-d);
	width: var(--ahs-mo-w-d);
	transform: translate(-50%, -50%) rotate(var(--ahs-mo-r-d)) scale(var(--ahs-mo-s-d));
	z-index: 4;
	pointer-events: none;
}

.ahs-main-object {
	display: block;
	width: 100%;
	height: auto;
	filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .35));
	opacity: 0;
	transform: scale(.85) translateY(40px);
	transition:
		opacity var(--ahs-anim-duration, 900ms) cubic-bezier(.22, .61, .36, 1),
		transform var(--ahs-anim-duration, 900ms) cubic-bezier(.22, .61, .36, 1);
	transition-delay: var(--ahs-anim-delay, 0ms);
}

.ahs-slide.ahs-play .ahs-main-object {
	opacity: 1;
	transform: scale(1) translateY(0);
}

.ahs-slide.is-prev .ahs-main-object,
.ahs-slide.is-next .ahs-main-object {
	opacity: 0;
	transform: scale(1.1) translateY(0);
	transition-delay: 0ms;
}

/* انیمیشن‌های جایگزین Main Object، از طریق data-animation قابل انتخاب در ادمین */
.ahs-anim-slide-up .ahs-main-object {
	transform: translateY(60px);
}
.ahs-anim-slide-up.ahs-play .ahs-main-object {
	transform: translateY(0);
}

.ahs-anim-zoom-rotate .ahs-main-object {
	transform: scale(.6) rotate(-12deg);
}
.ahs-anim-zoom-rotate.ahs-play .ahs-main-object {
	transform: scale(1) rotate(0deg);
}

.ahs-anim-none .ahs-main-object {
	transition: none;
	opacity: 1;
	transform: none;
}

@media (max-width: 1024px) {
	.ahs-main-object-wrap {
		left: var(--ahs-mo-x-t);
		top: var(--ahs-mo-y-t);
		width: var(--ahs-mo-w-t);
		transform: translate(-50%, -50%) rotate(var(--ahs-mo-r-t)) scale(var(--ahs-mo-s-t));
	}
}

@media (max-width: 600px) {
	.ahs-main-object-wrap {
		left: var(--ahs-mo-x-m);
		top: var(--ahs-mo-y-m);
		width: var(--ahs-mo-w-m);
		transform: translate(-50%, -50%) rotate(var(--ahs-mo-r-m)) scale(var(--ahs-mo-s-m));
	}
}

/* ------------------------------------------------------------------------
   Layer 4 — Text Layers (هر متن Position مستقل دارد)
   ------------------------------------------------------------------------ */
.ahs-texts {
	position: absolute;
	inset: 0;
	z-index: 5;
}

.ahs-text-item {
	position: absolute;
	left: var(--ahs-t-x-d);
	top: var(--ahs-t-y-d);
	max-width: min(420px, 44%);
	margin: 0;
	opacity: 0;
	transform: translateY(30px);
	transition:
		opacity var(--ahs-transition-duration) cubic-bezier(.22, .61, .36, 1),
		transform var(--ahs-transition-duration) cubic-bezier(.22, .61, .36, 1);
	transition-delay: var(--ahs-anim-delay, 0ms);
	line-height: 1.3;
}

.ahs-slide.ahs-play .ahs-text-item {
	opacity: 1;
	transform: translateY(0);
}

.ahs-slide.is-prev .ahs-text-item,
.ahs-slide.is-next .ahs-text-item {
	opacity: 0;
	transform: translateY(-16px);
	transition-delay: 0ms;
}

@media (max-width: 1024px) {
	.ahs-text-item {
		left: var(--ahs-t-x-t);
		top: var(--ahs-t-y-t);
		max-width: 60%;
	}
}

@media (max-width: 600px) {
	.ahs-text-item {
		left: var(--ahs-t-x-m);
		top: var(--ahs-t-y-m);
		max-width: 80%;
	}
}

.ahs-text-title {
	margin: 0 0 6px;
	letter-spacing: -.01em;
}

.ahs-text-subtitle {
	opacity: .85;
}

.ahs-text-badge {
	display: inline-block;
	padding: 6px 14px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .12);
	backdrop-filter: blur(6px);
	font-size: 12px !important;
	letter-spacing: .04em;
	text-transform: uppercase;
}

.ahs-text-button {
	display: inline-block;
	padding: 13px 30px;
	border-radius: 999px;
	background: #fff;
	color: #0f0f12 !important;
	text-decoration: none;
	font-weight: 600;
	transition: transform .25s ease, box-shadow .25s ease, opacity var(--ahs-transition-duration) ease, translate .0s;
	box-shadow: 0 10px 24px rgba(0, 0, 0, .2);
}

.ahs-text-button:hover {
	transform: translateY(-2px);
	box-shadow: 0 14px 30px rgba(0, 0, 0, .28);
}

/* ------------------------------------------------------------------------
   ناوبری: پیکان‌ها و نقاط
   ------------------------------------------------------------------------ */
.ahs-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 6;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, .35);
	background: rgba(0, 0, 0, .25);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	backdrop-filter: blur(4px);
	transition: background .2s ease, transform .2s ease;
}

.ahs-arrow:hover {
	background: rgba(0, 0, 0, .45);
}

.ahs-arrow-prev { left: 24px; }
.ahs-arrow-next { right: 24px; }

@media (max-width: 600px) {
	.ahs-arrow { width: 38px; height: 38px; }
	.ahs-arrow-prev { left: 12px; }
	.ahs-arrow-next { right: 12px; }
}

.ahs-dots {
	position: absolute;
	bottom: 22px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	gap: 8px;
	z-index: 6;
}

.ahs-dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .4);
	border: none;
	padding: 0;
	cursor: pointer;
	transition: background .2s ease, transform .2s ease;
}

.ahs-dot.is-active {
	background: #fff;
	transform: scale(1.3);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	.ahs-slide,
	.ahs-bg,
	.ahs-main-object,
	.ahs-text-item,
	.ahs-deco {
		transition-duration: 1ms !important;
		animation: none !important;
	}
}
