/* =========================================
   AGRITEX — Content additions
   Responsive YouTube embed + menu highlights
   + branch-card badge fix.
   style.css TOXUNULMAZ — bütün düzəlişlər burada.
   ========================================= */

/* ---------- Responsive YouTube embed ---------- */
.video-embed {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    margin: 20px 0;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    background: #000;
}

.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* YouTube Shorts — 9:16 vertikal frame.
   Ölçü viewport HÜNDÜRLÜYÜNDƏN hesablanır: en = 60vh × 9/16.
   Belə həm böyük desktop-da çox uzanmır, həm də mobildə ekrandan
   çıxmır (Shorts təbii 9:16 olduğuna görə boy-əsaslı sizing daha
   düzgün nəticə verir).
   - max-width 90vw → çox dar telefonlarda overflow yox
   - max-width 340px → desktop-da geniş açılmasın
   - max-height 540px → çox uzun ekranlarda da məntiqli qalsın */
.video-embed--shorts {
    width: calc(min(60vh, 540px) * 9 / 16);
    aspect-ratio: 9 / 16;
    height: auto;
    max-width: min(90vw, 340px);
    max-height: 540px;
    padding-bottom: 0;
    margin-left: auto;
    margin-right: auto;
}

/* Fallback: aspect-ratio dəstəklənməyən köhnə brauzerlər üçün */
@supports not (aspect-ratio: 1 / 1) {
    .video-embed--shorts {
        width: min(90vw, 304px);
        height: 0;
        padding-bottom: min(160vw, 540px);
    }
}

/* ---------- Menu: "Kampaniyalar" vurğulu ---------- */
.nav > li.nav-campaigns > a {
    background: #dc2626; /* qırmızı */
    color: #fff;
    font-weight: 600;
    position: relative;
    padding-right: 32px;
}

.nav > li.nav-campaigns > a:hover,
.nav > li.nav-campaigns.active > a {
    background: #991b1b; /* tünd qırmızı */
    color: #fff;
}

.nav > li.nav-campaigns > a::before {
    content: '\f06d';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 6px;
    font-size: 12px;
}

.nav > li.nav-campaigns > a::after {
    content: '%';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Mobile: badge-i sadələşdir */
@media (max-width: 980px) {
    .nav > li.nav-campaigns > a {
        background: transparent;
        color: var(--color-text);
        padding-right: 14px;
    }
    .nav > li.nav-campaigns > a::after {
        display: none;
    }
    .nav > li.nav-campaigns > a::before {
        color: #dc2626;
    }
}

/* ---------- Branch card: "Baş ofis" badge ---------- */
/* Ayrıca class — .product-card__badge "position:absolute" ilə top/left
   verirdi və bəzi kontekstdə badge səhifənin sol-üstünə qaçırdı. */
.branch-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    align-self: center;
    background: var(--color-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 5px 12px;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
}

.branch-card__badge i {
    font-size: 10px;
}

.branch-card__head {
    flex-wrap: wrap;
}

/* Köhnə nüsxələri də sıfırla (cache-li HTML hələ də .product-card__badge
   render edə bilər) — heç vaxt sol-üst-də absolute qalmasın. */
.branch-card .product-card__badge,
.branch-card__head .product-card__badge {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    margin-left: auto;
    flex-shrink: 0;
    align-self: center;
}

/* ========================================================
   Tractor detail gallery — thumbnail carousel
   style.css `.gallery__thumbs` `grid auto-fill` qaytarırdı →
   ≥7 şəkildə alta düşürdü. İndi horizontal scroll + snap.
   ======================================================== */

.gallery__thumbs-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
}

/* Override style.css `.gallery__thumbs { display: grid; ... }`.
   Eyni specificity, lakin content.css sonra yüklənir → kaskad qaydası ilə
   bu rule qalib gəlir. */
.gallery__thumbs-wrap .gallery__thumbs {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    flex: 1 1 0;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--color-primary) rgba(0, 0, 0, 0.05);
    padding: 4px 2px 10px;
    -webkit-overflow-scrolling: touch; /* iOS momentum */
    /* Sağ kənarda yumşaq fade-out — daha çox şəkil olduğunu vizual göstərir */
    mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 24px), transparent 100%);
    -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 24px), transparent 100%);
}

/* Webkit scrollbar (Chrome/Safari/Edge) */
.gallery__thumbs-wrap .gallery__thumbs::-webkit-scrollbar {
    height: 6px;
}
.gallery__thumbs-wrap .gallery__thumbs::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 999px;
}
.gallery__thumbs-wrap .gallery__thumbs::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 999px;
}

/* Override style.css `.gallery__thumb { aspect-ratio: 1/1 }` to enforce
   fixed-width flex item (grid item-dən fərqlənir). */
.gallery__thumbs-wrap .gallery__thumb {
    flex: 0 0 92px;
    width: 92px;
    height: 92px;
    aspect-ratio: 1 / 1;
    scroll-snap-align: start;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: linear-gradient(135deg, #ffffff 0%, #f7faf2 100%);
    cursor: pointer;
    padding: 0;
    position: relative;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery__thumbs-wrap .gallery__thumb:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(85, 139, 47, 0.18);
    border-color: var(--color-primary-light);
}

.gallery__thumbs-wrap .gallery__thumb.active {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary) inset;
}

.gallery__thumbs-wrap .gallery__thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
    display: block;
}

/* Sol/sağ scroll düymələri — yalnız 4-dən çox thumb varsa render olunur */
.gallery__thumbs-arrow {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: #fff;
    color: var(--color-primary-dark);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease, border-color 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    z-index: 2;
}

.gallery__thumbs-arrow:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
    transform: scale(1.06);
}

.gallery__thumbs-arrow.is-disabled {
    opacity: 0.35;
    pointer-events: none;
}

.gallery__thumbs-arrow i {
    font-size: 13px;
}

/* Mobil — düymələri gizlət, scroll + swipe kifayətdir */
@media (max-width: 768px) {
    .gallery__thumbs-arrow {
        display: none;
    }
    .gallery__thumbs-wrap .gallery__thumb {
        flex: 0 0 76px;
        width: 76px;
        height: 76px;
    }
    .gallery__thumbs-wrap .gallery__thumbs {
        gap: 8px;
    }
}

/* ========================================================
   Contact info — WhatsApp Channel CTA (yaşıl kartın daxili)
   Köhnə tək yaşıl yumru WhatsApp ikonunu əvəz edir: full-width
   "kanala qoşul" kartı yaşıl panelin altındakı boş yeri doldurur.
   ======================================================== */

/* Working hours komponenti yaşıl bg üzərində — inline gray rəng oxunmur,
   ağ tonal-ə override. Komponentin daxili inline-style-ları forge ilə qələbə. */
.contact-info__list .branches__hours,
.contact-info__list ul[style*='list-style:none'] li {
    color: rgba(255, 255, 255, 0.95) !important;
}

.contact-info__list ul[style*='list-style:none'] li span {
    color: rgba(255, 255, 255, 0.7) !important;
}

.contact-info__list ul[style*='list-style:none'] li strong {
    color: #fff !important;
}

.contact-info__socials {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
    position: relative;
    z-index: 1;
}

.contact-info__socials a {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
    color: var(--color-white);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.contact-info__socials a:hover {
    background: #fff;
    color: var(--color-primary-dark);
    transform: translateY(-2px);
}

.contact-whatsapp-cta {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 14px;
    margin-top: 24px;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 16px;
    color: #fff;
    text-decoration: none;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    position: relative;
    z-index: 1;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.contact-whatsapp-cta:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    color: #fff;
}

.contact-whatsapp-cta__icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #25D366;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 6px 14px rgba(37, 211, 102, 0.4);
}

.contact-whatsapp-cta__body {
    min-width: 0;
}

.contact-whatsapp-cta__body h4 {
    margin: 0 0 3px;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
}

.contact-whatsapp-cta__body p {
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 12.5px;
    line-height: 1.45;
    opacity: 1;
}

.contact-whatsapp-cta__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    background: #fff;
    color: var(--color-primary-dark);
    font-weight: 700;
    font-size: 13px;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.contact-whatsapp-cta__btn i {
    font-size: 11px;
    transition: transform 0.2s ease;
}

.contact-whatsapp-cta:hover .contact-whatsapp-cta__btn {
    background: var(--color-accent);
    color: #fff;
}

.contact-whatsapp-cta:hover .contact-whatsapp-cta__btn i {
    transform: translateX(3px);
}

/* Mobil — CTA-nı şaquli stack-ə çevir, daha rahat oxunur */
@media (max-width: 560px) {
    .contact-whatsapp-cta {
        grid-template-columns: auto 1fr;
        gap: 12px 14px;
    }
    .contact-whatsapp-cta__btn {
        grid-column: 1 / -1;
        justify-content: center;
        padding: 10px 16px;
        font-size: 14px;
    }
}
