/* ════════════════════════════════════════════════════════════
   PISTALAND — Dark & Chic Template
   Vanilla HTML / CSS / JS  ·  RTL  ·  پسته و آجیل
   ──────────────────────────────────────────────────────────
   Files:  styles.css · script.js
   Pages:  index · shop · product · cart · checkout · about
           blog · post
   ════════════════════════════════════════════════════════════ */

@font-face {
  font-family: 'Estedad';
  src: url('../fonts/woff2/IRANYekanXFaNum-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Estedad';
  src: url('../fonts/woff2/IRANYekanXFaNum-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ─── Design tokens ─────────────────────────────────────── */
:root {
  /* Dark surfaces */
  --bg:          #0E1611;   /* page */
  --bg-2:        #121D16;   /* alt section */
  --surface:     #16221A;   /* cards */
  --surface-2:   #1C2A21;   /* raised */
  --surface-3:   #243228;   /* hover / inputs */

  /* Lines */
  --line:        rgba(237, 234, 224, .10);
  --line-2:      rgba(237, 234, 224, .16);

  /* Text */
  --text:        #ECE9DE;   /* primary cream */
  --text-2:      #B6BEAC;   /* secondary sage */
  --muted:       #7E8A76;   /* muted */

  /* Accents */
  --pistachio:   #C2DC85;
  --pistachio-2: #A7C45F;
  --pistachio-d: #6F8540;
  --gold:        #D2B074;
  --gold-2:      #C09A57;
  --rose:        #D08A6E;

  /* Type */
  --fa: "Estedad", "Tahoma", sans-serif;
  --en: "Estedad", "Tahoma", sans-serif;

  /* Radius */
  --r-xs: 3px;
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-pill: 999px;

  /* Shadow / glow */
  --sh: 0 2px 8px rgba(0,0,0,.3), 0 24px 60px -24px rgba(0,0,0,.6);
  --glow: 0 0 0 1px var(--line), 0 30px 80px -40px rgba(194, 220, 133, .25);

  --container: 1280px;
  --gutter: 28px;
}

/* ─── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--fa);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
input, select, textarea { font: inherit; color: inherit; border: none; background: none; outline: none; }
::selection { background: var(--pistachio); color: var(--bg); }

/* scrollbar */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--pistachio-d); }

/* ─── Layout ────────────────────────────────────────────── */
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); width: 100%; }
.container-narrow { max-width: 880px; }
.section { padding: 120px 0; }
.section-sm { padding: 72px 0; }
.row { display: flex; }
.col { display: flex; flex-direction: column; }
.between { justify-content: space-between; }
.center { align-items: center; }
.wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
[class*="gap-"] { display: flex; }
.gap-6 { gap: 6px; } .gap-10 { gap: 10px; } .gap-14 { gap: 14px; }
.gap-20 { gap: 20px; } .gap-28 { gap: 28px; } .gap-40 { gap: 40px; }

/* ─── Type scale ────────────────────────────────────────── */
h1,h2,h3,h4,h5 { line-height: 1.15; font-weight: 800; letter-spacing: -.01em; color: var(--text); }
.kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 600; letter-spacing: .24em;
  color: var(--pistachio); text-transform: uppercase;
}
.kicker::before { content: ""; width: 26px; height: 1px; background: var(--pistachio-d); }
.kicker.center-line { }
.display { font-size: clamp(44px, 6vw, 92px); font-weight: 800; line-height: 1.02; letter-spacing: -.025em; }
.h1 { font-size: clamp(34px, 4.4vw, 60px); font-weight: 800; letter-spacing: -.02em; }
.h2 { font-size: clamp(26px, 3vw, 40px); font-weight: 800; letter-spacing: -.015em; }
.h3 { font-size: 21px; font-weight: 700; }
.lead { font-size: 18px; line-height: 1.85; color: var(--text-2); }
.body { color: var(--text-2); line-height: 1.85; }
.small { font-size: 13px; color: var(--muted); }
.tiny { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.txt-pistachio { color: var(--pistachio); }
.txt-gold { color: var(--gold); }
.txt-muted { color: var(--muted); }

.mt-10{margin-top:10px}.mt-16{margin-top:16px}.mt-24{margin-top:24px}
.mt-32{margin-top:32px}.mt-40{margin-top:40px}.mt-56{margin-top:56px}
.mb-16{margin-bottom:16px}.mb-24{margin-bottom:24px}.mb-40{margin-bottom:40px}

/* ─── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 14px 28px; border-radius: var(--r-pill);
  font-weight: 600; font-size: 14px; letter-spacing: .01em;
  transition: all .22s cubic-bezier(.3,.7,.4,1);
  border: 1px solid transparent; white-space: nowrap; cursor: pointer;
}
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--pistachio); color: #16201A; }
.btn-primary:hover { background: var(--pistachio-2); transform: translateY(-2px); box-shadow: 0 12px 30px -12px rgba(194,220,133,.5); }
.btn-gold { background: var(--gold); color: #1A140A; }
.btn-gold:hover { background: var(--gold-2); transform: translateY(-2px); }
.btn-outline { border-color: var(--line-2); color: var(--text); background: transparent; }
.btn-outline:hover { border-color: var(--pistachio); color: var(--pistachio); }
.btn-ghost { background: var(--surface-2); color: var(--text); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-text { padding: 0; border-radius: 0; color: var(--text); border-bottom: 1px solid var(--line-2); padding-bottom: 3px; }
.btn-text:hover { color: var(--pistachio); border-color: var(--pistachio); }
.btn-lg { padding: 17px 36px; font-size: 15px; }
.btn-sm { padding: 10px 18px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-padded { padding-top: 14px; padding-bottom: 14px; }

/* ─── Icon button ───────────────────────────────────────── */
.icon-btn {
  width: 46px; height: 46px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text); transition: all .2s;
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { transform: scale(.93); }

/* ════ HEADER ═══════════════════════════════════════════ */
.topbar {
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  text-align: center;
  font-size: 12.5px; letter-spacing: .12em;
  color: var(--text-2);
  padding: 9px 20px;
}
.topbar .serif-accent { font-size: 15px; }

.header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(14, 22, 17, .8);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.header__bar {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 24px; padding: 20px 0;
}
.nav { display: flex; gap: 36px; align-items: center; }
.nav a {
  font-size: 15px; font-weight: 500; color: var(--text-2);
  position: relative; padding: 6px 0; transition: color .2s;
}
.nav a:hover, .nav a.active { color: var(--text); }
.nav a.active::after {
  content: ""; position: absolute; bottom: -2px; right: 0; left: 0;
  height: 2px; background: var(--pistachio); border-radius: 2px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; justify-self: center; }
.brand__mark { width: 34px; height: 34px; }
.brand__name { font-family: var(--en); font-size: 27px; font-weight: 600; letter-spacing: .03em; color: var(--text); }
.brand__name-fa { font-size: 12px; letter-spacing: .35em; color: var(--pistachio); margin-top: -3px; }
.actions { display: flex; gap: 4px; align-items: center; justify-content: flex-end; }

.cart-link { position: relative; }
.cart-count {
  position: absolute; top: 4px; left: 4px;
  min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 50%; background: var(--pistachio); color: #16201A;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}
.menu-toggle { display: none; }

@media (max-width: 920px) {
  .header__bar { grid-template-columns: auto 1fr auto; }
  .nav { display: none; }
  .menu-toggle { display: inline-flex; }
  .brand { justify-self: center; }
  .brand__name { font-size: 23px; }
}

@media (max-width: 480px) {
  :root { --gutter: 16px; }
  .header__bar { gap: 10px; }
  .brand__name { font-size: 19px; }
  .brand__name-fa { display: none; }
}

/* Mobile drawer */
.drawer {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg); padding: 28px;
  transform: translateX(100%); transition: transform .35s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
body.drawer-open { overflow: hidden; }
.drawer__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 48px; }
.drawer__nav { display: flex; flex-direction: column; gap: 4px; }
.drawer__nav a {
  font-size: 28px; font-weight: 800; padding: 14px 0;
  border-bottom: 1px solid var(--line); color: var(--text);
}

/* ════ FOOTER ═══════════════════════════════════════════ */
.footer { background: var(--bg-2); border-top: 1px solid var(--line); padding: 90px 0 32px; margin-top: 0; }
.footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 48px; padding-bottom: 56px; border-bottom: 1px solid var(--line); }
.footer__brand { font-family: var(--en); font-size: 42px; font-weight: 600; color: var(--text); margin-bottom: 16px; }
.footer__brand span { color: var(--pistachio); }
.footer__tag { color: var(--text-2); font-size: 14px; line-height: 1.8; max-width: 36ch; }
.footer h4 { font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin-bottom: 20px; font-weight: 600; }
.footer ul { display: flex; flex-direction: column; gap: 13px; }
.footer ul a { color: var(--text-2); font-size: 14px; transition: color .2s; }
.footer ul a:hover { color: var(--pistachio); }
.newsletter { display: flex; border: 1px solid var(--line-2); border-radius: var(--r-pill); padding: 5px 5px 5px 20px; margin-top: 18px; max-width: 340px; }
.newsletter input { flex: 1; font-size: 14px; color: var(--text); }
.newsletter input::placeholder { color: var(--muted); }
.newsletter button { background: var(--pistachio); color: #16201A; border-radius: var(--r-pill); padding: 9px 18px; font-size: 13px; font-weight: 600; }
.footer__bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 26px; font-size: 12.5px; color: var(--muted); letter-spacing: .04em; }
.footer__social { display: flex; gap: 14px; }
.footer__social a { color: var(--text-2); }
.footer__social a:hover { color: var(--pistachio); }
@media (max-width: 920px) {
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 36px; }
  .footer__bottom { flex-direction: column; gap: 14px; text-align: center; }
}

/* ════ PRODUCT CARD ═════════════════════════════════════ */
.products { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; }
@media (max-width: 1080px){ .products { grid-template-columns: repeat(3,1fr); } }
@media (max-width: 720px){ .products { grid-template-columns: repeat(2,1fr); gap: 16px; } }

.card { display: flex; flex-direction: column; position: relative; }
.card__media {
  position: relative; aspect-ratio: 4/5; border-radius: var(--r-md);
  overflow: hidden; border: 1px solid var(--line);
  background: var(--surface);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 22px; transition: border-color .25s, transform .35s;
}
.card:hover .card__media { border-color: var(--line-2); transform: translateY(-4px); }
.card__media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 80% at 70% 15%, rgba(194,220,133,.10) 0%, transparent 55%);
}
.card__no { font-family: var(--en); font-size: 64px; font-weight: 400; color: rgba(237,234,224,.10); line-height: 1; }
.card__title-lg { font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: -.01em; position: relative; z-index: 1; }
.card__en { font-family: var(--en); font-style: italic; font-size: 13px; letter-spacing: .08em; color: var(--pistachio); margin-bottom: 6px; }
.card__media-foot { display: flex; justify-content: space-between; align-items: flex-end; position: relative; z-index: 1; }
.card__weight { font-family: var(--en); font-size: 13px; letter-spacing: .1em; color: var(--text-2); }

/* card with photo */
.card__media.has-photo { padding: 0; }
.card__media.has-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card__media.has-photo .card__media-inner {
  position: relative; z-index: 2; width: 100%; height: 100%;
  display: flex; flex-direction: column; justify-content: space-between; padding: 22px;
  background: linear-gradient(to top, rgba(8,12,9,.85) 0%, transparent 45%);
}

.badge {
  position: absolute; top: 16px; right: 16px; z-index: 3;
  font-size: 10px; font-weight: 700; letter-spacing: .12em;
  padding: 6px 11px; border-radius: var(--r-pill);
  background: var(--pistachio); color: #16201A;
}
.badge--gold { background: var(--gold); color: #1A140A; }
.badge--rose { background: var(--rose); color: #1A140A; }

.quick-add {
  position: absolute; left: 16px; right: 16px; bottom: 16px; z-index: 4;
  background: rgba(14,22,17,.7); backdrop-filter: blur(8px);
  border: 1px solid var(--line-2); color: var(--text);
  border-radius: var(--r-pill); padding: 11px; font-size: 12.5px; font-weight: 600;
  letter-spacing: .04em; opacity: 0; transform: translateY(8px); transition: all .25s;
}
.card:hover .quick-add { opacity: 1; transform: translateY(0); }
.quick-add:hover { background: var(--pistachio); color: #16201A; border-color: var(--pistachio); }

.card__info { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-top: 16px; }
.card__name { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.card__sub { font-size: 12.5px; color: var(--muted); }
.card__price { font-size: 15px; font-weight: 700; color: var(--text); white-space: nowrap; }
.card__price .old { text-decoration: line-through; color: var(--muted); font-weight: 400; font-size: 13px; margin-right: 6px; }

/* media tint variants (typographic cards) */
.tint-1 { background: linear-gradient(155deg, #1B2A1F 0%, #14201A 100%); }
.tint-2 { background: linear-gradient(155deg, #22301C 0%, #18241A 100%); }
.tint-3 { background: linear-gradient(155deg, #2A2818 0%, #1C1E14 100%); }
.tint-4 { background: linear-gradient(155deg, #1E2A26 0%, #16221E 100%); }

/* ════ FORMS ════════════════════════════════════════════ */
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.field input, .field select, .field textarea {
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  padding: 14px 16px; font-size: 15px; color: var(--text); transition: border-color .2s, background .2s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--muted); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--pistachio); background: var(--surface-2); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width:600px){ .field-row { grid-template-columns: 1fr; } }

.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: var(--r-pill); background: var(--surface); overflow: hidden; }
.qty button { width: 40px; height: 40px; font-size: 17px; color: var(--text); transition: background .15s; }
.qty button:hover { background: var(--surface-3); }
.qty input { width: 42px; text-align: center; font-weight: 700; color: var(--text); }

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 17px; border-radius: var(--r-pill);
  border: 1px solid var(--line-2); background: transparent;
  font-size: 13px; color: var(--text-2); cursor: pointer; transition: all .18s;
}
.chip:hover { border-color: var(--pistachio); color: var(--text); }
.chip.active { background: var(--pistachio); color: #16201A; border-color: var(--pistachio); font-weight: 600; }

/* ════ PAGE HEAD (sub-pages) ════════════════════════════ */
.page-head { padding: 72px 0 56px; border-bottom: 1px solid var(--line); }
.crumbs { font-size: 12px; letter-spacing: .12em; color: var(--muted); margin-bottom: 22px; }
.crumbs a:hover { color: var(--pistachio); }
.crumbs .sep { margin: 0 8px; opacity: .5; }

/* ════ TOAST ════════════════════════════════════════════ */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translate(-50%, 160%);
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line-2);
  padding: 14px 24px; border-radius: var(--r-pill); font-size: 14px; z-index: 300;
  box-shadow: var(--sh); transition: transform .4s cubic-bezier(.22,.61,.36,1);
  display: flex; align-items: center; gap: 10px;
}
.toast.show { transform: translate(-50%, 0); }
.toast .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pistachio); }

/* ════ MISC ═════════════════════════════════════════════ */
.divider { height: 1px; background: var(--line); border: none; }
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.3,1); }
.reveal.in { opacity: 1; transform: none; }
.tag-pill { display: inline-flex; align-items: center; padding: 5px 12px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; color: var(--text-2); }

/* ════ FLASH MESSAGES ════════════════════════════════ */
.flash { display:flex; align-items:center; gap:12px; padding:12px 18px; border-radius:var(--r-sm); border:1px solid; font-size:14px; margin-bottom:8px; }
.flash--success { background:rgba(135,168,78,.12); border-color:rgba(135,168,78,.35); color:var(--pistachio); }
.flash--error { background:rgba(220,80,80,.1); border-color:rgba(220,80,80,.3); color:#e07070; }
.flash--info { background:rgba(100,150,220,.1); border-color:rgba(100,150,220,.3); color:#90b0e0; }
