/* ===== پایه ===== */
:root{
  --pitch:#132A1D; --pitch-deep:#0D1F15; --chalk:#F6F1E3; --paper:#FBF8F0;
  --ink:#1C1B17; --muted:#5C6A5E; --amber:#C4872F;
  --line-dark:rgba(246,241,227,0.14); --line-light:rgba(28,27,23,0.12); --maxw:1080px;
}
*{box-sizing:border-box; margin:0; padding:0;}
html{scroll-behavior:smooth; scroll-padding-top:116px;}
html.no-scroll, html.no-scroll body{overflow:hidden;}
body{font-family:"Vazirmatn",Tahoma,Arial,sans-serif; background:var(--paper); color:var(--ink); line-height:1.8; font-size:17px;}
img,svg{display:block; max-width:100%;}
a{color:inherit; text-decoration:none;}
ul{list-style:none;}
button{font-family:inherit;}
.wrap{max-width:var(--maxw); margin:0 auto; padding:0 28px;}
h1,h2,h3{font-weight:800; line-height:1.35;}
.eyebrow-line{width:40px; height:2px; background:var(--amber); margin-bottom:14px;}

/* ===== هدر دو ردیفه ===== */
#siteHeader{
  position:sticky; top:0; z-index:50;
  background:rgba(19,42,29,.95); backdrop-filter:blur(8px);
  border-bottom:1px solid var(--line-dark); color:var(--chalk);
}
#siteHeader .wrap{display:flex; align-items:center; gap:14px;}
.hd-top{justify-content:space-between; height:60px;}
.hd-bar{height:50px; border-top:1px solid var(--line-dark);}
.brand{color:var(--chalk); font-weight:700; font-size:18px; display:flex; align-items:center; gap:10px; min-width:0;}
.brand .mark{width:38px; height:38px; border-radius:50%; border:2px solid var(--amber); object-fit:cover; flex-shrink:0;}
.brand .avatar{
  width:38px; height:38px; border-radius:50%; flex-shrink:0;
  border:2px solid var(--amber); background:#1D3E28; color:var(--amber);
  display:flex; align-items:center; justify-content:center;
  font-size:14px; font-weight:800; letter-spacing:.5px; direction:ltr;
}
.brand .brand-name{max-width:260px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}

.auth-links{display:flex; gap:10px; align-items:center; flex-shrink:0;}
.auth-links a{font-size:14px; padding:5px 16px; border-radius:3px; border:1px solid var(--line-dark); color:var(--chalk); transition:all .2s; white-space:nowrap;}
.auth-links a:hover{border-color:var(--amber); color:var(--amber);}
.auth-links a.primary{background:var(--amber); border-color:var(--amber); color:var(--pitch-deep); font-weight:700;}
.auth-links a.primary:hover{color:var(--pitch-deep); opacity:.9;}

#mainNav ul{display:flex; gap:26px; font-size:15px;}
#mainNav a{color:var(--chalk); opacity:.82; transition:opacity .2s, color .2s;}
#mainNav a:hover{opacity:1; color:var(--amber);}

.quick{display:flex; gap:8px; align-items:center; margin-inline-start:auto;}
.q-btn{
  display:inline-flex; align-items:center; gap:7px; height:38px; padding:0 13px;
  border:1px solid var(--line-dark); border-radius:4px; background:transparent; color:var(--chalk);
  font-size:13.5px; font-weight:600; cursor:pointer; white-space:nowrap; transition:all .2s; position:relative;
}
.q-btn:hover, .q-btn.active{border-color:var(--amber); color:var(--amber);}
.q-btn svg{width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; flex-shrink:0;}
.q-primary{background:var(--amber); border-color:var(--amber); color:var(--pitch-deep); font-weight:800;}
.q-primary:hover{color:var(--pitch-deep); opacity:.92;}
.dot{width:8px; height:8px; border-radius:50%; background:#2fbf71; animation:pulse 2s infinite; flex-shrink:0;}
@keyframes pulse{0%{box-shadow:0 0 0 0 rgba(47,191,113,.7);}70%{box-shadow:0 0 0 7px rgba(47,191,113,0);}100%{box-shadow:0 0 0 0 rgba(47,191,113,0);}}
.badge{min-width:18px; height:18px; padding:0 5px; border-radius:9px; background:var(--amber); color:var(--pitch-deep); font-size:11px; font-weight:800; display:inline-flex; align-items:center; justify-content:center; line-height:1;}
.badge[hidden]{display:none;}

.menu-btn{display:none;}
.burger{width:18px; height:14px; position:relative; display:block; flex-shrink:0;}
.burger i{position:absolute; right:0; left:0; height:2px; background:currentColor; border-radius:2px; transition:transform .25s, opacity .2s, top .25s;}
.burger i:nth-child(1){top:0;} .burger i:nth-child(2){top:6px;} .burger i:nth-child(3){top:12px;}
#siteHeader.open .menu-btn{border-color:var(--amber); color:var(--amber);}
#siteHeader.open .burger i:nth-child(1){top:6px; transform:rotate(45deg);}
#siteHeader.open .burger i:nth-child(2){opacity:0;}
#siteHeader.open .burger i:nth-child(3){top:6px; transform:rotate(-45deg);}

@media(max-width:860px){
  #siteHeader .wrap{padding:0 16px;}
  .hd-top{height:56px;}
  .hd-bar{gap:7px;}
  .menu-btn{display:inline-flex;}
  .quick{margin-inline-start:0; gap:7px;}
  #mainNav{
    display:none; position:absolute; top:100%; right:0; left:0;
    background:rgba(13,31,21,.985); border-bottom:1px solid var(--line-dark);
    padding:4px 20px 14px; box-shadow:0 24px 40px -18px rgba(0,0,0,.6);
    max-height:calc(100vh - 110px); overflow-y:auto;
  }
  #siteHeader.open #mainNav{display:block; animation:menuIn .22s ease;}
  #mainNav ul{flex-direction:column; gap:0; font-size:16.5px;}
  #mainNav ul li a{display:block; padding:14px 2px; border-bottom:1px solid var(--line-dark); opacity:.92;}
  .brand{font-size:16px;}
  .brand .brand-name{max-width:48vw;}
  .auth-links{gap:8px;}
  .auth-links a{padding:5px 12px; font-size:13px;}
}
@media(max-width:520px){
  .q-btn{height:36px; padding:0 9px; font-size:13px; gap:5px;}
  .q-btn .lbl{display:none;}
}
@media(max-width:370px){
  .menu-btn .t{display:none;}
  .q-btn{padding:0 8px;}
}
@keyframes menuIn{from{opacity:0; transform:translateY(-8px);}to{opacity:1; transform:none;}}

/* ===== پاپ‌آپ خوش‌آمد ===== */
.overlay-center{
  position:fixed; inset:0; z-index:120; background:rgba(8,20,13,.65); backdrop-filter:blur(3px);
  display:flex; align-items:center; justify-content:center; padding:20px; opacity:0; transition:opacity .3s;
}
.overlay-center.show{opacity:1;}
.welcome-box{
  background:var(--pitch); color:var(--chalk); border:1px solid var(--line-dark); border-top:3px solid var(--amber);
  border-radius:8px; padding:34px 30px 26px; max-width:380px; width:100%; text-align:center;
  box-shadow:0 30px 70px -20px rgba(0,0,0,.7); transform:translateY(18px) scale(.96); transition:transform .35s cubic-bezier(.2,.9,.3,1.2);
}
.overlay-center.show .welcome-box{transform:none;}
.welcome-box .w-avatar{
  width:64px; height:64px; border-radius:50%; margin:0 auto 16px; border:2px solid var(--amber);
  background:#1D3E28; color:var(--amber); display:flex; align-items:center; justify-content:center;
  font-size:22px; font-weight:800; direction:ltr;
}
.welcome-box h3{font-size:22px; margin-bottom:8px;}
.welcome-box p{color:#D8D2BF; font-size:15px; margin-bottom:22px;}
.welcome-box button{background:var(--amber); color:var(--pitch-deep); border:0; padding:11px 34px; border-radius:3px; font-size:15px; font-weight:700; cursor:pointer;}

/* ===== سبد خرید ===== */
.ov{position:fixed; inset:0; z-index:90; background:rgba(8,20,13,.55); backdrop-filter:blur(2px); opacity:0; pointer-events:none; transition:opacity .25s;}
.ov.show{opacity:1; pointer-events:auto;}
.cart{
  position:fixed; top:0; bottom:0; left:0; width:min(410px,94vw); z-index:95;
  background:var(--paper); color:var(--ink); display:flex; flex-direction:column;
  transform:translateX(-104%); transition:transform .3s ease; box-shadow:20px 0 50px -20px rgba(0,0,0,.5);
}
.cart.show{transform:none;}
.cart-head{display:flex; align-items:center; justify-content:space-between; padding:16px 20px; background:var(--pitch); color:var(--chalk);}
.cart-head h3{font-size:18px; display:flex; align-items:center; gap:10px;}
.cart-head svg{width:22px; height:22px; fill:none; stroke:var(--amber); stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round;}
.x-btn{width:38px; height:38px; border-radius:4px; border:1px solid var(--line-dark); background:transparent; color:inherit; cursor:pointer; display:flex; align-items:center; justify-content:center;}
.x-btn:hover{border-color:var(--amber); color:var(--amber);}
.x-btn svg{width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; display:block;}
.cart-items{flex:1; overflow-y:auto; padding:4px 20px;}
.ci{display:flex; gap:12px; padding:16px 0; border-bottom:1px solid var(--line-light);}
.ci img{width:84px; height:62px; object-fit:cover; border-radius:3px; flex-shrink:0;}
.ci-body{flex:1; min-width:0;}
.ci-title{font-size:14.5px; font-weight:700; line-height:1.6; margin-bottom:4px;}
.ci-price{font-size:13.5px; color:var(--muted);}
.ci-row{display:flex; align-items:center; justify-content:space-between; margin-top:8px;}
.qty{display:inline-flex; align-items:center; border:1px solid var(--line-light); border-radius:4px; background:#fff;}
.qty button{width:30px; height:30px; border:0; background:transparent; font-size:17px; cursor:pointer; color:var(--ink);}
.qty button:hover{color:var(--amber);}
.qty span{min-width:26px; text-align:center; font-size:14px; font-weight:700;}
.ci-del{border:0; background:transparent; color:#a0432f; font-size:13px; cursor:pointer; display:inline-flex; align-items:center; gap:4px;}
.ci-del svg{width:15px; height:15px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round;}
.cart-empty{text-align:center; padding:70px 10px 20px; color:var(--muted);}
.cart-empty svg{width:64px; height:64px; margin:0 auto 14px; fill:none; stroke:var(--amber); stroke-width:1.3; stroke-linecap:round; stroke-linejoin:round;}
.cart-empty p{margin-bottom:18px; font-size:15.5px;}
.btn-solid{display:inline-block; background:var(--amber); color:var(--pitch-deep); border:0; border-radius:3px; padding:12px 26px; font-weight:800; font-size:15px; cursor:pointer; text-align:center;}
.btn-solid:hover{opacity:.92;}
.cart-foot{border-top:1px solid var(--line-light); padding:16px 20px 20px; background:#fff;}
.coupon{display:flex; gap:8px; margin-bottom:14px;}
.coupon input{flex:1; min-width:0; padding:10px 12px; border:1px solid var(--line-light); border-radius:4px; font-family:inherit; font-size:16px; background:var(--paper);}
.coupon input:focus{outline:none; border-color:var(--amber);}
.coupon button{padding:0 16px; border:1px solid var(--pitch); background:transparent; color:var(--pitch); border-radius:4px; font-weight:700; cursor:pointer;}
.sum-row{display:flex; justify-content:space-between; font-size:14.5px; color:var(--muted); padding:3px 0;}
.sum-row.total{font-size:17px; color:var(--ink); font-weight:800; padding-top:10px; margin-top:6px; border-top:1px dashed var(--line-light);}
.cart-foot .btn-solid{display:block; width:100%; margin-top:14px; padding:14px;}
.cart-note{font-size:12.5px; color:var(--muted); text-align:center; margin-top:10px;}

/* ===== چت مشاوره ===== */
.chat{
  position:fixed; left:20px; bottom:20px; z-index:96; width:380px; height:min(580px,calc(100vh - 40px));
  display:flex; flex-direction:column; background:#fff; color:var(--ink); border-radius:12px; overflow:hidden;
  box-shadow:0 30px 80px -20px rgba(0,0,0,.55); border:1px solid var(--line-light);
  opacity:0; visibility:hidden; transform:translateY(18px) scale(.97); transition:opacity .25s, transform .3s, visibility .25s;
}
.chat.show{opacity:1; visibility:visible; transform:none;}
.chat-head{display:flex; align-items:center; gap:12px; padding:13px 16px; background:var(--pitch); color:var(--chalk);}
.chat-head img{width:42px; height:42px; border-radius:50%; border:2px solid var(--amber); object-fit:cover;}
.chat-head .tt{flex:1; min-width:0;}
.chat-head b{display:block; font-size:15.5px; line-height:1.4;}
.chat-head small{display:flex; align-items:center; gap:6px; font-size:12.5px; color:#C9C3AE;}
.chat-msgs{flex:1; overflow-y:auto; padding:16px 14px; background:#F3EFE3; display:flex; flex-direction:column; gap:10px;}
.msg{max-width:84%; padding:9px 13px; border-radius:14px; font-size:14.5px; line-height:1.8; word-wrap:break-word; animation:msgIn .22s ease;}
.msg time{display:block; font-size:11px; opacity:.6; margin-top:2px;}
.msg.bot{align-self:flex-start; background:#fff; border:1px solid var(--line-light); border-top-right-radius:4px;}
.msg.me{align-self:flex-end; background:var(--pitch); color:var(--chalk); border-top-left-radius:4px;}
@keyframes msgIn{from{opacity:0; transform:translateY(6px);}to{opacity:1; transform:none;}}
.chips{display:flex; flex-wrap:wrap; gap:7px; align-self:flex-start; max-width:100%;}
.chips button{border:1px solid var(--amber); color:#8d5f17; background:#fff; border-radius:16px; padding:5px 13px; font-size:13px; font-weight:600; cursor:pointer;}
.chips button:hover{background:var(--amber); color:var(--pitch-deep);}
.typing{align-self:flex-start; background:#fff; border:1px solid var(--line-light); border-radius:14px; border-top-right-radius:4px; padding:11px 15px; display:flex; gap:5px;}
.typing i{width:7px; height:7px; border-radius:50%; background:#9aa59c; animation:blink 1.2s infinite;}
.typing i:nth-child(2){animation-delay:.2s;} .typing i:nth-child(3){animation-delay:.4s;}
@keyframes blink{0%,60%,100%{opacity:.3; transform:none;}30%{opacity:1; transform:translateY(-3px);}}
.chat-in{display:flex; gap:8px; padding:10px 12px; border-top:1px solid var(--line-light); background:#fff;}
.chat-in input{flex:1; min-width:0; border:1px solid var(--line-light); border-radius:22px; padding:10px 16px; font-family:inherit; font-size:16px; background:var(--paper);}
.chat-in input:focus{outline:none; border-color:var(--amber);}
.chat-in button{width:44px; height:44px; border-radius:50%; border:0; background:var(--amber); color:var(--pitch-deep); cursor:pointer; display:flex; align-items:center; justify-content:center; flex-shrink:0;}
.chat-in button svg{width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round;}
@media(max-width:520px){
  .chat{left:0; right:0; top:0; bottom:0; width:100%; height:100%; height:100dvh; border-radius:0; border:0;}
}

/* ===== پیام کوتاه ===== */
.toast{
  position:fixed; left:50%; bottom:26px; transform:translate(-50%,20px); z-index:130;
  background:var(--pitch-deep); color:var(--chalk); border:1px solid var(--amber); border-radius:6px;
  padding:11px 20px; font-size:14.5px; opacity:0; pointer-events:none; transition:opacity .25s, transform .25s; max-width:90vw; text-align:center;
}
.toast.show{opacity:1; transform:translate(-50%,0);}

/* ===== نشانگر پیام جدید و پیام در حال ارسال در چت ===== */
.q-btn.chat-unread{position:relative;}
.q-btn.chat-unread::after{content:''; position:absolute; top:-5px; right:-5px; width:12px; height:12px; border-radius:50%; background:#D9534F; border:2px solid var(--pitch);}
.msg.pending{opacity:.6;}
