/* ==============================================
   NAVBAR یکپارچه بوتیک ۱۳
   استایل هدر، منوی موبایل و toast کل سایت.
   کنار این فایل، css/search.css و css/cart.css هم باید در <head>
   همه‌ی صفحات لینک شوند (المنت‌هایشان را navbar.js می‌سازد).
   ============================================== */

:root{
    --gold:#D4AF37;
    --goldHover:#E8C862;
    --black:#0f0f0f;
    --black2:#181818;
    --border:#2d2d2d;

    /* ترتیب لایه‌ها — همه‌ی z-indexهای مشترک از اینجا می‌آیند */
    --z-menu:990;
    --z-header:1000;
    --z-search:1500;
    --z-drawer:2000;
    --z-toast:2500;
}

/* قفل اسکرول صفحه وقتی منو/کشو/جستجو باز است */
html.b13-lock,
html.b13-lock body{
    overflow:hidden;
}

/* المنت‌هایی که navbar.js می‌سازد فونت و ریست خودشان را دارند تا
   در هر صفحه‌ای (با هر CSS دیگری) یکسان دیده شوند */
.site-header,
.mobileMenu,
.searchOverlay,
.drawer,
.b13Toast{
    font-family:"Vazirmatn", sans-serif;
    -webkit-tap-highlight-color:transparent;
}

.site-header a,
.mobileMenu a{
    text-decoration:none;
    color:inherit;
}

.site-header button,
.drawer button,
.searchOverlay button{
    font-family:inherit;
    -webkit-tap-highlight-color:transparent;
}

/* ---------- Header ---------- */
.site-header{
    position:fixed;
    top:20px;
    left:50%;
    transform:translateX(-50%);
    width:92%;
    max-width:1400px;
    height:80px;
    padding:0 30px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:16px;
    border-radius:25px;
    background:rgba(20,20,20,.55);
    backdrop-filter:blur(18px);
    -webkit-backdrop-filter:blur(18px);
    border:1px solid rgba(255,255,255,.08);
    box-shadow:0 15px 40px rgba(0,0,0,.25);
    color:#fff;
    z-index:var(--z-header);
    transition:top .4s ease, height .4s ease, background .4s ease, box-shadow .4s ease;
}

/* وقتی صفحه اسکرول می‌شود هدر جمع‌وجورتر و تیره‌تر می‌شود */
.site-header.scrolled{
    top:12px;
    height:68px;
    background:rgba(12,12,12,.82);
    box-shadow:0 10px 30px rgba(0,0,0,.4);
}

/* ---------- Logo ---------- */
.site-header .logo{
    display:flex;
    align-items:center;
    gap:14px;
    font-weight:700;
    flex-shrink:0;
}

.logoIcon{
    width:48px;
    height:48px;
    flex-shrink:0;
    border:2px solid var(--gold);
    border-radius:14px;
    display:flex;
    justify-content:center;
    align-items:center;
    font-family:"Poppins", "Vazirmatn", sans-serif;
    font-size:24px;
    font-weight:700;
    color:var(--gold);
    transition:.4s;
}

.logoText{
    display:flex;
    flex-direction:column;
    line-height:1;
    font-family:"Poppins", "Vazirmatn", sans-serif;
}

.logoText span,
.site-header .logoText{
    font-size:23px;
    font-weight:700;
    letter-spacing:2px;
}

.logoText small{
    color:var(--gold);
    letter-spacing:5px;
    font-size:11px;
    margin-top:4px;
}

.site-header .logo:hover .logoIcon{
    transform:rotate(-8deg);
    background:var(--gold);
    color:black;
}

/* ---------- Main nav links ---------- */
.navbar{
    display:flex;
    gap:34px;
}

.navbar a{
    position:relative;
    font-size:16px;
    color:#eee;
    white-space:nowrap;
    transition:.35s;
}

.navbar a:hover,
.navbar a.active{
    color:var(--gold);
}

.navbar a::after{
    content:"";
    position:absolute;
    right:0;
    bottom:-8px;
    width:0;
    height:2px;
    background:var(--gold);
    transition:.35s;
}

.navbar a:hover::after,
.navbar a.active::after{
    width:100%;
}

/* برچسب «به‌زودی» کنار لینک صفحاتی که هنوز ساخته نشده‌اند */
.soonTag{
    font-style:normal;
    font-size:10px;
    line-height:1;
    padding:3px 6px;
    margin-inline-start:6px;
    border-radius:20px;
    border:1px solid rgba(212,175,55,.45);
    color:var(--gold);
    vertical-align:middle;
}

.navbar a[data-soon]{ color:#999; }
.navbar a[data-soon]::after{ display:none; }

/* ---------- Icons: search / wishlist / cart / menu ---------- */
.navIcons{
    display:flex;
    align-items:center;
    gap:14px;
    flex-shrink:0;
}

.navIcons button,
.navIcons .accountBtn{
    width:46px;
    height:46px;
    flex-shrink:0;
    padding:0;
    border-radius:50%;
    background:#181818;
    color:white;
    border:none;
    cursor:pointer;
    display:flex;
    justify-content:center;
    align-items:center;
    position:relative;
    transition:background .35s, color .35s, transform .35s;
}

.navIcons button svg,
.navIcons .accountBtn svg{
    width:19px;
    height:19px;
    stroke:currentColor;
    fill:none;
}

@media (hover:hover){
    .navIcons button:hover,
    .navIcons .accountBtn:hover{
        background:var(--gold);
        color:black;
        transform:translateY(-5px);
    }
}

.navIcons button:focus-visible,
.navIcons .accountBtn:focus-visible{
    outline:2px solid var(--gold);
    outline-offset:2px;
}

.navIcons .badge{
    position:absolute;
    top:-6px;
    right:-4px;
    min-width:20px;
    height:20px;
    padding:0 4px;
    border-radius:20px;
    background:var(--gold);
    color:black;
    font-size:11px;
    font-weight:700;
    display:flex;
    justify-content:center;
    align-items:center;
    pointer-events:none;
}

.navIcons .badge[hidden]{ display:none; }

/* دکمه‌ی همبرگری فقط در موبایل دیده می‌شود */
.navIcons .menuToggle{
    display:none;
    flex-direction:column;
    gap:5px;
}

.menuToggle span{
    width:20px;
    height:2px;
    background:currentColor;
    border-radius:2px;
    transition:.35s;
}

.menuToggle.open span:nth-child(1){ transform:translateY(7px) rotate(45deg); }
.menuToggle.open span:nth-child(2){ opacity:0; }
.menuToggle.open span:nth-child(3){ transform:translateY(-7px) rotate(-45deg); }

/* ---------- Mobile fullscreen menu ---------- */
.mobileMenu{
    position:fixed;
    inset:0;
    background:rgba(10,10,10,.97);
    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:center;
    gap:30px;
    padding:100px 24px 40px;
    overflow-y:auto;
    overscroll-behavior:contain;
    z-index:var(--z-menu);
    opacity:0;
    visibility:hidden;
    transition:opacity .4s ease, visibility 0s linear .4s;
}

.mobileMenu.active{
    opacity:1;
    visibility:visible;
    transition:opacity .4s ease, visibility 0s;
}

.mobileMenu a{
    font-size:24px;
    color:#eee;
    padding:4px 12px;
    opacity:0;
    transform:translateY(15px);
    transition:opacity .4s ease, transform .4s ease, color .3s;
}

.mobileMenu.active a{
    opacity:1;
    transform:translateY(0);
}

.mobileMenu a.active{
    color:var(--gold);
}

.mobileMenu a[data-soon]{
    color:#8d8d8d;
}

/* تاخیر پلکانی برای ورود لینک‌ها */
.mobileMenu.active a:nth-child(1){transition-delay:.05s;}
.mobileMenu.active a:nth-child(2){transition-delay:.1s;}
.mobileMenu.active a:nth-child(3){transition-delay:.15s;}
.mobileMenu.active a:nth-child(4){transition-delay:.2s;}
.mobileMenu.active a:nth-child(5){transition-delay:.25s;}
.mobileMenu.active a:nth-child(6){transition-delay:.3s;}
.mobileMenu.active a:nth-child(7){transition-delay:.35s;}

/* لینک ورود / ثبت‌نام در منوی موبایل */
.mobileMenu .menuLogin{
    display:flex;
    align-items:center;
    gap:10px;
    margin-top:10px;
    padding:12px 28px;
    border:1px solid var(--gold);
    border-radius:50px;
    color:var(--gold);
    font-size:18px;
}

.mobileMenu .menuLogin svg{
    width:20px;
    height:20px;
    stroke:currentColor;
    fill:none;
}

.mobileMenu .menuLogin:active{
    background:var(--gold);
    color:#000;
}

/* ---------- Toast ---------- */
.b13Toast{
    position:fixed;
    left:50%;
    bottom:calc(24px + env(safe-area-inset-bottom, 0px));
    transform:translate(-50%, 30px);
    width:max-content;
    max-width:calc(100% - 32px);
    padding:14px 24px;
    border-radius:14px;
    background:#1b1b1b;
    border:1px solid rgba(212,175,55,.35);
    color:#fff;
    font-size:14px;
    line-height:1.7;
    text-align:center;
    box-shadow:0 20px 50px rgba(0,0,0,.4);
    opacity:0;
    visibility:hidden;
    pointer-events:none;
    transition:opacity .35s, transform .35s, visibility 0s linear .35s;
    z-index:var(--z-toast);
}

.b13Toast.show{
    opacity:1;
    visibility:visible;
    transform:translate(-50%, 0);
    transition:opacity .35s, transform .35s, visibility 0s;
}

/* ---------- Responsive ---------- */
@media (max-width:1100px){
    .navbar{ gap:22px; }
    .navbar a{ font-size:15px; }
    .navbar .soonTag{ display:none; }
}

@media (max-width:900px){

    .navbar{ display:none; }

    .navIcons .menuToggle{ display:flex; }

    .site-header{ padding:0 20px; }

    .logoText span,
    .site-header .logoText{ font-size:19px; }

}

@media (max-width:600px){

    .site-header{
        top:10px;
        width:calc(100% - 20px);
        height:62px;
        padding:0 10px 0 12px;
        border-radius:18px;
    }

    .site-header.scrolled{
        top:6px;
        height:58px;
    }

    .site-header .logo{ gap:8px; }

    .logoIcon{
        width:38px;
        height:38px;
        border-radius:11px;
        font-size:19px;
    }

    .logoText span,
    .site-header .logoText{
        font-size:16px;
        letter-spacing:1px;
    }

    .logoText small{
        font-size:10px;
        letter-spacing:4px;
    }

    .navIcons{ gap:6px; }

    .navIcons button{
        width:38px;
        height:38px;
    }

    .navIcons button svg{
        width:17px;
        height:17px;
    }

    /* در موبایل جا برای آیکون پنجم نیست؛ لینک ورود داخل منوی همبرگری است */
    .navIcons .accountBtn{
        display:none;
    }

    .navIcons .badge{
        top:-4px;
        right:-3px;
        min-width:17px;
        height:17px;
        font-size:10px;
    }

    .mobileMenu{
        gap:24px;
        padding-top:90px;
    }

    .mobileMenu a{ font-size:21px; }

    .mobileMenu .menuLogin{ font-size:17px; padding:11px 24px; }

}

/* گوشی‌های خیلی کوچک (۳۲۰ تا ۳۴۰ پیکسل) */
@media (max-width:340px){
    .logoText{ display:none; }
}

@media (prefers-reduced-motion: reduce){
    .site-header,
    .mobileMenu,
    .mobileMenu a,
    .b13Toast{
        transition:none;
    }
}
