/* =========================================
   AGRITEX — Hero slider (modern banner)
   Yüklənmə sırası: style.css → hero.css (override)
   style.css TOXUNULMAZ — bu fayl mövcud .hero-* qaydalarını
   override edir. JS (main.js#82-133) eyni class selektor-ları
   istifadə edir, dəyişməyə ehtiyac yoxdur.

   ─── 2 tip slide ───────────────────────────────────────────
   .hero-slide--banner  → admin sliderindəki şəkillər (Slider modeli)
       Desktop: full-bleed background image + overlay + mətn/CTA
       Mobile:  dizayner şəklini ayrı yükləyibsə → klik olunan şəkil
                yüklənməyibsə → desktop ilə eyni overlay layout
   .hero-slide--product → traktor məhsul kartı (split layout)

   ─── Image policy (NO CROP) ────────────────────────────────
   Desktop: aspect-ratio 1920/720 hero container + object-fit:cover
   ilə şəkil təbii nisbətdə tam görünür (sıxılma yoxdur). max-height
   720px böyük 4K monitorlarda da pixel-əsaslı dəqiqlik saxlayır.
   ========================================= */

/* ---------- Hero container ---------- */
.hero {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background: #0a0f08;
}

.hero::before,
.hero::after {
    /* style.css dekorativ blob-ları söndür */
    display: none;
}

.hero-slider {
    position: relative;
    width: 100%;
    /* 1920×720 aspect ratio — şəkil heç vaxt sıxılmır, max 720px boy */
    aspect-ratio: 1920 / 720;
    max-height: 720px;
    min-height: 380px;
    overflow: hidden;
}

/* ---------- Slide base ----------
   style.css-də .hero-slide-də `display: flex` var — biz banner-də
   absolute layout istəyirik, ona görə explicit `display: block` ilə
   override edirik (children öz-özünə absolute positioned). */
.hero-slide {
    position: absolute;
    inset: 0;
    display: block;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.9s ease;
}

.hero-slide.active {
    opacity: 1;
    visibility: visible;
}

/* ============================================================
   BANNER SLIDE — admin sliderindəki şəkillər
   ============================================================ */

/* Desktop wrapper — full-bleed image + overlay + content */
.hero-slide__desktop {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
}

.hero-slide__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.hero-slide__bg picture,
.hero-slide__bg img {
    width: 100%;
    height: 100%;
    display: block;
}

.hero-slide__bg img {
    object-fit: cover;
    /* Şəkil sıxılırsa sağ tərəfdə qalan vacib element (traktor) saxlansın,
       sol tərəfdən (fon/sahə) crop olsun. */
    object-position: right center;
    transform: scale(1.02);
    transition: transform 8s ease-out;
    will-change: transform;
}

.hero-slide--banner.active .hero-slide__bg img {
    /* Ken Burns: aktiv slide-da yavaş zoom */
    transform: scale(1.08);
}

@media (prefers-reduced-motion: reduce) {
    .hero-slide__bg img {
        transform: none !important;
        transition: none;
    }
}

/* Overlay — soldan tünd → sağa şəffaf */
.hero-slide__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(90deg, rgba(10, 25, 8, 0.78) 0%, rgba(10, 25, 8, 0.45) 45%, rgba(10, 25, 8, 0.15) 100%),
        linear-gradient(180deg, rgba(10, 25, 8, 0) 60%, rgba(10, 25, 8, 0.55) 100%);
    pointer-events: none;
}

/* Content layer — absolute fill + flex center → mətn HƏMİŞƏ şəkilin üzərində
   olur, heç bir halda image-ın aşağısında rendering ola bilməz. */
.hero-slide--banner .hero-slide__content {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: auto;
    display: flex;
    align-items: center;
    pointer-events: none;
}

.hero-slide--banner .hero-slide__content > .container {
    pointer-events: auto;
}

.hero-slide__inner--banner {
    max-width: 620px;
    color: #fff;
    padding: 60px 0;
}

/* Banner title */
.hero-slide--banner .hero-slide__title {
    font-size: clamp(32px, 5.2vw, 64px);
    font-weight: 800;
    line-height: 1.08;
    color: #fff;
    margin: 0 0 22px;
    letter-spacing: -0.5px;
    text-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.8s ease 0.25s, transform 0.8s ease 0.25s;
}

.hero-slide--banner .hero-slide__text {
    font-size: clamp(15px, 1.6vw, 19px);
    font-weight: 400;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.92);
    margin: 0 0 36px;
    max-width: 540px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.8s ease 0.4s, transform 0.8s ease 0.4s;
}

.hero-slide--banner .hero-slide__btns {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.8s ease 0.55s, transform 0.8s ease 0.55s;
}

.hero-slide__cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.3px;
    border-radius: 999px;
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 12px 28px rgba(124, 179, 66, 0.45);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.hero-slide__cta:hover {
    background: var(--color-primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 18px 36px rgba(85, 139, 47, 0.5);
    color: #fff;
}

.hero-slide__cta i {
    font-size: 13px;
    transition: transform 0.3s ease;
}

.hero-slide__cta:hover i {
    transform: translateX(4px);
}

.hero-slide--banner.active .hero-slide__title,
.hero-slide--banner.active .hero-slide__text,
.hero-slide--banner.active .hero-slide__btns {
    opacity: 1;
    transform: translateY(0);
}

/* ─── Mobil klik olunan şəkil (designer-uploaded) ─────────── */
.hero-slide__mobile-link {
    display: none; /* desktop-da gizli */
    position: absolute;
    inset: 0;
    z-index: 3;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #0a0f08;
}

.hero-slide__mobile-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
}

/* ─── MOBILE BREAKPOINT ─────────────────────────────────────
   ≤768px: əgər slide-ın mobil şəkili varsa (hero-slide--has-mobile),
   yalnız klik olunan şəkili göstər, desktop overlay-i gizlət.
   Mobil şəkil yoxdursa, desktop overlay göstərilir (fallback).
   ────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .hero-slider {
        /* Mobil-də nisbəti sərbəst burax — şəkil portreti dəstəklənsin.
           min/max boy ekranı dolduracaq qədər, lakin viewport-dan kənar yox. */
        aspect-ratio: auto;
        height: auto;
        min-height: 0;
        max-height: none;
    }

    /* Active slide-ın hündürlüyü hero-slider-ı təyin edir */
    .hero-slide {
        position: relative;
        height: auto;
        opacity: 1;
        visibility: visible;
        display: none;
    }

    .hero-slide.active {
        display: block;
    }

    /* Mobil şəkili varsa: yalnız klik şəkli göstər (designer mətni şəkildə).
       Şəkilin TƏBİİ aspect ratio-su saxlanır — bizim heç bir crop yoxdur.
       img height:auto + width:100% → şəkilin orijinal nisbəti ekrana uyğunlaşdırılır. */
    .hero-slide--has-mobile .hero-slide__mobile-link {
        display: block;
        position: relative;
        inset: auto;
        height: auto;
        width: 100%;
    }

    .hero-slide--has-mobile .hero-slide__mobile-link img {
        display: block;
        width: 100%;
        height: auto;
        object-fit: contain;
        max-height: 92vh; /* çox uzun şəkillər viewport-dan kənara çıxmasın */
    }

    /* Floating CTA pill — sağ-aşağıda, dizaynerin mətnini bloklamaz.
       pointer-events:none → kliklər wrapping <a>-a keçir, pill yalnız vizual.
       safe-area-inset → iPhone notch/home-indicator olan cihazlar üçün. */
    .hero-slide__mobile-cta {
        position: absolute;
        bottom: calc(20px + env(safe-area-inset-bottom, 0px));
        right: 16px;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 12px 20px;
        background: var(--color-primary);
        color: #fff;
        border-radius: 999px;
        font-weight: 600;
        font-size: 14px;
        letter-spacing: 0.2px;
        line-height: 1;
        box-shadow:
            0 10px 24px rgba(85, 139, 47, 0.45),
            0 0 0 4px rgba(255, 255, 255, 0.18);
        pointer-events: none;
        max-width: calc(100% - 32px);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        z-index: 4;
    }

    .hero-slide__mobile-cta i {
        font-size: 12px;
        flex-shrink: 0;
    }

    /* Yalnız aktiv slide-da pulse — diqqəti çəkir, sonra dinclənir */
    .hero-slide--has-mobile.active .hero-slide__mobile-cta {
        animation: heroMobileCtaPulse 2.6s ease-in-out infinite;
    }

    @keyframes heroMobileCtaPulse {
        0%, 100% {
            transform: translateY(0);
            box-shadow:
                0 10px 24px rgba(85, 139, 47, 0.45),
                0 0 0 4px rgba(255, 255, 255, 0.18);
        }
        50% {
            transform: translateY(-4px);
            box-shadow:
                0 16px 30px rgba(85, 139, 47, 0.55),
                0 0 0 6px rgba(255, 255, 255, 0.22);
        }
    }

    @media (prefers-reduced-motion: reduce) {
        .hero-slide--has-mobile.active .hero-slide__mobile-cta {
            animation: none;
        }
    }

    /* Tap feedback — basanda kicik scale aşağı, dərhal feedback */
    .hero-slide--has-mobile .hero-slide__mobile-link:active .hero-slide__mobile-cta {
        transform: scale(0.96);
        transition: transform 0.1s ease;
    }

    .hero-slide--has-mobile .hero-slide__desktop,
    .hero-slide--has-mobile .hero-slide__overlay,
    .hero-slide--has-mobile .hero-slide__content {
        display: none !important;
    }

    /* Mobil şəkili yoxdursa: desktop layout-u mobil-friendly et */
    .hero-slide--banner:not(.hero-slide--has-mobile) .hero-slide__desktop {
        position: relative;
        height: 480px;
    }

    .hero-slide--banner:not(.hero-slide--has-mobile) .hero-slide__overlay {
        background:
            linear-gradient(180deg, rgba(10, 25, 8, 0.25) 0%, rgba(10, 25, 8, 0.55) 55%, rgba(10, 25, 8, 0.85) 100%);
    }

    .hero-slide--banner:not(.hero-slide--has-mobile) .hero-slide__desktop {
        align-items: flex-end;
    }

    .hero-slide--banner:not(.hero-slide--has-mobile) .hero-slide__inner--banner {
        max-width: 100%;
        padding: 0 0 56px;
        text-align: center;
    }

    .hero-slide--banner:not(.hero-slide--has-mobile) .hero-slide__text {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-slide--banner:not(.hero-slide--has-mobile) .hero-slide__btns {
        justify-content: center;
    }
}

/* ============================================================
   PRODUCT SLIDE — traktor məhsul kartı
   ============================================================ */

.hero-slide--product {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #f1f8e9 0%, #ffffff 50%, #e8f5d8 100%);
}

.hero-slide--product .hero-slide__content {
    position: relative;
    width: 100%;
    z-index: 2;
}

.hero-slide--product .hero-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-slide--product .hero-slide__inner {
    max-width: 580px;
    color: var(--color-dark);
}

.hero-slide--product .hero-slide__media {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 460px;
}

.hero-slide--product .hero-slide__media::before {
    content: '';
    position: absolute;
    inset: 30px 60px;
    background: radial-gradient(ellipse at center, rgba(124, 179, 66, 0.18) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
}

.hero-slide--product .hero-slide__media img {
    position: relative;
    z-index: 1;
    max-width: 100%;
    max-height: 480px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.18));
    animation: heroFloat 5s ease-in-out infinite;
    will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
    .hero-slide--product .hero-slide__media img {
        animation: none;
    }
}

@keyframes heroFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

.hero-slide--product .hero-slide__model-tag {
    position: absolute;
    z-index: 2;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    padding: 10px 22px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 14px;
    color: var(--color-dark);
    box-shadow: var(--shadow);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.hero-slide--product .hero-slide__model-tag i {
    color: var(--color-primary-dark);
}

.hero-slide--product .hero-slide__sub {
    display: inline-block;
    background: var(--color-primary-soft);
    border: 1px solid rgba(124, 179, 66, 0.3);
    color: var(--color-primary-dark);
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 22px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease 0.2s;
}

.hero-slide--product .hero-slide__title {
    font-size: clamp(30px, 4.6vw, 54px);
    color: var(--color-dark);
    margin-bottom: 18px;
    line-height: 1.12;
    font-weight: 800;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.7s ease 0.35s;
}

.hero-slide--product .hero-slide__title span {
    color: var(--color-primary-dark);
    position: relative;
}

.hero-slide--product .hero-slide__title span::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 4px;
    height: 8px;
    background: rgba(124, 179, 66, 0.28);
    z-index: -1;
}

.hero-slide--product .hero-slide__text {
    font-size: 17px;
    color: var(--color-muted);
    margin-bottom: 32px;
    max-width: 540px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.7s ease 0.5s;
    line-height: 1.7;
}

.hero-slide--product .hero-slide__btns {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.7s ease 0.65s;
}

.hero-slide--product.active .hero-slide__sub,
.hero-slide--product.active .hero-slide__title,
.hero-slide--product.active .hero-slide__text,
.hero-slide--product.active .hero-slide__btns {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 980px) {
    .hero-slide--product .hero-split {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
    .hero-slide--product .hero-slide__inner {
        max-width: 100%;
        margin: 0 auto;
    }
    .hero-slide--product .hero-slide__media {
        min-height: 320px;
    }
    .hero-slide--product .hero-slide__btns {
        justify-content: center;
    }
}

/* ============================================================
   NAVIGATION — arrows, dots, progress bar
   ============================================================ */

.hero-arrows {
    position: absolute;
    inset: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 5;
}

.hero-arrow {
    pointer-events: auto;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.hero-arrow:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    transform: scale(1.08);
}

.hero-slider:has(.hero-slide--product.active) .hero-arrow {
    background: rgba(255, 255, 255, 0.85);
    color: var(--color-primary-dark);
    border-color: var(--color-border);
}

.hero-slider:has(.hero-slide--product.active) .hero-arrow:hover {
    background: var(--color-primary);
    color: #fff;
}

@media (max-width: 768px) {
    .hero-arrows {
        padding: 0 12px;
    }
    .hero-arrow {
        width: 42px;
        height: 42px;
        font-size: 14px;
    }
}

/* Dots */
.hero-dots {
    position: absolute;
    bottom: 36px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 5;
}

.hero-dots button {
    width: 32px;
    height: 4px;
    border-radius: 4px;
    border: none;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    padding: 0;
    transition: background 0.3s ease, width 0.3s ease;
}

.hero-dots button.active {
    background: #fff;
    width: 48px;
}

.hero-slider:has(.hero-slide--product.active) .hero-dots button {
    background: rgba(85, 139, 47, 0.3);
}

.hero-slider:has(.hero-slide--product.active) .hero-dots button.active {
    background: var(--color-primary-dark);
}

@media (max-width: 768px) {
    /* Mobil-də dot-lar həmişə hər hansı fon üzərində oxunsun deyə pill kapsulu.
       Sol-aşağıda yerləşir ki sağ-aşağıdakı floating CTA ilə kəsişməsin. */
    .hero-dots {
        bottom: calc(20px + env(safe-area-inset-bottom, 0px));
        left: 16px;
        transform: none;
        gap: 6px;
        padding: 7px 10px;
        background: rgba(10, 25, 8, 0.45);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border-radius: 999px;
    }
    .hero-dots button {
        width: 18px;
        height: 3px;
        background: rgba(255, 255, 255, 0.55);
    }
    .hero-dots button.active {
        width: 28px;
        background: #fff;
    }
}

/* Progress bar */
.hero-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.15);
    z-index: 4;
}

.hero-progress__bar {
    display: block;
    height: 100%;
    width: 0;
    background: var(--color-primary);
    transform-origin: left center;
    animation: heroProgress 6.5s linear infinite;
}

@keyframes heroProgress {
    0% { width: 0; }
    100% { width: 100%; }
}

.hero-slider:hover .hero-progress__bar {
    animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
    .hero-progress__bar {
        animation: none;
        width: 100%;
        opacity: 0.4;
    }
}

.hero-slider:has(.hero-slide--product.active) .hero-progress {
    background: rgba(85, 139, 47, 0.15);
}

@media (max-width: 768px) {
    .hero-progress {
        display: none;
    }
}
