/* ==========================================================================
   RIVEXA — Handmade IoT Store
   Design language: dark circuit-board tech, mint-teal signal + copper solder
   accents, Vazirmatn for Persian type, JetBrains Mono for specs/prices.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root{
  /* ---- color tokens ---- */
  --bg:            #0a0d13;
  --bg-soft:       #10141d;
  --surface:       #141924;
  --surface-2:     #1b2230;
  --border:        #232b3a;
  --border-soft:   #1c2331;

  --text:          #eaeef4;
  --text-dim:      #9aa5b8;
  --text-faint:    #5c6883;

  --teal:          #22e0b8;
  --teal-dim:      #17a586;
  --teal-glow:     rgba(34,224,184,.35);

  --copper:        #ff9354;
  --copper-dim:    #d9773f;
  --copper-glow:   rgba(255,147,84,.30);

  --danger:        #ff5c72;
  --success:       #22e0b8;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;

  --font-display: 'Vazirmatn', sans-serif;
  --font-body: 'Vazirmatn', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --header-h: 76px;
}

*,*::before,*::after{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:var(--font-body);
  direction:rtl;
  line-height:1.7;
  -webkit-font-smoothing:antialiased;
}
img{ max-width:100%; display:block; }
a{ color:inherit; text-decoration:none; }
button{ font-family:inherit; }
ul{ list-style:none; margin:0; padding:0; }
h1,h2,h3,h4{ font-family:var(--font-display); margin:0; font-weight:800; letter-spacing:-.01em; }
p{ margin:0; }
input,select,textarea{ font-family:inherit; }

@media (prefers-reduced-motion: reduce){
  *{ animation-duration:.001ms !important; animation-iteration-count:1 !important; transition-duration:.001ms !important; scroll-behavior:auto !important; }
}

/* ---- background circuit texture ---- */
.circuit-bg{
  position:fixed; inset:0; z-index:-1; pointer-events:none;
  background-image:
    radial-gradient(circle at 12% 8%, rgba(34,224,184,.08), transparent 40%),
    radial-gradient(circle at 88% 18%, rgba(255,147,84,.07), transparent 38%),
    radial-gradient(circle at 50% 90%, rgba(34,224,184,.05), transparent 45%);
}
.circuit-bg::after{
  content:"";
  position:absolute; inset:0;
  background-image:
    linear-gradient(var(--border-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
  background-size:56px 56px;
  opacity:.35;
  mask-image:linear-gradient(to bottom, rgba(0,0,0,.9), rgba(0,0,0,.05) 70%);
}

/* ---- layout helpers ---- */
.container{ width:100%; max-width:1220px; margin:0 auto; padding:0 24px; }
.section{ padding:96px 0; position:relative; }
.section-head{ display:flex; align-items:flex-end; justify-content:space-between; gap:20px; margin-bottom:40px; flex-wrap:wrap; }
.eyebrow{
  display:inline-flex; align-items:center; gap:8px;
  font-family:var(--font-mono); font-size:12.5px; letter-spacing:.14em;
  color:var(--teal); text-transform:uppercase; margin-bottom:14px;
}
.eyebrow::before{ content:""; width:8px; height:8px; border-radius:50%; background:var(--teal); box-shadow:0 0 10px var(--teal-glow); }
.section-title{ font-size:clamp(26px,3.4vw,38px); }
.section-desc{ color:var(--text-dim); max-width:520px; font-size:15px; }
.link-arrow{ display:inline-flex; align-items:center; gap:6px; color:var(--teal); font-size:14px; font-weight:600; white-space:nowrap; }
.link-arrow svg{ transition:transform .25s; }
.link-arrow:hover svg{ transform:translateX(-4px); }

/* ---- reveal-on-scroll ---- */
.reveal{ opacity:0; transform:translateY(28px); transition:opacity .7s cubic-bezier(.2,.7,.3,1), transform .7s cubic-bezier(.2,.7,.3,1); }
.reveal.in{ opacity:1; transform:translateY(0); }
.reveal-scale{ opacity:0; transform:scale(.94); transition:opacity .6s ease, transform .6s cubic-bezier(.2,.7,.3,1); }
.reveal-scale.in{ opacity:1; transform:scale(1); }
.stagger .reveal:nth-child(1){ transition-delay:.02s; }
.stagger .reveal:nth-child(2){ transition-delay:.09s; }
.stagger .reveal:nth-child(3){ transition-delay:.16s; }
.stagger .reveal:nth-child(4){ transition-delay:.23s; }
.stagger .reveal:nth-child(5){ transition-delay:.30s; }
.stagger .reveal:nth-child(6){ transition-delay:.37s; }

/* ==========================================================================
   HEADER
   ========================================================================== */
.site-header{
  position:sticky; top:0; z-index:100;
  height:var(--header-h);
  display:flex; align-items:center;
  background:rgba(10,13,19,.75);
  backdrop-filter:blur(14px);
  border-bottom:1px solid var(--border-soft);
  transition:border-color .3s, background .3s;
}
.site-header .container{ display:flex; align-items:center; justify-content:space-between; gap:24px; }
.brand{ display:flex; align-items:center; gap:10px; font-weight:800; font-size:20px; }
.brand-mark{
  width:38px; height:38px; border-radius:10px;
  background:linear-gradient(145deg, var(--teal), var(--teal-dim));
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 0 22px var(--teal-glow);
  flex-shrink:0;
}
.brand-mark svg{ width:20px; height:20px; }
.brand-name{ letter-spacing:-.02em; }
.brand-name span{ color:var(--teal); }
.brand-sub{ font-family:var(--font-mono); font-size:11px; color:var(--text-faint); letter-spacing:.05em; display:block; margin-top:-2px; }

.main-nav{ display:flex; align-items:center; gap:6px; }
.main-nav a{
  padding:9px 15px; border-radius:999px; font-size:14.5px; font-weight:500; color:var(--text-dim);
  transition:color .2s, background .2s;
}
.main-nav a:hover, .main-nav a.active{ color:var(--text); background:var(--surface-2); }

.header-actions{ display:flex; align-items:center; gap:8px; }
.icon-btn{
  position:relative; width:42px; height:42px; border-radius:12px;
  display:flex; align-items:center; justify-content:center;
  background:var(--surface); border:1px solid var(--border); color:var(--text-dim);
  cursor:pointer; transition:border-color .2s, color .2s, transform .15s;
}
.icon-btn:hover{ color:var(--teal); border-color:var(--teal-dim); transform:translateY(-1px); }
.icon-btn svg{ width:19px; height:19px; }
.badge-count{
  position:absolute; top:-5px; left:-5px; min-width:18px; height:18px; padding:0 4px;
  border-radius:999px; background:var(--copper); color:#1a0e05;
  font-family:var(--font-mono); font-size:10.5px; font-weight:700;
  display:flex; align-items:center; justify-content:center; border:2px solid var(--bg);
}
.search-inline{ position:relative; display:none; }
.search-inline input{
  width:220px; height:42px; border-radius:12px; border:1px solid var(--border); background:var(--surface);
  color:var(--text); padding:0 40px 0 14px; font-size:13.5px; transition:width .25s, border-color .25s;
}
.search-inline input:focus{ outline:none; border-color:var(--teal-dim); width:260px; }
.search-inline svg{ position:absolute; left:12px; top:50%; transform:translateY(-50%); width:16px; height:16px; color:var(--text-faint); }
@media (min-width:900px){ .search-inline{ display:block; } }

.user-menu{ position:relative; }
.avatar-btn{
  width:42px; height:42px; border-radius:12px; border:1px solid var(--border); background:var(--surface);
  color:var(--text-dim); display:flex; align-items:center; justify-content:center; cursor:pointer; transition:border-color .2s,color .2s;
}
.avatar-btn:hover{ color:var(--teal); border-color:var(--teal-dim); }
.dropdown{
  position:absolute; top:calc(100% + 10px); left:0; min-width:210px;
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-md);
  padding:8px; opacity:0; visibility:hidden; transform:translateY(-8px);
  transition:opacity .2s, transform .2s, visibility .2s; box-shadow:0 20px 40px rgba(0,0,0,.4); z-index:60;
}
.dropdown.open{ opacity:1; visibility:visible; transform:translateY(0); }
.dropdown a, .dropdown button{
  display:flex; align-items:center; gap:10px; width:100%; text-align:right; padding:10px 12px; border-radius:9px;
  color:var(--text-dim); font-size:14px; background:none; border:none; cursor:pointer; transition:background .15s,color .15s;
}
.dropdown a:hover, .dropdown button:hover{ background:var(--surface-2); color:var(--text); }
.dropdown hr{ border:none; border-top:1px solid var(--border); margin:6px 4px; }
.dropdown svg{ width:16px; height:16px; flex-shrink:0; color:var(--text-faint); }
.dropdown .danger{ color:var(--danger); }
.dropdown .danger svg{ color:var(--danger); }

.burger{ display:flex; width:42px; height:42px; border-radius:12px; border:1px solid var(--border); background:var(--surface); align-items:center; justify-content:center; cursor:pointer; }
.burger svg{ width:19px; height:19px; }
@media (min-width:900px){ .burger{ display:none; } }
@media (max-width:899px){ .main-nav{ display:none; } }

.mobile-nav{
  position:fixed; inset:0; z-index:200; background:rgba(6,8,12,.7); backdrop-filter:blur(6px);
  opacity:0; visibility:hidden; transition:opacity .25s, visibility .25s;
}
.mobile-nav.open{ opacity:1; visibility:visible; }
.mobile-nav-panel{
  position:absolute; top:0; left:0; width:78%; max-width:320px; height:100%;
  background:var(--bg-soft); border-left:1px solid var(--border); padding:24px;
  transform:translateX(-100%); transition:transform .3s cubic-bezier(.2,.7,.3,1);
  display:flex; flex-direction:column; gap:6px;
}
.mobile-nav.open .mobile-nav-panel{ transform:translateX(0); }
.mobile-nav-panel a{ padding:14px 12px; border-radius:10px; font-size:16px; color:var(--text-dim); }
.mobile-nav-panel a:hover{ background:var(--surface-2); color:var(--text); }
.mobile-nav-close{ align-self:flex-start; margin-bottom:14px; }

/* ==========================================================================
   BUTTONS / FORMS
   ========================================================================== */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  height:48px; padding:0 24px; border-radius:12px; font-size:15px; font-weight:700;
  cursor:pointer; border:1px solid transparent; transition:transform .15s, box-shadow .2s, background .2s, border-color .2s, opacity .2s;
  white-space:nowrap;
}
.btn:active{ transform:scale(.97); }
.btn:disabled{ opacity:.5; cursor:not-allowed; transform:none; }
.btn-primary{ background:linear-gradient(135deg, var(--teal), var(--teal-dim)); color:#052019; box-shadow:0 8px 24px -8px var(--teal-glow); }
.btn-primary:hover{ box-shadow:0 10px 30px -6px var(--teal-glow); }
.btn-copper{ background:linear-gradient(135deg, var(--copper), var(--copper-dim)); color:#2b1102; box-shadow:0 8px 24px -8px var(--copper-glow); }
.btn-ghost{ background:var(--surface); color:var(--text); border-color:var(--border); }
.btn-ghost:hover{ border-color:var(--teal-dim); color:var(--teal); }
.btn-outline{ background:transparent; color:var(--text); border-color:var(--border); }
.btn-outline:hover{ border-color:var(--teal-dim); color:var(--teal); }
.btn-danger{ background:rgba(255,92,114,.12); color:var(--danger); border-color:rgba(255,92,114,.35); }
.btn-danger:hover{ background:rgba(255,92,114,.2); }
.btn-sm{ height:38px; padding:0 16px; font-size:13.5px; border-radius:10px; }
.btn-block{ width:100%; }
.btn-loading{ position:relative; color:transparent !important; pointer-events:none; }
.btn-loading::after{
  content:""; position:absolute; width:18px; height:18px; border-radius:50%;
  border:2px solid rgba(255,255,255,.35); border-top-color:#fff; animation:spin .7s linear infinite;
}
@keyframes spin{ to{ transform:rotate(360deg); } }

.field{ display:flex; flex-direction:column; gap:8px; margin-bottom:18px; }
.field label{ font-size:13.5px; color:var(--text-dim); font-weight:600; }
.field input, .field select, .field textarea{
  height:50px; border-radius:12px; border:1px solid var(--border); background:var(--surface);
  color:var(--text); padding:0 16px; font-size:15px; transition:border-color .2s, box-shadow .2s;
}
.field textarea{ height:auto; padding:14px 16px; resize:vertical; min-height:100px; }
.field input:focus, .field select:focus, .field textarea:focus{ outline:none; border-color:var(--teal-dim); box-shadow:0 0 0 3px rgba(34,224,184,.12); }
.field-error{ font-size:12.5px; color:var(--danger); display:none; }
.field.has-error input{ border-color:var(--danger); }
.field.has-error .field-error{ display:block; }
.field-hint{ font-size:12px; color:var(--text-faint); }

.otp-inputs{ display:flex; gap:8px; direction:ltr; }
.otp-inputs input{ width:44px; height:52px; text-align:center; font-family:var(--font-mono); font-size:20px; padding:0; }

/* ==========================================================================
   HERO
   ========================================================================== */
.hero{ position:relative; padding-top:64px; padding-bottom:40px; overflow:hidden; }
.hero-grid{ display:grid; grid-template-columns:1.1fr .9fr; gap:48px; align-items:center; }
@media (max-width:960px){ .hero-grid{ grid-template-columns:1fr; } }
.hero-eyebrow{
  display:inline-flex; align-items:center; gap:10px; padding:8px 14px; border-radius:999px;
  border:1px solid var(--border); background:var(--surface); font-family:var(--font-mono); font-size:12px;
  color:var(--text-dim); margin-bottom:22px; letter-spacing:.03em;
}
.hero-eyebrow b{ color:var(--teal); font-weight:600; }
.hero h1{ font-size:clamp(34px,5.4vw,58px); line-height:1.18; }
.hero h1 em{ font-style:normal; color:var(--teal); position:relative; }
.hero p.lead{ margin-top:22px; font-size:17px; color:var(--text-dim); max-width:480px; }
.hero-cta{ display:flex; gap:14px; margin-top:34px; flex-wrap:wrap; }
.hero-stats{ display:flex; gap:32px; margin-top:52px; flex-wrap:wrap; }
.hero-stat b{ display:block; font-family:var(--font-mono); font-size:24px; color:var(--text); }
.hero-stat span{ font-size:12.5px; color:var(--text-faint); }

.hero-visual{ position:relative; aspect-ratio:1/1; max-width:480px; margin:0 auto; }
.hero-visual svg{ width:100%; height:100%; }
.hero-orbit-card{
  position:absolute; padding:12px 16px; border-radius:14px; background:var(--surface);
  border:1px solid var(--border); backdrop-filter:blur(10px); display:flex; align-items:center; gap:10px;
  font-size:12.5px; box-shadow:0 20px 40px rgba(0,0,0,.35); animation:float 6s ease-in-out infinite;
}
.hero-orbit-card svg{ width:18px; height:18px; color:var(--teal); }
.hero-orbit-card.c1{ top:6%; right:0%; animation-delay:0s; }
.hero-orbit-card.c2{ bottom:14%; left:-4%; animation-delay:1.2s; }
.hero-orbit-card.c3{ top:46%; right:-6%; animation-delay:2.4s; }
@keyframes float{ 0%,100%{ transform:translateY(0); } 50%{ transform:translateY(-12px); } }

.trace-path{ fill:none; stroke:var(--teal); stroke-width:2; stroke-linecap:round; opacity:.55;
  stroke-dasharray:1400; stroke-dashoffset:1400; animation:draw 2.6s ease forwards .2s; }
.trace-path.copper{ stroke:var(--copper); }
@keyframes draw{ to{ stroke-dashoffset:0; } }
.trace-node{ fill:var(--bg); stroke:var(--teal); stroke-width:2; }

/* ---- marquee ---- */
.marquee{ border-top:1px solid var(--border-soft); border-bottom:1px solid var(--border-soft); overflow:hidden; padding:18px 0; }
.marquee-track{ display:flex; gap:56px; width:max-content; animation:scroll-x 28s linear infinite; }
.marquee-track span{ font-family:var(--font-mono); font-size:13px; color:var(--text-faint); letter-spacing:.08em; white-space:nowrap; display:flex; align-items:center; gap:10px; }
.marquee-track span::before{ content:"◆"; color:var(--teal); font-size:8px; }
@keyframes scroll-x{ from{ transform:translateX(0); } to{ transform:translateX(-50%); } }

/* ==========================================================================
   PRODUCT CARDS / GRID
   ========================================================================== */
.filter-bar{ display:flex; gap:10px; flex-wrap:wrap; margin-bottom:32px; }
.chip{
  padding:9px 18px; border-radius:999px; border:1px solid var(--border); background:var(--surface);
  color:var(--text-dim); font-size:13.5px; cursor:pointer; transition:all .2s; font-weight:500;
}
.chip:hover{ border-color:var(--teal-dim); color:var(--text); }
.chip.active{ background:var(--teal); border-color:var(--teal); color:#052019; font-weight:700; }

.product-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(250px,1fr)); gap:22px; }
.product-card{
  position:relative; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg);
  overflow:hidden; transition:transform .3s cubic-bezier(.2,.7,.3,1), border-color .3s, box-shadow .3s;
}
.product-card:hover{ transform:translateY(-6px); border-color:var(--teal-dim); box-shadow:0 24px 48px -18px rgba(34,224,184,.22); }
.product-thumb{ position:relative; aspect-ratio:1/.85; background:var(--surface-2); overflow:hidden; }
.product-thumb img{ width:100%; height:100%; object-fit:cover; transition:transform .5s cubic-bezier(.2,.7,.3,1); }
.product-card:hover .product-thumb img{ transform:scale(1.08); }
.product-thumb::after{ content:""; position:absolute; inset:0; background:linear-gradient(160deg, transparent 60%, rgba(0,0,0,.35)); }
.product-fav{
  position:absolute; top:12px; left:12px; z-index:2; width:36px; height:36px; border-radius:10px;
  background:rgba(10,13,19,.65); backdrop-filter:blur(6px); border:1px solid var(--border);
  display:flex; align-items:center; justify-content:center; cursor:pointer; color:var(--text-dim); transition:color .2s,border-color .2s;
}
.product-fav svg{ width:17px; height:17px; }
.product-fav:hover{ color:var(--copper); border-color:var(--copper-dim); }
.product-fav.active{ color:var(--copper); border-color:var(--copper-dim); }
.product-fav.active svg{ fill:var(--copper); }
.stock-badge{ position:absolute; top:12px; right:12px; z-index:2; font-family:var(--font-mono); font-size:10.5px; padding:5px 10px; border-radius:999px; background:rgba(10,13,19,.7); border:1px solid var(--border); color:var(--text-dim); }
.stock-badge.out{ color:var(--danger); border-color:rgba(255,92,114,.35); }
.stock-badge.low{ color:var(--copper); border-color:rgba(255,147,84,.35); }
.product-body{ padding:18px; }
.product-cat{ font-family:var(--font-mono); font-size:11px; color:var(--teal); letter-spacing:.06em; margin-bottom:6px; }
.product-name{ font-size:15.5px; font-weight:700; margin-bottom:6px; }
.product-desc{ font-size:13px; color:var(--text-dim); overflow:hidden; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; min-height:38px; }
.product-foot{ display:flex; align-items:center; justify-content:space-between; margin-top:16px; }
.price{ font-family:var(--font-mono); font-weight:600; font-size:15.5px; }
.price small{ font-size:11px; color:var(--text-faint); font-weight:400; margin-right:3px; }
.add-btn{
  width:40px; height:40px; border-radius:10px; background:var(--teal); color:#052019; border:none;
  display:flex; align-items:center; justify-content:center; cursor:pointer; transition:transform .15s, background .2s;
}
.add-btn:hover{ background:#3aeecb; }
.add-btn:active{ transform:scale(.9); }
.add-btn:disabled{ background:var(--surface-2); color:var(--text-faint); cursor:not-allowed; }
.add-btn svg{ width:18px; height:18px; }

.skeleton{ background:linear-gradient(100deg, var(--surface) 40%, var(--surface-2) 50%, var(--surface) 60%); background-size:200% 100%; animation:shimmer 1.4s infinite; border-radius:var(--radius-lg); }
@keyframes shimmer{ from{ background-position:120% 0; } to{ background-position:-20% 0; } }

.empty-state{ text-align:center; padding:70px 20px; color:var(--text-dim); }
.empty-state svg{ width:52px; height:52px; color:var(--text-faint); margin-bottom:18px; }
.empty-state h3{ font-size:18px; margin-bottom:8px; color:var(--text); }
.empty-state p{ font-size:14px; margin-bottom:20px; }

/* ==========================================================================
   PROCESS / CATEGORY strip
   ========================================================================== */
.category-strip{ display:grid; grid-template-columns:repeat(3,1fr); gap:20px; }
@media (max-width:760px){ .category-strip{ grid-template-columns:1fr; } }
.category-card{
  position:relative; padding:28px; border-radius:var(--radius-lg); border:1px solid var(--border);
  background:linear-gradient(160deg, var(--surface), var(--bg-soft)); overflow:hidden; cursor:pointer; transition:border-color .3s, transform .3s;
}
.category-card:hover{ border-color:var(--teal-dim); transform:translateY(-4px); }
.category-card .num{ font-family:var(--font-mono); color:var(--text-faint); font-size:12px; }
.category-card h3{ margin-top:38px; font-size:19px; }
.category-card p{ margin-top:8px; color:var(--text-dim); font-size:13.5px; }
.category-card svg{ position:absolute; left:-10px; bottom:-14px; width:110px; height:110px; color:var(--teal); opacity:.08; }

/* ==========================================================================
   PAGE HEADER (inner pages)
   ========================================================================== */
.page-header{ padding:52px 0 30px; border-bottom:1px solid var(--border-soft); }
.breadcrumb{ display:flex; gap:8px; align-items:center; font-size:13px; color:var(--text-faint); margin-bottom:14px; }
.breadcrumb a:hover{ color:var(--teal); }

/* ==========================================================================
   PRODUCT DETAIL
   ========================================================================== */
.product-detail{ display:grid; grid-template-columns:1fr 1fr; gap:56px; align-items:flex-start; }
@media (max-width:860px){ .product-detail{ grid-template-columns:1fr; gap:32px; } }
.pd-gallery{ position:sticky; top:calc(var(--header-h) + 24px); }
.pd-image{ border-radius:var(--radius-lg); overflow:hidden; border:1px solid var(--border); aspect-ratio:1/1; background:var(--surface); }
.pd-image img{ width:100%; height:100%; object-fit:cover; }
.pd-cat{ font-family:var(--font-mono); color:var(--teal); font-size:12px; letter-spacing:.06em; margin-bottom:10px; }
.pd-title{ font-size:clamp(24px,3vw,32px); margin-bottom:14px; }
.pd-price-row{ display:flex; align-items:center; gap:16px; margin:20px 0; }
.pd-price{ font-family:var(--font-mono); font-size:28px; font-weight:600; }
.pd-desc{ color:var(--text-dim); font-size:15px; line-height:1.9; margin-bottom:24px; }
.pd-qty{ display:flex; align-items:center; gap:12px; border:1px solid var(--border); border-radius:12px; width:fit-content; }
.pd-qty button{ width:44px; height:48px; background:none; border:none; color:var(--text); font-size:18px; cursor:pointer; }
.pd-qty span{ font-family:var(--font-mono); min-width:24px; text-align:center; }
.pd-actions{ display:flex; gap:12px; margin-top:26px; flex-wrap:wrap; }
.pd-meta{ display:flex; gap:22px; margin-top:28px; padding-top:24px; border-top:1px solid var(--border-soft); flex-wrap:wrap; }
.pd-meta-item{ display:flex; align-items:center; gap:8px; font-size:13px; color:var(--text-dim); }
.pd-meta-item svg{ width:17px; height:17px; color:var(--teal); }

.tabs{ display:flex; gap:6px; margin:56px 0 24px; border-bottom:1px solid var(--border-soft); }
.tab-btn{ padding:12px 4px; margin-left:26px; background:none; border:none; color:var(--text-faint); font-size:15px; font-weight:600; cursor:pointer; position:relative; }
.tab-btn.active{ color:var(--text); }
.tab-btn.active::after{ content:""; position:absolute; bottom:-1px; right:0; left:0; height:2px; background:var(--teal); }
.tab-panel{ display:none; }
.tab-panel.active{ display:block; }

.comment-item{ padding:18px 0; border-bottom:1px solid var(--border-soft); display:flex; gap:14px; }
.comment-avatar{ width:38px; height:38px; border-radius:10px; background:var(--surface-2); display:flex; align-items:center; justify-content:center; font-weight:700; color:var(--teal); flex-shrink:0; }
.comment-text{ font-size:14.5px; color:var(--text-dim); margin-top:4px; }
.comment-form{ display:flex; gap:10px; margin-top:20px; align-items:flex-start; }
.comment-form textarea{ flex:1; }

/* ==========================================================================
   CART
   ========================================================================== */
.cart-layout{ display:grid; grid-template-columns:1.6fr 1fr; gap:32px; align-items:flex-start; }
@media (max-width:860px){ .cart-layout{ grid-template-columns:1fr; } }
.cart-item{ display:flex; gap:16px; padding:18px; border:1px solid var(--border); border-radius:var(--radius-md); background:var(--surface); margin-bottom:14px; align-items:center; }
.cart-item img{ width:76px; height:76px; border-radius:10px; object-fit:cover; background:var(--surface-2); }
.cart-item-info{ flex:1; min-width:0; }
.cart-item-name{ font-weight:700; font-size:14.5px; margin-bottom:4px; }
.cart-item-stock{ font-size:12px; color:var(--text-faint); }
.cart-item-stock.warn{ color:var(--danger); }
.cart-qty{ display:flex; align-items:center; gap:8px; border:1px solid var(--border); border-radius:10px; }
.cart-qty button{ width:32px; height:36px; background:none; border:none; color:var(--text); cursor:pointer; font-size:16px; }
.cart-qty span{ font-family:var(--font-mono); min-width:20px; text-align:center; font-size:13px; }
.cart-item-remove{ color:var(--text-faint); cursor:pointer; transition:color .2s; background:none; border:none; padding:6px; }
.cart-item-remove:hover{ color:var(--danger); }
.cart-item-remove svg{ width:18px; height:18px; }

.summary-card{ position:sticky; top:calc(var(--header-h) + 24px); border:1px solid var(--border); border-radius:var(--radius-lg); background:var(--surface); padding:24px; }
.summary-row{ display:flex; justify-content:space-between; font-size:14px; color:var(--text-dim); margin-bottom:12px; }
.summary-row.total{ color:var(--text); font-weight:700; font-size:17px; padding-top:14px; border-top:1px solid var(--border-soft); margin-top:6px; font-family:var(--font-mono); }

/* ==========================================================================
   AUTH PAGE
   ========================================================================== */
.auth-wrap{ min-height:calc(100vh - var(--header-h)); display:flex; align-items:center; justify-content:center; padding:60px 20px; }
.auth-card{ width:100%; max-width:420px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); padding:36px; }
.auth-tabs{ display:flex; background:var(--surface-2); border-radius:12px; padding:4px; margin-bottom:28px; }
.auth-tabs button{ flex:1; padding:11px; border-radius:9px; background:none; border:none; color:var(--text-dim); font-weight:700; font-size:14px; cursor:pointer; transition:all .2s; }
.auth-tabs button.active{ background:var(--teal); color:#052019; }
.auth-step{ display:none; }
.auth-step.active{ display:block; animation:fadeUp .35s ease; }
@keyframes fadeUp{ from{ opacity:0; transform:translateY(8px); } to{ opacity:1; transform:translateY(0); } }
.auth-switch-link{ display:flex; gap:6px; justify-content:center; margin-top:8px; }
.auth-back{ display:flex; align-items:center; gap:6px; color:var(--text-faint); font-size:13px; margin-bottom:18px; cursor:pointer; width:fit-content; }
.auth-back svg{ width:15px; height:15px; }

/* ==========================================================================
   PROFILE / ORDERS / TABS PAGE
   ========================================================================== */
.profile-layout{ display:grid; grid-template-columns:260px 1fr; gap:32px; align-items:flex-start; }
@media (max-width:820px){ .profile-layout{ grid-template-columns:1fr; } }
.profile-side{ border:1px solid var(--border); border-radius:var(--radius-lg); background:var(--surface); padding:10px; position:sticky; top:calc(var(--header-h) + 24px); }
.profile-side-head{ display:flex; align-items:center; gap:12px; padding:14px 12px 18px; border-bottom:1px solid var(--border-soft); margin-bottom:10px; }
.profile-avatar{ width:46px; height:46px; border-radius:12px; background:linear-gradient(135deg,var(--teal),var(--teal-dim)); display:flex; align-items:center; justify-content:center; font-weight:800; color:#052019; }
.profile-side nav a{ display:flex; align-items:center; gap:10px; padding:12px; border-radius:10px; color:var(--text-dim); font-size:14px; font-weight:500; margin-bottom:2px; transition:background .2s,color .2s; }
.profile-side nav a svg{ width:17px; height:17px; }
.profile-side nav a:hover{ background:var(--surface-2); color:var(--text); }
.profile-side nav a.active{ background:rgba(34,224,184,.1); color:var(--teal); }
.profile-panel{ display:none; }
.profile-panel.active{ display:block; animation:fadeUp .35s ease; }
.card-block{ border:1px solid var(--border); border-radius:var(--radius-lg); background:var(--surface); padding:26px; margin-bottom:20px; }
.card-block h3{ font-size:16.5px; margin-bottom:18px; }

.order-item{ border:1px solid var(--border); border-radius:var(--radius-md); padding:18px; margin-bottom:14px; cursor:pointer; transition:border-color .2s; }
.order-item:hover{ border-color:var(--teal-dim); }
.order-item-top{ display:flex; justify-content:space-between; align-items:center; margin-bottom:6px; }
.order-id{ font-family:var(--font-mono); font-size:13px; color:var(--text-faint); }
.order-date{ font-size:12.5px; color:var(--text-faint); }
.order-price{ font-family:var(--font-mono); font-weight:700; color:var(--teal); }

.settings-row{ display:flex; align-items:center; justify-content:space-between; padding:14px 0; border-bottom:1px solid var(--border-soft); }
.settings-row:last-child{ border-bottom:none; }
.settings-row-label{ font-size:14px; }
.settings-row-desc{ font-size:12.5px; color:var(--text-faint); margin-top:3px; }

.fav-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:18px; }

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer{ border-top:1px solid var(--border-soft); padding:64px 0 28px; margin-top:60px; }
.footer-grid{ display:grid; grid-template-columns:1.5fr 1fr 1fr 1fr; gap:40px; margin-bottom:48px; }
@media (max-width:760px){ .footer-grid{ grid-template-columns:1fr 1fr; } }
.footer-brand p{ color:var(--text-dim); font-size:13.5px; margin-top:14px; max-width:280px; }
.footer-col h4{ font-size:13px; color:var(--text-faint); margin-bottom:16px; letter-spacing:.04em; }
.footer-col a{ display:block; padding:6px 0; color:var(--text-dim); font-size:14px; transition:color .2s; }
.footer-col a:hover{ color:var(--teal); }
.footer-social{ display:flex; gap:10px; margin-top:16px; }
.footer-social a{ width:36px; height:36px; border-radius:10px; background:var(--surface); border:1px solid var(--border); display:flex; align-items:center; justify-content:center; }
.footer-social a svg{ width:16px; height:16px; }
.footer-bottom{ display:flex; justify-content:space-between; align-items:center; padding-top:24px; border-top:1px solid var(--border-soft); color:var(--text-faint); font-size:12.5px; flex-wrap:wrap; gap:10px; }
.footer-bottom span{ font-family:var(--font-mono); }

/* ==========================================================================
   MODALS / DRAWERS / TOASTS
   ========================================================================== */
.overlay{ position:fixed; inset:0; background:rgba(6,8,12,.65); backdrop-filter:blur(4px); z-index:300; opacity:0; visibility:hidden; transition:opacity .25s, visibility .25s; }
.overlay.open{ opacity:1; visibility:visible; }

.drawer{ position:fixed; top:0; left:0; height:100%; width:100%; max-width:400px; background:var(--bg-soft); border-left:1px solid var(--border); z-index:301; transform:translateX(-100%); transition:transform .32s cubic-bezier(.2,.7,.3,1); display:flex; flex-direction:column; }
.drawer.open{ transform:translateX(0); }
.drawer-head{ display:flex; align-items:center; justify-content:space-between; padding:20px 22px; border-bottom:1px solid var(--border-soft); }
.drawer-body{ padding:20px 22px; overflow-y:auto; flex:1; }
.drawer-foot{ padding:20px 22px; border-top:1px solid var(--border-soft); }

.modal{ position:fixed; top:50%; right:50%; transform:translate(50%,-50%) scale(.95); width:92%; max-width:420px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); z-index:301; padding:26px; opacity:0; visibility:hidden; transition:opacity .25s, transform .25s, visibility .25s; }
.modal.open{ opacity:1; visibility:visible; transform:translate(50%,-50%) scale(1); }
.modal-head{ display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; }
.modal-close{ background:none; border:none; color:var(--text-faint); cursor:pointer; }
.modal-close svg{ width:20px; height:20px; }

.toast-wrap{ position:fixed; bottom:24px; left:50%; transform:translateX(-50%); z-index:400; display:flex; flex-direction:column; gap:10px; align-items:center; width:100%; padding:0 16px; }
.toast{
  display:flex; align-items:center; gap:10px; padding:13px 20px; border-radius:12px; background:var(--surface); border:1px solid var(--border);
  color:var(--text); font-size:13.5px; box-shadow:0 20px 40px rgba(0,0,0,.4); animation:toast-in .3s ease; max-width:360px;
}
.toast svg{ width:18px; height:18px; flex-shrink:0; }
.toast.success{ border-color:rgba(34,224,184,.4); }
.toast.success svg{ color:var(--teal); }
.toast.error{ border-color:rgba(255,92,114,.4); }
.toast.error svg{ color:var(--danger); }
.toast.leaving{ animation:toast-out .25s ease forwards; }
@keyframes toast-in{ from{ opacity:0; transform:translateY(12px); } to{ opacity:1; transform:translateY(0); } }
@keyframes toast-out{ to{ opacity:0; transform:translateY(-8px); } }

.page-loader{ position:fixed; inset:0; background:var(--bg); z-index:9999; display:flex; align-items:center; justify-content:center; transition:opacity .4s, visibility .4s; }
.page-loader.hidden{ opacity:0; visibility:hidden; }
.page-loader .loader-mark{ width:52px; height:52px; border-radius:14px; background:linear-gradient(145deg,var(--teal),var(--teal-dim)); display:flex; align-items:center; justify-content:center; animation:pulse-mark 1.3s ease-in-out infinite; }
@keyframes pulse-mark{ 0%,100%{ transform:scale(1); opacity:1; } 50%{ transform:scale(.85); opacity:.6; } }

/* misc */
.divider-text{ display:flex; align-items:center; gap:12px; color:var(--text-faint); font-size:12.5px; margin:20px 0; }
.divider-text::before, .divider-text::after{ content:""; flex:1; height:1px; background:var(--border); }
.text-center{ text-align:center; }
.mt-8{ margin-top:8px; } .mt-16{ margin-top:16px; } .mt-24{ margin-top:24px; }
.muted{ color:var(--text-dim); }
.faint{ color:var(--text-faint); font-size:13px; }
.spinner-block{ display:flex; align-items:center; justify-content:center; padding:60px 0; }
.spinner{ width:34px; height:34px; border-radius:50%; border:3px solid var(--border); border-top-color:var(--teal); animation:spin .7s linear infinite; }
