/* =========================================================
   نویر ویژن — سیستم طراحی مشترک
   پایه‌ی رنگ و تایپوگرافی از همون صفحه‌ی «پرو مجازی» اومده:
   زمینه‌ی تیره‌ی جوهری + لهجه‌ی کهربایی‌صدفی (تورتوایز) + سبز-فیروزه‌ای کم‌رنگ
   فونت نمایشی: وزیرمتن (درشت و پروبلد) / فونت داده: IBM Plex Mono
   ========================================================= */

:root{
  --ink:#14171F; --ink-2:#1E2330; --ink-3:#282E3D; --ink-4:#333B4E;
  --cream:#F3ECDD; --paper:#FBF7EE;
  --tortoise:#B97A3D; --tortoise-deep:#8F5A26; --tortoise-soft:rgba(185,122,61,0.14);
  --slate:#5C6472; --cyan:#6FD3C7; --cyan-deep:#49B3A6;
  --red:#E3667A; --amber:#E3A857; --green:#7FBF8F;
  --text-light:#EDE7DA; --text-dim:rgba(237,231,218,0.65); --text-dimmer:rgba(237,231,218,0.45);
  --text-dark:#23262E;
  --line-dark: rgba(237,231,218,0.14); --line-dark-2: rgba(237,231,218,0.08);
  --radius-lg:20px; --radius-md:14px; --radius-sm:10px; --radius-pill:100px;
  --shadow-lift: 0 18px 40px -20px rgba(0,0,0,0.55);
  --header-glass: rgba(20,23,31,0.85);
}

/* تم روشن — همون متغیرها رو با مقدار روشن بازتعریف می‌کنه، پس بقیه‌ی
   استایل‌ها که همه از var(--...) استفاده می‌کنن خودکار هماهنگ می‌شن. */
:root[data-theme="light"]{
  --ink:#FBF7EE; --ink-2:#F3ECDD; --ink-3:#EAE1CC; --ink-4:#DDD3B8;
  --tortoise:#B97A3D; --tortoise-deep:#8F5A26; --tortoise-soft:rgba(185,122,61,0.12);
  --slate:#6B7280; --cyan:#2E9E90; --cyan-deep:#1F7A6F;
  --red:#C4425A; --amber:#B87F2E; --green:#4C8F5C;
  --text-light:#23262E; --text-dim:rgba(35,38,46,0.68); --text-dimmer:rgba(35,38,46,0.48);
  --text-dark:#23262E;
  --line-dark: rgba(35,38,46,0.14); --line-dark-2: rgba(35,38,46,0.08);
  --shadow-lift: 0 18px 40px -20px rgba(35,38,46,0.18);
  --header-glass: rgba(251,247,238,0.85);
}

*{box-sizing:border-box;}

/* کلاس عمومی مخفی‌سازی — همه‌ی صفحات (از جمله پنل ادمین) برای نمایش/عدم‌نمایش
   بخش‌ها (فرم لاگین، داشبورد، مودال‌ها و ...) به همین کلاس تکیه می‌کنن. */
.hidden{display:none !important;}
html{scroll-behavior:smooth;}
body{
  margin:0; background:var(--ink); color:var(--text-light);
  font-family:'Vazirmatn',sans-serif; line-height:1.6; font-size:15px;
  -webkit-font-smoothing:antialiased;
  transition:background-color .2s, color .2s;
}
a{color:inherit; text-decoration:none;}
img{max-width:100%; display:block;}
button{font-family:inherit; cursor:pointer;}
.mono{font-family:'IBM Plex Mono',monospace;}
::selection{background:var(--tortoise); color:var(--ink);}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce){
  *{animation-duration:0.001ms !important; transition-duration:0.001ms !important;}
}

/* ---------- layout shells ---------- */
.wrap{max-width:1180px; margin:0 auto; padding:0 28px;}
.section{padding:56px 0;}
.section-tight{padding:34px 0;}

/* ---------- header / nav ---------- */
.site-header{
  position:sticky; top:0; z-index:40;
  display:flex; align-items:center; justify-content:space-between;
  padding:16px 28px; border-bottom:1px solid var(--line-dark);
  background:var(--header-glass); backdrop-filter:blur(10px);
}
.logo{display:flex; align-items:center; gap:10px; font-weight:800; font-size:20px; letter-spacing:.2px;}
.logo .logo-mark{width:42px; height:42px; object-fit:contain; display:block; filter:invert(1); transition:filter .2s;}
:root[data-theme="light"] .logo .logo-mark{filter:none;}
.logo .logo-text{font-family:'Vazirmatn',sans-serif;}
.main-nav{display:flex; align-items:center; gap:26px;}
.main-nav a{font-size:14px; color:var(--text-dim); transition:color .15s;}
.main-nav a:hover, .main-nav a.active{color:var(--text-light);}
.nav-right{display:flex; align-items:center; gap:14px;}
.cart-btn{
  position:relative; display:flex; align-items:center; gap:7px;
  background:transparent; border:1px solid var(--line-dark); color:var(--text-light);
  padding:9px 16px; border-radius:var(--radius-pill); font-size:13px;
}
.cart-btn:hover{border-color:var(--cyan);}
.cart-btn svg{width:16px; height:16px;}
.cart-count{
  position:absolute; top:-6px; left:-6px; background:var(--tortoise); color:var(--ink);
  font-size:10.5px; font-weight:800; width:19px; height:19px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
}
.cart-count.hidden{display:none;}
.theme-toggle{
  display:flex; align-items:center; justify-content:center;
  width:36px; height:36px; border-radius:50%;
  background:transparent; border:1px solid var(--line-dark); color:var(--text-light);
  transition:border-color .15s;
}
.theme-toggle:hover{border-color:var(--cyan);}
.menu-toggle{display:none; background:none; border:none; color:var(--text-light);}

@media (max-width:760px){
  .main-nav{
    position:fixed; inset:64px 0 0 0; background:var(--ink); flex-direction:column;
    align-items:flex-start; padding:24px 28px; gap:20px; transform:translateY(-12px);
    opacity:0; pointer-events:none; transition:opacity .18s, transform .18s; z-index:45;
  }
  .main-nav.open{opacity:1; pointer-events:auto; transform:translateY(0);}
  .menu-toggle{display:block;}
}

/* ---------- eyebrow / headings ---------- */
.eyebrow{
  font-family:'IBM Plex Mono',monospace; font-size:12px; letter-spacing:1.5px;
  text-transform:uppercase; color:var(--cyan); display:inline-flex; align-items:center; gap:8px; margin-bottom:10px;
}
.eyebrow::before{content:''; width:16px; height:1px; background:var(--cyan);}
h1,h2,h3{margin:0; font-weight:800;}
h1{font-size:clamp(28px,4vw,44px); line-height:1.15;}
h2{font-size:clamp(22px,3vw,30px); line-height:1.2;}
h3{font-size:16px;}
.lede{color:var(--text-dim); font-size:15px; margin:12px 0 0; max-width:520px;}

/* ---------- buttons ---------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  border:none; border-radius:var(--radius-pill); font-weight:700; font-size:14.5px;
  padding:13px 26px; transition:background .15s, border-color .15s, opacity .15s, transform .1s;
}
.btn:active{transform:scale(0.98);}
.btn-primary{background:var(--tortoise); color:var(--ink);}
.btn-primary:hover{background:#c98a49;}
.btn-primary:disabled{opacity:0.45; cursor:not-allowed;}
.btn-ghost{background:transparent; border:1px solid var(--line-dark); color:var(--text-light);}
.btn-ghost:hover{border-color:var(--cyan);}
.btn-danger{background:transparent; border:1px solid rgba(227,102,122,0.4); color:var(--red);}
.btn-danger:hover{background:rgba(227,102,122,0.1);}
.btn-sm{padding:8px 16px; font-size:12.5px;}
.btn-block{width:100%;}

/* ---------- badges / tags ---------- */
.badge{
  font-family:'IBM Plex Mono',monospace; font-size:10.5px;
  padding:5px 10px; border-radius:var(--radius-pill); background:rgba(111,211,199,0.1);
  color:var(--cyan); border:1px solid rgba(111,211,199,0.25); display:inline-block;
}
.badge-warm{background:var(--tortoise-soft); color:var(--tortoise); border-color:rgba(185,122,61,0.3);}
.badge-status{font-size:11px; padding:4px 10px; border-radius:var(--radius-pill); font-family:'IBM Plex Mono',monospace;}
.status-PENDING_PAYMENT{background:rgba(227,168,87,0.14); color:var(--amber); border:1px solid rgba(227,168,87,0.3);}
.status-PAID{background:rgba(127,191,143,0.14); color:var(--green); border:1px solid rgba(127,191,143,0.3);}
.status-FAILED, .status-CANCELED{background:rgba(227,102,122,0.14); color:var(--red); border:1px solid rgba(227,102,122,0.3);}
.status-SHIPPED{background:rgba(111,211,199,0.14); color:var(--cyan); border:1px solid rgba(111,211,199,0.3);}
.status-OPEN{background:rgba(227,168,87,0.14); color:var(--amber); border:1px solid rgba(227,168,87,0.3);}
.status-PENDING{background:rgba(111,211,199,0.14); color:var(--cyan); border:1px solid rgba(111,211,199,0.3);}
.status-CLOSED{background:rgba(227,102,122,0.14); color:var(--red); border:1px solid rgba(227,102,122,0.3);}

/* ---------- cards / panels ---------- */
.panel{
  background:var(--ink-2); border:1px solid var(--line-dark); border-radius:var(--radius-lg); padding:20px;
}
.product-card{
  background:var(--ink-2); border:1px solid var(--line-dark); border-radius:var(--radius-lg);
  overflow:hidden; display:flex; flex-direction:column; transition:border-color .18s, transform .18s;
}
.product-card:hover{border-color:var(--tortoise); transform:translateY(-3px);}
.product-card .thumb{
  aspect-ratio:4/3; background:var(--ink-3); display:flex; align-items:center; justify-content:center;
  position:relative; overflow:hidden;
}
.product-card .thumb img{width:100%; height:100%; object-fit:contain; padding:14px;}
.product-card .thumb .tag{
  position:absolute; top:10px; right:10px;
}
.product-card .body{padding:16px; display:flex; flex-direction:column; gap:8px; flex:1;}
.product-card .name{font-size:14.5px; font-weight:700; margin:0;}
.product-card .specs{display:flex; flex-wrap:wrap; gap:6px;}
.product-card .price-row{
  margin-top:auto; display:flex; align-items:center; justify-content:space-between; padding-top:8px;
}
.price{font-family:'IBM Plex Mono',monospace; color:var(--tortoise); font-size:14px; font-weight:600;}
.price-lg{font-size:20px;}
.price-compare{font-family:'IBM Plex Mono',monospace; color:var(--text-dimmer); font-size:12px; text-decoration:line-through;}
.stock-note{font-size:11.5px; color:var(--text-dimmer);}
.stock-note.low{color:var(--amber);}
.stock-note.out{color:var(--red);}

.grid{display:grid; gap:20px;}
.grid-4{grid-template-columns:repeat(4,1fr);}
.grid-3{grid-template-columns:repeat(3,1fr);}
.grid-2{grid-template-columns:repeat(2,1fr);}
@media (max-width:980px){ .grid-4{grid-template-columns:repeat(2,1fr);} .grid-3{grid-template-columns:repeat(2,1fr);} }
@media (max-width:600px){ .grid-4, .grid-3, .grid-2{grid-template-columns:1fr;} }

/* ---------- filters / chips ---------- */
.chip-row{display:flex; gap:8px; flex-wrap:wrap; margin-bottom:26px;}
.chip{
  background:var(--ink-2); border:1px solid var(--line-dark); color:var(--text-dim);
  padding:9px 18px; border-radius:var(--radius-pill); font-size:13.5px; transition:.15s;
}
.chip.active{background:var(--tortoise); border-color:var(--tortoise); color:var(--ink); font-weight:700;}
.chip:hover:not(.active){border-color:var(--cyan); color:var(--text-light);}

/* ---------- forms ---------- */
label{display:block; font-size:13px; color:var(--text-dim); margin-bottom:6px;}
input, textarea, select{
  width:100%; background:var(--ink-3); border:1px solid var(--line-dark); color:var(--text-light);
  border-radius:var(--radius-sm); padding:11px 14px; font-family:inherit; font-size:14px;
}
input:focus, textarea:focus, select:focus{
  outline:none; border-color:var(--cyan); box-shadow:0 0 0 3px rgba(111,211,199,0.15);
}
input::placeholder, textarea::placeholder{color:var(--text-dimmer);}
.field{margin-bottom:16px;}
.field-row{display:flex; gap:14px;}
.field-row .field{flex:1;}
.error-text{color:var(--red); font-size:12.5px; margin-top:6px;}
.help-text{color:var(--text-dimmer); font-size:12px; margin-top:6px;}

/* ---------- tables (admin) ---------- */
table{width:100%; border-collapse:collapse; font-size:13.5px;}
th{
  text-align:right; font-family:'IBM Plex Mono',monospace; font-size:11px; letter-spacing:0.5px;
  text-transform:uppercase; color:var(--text-dimmer); padding:10px 12px; border-bottom:1px solid var(--line-dark);
}
td{padding:12px; border-bottom:1px solid var(--line-dark-2); vertical-align:middle;}
tr:last-child td{border-bottom:none;}
.table-wrap{overflow-x:auto;}

/* ---------- empty / loading / toast ---------- */
.empty-state{
  text-align:center; padding:60px 20px; color:var(--text-dim);
}
.empty-state svg{width:34px; height:34px; color:var(--tortoise); margin-bottom:14px;}
.skeleton{
  background:linear-gradient(90deg, var(--ink-2) 25%, var(--ink-3) 37%, var(--ink-2) 63%);
  background-size:400% 100%; animation:shimmer 1.4s ease infinite; border-radius:var(--radius-md);
}
@keyframes shimmer{0%{background-position:100% 0;} 100%{background-position:-100% 0;}}
.toast{
  position:fixed; bottom:26px; left:50%; transform:translateX(-50%) translateY(20px);
  background:var(--ink-3); border:1px solid var(--line-dark); color:var(--text-light);
  padding:13px 22px; border-radius:var(--radius-pill); font-size:13.5px; z-index:100;
  opacity:0; pointer-events:none; transition:opacity .2s, transform .2s;
  display:flex; align-items:center; gap:10px; box-shadow:var(--shadow-lift);
}
.toast.show{opacity:1; transform:translateX(-50%) translateY(0);}
.toast.error{border-color:rgba(227,102,122,0.4);}
.toast svg{width:16px; height:16px; color:var(--cyan); flex-shrink:0;}
.toast.error svg{color:var(--red);}

/* ---------- footer ---------- */
.site-footer{border-top:1px solid var(--line-dark); margin-top:56px;}
.footer-grid{
  max-width:1180px; margin:0 auto; padding:52px 28px 30px;
  display:grid; grid-template-columns:1.4fr 1fr 1fr 1fr; gap:36px;
}
.footer-brand .logo{margin-bottom:16px; pointer-events:none;}
.footer-brand p{color:var(--text-dimmer); font-size:13px; line-height:2; max-width:270px; margin:0;}
.footer-col h4{font-size:13.5px; font-weight:700; margin:0 0 16px; color:var(--text-light);}
.footer-col a{display:block; color:var(--text-dimmer); font-size:13px; margin:11px 0; transition:color .15s;}
.footer-col a:hover{color:var(--cyan);}
.footer-bottom{
  border-top:1px solid var(--line-dark);
  max-width:1180px; margin:0 auto; padding:20px 28px;
  display:flex; justify-content:space-between; flex-wrap:wrap; gap:12px;
  color:var(--text-dimmer); font-size:12px;
}
@media (max-width:820px){ .footer-grid{grid-template-columns:1fr 1fr;} }
@media (max-width:560px){ .footer-grid{grid-template-columns:1fr; gap:28px; padding-top:40px;} }

/* ---------- misc ---------- */
.divider{height:1px; background:var(--line-dark); margin:28px 0;}
.note{
  padding:16px 18px; border-radius:var(--radius-md);
  background:var(--tortoise-soft); border:1px solid rgba(185,122,61,0.25);
  font-size:12.5px; color:rgba(237,231,218,0.75); display:flex; gap:10px;
}
.note svg{width:16px; height:16px; flex-shrink:0; margin-top:2px; color:var(--tortoise);}
.center{text-align:center;}
.flex-between{display:flex; align-items:center; justify-content:space-between; gap:12px;}
.gap-8{gap:8px;} .gap-12{gap:12px;}
.qty-control{display:flex; align-items:center; gap:10px;}
.qty-control button{
  width:28px; height:28px; border-radius:50%; border:1px solid var(--line-dark);
  background:transparent; color:var(--text-light); font-size:15px; line-height:1;
}
.qty-control button:hover{border-color:var(--cyan);}
.qty-control span{min-width:20px; text-align:center; font-family:'IBM Plex Mono',monospace;}

/* ---------- امتیاز ستاره‌ای ---------- */
.stars{display:inline-flex; gap:2px; color:var(--tortoise);}
.stars svg{width:15px; height:15px;}
.stars.stars-lg svg{width:22px; height:22px;}
.star-input{display:inline-flex; gap:4px; cursor:pointer;}
.star-input svg{width:24px; height:24px; color:var(--line-dark); transition:color .1s;}
.star-input svg.filled{color:var(--tortoise);}

/* ---------- نظرات محصول ---------- */
.review-item{border-bottom:1px solid var(--line-dark); padding:16px 0;}
.review-item:last-child{border-bottom:none;}
.review-item .review-head{display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:6px;}
.review-item .review-name{font-weight:700; font-size:13.5px;}
.review-item .review-date{color:var(--text-dimmer); font-size:11.5px;}
.review-item p{margin:0; font-size:13.5px; color:var(--text-dim); line-height:1.9;}
.review-summary{display:flex; align-items:center; gap:12px; margin-bottom:22px;}
.review-summary .avg{font-size:30px; font-weight:800; font-family:'IBM Plex Mono',monospace;}

/* ---------- تیکت / چت پشتیبانی ---------- */
.ticket-list{display:flex; flex-direction:column; gap:10px;}
.ticket-row{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:14px 16px; border:1px solid var(--line-dark); border-radius:var(--radius-md);
  background:var(--ink-2); cursor:pointer; transition:border-color .15s;
}
.ticket-row:hover{border-color:var(--cyan);}
.ticket-row .subject{font-weight:700; font-size:13.5px;}
.ticket-row .last-msg{color:var(--text-dimmer); font-size:12px; margin-top:4px; max-width:360px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.chat-thread{display:flex; flex-direction:column; gap:10px; max-height:440px; overflow-y:auto; padding:6px 2px;}
.chat-bubble{max-width:75%; padding:10px 14px; border-radius:14px; font-size:13.5px; line-height:1.8; white-space:pre-wrap;}
.chat-bubble.customer{align-self:flex-start; background:var(--ink-3); border:1px solid var(--line-dark); border-bottom-left-radius:4px;}
.chat-bubble.admin{align-self:flex-end; background:var(--tortoise-soft); border:1px solid rgba(185,122,61,0.3); border-bottom-right-radius:4px;}
.chat-bubble .chat-meta{display:block; font-size:10.5px; color:var(--text-dimmer); margin-top:4px;}
.chat-input-row{display:flex; gap:10px; margin-top:14px;}
.chat-input-row textarea{resize:none; min-height:44px;}

/* ---------- ویجت چت شناور (سوال سریع — جدا از صفحه‌ی تیکت رسمی) ---------- */
.chat-widget-btn{
  position:fixed; bottom:22px; left:22px; z-index:60;
  width:54px; height:54px; border-radius:50%;
  background:var(--tortoise); color:#fff; border:none; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  box-shadow:var(--shadow-lift);
  transition:transform .15s ease;
}
.chat-widget-btn:hover{transform:scale(1.06);}
.chat-widget-btn svg{width:24px; height:24px;}
.chat-widget-panel{
  position:fixed; bottom:88px; left:22px; z-index:60;
  width:340px; max-width:calc(100vw - 32px); height:460px; max-height:calc(100vh - 120px);
  background:var(--ink-2); border:1px solid var(--line-dark); border-radius:var(--radius-lg);
  box-shadow:var(--shadow-lift); display:flex; flex-direction:column; overflow:hidden;
}
.chat-widget-panel.hidden{display:none;}
.chat-widget-head{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 16px; border-bottom:1px solid var(--line-dark); flex-shrink:0;
}
.chat-widget-head h4{margin:0; font-size:14px;}
.chat-widget-head button{background:none; border:none; color:var(--text-dim); cursor:pointer; font-size:18px; line-height:1;}
.chat-widget-body{flex:1; overflow-y:auto; padding:14px; display:flex; flex-direction:column; gap:10px;}
.chat-widget-input-row{display:flex; gap:8px; padding:10px; border-top:1px solid var(--line-dark); flex-shrink:0;}
.chat-widget-input-row textarea{
  flex:1; resize:none; min-height:38px; max-height:80px; font-family:inherit; font-size:13px;
  background:var(--ink-3); border:1px solid var(--line-dark); border-radius:var(--radius-sm); color:var(--text-light);
  padding:8px 10px;
}
.chat-widget-input-row button{
  background:var(--tortoise); color:#fff; border:none; border-radius:var(--radius-sm);
  padding:0 14px; cursor:pointer; font-weight:600; font-size:13px;
}
@media (max-width:480px){
  .chat-widget-btn{left:14px; bottom:14px;}
  .chat-widget-panel{left:14px; bottom:76px; width:calc(100vw - 28px);}
}

/* ---------- داشبورد آماری پنل ادمین ---------- */
.stat-grid{display:grid; grid-template-columns:repeat(auto-fit, minmax(170px,1fr)); gap:14px; margin-bottom:26px;}
.stat-card{background:var(--ink-2); border:1px solid var(--line-dark); border-radius:var(--radius-md); padding:16px 18px;}
.stat-card .label{font-size:12px; color:var(--text-dimmer); margin-bottom:8px;}
.stat-card .value{font-size:22px; font-weight:800; font-family:'IBM Plex Mono',monospace; color:var(--tortoise);}
.stat-card .sub{font-size:11.5px; color:var(--text-dimmer); margin-top:4px;}

/* ---------- شمارنده‌ی اعلان روی تب‌های ادمین ---------- */
.tab-badge{
  display:inline-flex; align-items:center; justify-content:center; min-width:18px; height:18px; padding:0 5px;
  border-radius:var(--radius-pill); background:var(--red); color:#fff; font-size:10.5px; font-weight:700; margin-inline-start:6px;
}
