/* ==========================================================================
   Mobil alt menü + Kategoriler / Hesabım pencereleri (≤768px)
   Ürün detayda sabit "Sepete Ekle" çubuğu ile aynı yeri paylaşır: biri görünürken diğeri saklanır.
   ========================================================================== */

.m18-bn,
.m18-bn-backdrop,
.m18-bn-sheet {
    display: none;
}

@media (max-width: 768px) {
    :root {
        --m18-bn-h: 64px;
        --m18-bn-gap: 10px;
        --m18-bn-safe: env(safe-area-inset-bottom, 0px);
    }

    /* Sayfanın son satırı menünün altında kalmasın */
    body.has-bn {
        padding-bottom: calc(var(--m18-bn-h) + var(--m18-bn-gap) * 2 + var(--m18-bn-safe));
    }

    .m18-bn {
        position: fixed;
        left: max(10px, env(safe-area-inset-left, 0px));
        right: max(10px, env(safe-area-inset-right, 0px));
        /* iPhone: tarayıcı çubuğu gizlenince alttaki ev çizgisi alanına (≈34px) biraz in,
           ama çizginin tam üstüne binme. Çubuk görünürken safe-area 0 → 10px boşluk. */
        bottom: max(var(--m18-bn-gap), calc(var(--m18-bn-safe) - 12px));
        z-index: 980;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        align-items: center;
        height: var(--m18-bn-h);
        padding: 0 .35rem;
        border-radius: 20px;
        /* Cam efekti: buzlu şeffaf bar */
        background: rgba(255, 255, 255, .72);
        -webkit-backdrop-filter: blur(16px) saturate(140%);
        backdrop-filter: blur(16px) saturate(140%);
        border: 1px solid rgba(255, 255, 255, .6);
        box-shadow: 0 10px 30px rgba(20, 18, 14, .16);
        transition: transform .28s ease, opacity .2s ease;
    }

    .m18-bn__item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: .2rem;
        height: 100%;
        padding: 0;
        border: 0;
        background: none;
        color: #8a8375;
        font: 600 .66rem/1 var(--c18-body, "Poppins", system-ui, sans-serif);
        text-decoration: none;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .m18-bn__item .m18-icon {
        width: 22px;
        height: 22px;
    }

    .m18-bn__item.is-active {
        color: #16351C;
    }

    .m18-bn__item.is-active::after {
        content: "";
        width: 4px;
        height: 4px;
        margin-top: .05rem;
        border-radius: 50%;
        background: var(--c18-green, #2f7a3a);
    }

    /* WhatsApp / Destek bölmesi */
    .m18-bn__item--wa {
        color: #1f8a4c;
    }

    .m18-bn__wa-ico {
        width: 22px;
        height: 22px;
        color: #25D366;
    }

    /* Ortadaki büyük sepet */
    .m18-bn__cart {
        position: relative;
        justify-self: center;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 62px;
        height: 62px;
        margin-top: -26px;
        padding: 0;
        border: 5px solid #fff;
        border-radius: 50%;
        background: var(--c18-orange, #F28C28);
        color: #22251F;
        box-shadow: 0 8px 20px rgba(242, 140, 40, .45);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .m18-bn__cart .m18-icon {
        width: 26px;
        height: 26px;
    }

    .m18-bn__badge {
        position: absolute;
        top: -4px;
        right: -4px;
        min-width: 20px;
        height: 20px;
        padding: 0 5px;
        border: 2px solid #fff;
        border-radius: 999px;
        background: #22251F;
        color: #fff;
        font: 800 .66rem/16px var(--c18-body, system-ui, sans-serif);
        text-align: center;
    }

    .m18-bn__badge.hidden {
        display: none;
    }

    /* Menünün saklandığı durumlar */
    body.m18pd-sticky-on .m18-bn,
    body.has-compare-bar .m18-bn,
    body.site-header-menu-open .m18-bn,
    body.m18-search-open .m18-bn,
    body.cart-drawer-open .m18-bn,
    body.spf-drawer-open .m18-bn,
    body.c18-blogf-open .m18-bn,
    body.cart-add-modal-open .m18-bn,
    body.wa-widget-open .m18-bn,
    body.m18c18-lock .m18-bn,
    body.m18pd-lightbox-open .m18-bn,
    body.m18rp-modal-open .m18-bn,
    body.m18-news-popup-open .m18-bn,
    body.m18-bn-typing .m18-bn,
    body:has(#cookie-consent-root.is-open) .m18-bn,
    body:has(#cookie-consent-root.is-prefs) .m18-bn {
        transform: translateY(calc(100% + 40px));
        opacity: 0;
        pointer-events: none;
    }

    /* Üst menü: aşağı kaydırınca tamamen gizlenir, yukarı kaydırınca geri gelir.
       (site-header.js aşağı kaydırmada .is-compact ekliyor, yukarıda kaldırıyor.)
       Mobil menü veya arama açıkken gizlenmez. */
    /* DİKKAT: burada will-change/transform kalıcı verilmemeli. Hamburger menü header'ın içinde
       position:fixed duruyor; header'a transform verilirse menü tam ekran yerine header'a hapsolur. */
    body.has-bn .site-header {
        transition: transform .28s ease, box-shadow .2s ease;
    }

    body.has-bn:not(.site-header-menu-open):not(.m18-search-open) .site-header.is-compact {
        transform: translateY(calc(-100% - 8px));
        box-shadow: none;
    }

    /* Yüzen butonlar menünün üstünde dursun; "Hemen Ara" mobilde Hesabım penceresine taşındı */
    body.has-bn .call-fab {
        display: none !important;
    }

    /* WhatsApp artık alt menüde "Destek" olarak var: yüzen buton ve karşılama balonu mobilde gizli.
       (Panel açılınca .is-open ile üstteki × kapatma yine görünür.) */
    body.has-bn .wa-widget:not(.is-open) .wa-widget__fab {
        display: none !important;
    }

    body.has-bn .wa-ai-greet {
        display: none !important;
    }

    body.has-bn:not(.has-compare-bar) .wa-widget:not(.is-open),
    body.has-bn:not(.has-compare-bar) .m18c18__head {
        /* Menünün epey üstünde dursun (parmak menüye basarken butona değmesin) */
        bottom: calc(var(--m18-bn-h) + var(--m18-bn-gap) + 72px + var(--m18-bn-safe));
        transition: bottom .25s ease, opacity .2s ease, transform .2s ease;
    }

    /* Menü saklanınca (klavye, çerez paneli) yüzen butonlar da yerine insin */
    body.has-bn.m18-bn-typing:not(.m18pd-sticky-on) .wa-widget:not(.is-open),
    body.has-bn.m18-bn-typing:not(.m18pd-sticky-on) .m18c18__head {
        bottom: calc(1rem + var(--m18-bn-safe));
    }

    body.m18-bn-sheet-open .wa-widget,
    body.m18-bn-sheet-open .m18c18__head {
        opacity: 0;
        pointer-events: none;
    }

    /* ---------- Pencere (sheet) ---------- */
    .m18-bn-backdrop:not([hidden]) {
        position: fixed;
        inset: 0;
        z-index: 1100;
        display: block;
        background: rgba(20, 18, 14, .45);
        opacity: 0;
        transition: opacity .25s ease;
    }

    .m18-bn-backdrop.is-open {
        opacity: 1;
    }

    .m18-bn-sheet:not([hidden]) {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1101;
        display: flex;
        flex-direction: column;
        max-height: 86dvh;
        padding: .5rem 0 0;
        border-radius: 26px 26px 0 0;
        background: #FAF6EF;
        box-shadow: 0 -10px 40px rgba(20, 18, 14, .2);
        transform: translateY(100%);
        transition: transform .28s cubic-bezier(.2, .8, .2, 1);
    }

    .m18-bn-sheet.is-open {
        transform: translateY(0);
    }

    body.m18-bn-sheet-open {
        overflow: hidden;
    }

    .m18-bn-sheet__grip {
        align-self: center;
        width: 44px;
        height: 4px;
        margin-bottom: .6rem;
        border-radius: 99px;
        background: #DDD3C4;
    }

    .m18-bn-sheet__head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 1.15rem .85rem;
    }

    .m18-bn-sheet__head h2 {
        margin: 0;
        overflow: hidden;
        color: var(--c18-ink, #1C1F1A);
        font: 800 1.35rem/1.2 var(--c18-display, "Poppins", system-ui, sans-serif);
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .m18-bn-sheet__close {
        display: inline-flex;
        flex-shrink: 0;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border: 1px solid #ECE4D8;
        border-radius: 50%;
        background: #fff;
        color: #22251F;
        cursor: pointer;
    }

    .m18-bn-sheet__body {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 0 1.15rem calc(1.25rem + var(--m18-bn-safe));
        -webkit-overflow-scrolling: touch;
    }

    /* Kategoriler */
    .m18-bn-search {
        display: flex;
        align-items: center;
        gap: .6rem;
        height: 50px;
        padding: 0 1rem;
        border: 1px solid #E6DCCD;
        border-radius: 14px;
        background: #fff;
        color: #6E675C;
    }

    .m18-bn-search input {
        flex: 1;
        min-width: 0;
        border: 0;
        outline: 0;
        background: none;
        color: var(--c18-ink, #1C1F1A);
        font: 500 16px/1.2 var(--c18-body, system-ui, sans-serif); /* 16px: iOS yakınlaştırmasın */
    }

    .m18-bn-all {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 56px;
        margin: .85rem 0;
        border-radius: 16px;
        background: #22251F;
        color: #fff;
        font: 800 1.05rem/1 var(--c18-display, system-ui, sans-serif);
        text-decoration: none;
    }

    .m18-bn-cats {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: .6rem;
    }

    .m18-bn-cat {
        display: flex;
        align-items: center;
        gap: .65rem;
        min-height: 72px;
        padding: .6rem .7rem;
        border: 1px solid #ECE4D8;
        border-radius: 16px;
        background: #fff;
        color: var(--c18-ink, #1C1F1A);
        text-decoration: none;
    }

    .m18-bn-cat__img {
        display: inline-flex;
        flex-shrink: 0;
        align-items: center;
        justify-content: center;
        width: 46px;
        height: 46px;
        overflow: hidden;
        border-radius: 12px;
        background: var(--c18-orange-soft, #FFF3E6);
        color: var(--c18-walnut, #A9530A);
        font: 800 1rem/1 var(--c18-display, system-ui, sans-serif);
    }

    .m18-bn-cat__img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .m18-bn-cat__copy {
        display: flex;
        flex-direction: column;
        gap: .15rem;
        min-width: 0;
    }

    .m18-bn-cat__copy strong {
        font: 700 .86rem/1.2 var(--c18-body, system-ui, sans-serif);
        overflow-wrap: anywhere;
    }

    .m18-bn-cat__copy small {
        color: #8A8277;
        font: 500 .72rem/1 var(--c18-body, system-ui, sans-serif);
    }

    /* Hesabım */
    .m18-bn-account__lead,
    .m18-bn-account__email {
        margin: 0 0 1rem;
        color: #6E675C;
        font-size: .9rem;
        line-height: 1.45;
    }

    .m18-bn-login {
        display: grid;
        gap: .75rem;
    }

    .m18-bn-field {
        display: grid;
        gap: .35rem;
        color: #4a4339;
        font: 600 .8rem/1 var(--c18-body, system-ui, sans-serif);
    }

    .m18-bn-field input {
        height: 50px;
        padding: 0 1rem;
        border: 1px solid #E6DCCD;
        border-radius: 14px;
        background: #fff;
        color: var(--c18-ink, #1C1F1A);
        font: 500 16px/1.2 var(--c18-body, system-ui, sans-serif);
    }

    .m18-bn-field input:focus {
        border-color: var(--c18-orange, #F28C28);
        outline: 3px solid rgba(242, 140, 40, .18);
    }

    .m18-bn-login__row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: .5rem;
        font-size: .82rem;
    }

    .m18-bn-login__row a {
        color: var(--c18-walnut, #A9530A);
        font-weight: 700;
        text-decoration: none;
    }

    .m18-bn-check {
        display: inline-flex;
        align-items: center;
        gap: .4rem;
        color: #4a4339;
    }

    .m18-bn-login__error {
        margin: 0;
        padding: .6rem .8rem;
        border-radius: 12px;
        background: #FDECEC;
        color: #A12626;
        font-size: .84rem;
        font-weight: 600;
    }

    .m18-bn-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: .55rem;
        width: 100%;
        height: 52px;
        border-radius: 14px;
        font: 800 1rem/1 var(--c18-display, system-ui, sans-serif);
        text-decoration: none;
        cursor: pointer;
    }

    .m18-bn-btn--dark {
        border: 0;
        background: #22251F;
        color: #fff;
    }

    .m18-bn-btn--dark:disabled {
        opacity: .6;
    }

    .m18-bn-btn--light {
        margin-top: .75rem;
        border: 1px solid #E6DCCD;
        background: #fff;
        color: var(--c18-ink, #1C1F1A);
        font-weight: 700;
        font-size: .92rem;
    }

    .m18-bn-account__register {
        margin: 1rem 0 .9rem;
        color: #6E675C;
        font-size: .88rem;
        text-align: center;
    }

    .m18-bn-account__register a {
        color: var(--c18-walnut, #A9530A);
        font-weight: 800;
        text-decoration: none;
    }

    .m18-bn-links {
        display: grid;
        gap: .5rem;
        margin-bottom: .75rem;
    }

    .m18-bn-link {
        display: flex;
        align-items: center;
        gap: .75rem;
        min-height: 54px;
        margin-bottom: .5rem;
        padding: 0 .95rem;
        border: 1px solid #ECE4D8;
        border-radius: 14px;
        background: #fff;
        color: var(--c18-ink, #1C1F1A);
        font: 600 .92rem/1.2 var(--c18-body, system-ui, sans-serif);
        text-decoration: none;
    }

    .m18-bn-links .m18-bn-link {
        margin-bottom: 0;
    }

    .m18-bn-link > span {
        flex: 1;
    }

    .m18-bn-link .m18-icon:first-child {
        color: var(--c18-walnut, #A9530A);
    }

    .m18-bn-link .m18-icon:last-child {
        color: #B9AF9F;
    }

    .m18-bn-logout-form {
        margin: 0 0 .75rem;
    }

    .m18-bn-logout {
        width: 100%;
        height: 50px;
        border: 1px solid #F1D3D3;
        border-radius: 14px;
        background: #fff;
        color: #A12626;
        font: 700 .92rem/1 var(--c18-body, system-ui, sans-serif);
        cursor: pointer;
    }
}

@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
    .m18-bn,
    .m18-bn-sheet,
    .m18-bn-backdrop {
        transition: none !important;
    }
}

/* Hesabım giriş penceresi — F · Yeşil başlık bandı (yalnızca giriş yapmamış kullanıcı) */
.m18-bn-sheet.m18-bn-sheet--login:not([hidden]) { padding-top: .5rem; overflow: hidden; background: #2F5D3A; }
.m18-bn-sheet--login .m18-bn-sheet__grip { background: rgba(255, 255, 255, .35); }
.m18-bn-sheet--login .m18-bn-sheet__head { align-items: flex-start; padding: .15rem 1.15rem 1.05rem; }
.m18-bn-sheet--login .m18-bn-sheet__titles { min-width: 0; }
.m18-bn-sheet--login .m18-bn-sheet__head h2 { color: #fff; font-size: 1.35rem; font-weight: 700; }
.m18-bn-sheet--login .m18-bn-sheet__sub { margin: .2rem 0 0; color: rgba(255, 255, 255, .82); font-size: .85rem; line-height: 1.3; }
.m18-bn-sheet--login .m18-bn-sheet__close { width: 36px; height: 36px; border: 0; background: rgba(255, 255, 255, .16); color: #fff; }
.m18-bn-sheet--login .m18-bn-sheet__body { padding-top: 1.1rem; background: #fff; }
.m18-bn-sheet--login .m18-bn-login { gap: .65rem; }
.m18-bn-field--icon { position: relative; display: block; }
.m18-bn-field__icon { position: absolute; top: 50%; left: .9rem; display: inline-flex; color: #8A8277; transform: translateY(-50%); pointer-events: none; }
.m18-bn-sheet--login .m18-bn-field--icon input { width: 100%; height: 50px; padding-left: 2.7rem; border: 1px solid transparent; border-radius: 12px; background: #F3F2EF; }
.m18-bn-sheet--login .m18-bn-field--icon input::placeholder { color: #8A8277; }
.m18-bn-sheet--login .m18-bn-field--icon input:focus { border-color: #2F5D3A; background: #fff; outline: 3px solid rgba(47, 93, 58, .14); }
.m18-bn-sheet--login .m18-bn-login__row a { color: #2F5D3A; }
.m18-bn-btn--orange { border: 0; border-radius: 12px; background: #F07A0F; color: #fff; font-weight: 700; }
.m18-bn-btn--orange:active { background: #D96A06; }
.m18-bn-btn--orange:disabled { opacity: .6; }
.m18-bn-sheet--login .m18-bn-btn--light { margin-top: .65rem; border-radius: 12px; }
.m18-bn-sheet--login .m18-bn-account__register { margin: .9rem 0 .6rem; }
.m18-bn-sheet--login .m18-bn-account__register a { color: #2F5D3A; }
.m18-bn-account__foot { display: flex; justify-content: center; gap: 1.1rem; margin: 0; padding-top: .7rem; border-top: 1px solid #F0ECE5; font-size: .8rem; }
.m18-bn-account__foot a { display: inline-flex; align-items: center; gap: .35rem; color: #6E675C; text-decoration: none; }
.m18-bn-sheet--login .m18-bn-field--pw input { padding-right: 3rem; }
.m18-bn-pw-toggle { position: absolute; top: 50%; right: .35rem; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 10px; background: none; color: #8A8277; cursor: pointer; transform: translateY(-50%); }
.m18-bn-pw-toggle[aria-pressed="true"] { color: #2F5D3A; }
.m18-bn-pw-toggle [hidden] { display: none; }

/* Kategoriler penceresi — H · Hikaye yuvarlakları + çok satanlar */
#m18-bn-cats.m18-bn-sheet:not([hidden]) { background: #fff; }
.m18-bn-stories { display: flex; gap: .85rem; margin: 0 -1.15rem 1.1rem; padding: .3rem 1.15rem .2rem; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.m18-bn-stories::-webkit-scrollbar { display: none; }
.m18-bn-story { display: flex; flex: 0 0 auto; flex-direction: column; align-items: center; gap: .4rem; width: 72px; color: var(--c18-ink, #1C1F1A); text-decoration: none; }
.m18-bn-story__ring { display: block; padding: 3px; border-radius: 50%; background: linear-gradient(135deg, #F07A0F, #F5A623); }
.m18-bn-story__img { display: flex; align-items: center; justify-content: center; width: 62px; height: 62px; overflow: hidden; border: 2px solid #fff; border-radius: 50%; background: #FDF1E4; color: #A9530A; font: 800 1.2rem/1 var(--c18-display, system-ui, sans-serif); }
.m18-bn-story__img img { width: 100%; height: 100%; object-fit: cover; }
.m18-bn-story__name { display: -webkit-box; max-width: 100%; overflow: hidden; font: 600 .74rem/1.2 var(--c18-body, system-ui, sans-serif); text-align: center; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.m18-bn-picks__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: .2rem; }
.m18-bn-picks__title { margin: 0; color: var(--c18-ink, #1C1F1A); font: 700 1rem/1.2 var(--c18-display, system-ui, sans-serif); }
.m18-bn-picks__all { color: #C25808; font: 600 .82rem/1.2 var(--c18-body, system-ui, sans-serif); text-decoration: none; }
.m18-bn-pick { display: flex; align-items: center; gap: .75rem; padding: .65rem 0; border-bottom: 1px solid #F1EEE8; color: var(--c18-ink, #1C1F1A); text-decoration: none; }
.m18-bn-pick:last-child { border-bottom: 0; }
.m18-bn-pick__img { flex-shrink: 0; width: 52px; height: 52px; overflow: hidden; border-radius: 10px; background: #F6F1E9; }
.m18-bn-pick__img img { width: 100%; height: 100%; object-fit: cover; }
.m18-bn-pick__copy { display: flex; flex: 1; flex-direction: column; gap: .2rem; min-width: 0; }
.m18-bn-pick__name { overflow: hidden; font: 600 .86rem/1.25 var(--c18-body, system-ui, sans-serif); text-overflow: ellipsis; white-space: nowrap; }
.m18-bn-pick__price { color: #C25808; font: 700 .86rem/1.2 var(--c18-body, system-ui, sans-serif); }
.m18-bn-pick__price s { margin-right: .3rem; color: #9A9086; font-weight: 500; font-size: .76rem; }
.m18-bn-pick > .m18-icon:last-child { flex-shrink: 0; color: #B9AF9F; }

/* Hesabım penceresi (üye) — A · Yeşil bant, sade çizgili satırlar */
.m18-bn-sheet--member .m18-bn-sheet__head { align-items: center; gap: .75rem; }
.m18-bn-sheet__av { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 50%; background: rgba(255, 255, 255, .16); color: #fff; font: 700 1rem/1 "Poppins", system-ui, sans-serif; }
.m18-bn-sheet--member .m18-bn-sheet__titles { flex: 1; min-width: 0; }
.m18-bn-sheet--member .m18-bn-sheet__head h2 { font-size: 1.1rem; }
.m18-bn-sheet--member .m18-bn-sheet__sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m18-bn-sheet--member .m18-bn-sheet__close { align-self: center; }
.m18-bn-sheet--member .m18-bn-sheet__body { padding-top: .25rem; }
.m18-bn-sheet--member .m18-bn-links { gap: 0; margin-bottom: 0; }
.m18-bn-sheet--member .m18-bn-link { min-height: 0; margin: 0; padding: .85rem 0; border: 0; border-bottom: 1px solid #F1EEE8; border-radius: 0; background: none; }
.m18-bn-sheet--member .m18-bn-link .m18-icon:first-child { color: #7A7468; }
.m18-bn-sheet--member .m18-bn-link .m18-icon:last-child { color: #C9BFB0; }
.m18-bn-sheet--member .m18-bn-logout-form { margin: 1rem 0 .5rem; }
.m18-bn-sheet--member .m18-bn-logout { display: flex; align-items: center; justify-content: center; gap: .5rem; height: 48px; border: 1.5px solid #E6DCCD; border-radius: 14px; background: #fff; color: #A12626; font-weight: 600; }
