@import url('/fonts/vazirmatn/400.css');
@import url('/fonts/vazirmatn/500.css');
@import url('/fonts/vazirmatn/700.css');
@import url('/fonts/markazi/500.css');
@import url('/fonts/markazi/700.css');

:root {
  --paper: #EDEFE8;
  --paper-deep: #E1E5DA;
  --label: #FAF9F4;
  --green: #1F3B33;
  --ink: #26302C;
  --muted: #5B6761;
  --line: #C7CEC1;
  --saffron: #E5A933;
  --pomegranate: #9A2C38;
  --lapis: #2C4A86;

  --serif: 'Markazi Text', 'Vazirmatn', serif;
  --sans: 'Vazirmatn', system-ui, sans-serif;

  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--lapis);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- نوار حالت آزمایشی ---------- */
.test-strip {
  background: var(--green);
  color: #E9EEE6;
  font-size: 13px;
  line-height: 1.7;
  padding: 8px 0;
}
.test-strip strong { color: var(--saffron); font-weight: 500; }

/* ---------- سربرگ ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 22px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 14px;
  text-decoration: none;
}
.brand-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 46px;
  line-height: 1;
  color: var(--green);
}
.brand-tag {
  font-size: 14px;
  color: var(--muted);
}

.cart-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px 9px 12px;
  background: transparent;
  border: 1.5px solid var(--green);
  border-radius: 999px;
  color: var(--green);
  font-weight: 500;
  font-size: 15px;
  cursor: pointer;
}
.cart-button:hover { background: var(--green); color: var(--paper); }
.cart-count {
  min-width: 24px;
  height: 24px;
  padding-inline: 6px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--saffron);
  color: var(--green);
  font-size: 13px;
  line-height: 1;
}
.cart-count[data-empty] { background: var(--paper-deep); color: var(--muted); }

/* ---------- معرفی: برشتهٔ این هفته ---------- */
.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: end;
  padding-block: clamp(40px, 7vw, 88px) clamp(32px, 5vw, 56px);
}
.intro h1 {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(40px, 6.2vw, 76px);
  line-height: 1.12;
  color: var(--green);
  text-wrap: balance;
}
.intro p {
  margin: 0;
  max-width: 34em;
  font-size: 17px;
  color: var(--ink);
}

.batch {
  border-top: 3px solid var(--green);
  padding-top: 18px;
}
.batch dl { margin: 0; display: grid; gap: 14px; }
.batch div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.batch dt { color: var(--muted); font-size: 14px; }
.batch dd { margin: 0; font-weight: 500; color: var(--green); text-align: left; }
.batch .batch-date {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
}

/* ---------- قفسه ---------- */
.shelf-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding-top: 8px;
  margin-bottom: 28px;
}
.shelf-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 700;
  color: var(--green);
}
.shelf-head p { margin: 0; color: var(--muted); font-size: 14px; }

.shelf {
  list-style: none;
  margin: 0;
  padding: 0 0 96px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 56px clamp(20px, 3vw, 40px);
}

.product { display: flex; flex-direction: column; }

/* کیسهٔ قهوه */
.bag {
  --bag: var(--green);
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--bag);
  border-radius: 4px 4px 18px 18px;
  padding: 44px 11% 0;
  isolation: isolate;
  overflow: hidden;
}
/* لبهٔ دوخت بالای کیسه */
.bag::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 22px;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,.16) 0 2px, transparent 2px 7px),
    linear-gradient(rgba(255,255,255,.12), rgba(255,255,255,.12));
  border-bottom: 1px solid rgba(0,0,0,.18);
}
/* چین‌های کناری کیسه */
.bag::after {
  content: '';
  position: absolute;
  inset: 22px 0 0;
  background: linear-gradient(90deg,
    rgba(0,0,0,.18) 0, rgba(0,0,0,0) 9%,
    rgba(255,255,255,.06) 50%,
    rgba(0,0,0,0) 91%, rgba(0,0,0,.18) 100%);
  z-index: -1;
  pointer-events: none;
}

.label {
  position: relative;
  background: var(--label);
  color: var(--ink);
  padding: 20px 20px 18px;
  border-radius: 2px;
  box-shadow: 0 1px 0 rgba(0,0,0,.08);
  transform: rotate(var(--tilt, 0deg));
}
.label h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(30px, 3vw, 38px);
  line-height: 1.15;
  color: var(--green);
}
.label .origin {
  margin: 4px 0 14px;
  font-size: 13px;
  color: var(--muted);
}
.label .notes {
  margin: 0;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 14px;
  line-height: 1.7;
}

/* درجهٔ برشته */
.roast {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--muted);
}
.roast-scale { display: flex; gap: 3px; }
.roast-scale span {
  width: 14px;
  height: 6px;
  border-radius: 1px;
  background: var(--paper-deep);
}
.roast-scale span[data-on] { background: var(--green); }

.bag-foot {
  position: absolute;
  inset-inline: 11%;
  bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  color: rgba(255,255,255,.85);
  font-size: 13px;
}
.bag-mark {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 30px;
  line-height: 1;
}

.buy {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px 16px;
  padding-top: 18px;
}
.price {
  font-size: 19px;
  font-weight: 700;
  color: var(--green);
}
.price small { font-size: 13px; font-weight: 400; color: var(--muted); margin-inline-start: 4px; }

.grind {
  grid-column: 1 / -1;
  width: 100%;
  appearance: none;
  padding: 10px 14px 10px 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%231F3B33' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat left 14px center,
    var(--label);
  font-size: 14px;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: #F2F4EE;
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease;
}
.btn:hover { background: #163029; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; padding-block: 15px; font-size: 16px; }
.btn-quiet {
  background: transparent;
  color: var(--green);
  border: 1.5px solid var(--green);
}
.btn-quiet:hover { background: var(--paper-deep); }

.add[data-added] { background: var(--saffron); color: var(--green); }

/* کالای ناموجود و اشتراک */
.sold-out {
  position: absolute;
  inset-inline-end: 14px;
  bottom: 58px;
  padding: 4px 12px;
  border-radius: 4px;
  background: var(--label);
  color: var(--pomegranate);
  border: 1.5px solid currentColor;
  font-size: 13px;
  font-weight: 700;
  transform: rotate(4deg);
}
.buy .btn-quiet { grid-column: 1 / -1; }
.buy-note { margin: 10px 0 0; font-size: 13px; line-height: 1.8; color: var(--muted); }
.cart-block {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-inline-start: 3px solid var(--saffron);
  background: var(--label);
  font-size: 14px;
}

/* ---------- کشوی سبد خرید ---------- */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(20, 32, 28, .38);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  z-index: 40;
}
.drawer {
  position: fixed;
  inset-block: 0;
  left: 0;
  width: min(420px, 100%);
  background: var(--paper);
  z-index: 50;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform .3s cubic-bezier(.2,.7,.2,1);
  box-shadow: 0 0 0 1px var(--line);
}
body[data-cart-open] .scrim { opacity: 1; pointer-events: auto; }
body[data-cart-open] .drawer { transform: none; }
body[data-cart-open] { overflow: hidden; }

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 30px;
  color: var(--green);
}
.close {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: transparent;
  color: var(--green);
  cursor: pointer;
}
.close:hover { background: var(--paper-deep); }

.drawer-body { flex: 1; overflow-y: auto; padding: 8px 24px; }
.drawer-foot { padding: 20px 24px 24px; border-top: 1px solid var(--line); background: var(--paper-deep); }

.empty {
  padding: 48px 0;
  color: var(--muted);
}
.empty p { margin: 0 0 16px; }

.line {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 4px 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.line:last-child { border-bottom: 0; }
.swatch {
  grid-row: span 2;
  width: 36px;
  height: 46px;
  border-radius: 2px 2px 6px 6px;
  background: var(--bag);
  border-top: 5px solid rgba(0,0,0,.2);
}
.line-name { font-weight: 500; color: var(--green); }
.line-grind { font-size: 13px; color: var(--muted); }
.line-price { text-align: left; font-weight: 500; }
.line-actions {
  grid-column: 2 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}

.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--label);
}
.qty button {
  width: 34px; height: 32px;
  border: 0; background: transparent;
  color: var(--green);
  font-size: 18px; line-height: 1;
  cursor: pointer;
}
.qty output { min-width: 26px; text-align: center; font-size: 14px; }
.remove {
  border: 0; background: none; padding: 4px 0;
  font-size: 13px; color: var(--muted);
  text-decoration: underline; text-underline-offset: 4px;
  cursor: pointer;
}
.remove:hover { color: var(--pomegranate); }

.totals { margin: 0 0 18px; display: grid; gap: 6px; font-size: 15px; }
.totals div { display: flex; justify-content: space-between; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; }
.totals .grand { padding-top: 10px; margin-top: 4px; border-top: 1px solid var(--line); font-size: 18px; font-weight: 700; color: var(--green); }
.totals .grand dt { color: var(--green); }
.ship-hint { margin: 0 0 14px; font-size: 13px; color: var(--muted); }

/* ---------- صفحهٔ پرداخت ---------- */
.page-title {
  margin: 0;
  padding-block: 44px 8px;
  font-family: var(--serif);
  font-size: clamp(38px, 5vw, 56px);
  line-height: 1.15;
  color: var(--green);
}
.page-lede { margin: 0 0 36px; color: var(--muted); max-width: 40em; }

.checkout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
  padding-bottom: 96px;
}

.form { display: grid; gap: 22px; }
.form fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 18px; }
.form legend {
  padding: 0;
  margin-bottom: 4px;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 700;
  color: var(--green);
}
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; font-weight: 500; }
.field .hint { font-size: 12px; color: var(--muted); }
.field input, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--label);
  font-size: 16px;
}
.field textarea { resize: vertical; min-height: 92px; line-height: 1.8; }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 59, 51, .14);
}
.field input[dir="ltr"] { text-align: right; }
.field[data-invalid] input, .field[data-invalid] textarea { border-color: var(--pomegranate); }
.field .error { font-size: 13px; color: var(--pomegranate); }
.field .error:empty { display: none; }

.form-error {
  padding: 14px 16px;
  border-inline-start: 3px solid var(--pomegranate);
  background: #F3E3E2;
  color: #6E1F27;
  font-size: 14px;
}
.form-error:empty { display: none; }

/* روش پرداخت */
.methods { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.method {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--label);
  cursor: pointer;
}
.method input { margin: 6px 0 0; accent-color: var(--green); }
.method b { display: block; color: var(--green); font-weight: 700; }
.method small { display: block; font-size: 13px; line-height: 1.7; color: var(--muted); }
.method:has(input:checked) { border-color: var(--green); box-shadow: 0 0 0 3px rgba(31, 59, 51, .1); }

.mandate-terms { margin: 0; display: grid; background: var(--label); border: 1px solid var(--line); border-radius: 10px; padding: 4px 16px; }
.mandate-terms div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.mandate-terms div:last-child { border-bottom: 0; }
.mandate-terms dt { color: var(--muted); }
.mandate-terms dd { margin: 0; font-weight: 500; color: var(--green); }
.hint-box {
  margin: 0;
  padding: 12px 16px;
  border-inline-start: 3px solid var(--saffron);
  background: var(--paper-deep);
  font-size: 14px;
  line-height: 1.9;
}

/* رسید */
.receipt {
  position: sticky;
  top: 24px;
  background: var(--label);
  padding: 28px 28px 32px;
  --tooth: 10px;
  -webkit-mask:
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / var(--tooth) 51% repeat-x,
    linear-gradient(#000 0 0) top / 100% calc(100% - var(--tooth) / 2) no-repeat;
          mask:
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / var(--tooth) 51% repeat-x,
    linear-gradient(#000 0 0) top / 100% calc(100% - var(--tooth) / 2) no-repeat;
  padding-bottom: 40px;
}
.receipt h2 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 28px;
  color: var(--green);
}
.receipt .line { grid-template-columns: 30px 1fr auto; padding: 12px 0; border-bottom-style: dashed; }
.receipt .swatch { width: 30px; height: 38px; }
.receipt .totals { margin-top: 16px; }
.receipt .pay-note { margin: 14px 0 0; font-size: 13px; color: var(--muted); text-align: center; }

/* ---------- نتیجهٔ پرداخت ---------- */
.result {
  max-width: 560px;
  margin: 0 auto;
  padding-block: 64px 96px;
}
.stamp {
  display: inline-block;
  padding: 6px 16px;
  border: 2px solid currentColor;
  border-radius: 6px;
  font-weight: 700;
  font-size: 14px;
  transform: rotate(-3deg);
  margin-bottom: 18px;
}
.result[data-state="paid"] .stamp { color: var(--green); }
.result[data-state="failed"] .stamp { color: var(--pomegranate); }
.result[data-state="pending"] .stamp { color: var(--muted); }
.result h1 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: clamp(40px, 6vw, 60px);
  line-height: 1.12;
  color: var(--green);
}
.result > p { margin: 0 0 28px; font-size: 17px; }
.result .receipt { position: static; margin-bottom: 28px; }
.facts { margin: 0; display: grid; gap: 0; }
.facts div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 15px;
}
.facts div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; text-align: left; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.actions .btn-danger { background: transparent; color: var(--pomegranate); border: 1.5px solid currentColor; }
.actions .btn-danger:hover { background: #F3E3E2; }

/* پیامک شبیه‌سازی‌شدهٔ پل‌پی (فقط در حالت ماک) */
.demo-sms {
  margin: 0 0 28px;
  padding: 16px 18px;
  border: 1.5px dashed var(--lapis);
  border-radius: 10px;
  background: #E8ECF5;
  font-size: 14px;
}
.demo-sms b { display: block; color: var(--lapis); margin-bottom: 4px; }
.demo-sms p { margin: 0 0 12px; }
.demo-sms .btn { background: var(--lapis); }
.result[data-state="waiting"] .stamp { color: var(--lapis); }
.live { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin: -16px 0 24px; }
.live::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--lapis); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }

/* ---------- اشتراک ---------- */
.charges { list-style: none; margin: 0; padding: 0; }
.charges li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.charges li:last-child { border-bottom: 0; }
.charges .meta { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.charges .bad { color: var(--pomegranate); }
.section-title { margin: 0 0 4px; font-family: var(--serif); font-size: 28px; color: var(--green); }
.demo-tools { margin: 0 0 28px; padding: 14px 16px; border: 1.5px dashed var(--lapis); border-radius: 10px; font-size: 14px; }
.demo-tools p { margin: 0 0 10px; }

/* ---------- پانویس ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 28px 36px;
  font-size: 14px;
  color: var(--muted);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px 32px;
}
.site-footer p { margin: 0; }
.footer-info { display: grid; gap: 4px; }

/* نمادهای اعتماد؛ کد خودشان دست نخورده، فقط اندازه یکسان می‌شود */
.seals { display: flex; align-items: center; gap: 12px; }
.seal {
  display: grid;
  place-items: center;
  min-width: 88px;
  height: 96px;
  padding: 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.seal a { display: block; line-height: 0; }
.seal img { height: 86px !important; width: auto; }

/* ---------- بارگذاری ---------- */
.skeleton .bag { background: var(--paper-deep); }
.skeleton .bag::before, .skeleton .bag::after { display: none; }

/* ---------- واکنش‌گرا ---------- */
@media (max-width: 960px) {
  .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .intro { grid-template-columns: 1fr; align-items: start; }
  .checkout { grid-template-columns: 1fr; }
  .receipt { position: static; order: -1; }
}
@media (max-width: 600px) {
  .methods { grid-template-columns: 1fr; }
  .brand-tag { display: none; }
  .brand-name { font-size: 38px; }
  .shelf { grid-template-columns: 1fr; gap: 48px; }
  .bag { aspect-ratio: 5 / 5; }
  .row { grid-template-columns: 1fr; }
  .shelf-head { flex-direction: column; gap: 4px; }
  .receipt { padding-inline: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}
