/* =====================================================================
   ÇARŞI — header (Header/_HeaderTop_bazaar.cshtml + Header/_Nav_bazaar.cshtml) ve kategori rayı (Shared/Bazaar/_CategoryRail)
   - Masaüstü (≥992): [bilgi satırı: avantajlar · kısayollar · kargo/WhatsApp/telefon]
                      [ana satır: logo · Kategoriler · geniş arama + bitişik "Ara" · hesap/favori · sepet hapı (adet + tutar)]
     Bant YOK. Header yapışkan; top = -(bilgi satırı) → kaydırınca yalnız ana satır kalır (layout kayması/scroll sıçraması yok).
   - Mobil (≤991): klasik grid'e DOKUNULMAZ (DOM sırası aynı; bilgi satırı ve Kategoriler düğmesi display:none) → mobil
     uygulama ve alt bar etkilenmez.
   ===================================================================== */
html[data-theme-kit="bazaar"] .modern-header--bazaar {
    --header-secondary: var(--bz-ink);
    background: var(--bz-surface);
    box-shadow: 0 1px 0 var(--bz-line);
}

/* ---------------------------------------------------------------------
   Bilgi satırı (yalnız masaüstü)
   --------------------------------------------------------------------- */
.bz-info {
    background: var(--bz-surface-2);
    border-bottom: 1px solid var(--bz-line);
    color: var(--bz-text-muted);
    font-family: var(--bz-font-body);
    font-size: 12.5px;
}

.bz-info__inner {
    display: flex;
    align-items: center;
    gap: 20px;
    max-width: 1400px;
    height: 36px;
    margin: 0 auto;
    padding: 0 24px;
}

.bz-info__perks {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 18px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.bz-info__perks li {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--bz-text-body);
    font-weight: 500;
    white-space: nowrap;
}

.bz-info__perks i {
    color: var(--bz-accent-text);
    font-size: 12px;
}

/* Kısayollar: sığmayan öğe 2. satıra düşer ve satır yüksekliğinde kırpılır (bazaar.js klavye sırasından çıkarır) */
.bz-info__links {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0 2px;
    min-width: 0;
    height: 36px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    list-style: none;
}

.bz-info__links > li {
    display: flex;
    align-items: center;
    height: 36px;
}

.bz-info__links > li.is-overflow {
    visibility: hidden;
}

.bz-info__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 26px;
    padding: 0 10px;
    border-radius: var(--bz-radius-pill);
    color: var(--bz-text-body);
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease;
}

.bz-info__link:hover,
.bz-info__link:focus-visible {
    background: var(--bz-surface);
    color: var(--bz-accent-text);
}

.bz-info__link[aria-current="page"] {
    background: var(--bz-surface);
    color: var(--bz-text);
    font-weight: 700;
}

.bz-info__link.is-hot {
    color: var(--bz-accent-text);
    font-weight: 700;
}

.bz-info__contact {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 14px;
}

.bz-info__note {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.bz-info__note i {
    color: var(--bz-accent-text);
}

.bz-info__note b {
    color: var(--bz-text);
    font-weight: 700;
}

.bz-info__wa {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--bz-wa-soft);
    color: var(--bz-wa);
    font-size: 15px;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease;
}

.bz-info__wa:hover {
    background: var(--bz-wa);
    color: var(--bz-surface);
}

.bz-info__tel {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--bz-text);
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
    font-variant-numeric: tabular-nums;
}

.bz-info__tel i {
    color: var(--bz-accent-text);
}

.bz-info__tel:hover {
    color: var(--bz-accent-text);
}

@media (max-width: 1399.98px) {
    .bz-info__perk--wide,
    .bz-info__note {
        display: none !important;
    }
}

@media (max-width: 1199.98px) {
    .bz-info__perks {
        display: none;
    }

    .bz-info__links {
        justify-content: flex-start;
    }
}

/* ---------------------------------------------------------------------
   Ana satır (masaüstü)
   --------------------------------------------------------------------- */
@media (min-width: 992px) {
    .modern-header--bazaar .modern-header-top {
        max-width: 1400px;
        padding: 16px 24px;
        gap: 14px;
        border-bottom: 0;
    }

    /* Kategoriler düğmesi: koyu mürekkep hap; panel açıkken ok döner */
    .modern-header--bazaar .bz-cats-btn {
        flex: 0 0 auto;
        align-items: center;
        gap: 10px;
        height: 50px;
        padding: 0 18px;
        border: 0;
        border-radius: 14px;
        background: var(--bz-ink);
        color: var(--bz-on-ink);
        font-family: var(--bz-font-heading);
        font-size: 14.5px;
        font-weight: 600;
        letter-spacing: .01em;
        cursor: pointer;
        transition: background-color .15s ease;
    }

    .modern-header--bazaar .bz-cats-btn:hover,
    .modern-header--bazaar .bz-cats-btn[aria-expanded="true"] {
        background: var(--bz-cta-bg);
        color: var(--bz-cta-fg);
    }

    .bz-cats-btn__chev {
        font-size: 11px;
        transition: transform .2s ease;
    }

    .bz-cats-btn[aria-expanded="true"] .bz-cats-btn__chev {
        transform: rotate(180deg);
    }

    /* Arama: geniş kutu + bitişik marka renkli "Ara" düğmesi */
    .modern-header--bazaar .modern-header-search {
        flex: 1 1 auto;
        max-width: none;
        min-width: 240px;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .modern-header--bazaar .modern-header-search .modern-search-form {
        flex: 1 1 auto;
    }

    .modern-header--bazaar .modern-search-form .search-input {
        height: 50px;
        padding: 0 118px 0 18px;
        border: 2px solid var(--bz-line-strong);
        border-radius: 14px;
        background: var(--bz-surface);
        box-shadow: none;
        color: var(--bz-text);
        font-family: var(--bz-font-body);
        font-size: 15px;
        transition: border-color .15s ease, box-shadow .15s ease;
    }

    .modern-header--bazaar .modern-search-form .search-input:hover {
        border-color: var(--bz-text-muted);
    }

    .modern-header--bazaar .modern-search-form .search-input:focus {
        border-color: var(--bz-cta-bg);
        box-shadow: 0 0 0 4px var(--bz-accent-soft);
    }

    .modern-header--bazaar .modern-search-form .search-btn {
        top: 4px;
        right: 4px;
        bottom: 4px;
        width: auto;
        height: auto;
        gap: 8px;
        padding: 0 20px;
        border-radius: 11px;
        background: var(--bz-cta-bg);
        color: var(--bz-cta-fg);
        font-family: var(--bz-font-heading);
        font-size: 14.5px;
        font-weight: 700;
        transform: none;
        transition: background-color .15s ease;
    }

    .modern-header--bazaar .modern-search-form .search-btn:hover {
        background: var(--bz-cta-hover);
    }

    .modern-header--bazaar .modern-search-form .search-btn:active {
        transform: scale(.98);
    }

    .modern-header--bazaar .modern-search-form .search-btn i {
        font-size: 14px;
        transform: none;
    }

    /* Aksiyonlar: ikon + etiket, tek satır; hover'da açık zemin */
    .modern-header--bazaar .modern-header-actions {
        gap: 4px;
    }

    .modern-header--bazaar .header-action-btn {
        color: var(--bz-text);
        border-radius: 12px;
        transition: background-color .15s ease, color .15s ease;
    }

    .modern-header--bazaar .header-action-btn:hover {
        background: var(--bz-surface-2);
        color: var(--bz-text);
    }

    .modern-header--bazaar .header-action-btn-labeled {
        height: 50px;
        padding: 0 12px !important;
        gap: 8px;
        font-weight: 600;
    }

    .modern-header--bazaar .header-action-btn-labeled i {
        color: var(--bz-accent-text);
        font-size: 18px;
    }

    .modern-header--bazaar .header-action-btn-labeled span {
        color: var(--bz-text);
        font-family: var(--bz-font-body);
        font-size: 13.5px;
    }

    /* Hesabım / Giriş Yap: çerçeveli hap */
    .modern-header--bazaar .modern-header-actions .dropdown > .header-action-btn-labeled {
        border: 1.5px solid var(--bz-line-strong);
        background: var(--bz-surface);
    }

    .modern-header--bazaar .modern-header-actions .dropdown > .header-action-btn-labeled:hover,
    .modern-header--bazaar .modern-header-actions .dropdown > .header-action-btn-labeled[aria-expanded="true"] {
        border-color: var(--bz-text);
        background: var(--bz-surface);
    }

    .modern-header--bazaar .modern-user-dropdown {
        padding: 6px;
        border: 1px solid var(--bz-line);
        border-radius: 14px;
        box-shadow: var(--bz-shadow-pop);
    }

    .modern-header--bazaar .modern-user-dropdown .dropdown-item {
        border-radius: 10px;
    }

    .modern-header--bazaar .account-summary-btn {
        height: 50px;
        border-radius: 12px;
        background: var(--bz-surface-2);
        color: var(--bz-text);
        font-weight: 600;
    }

    .modern-header--bazaar .account-summary-btn:hover {
        background: var(--bz-ink);
        color: var(--bz-on-ink);
    }

    /* Sepet: marka renkli hap + "Sepetim / ₺tutar" (tutarı app.js #desktop-only-cart-total'a yazar) */
    .modern-header--bazaar .header-cart-btn {
        width: auto;
        height: 50px;
        padding: 0 18px 0 16px;
        gap: 12px;
        border-radius: 14px;
        background: var(--bz-cta-bg);
        color: var(--bz-cta-fg);
    }

    .modern-header--bazaar .header-cart-btn:hover {
        background: var(--bz-cta-hover);
        color: var(--bz-cta-fg);
    }

    .modern-header--bazaar .header-cart-btn > i {
        font-size: 19px;
        color: inherit;
    }

    /* Adet rozeti ikonun sağ üstünde, beyaz zemin + marka yazısı (app.css şablonunun margin'i sıfırlanır) */
    .modern-header--bazaar .header-cart-btn .cart-counter {
        top: 6px;
        left: 28px;
        right: auto;
        width: 20px;
        min-width: 20px;
        height: 20px;
        margin: 0;
        padding: 0;
        border: 2px solid var(--bz-cta-bg);
        background: var(--bz-surface);
        color: var(--bz-accent-text);
        font-family: var(--bz-font-body);
        font-size: 10.5px;
        font-weight: 700;
        line-height: 16px;
    }

    /* app.css ".headerCartButton span { position:absolute; background:red; 20×20 … }" şablonu → meta span'ları nötr */
    .modern-header--bazaar .headerCartButton .mgz-cart-meta,
    .modern-header--bazaar .headerCartButton .mgz-cart-meta span {
        position: static;
        width: auto;
        height: auto;
        margin: 0;
        padding: 0;
        border-radius: 0;
        background: none;
        color: inherit;
        line-height: 1.1;
        text-align: left;
    }

    .modern-header--bazaar .headerCartButton .mgz-cart-meta {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .modern-header--bazaar .headerCartButton .mgz-cart-meta .mgz-cart-label {
        font-family: var(--bz-font-body);
        font-size: 11.5px;
        font-weight: 500;
    }

    .modern-header--bazaar .headerCartButton .mgz-cart-meta .mgz-cart-total {
        font-family: var(--bz-font-heading);
        font-size: 15px;
        font-weight: 700;
        font-variant-numeric: tabular-nums;
        white-space: nowrap;
    }

    .modern-header--bazaar .headerCartButton .mgz-cart-meta .mgz-cart-total:empty::before {
        content: "—";
    }
}

/* Dar masaüstü: etiketler gizlenir (ikon + title/aria kalır), arama yer kazanır. custom.css etiketli butona
   "width:auto !important" verdiği için genişlik de !important. */
@media (min-width: 992px) and (max-width: 1299.98px) {
    .modern-header--bazaar .header-action-btn-labeled span,
    .modern-header--bazaar .account-summary-btn span {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
    }

    .modern-header--bazaar .header-action-btn-labeled {
        width: 46px !important;
        padding: 0 !important;
        justify-content: center;
    }

    .modern-header--bazaar .account-summary-btn {
        width: 46px;
        padding: 0;
        justify-content: center;
    }

    .modern-header--bazaar .bz-cats-btn span {
        display: none;
    }
}

/* Mobil: sepet metni ve arama etiketi gizli (klasik ikon butonları korunur → mobil header birebir Klasik) */
@media (max-width: 991.98px) {
    .modern-header--bazaar .mgz-cart-meta,
    .modern-header--bazaar .search-btn__label {
        display: none;
    }
}

/* ---------------------------------------------------------------------
   Yapışkan header — yalnız masaüstü. Klasik'te body "overflow-x:hidden" kaydırma kabı olduğundan sticky tutmaz;
   Çarşı'da body overflow-x:clip (yatay taşmayı keser, kaydırma kabı oluşturmaz). top = -(bilgi satırı) → bilgi satırı
   kaydırılınca gider, ana satır yapışık kalır (--bz-stick-top bazaar.js'te ölçülür).
   --------------------------------------------------------------------- */
@media (min-width: 992px) {
    html[data-theme-kit="bazaar"] body {
        overflow-x: clip;
    }

    .modern-header--bazaar {
        top: calc(-1 * var(--bz-stick-top, 37px));
        transition: box-shadow .2s ease;
    }

    .modern-header--bazaar.is-stuck {
        box-shadow: var(--bz-shadow-sticky);
    }

    /* Header yapışınca sayfanın diğer yapışkan kolonları onun altından başlar (--bz-header-h: görünen ana satır) */
    html[data-theme-kit="bazaar"] :is(.cart-summary-box, .checkout-box, .static-page-sidebar, .pd-sticky) {
        top: calc(var(--bz-header-h, 82px) + 16px);
    }
}

/* ---------------------------------------------------------------------
   Kategoriler açılır paneli (header ana satırının altında)
   --------------------------------------------------------------------- */
.bz-cats-drop {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1002;
    pointer-events: none;
}

.bz-cats-drop__inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.bz-cats-drop .bz-rail {
    width: 290px;
    margin-top: 6px;
    box-shadow: var(--bz-shadow-pop);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    /* Kapanırken solma bitince gizlenir; açılırken ANINDA görünür (klavye odağı ilk öğeye verilebilsin) */
    transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
}

.bz-cats-drop.is-open .bz-rail {
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    transition: opacity .18s ease, transform .18s ease, visibility 0s;
}

.bz-cats-drop .bz-rail__list {
    max-height: min(62vh, 540px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* ---------------------------------------------------------------------
   Kategori rayı (hero'da her zaman açık / header panelinde)
   --------------------------------------------------------------------- */
.bz-rail {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--bz-surface);
    border: 1px solid var(--bz-line);
    border-radius: var(--bz-radius-card);
}

.bz-rail__head {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
    padding: 13px 18px;
    border-radius: calc(var(--bz-radius-card) - 1px) calc(var(--bz-radius-card) - 1px) 0 0;
    background: var(--bz-cta-bg);
    color: var(--bz-cta-fg);
    font-family: var(--bz-font-heading);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .01em;
}

.bz-rail__list {
    margin: 0;
    padding: 6px;
    list-style: none;
}

.bz-rail__link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 42px;
    padding: 6px 10px;
    border-radius: var(--bz-radius-ctl);
    color: var(--bz-text);
    font-family: var(--bz-font-body);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color .12s ease, color .12s ease;
}

.bz-rail__item.is-active > .bz-rail__link,
.bz-rail__link:focus-visible {
    background: var(--bz-tint);
    color: var(--bz-accent-text);
}

@media (hover: hover) {
    .bz-rail__item:hover > .bz-rail__link {
        background: var(--bz-tint);
        color: var(--bz-accent-text);
    }
}

.bz-rail__ico {
    display: flex;
    flex: 0 0 30px;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    overflow: hidden;
    border-radius: 9px;
    background: var(--bz-surface-2);
}

.bz-rail__ico img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.bz-rail__ico--mono {
    background: var(--bz-accent-soft);
    color: var(--bz-accent-text);
    font-family: var(--bz-font-heading);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
}

.bz-rail__name {
    display: -webkit-box;
    min-width: 0;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
}

.bz-rail__arrow {
    margin-left: auto;
    color: var(--bz-text-muted);
    font-size: 12px;
}

.bz-rail__all {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 6px 6px;
    padding: 10px 12px;
    border-top: 1px dashed var(--bz-line-strong);
    color: var(--bz-accent-text);
    font-size: 13.5px;
    font-weight: 700;
    text-decoration: none;
}

.bz-rail__all:hover {
    color: var(--bz-text);
}

/* Alt kategori paneli: rayın sağına açılır (kapsayıcısı ray → listenin taşma kırpması onu kesmez) */
.bz-rail__fly {
    position: absolute;
    top: -1px;
    left: calc(100% - 1px);
    z-index: 5;
    width: var(--bz-fly-w, min(760px, calc(100vw - 380px)));
    min-height: calc(100% + 2px);
    max-height: var(--bz-fly-maxh, none);
    overflow: auto;
    padding: 20px 24px;
    background: var(--bz-surface);
    border: 1px solid var(--bz-line);
    border-radius: 0 var(--bz-radius-card) var(--bz-radius-card) 0;
    box-shadow: var(--bz-shadow-pop);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .15s ease, visibility 0s linear .15s;
}

.bz-rail__item.is-active > .bz-rail__fly {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity .15s ease, visibility 0s;
}

@media (hover: hover) {
    .bz-rail__item:hover > .bz-rail__fly {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transition: opacity .15s ease, visibility 0s;
    }
}

.bz-rail__fly-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--bz-line);
}

.bz-rail__fly-title {
    color: var(--bz-text);
    font-family: var(--bz-font-heading);
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
}

.bz-rail__fly-all {
    color: var(--bz-accent-text);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
}

.bz-rail__cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px 26px;
}

.bz-rail__col-title {
    display: inline-block;
    padding-bottom: 2px;
    color: var(--bz-text);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    background: linear-gradient(transparent 64%, var(--bz-accent-soft) 64%);
}

.bz-rail__col-title:hover {
    color: var(--bz-accent-text);
}

.bz-rail__col ul {
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

.bz-rail__col li a {
    display: block;
    padding: 4px 0;
    color: var(--bz-text-muted);
    font-size: 13.5px;
    text-decoration: none;
}

.bz-rail__col li a:hover,
.bz-rail__col li a:focus-visible {
    color: var(--bz-accent-text);
}

/* Hero rayı: hücreyi doldurur (satır yüksekliğine katkı vermez — slider belirler); liste sığdığı kadar gösterir */
.bz-rail--hero {
    position: absolute;
    inset: 0;
}

.bz-rail--hero .bz-rail__list {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.bz-rail--hero .bz-rail__fly {
    min-height: 0;
    height: calc(100% + 2px);
}

/* Yarım kalan kategori gösterilmez (bazaar.js fitHeroRail) */
.bz-rail--hero .bz-rail__item.is-cut {
    visibility: hidden;
}
