/* ============================================================
   Bubble Mousse Iran — shop pages (checkout, tracking, payment result)
   Extends css/style.css; same tokens, same RTL mobile-first rules.
   ============================================================ */

.shop-main { background: var(--cream); padding: 26px 0 60px; }
.shop-head { margin-bottom: 18px; }
.shop-head h1 { font-size: var(--fs-l); margin: 0 0 6px; }
.shop-head p { color: var(--ink-2); font-size: var(--fs-s); margin: 0; }

/* ---------- two-column checkout ---------- */
.checkout { display: grid; gap: 18px; align-items: start; }
@media (min-width: 900px) {
  .checkout { grid-template-columns: 1fr 360px; }
  .co-aside { position: sticky; top: 18px; }
}

.co-card {
  background: var(--cream-2); border: 1px solid var(--c-line);
  border-radius: var(--radius-m); padding: 18px; margin-bottom: 18px;
  box-shadow: var(--shadow-s);
}
.co-card > h2 {
  font-size: var(--fs-m); margin: 0 0 14px; padding-bottom: 12px;
  border-bottom: 1px solid var(--c-line);
}
.co-note { color: var(--ink-3); font-size: var(--fs-xs); margin: 6px 0 0; }

.co-grid { display: grid; gap: 14px; }
@media (min-width: 620px) { .co-grid.two { grid-template-columns: 1fr 1fr; } }

.co-field label { display: block; font-size: var(--fs-s); font-weight: 600; margin-bottom: 6px; }
.co-field .req { color: var(--red); margin-inline-start: 3px; }
.co-field input, .co-field select, .co-field textarea {
  width: 100%; padding: 11px 13px; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius-s);
}
.co-field textarea { min-height: 96px; resize: vertical; }
.co-field input:focus, .co-field select:focus, .co-field textarea:focus {
  outline: 2px solid var(--emerald); outline-offset: 1px; border-color: var(--emerald);
}
.co-field.error input, .co-field.error select, .co-field.error textarea { border-color: var(--c-error); }
.co-field .err { display: none; color: var(--c-error); font-size: var(--fs-xs); margin-top: 5px; }
.co-field.error .err { display: block; }
.co-field select:disabled { background: #f2f0e8; color: var(--ink-3); }

/* ---------- product picker ---------- */
.pick { display: grid; gap: 12px; }
.pick-row {
  display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center;
  border: 1px solid var(--c-line); border-radius: var(--radius-m); padding: 12px; background: #fff;
}
.pick-row.on { border-color: var(--emerald); box-shadow: 0 0 0 1px var(--emerald) inset; }
.pick-row img { width: 64px; height: 64px; object-fit: contain; }
.pick-name { font-weight: 700; font-size: var(--fs-s); }
.pick-sub { color: var(--ink-3); font-size: var(--fs-xs); margin-top: 2px; }
.pick-price { font-weight: 700; font-size: var(--fs-s); margin-top: 4px; }
.pick-price s { color: var(--ink-3); font-weight: 500; margin-inline-start: 6px; font-size: var(--fs-xs); }
.pick-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.pick-tools select {
  padding: 7px 10px; font: inherit; font-size: var(--fs-xs); background: #fff;
  border: 1px solid var(--c-line); border-radius: var(--radius-s);
}
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--c-line); border-radius: var(--radius-pill); background: #fff; }
.stepper button {
  width: 32px; height: 32px; border: 0; background: none; font-size: 1.1rem; font-weight: 700;
  color: var(--emerald); cursor: pointer; line-height: 1;
}
.stepper button:disabled { color: var(--ink-3); cursor: default; }
.stepper span { min-width: 30px; text-align: center; font-weight: 700; font-size: var(--fs-s); }

/* ---------- summary ---------- */
.sum-card {
  background: var(--cream-2); border: 1px solid var(--c-line);
  border-radius: var(--radius-m); padding: 18px; box-shadow: var(--shadow-s);
}
.sum-card > h2 { font-size: var(--fs-m); margin: 0 0 14px; }
.sum-item {
  display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--c-line);
}
.sum-item img { width: 52px; height: 52px; object-fit: contain; background: #fff; border-radius: var(--radius-s); }
.sum-name { font-size: var(--fs-s); font-weight: 600; line-height: 1.5; }
.sum-meta { color: var(--ink-3); font-size: var(--fs-xs); margin-top: 2px; }
.sum-price { font-size: var(--fs-s); font-weight: 600; white-space: nowrap; }
.sum-empty { color: var(--ink-3); font-size: var(--fs-s); padding: 14px 0; text-align: center; }
.sum-line {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; font-size: var(--fs-s); border-bottom: 1px solid var(--c-line);
}
.sum-line span:last-child { font-weight: 600; }
.sum-total {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0 4px; font-weight: 800; font-size: var(--fs-m);
}
.sum-total .amount { color: var(--emerald-deep); }

.opt-list { display: grid; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--c-line); }
.opt {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer;
  border: 1px solid var(--c-line); border-radius: var(--radius-s); background: #fff; font-size: var(--fs-s);
}
.opt input { accent-color: var(--emerald); }
.opt.on { border-color: var(--emerald); background: var(--emerald-soft); }
.opt .opt-label { flex: 1; }
.opt .opt-price { color: var(--ink-2); font-size: var(--fs-xs); white-space: nowrap; }

.terms-row { display: flex; align-items: flex-start; gap: 8px; margin: 14px 0 12px; font-size: var(--fs-xs); color: var(--ink-2); }
.terms-row input { margin-top: 3px; accent-color: var(--emerald); }
.terms-row a { font-weight: 700; }

.co-submit { width: 100%; }
.co-submit:disabled { opacity: 0.55; cursor: not-allowed; }
.co-error { color: var(--c-error); font-size: var(--fs-s); font-weight: 600; text-align: center; margin: 10px 0 0; }
.co-trust { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.co-trust span { font-size: var(--fs-xs); color: var(--ink-3); background: var(--cream); border-radius: var(--radius-pill); padding: 4px 10px; }

/* ---------- order received ---------- */
.receipt { max-width: 620px; margin: 0 auto; text-align: center; }
.receipt .code {
  display: inline-block; font-size: var(--fs-l); font-weight: 800; letter-spacing: 1px;
  background: var(--emerald-soft); color: var(--emerald-deep);
  border-radius: var(--radius-s); padding: 10px 22px; margin: 12px 0 18px;
}

/* ---------- tracking ---------- */
.track-form { display: grid; gap: 12px; max-width: 460px; }
@media (min-width: 620px) { .track-form { grid-template-columns: 1fr 1fr; align-items: end; } }
.track-form .full { grid-column: 1 / -1; }

.track-order { margin-top: 16px; }
.track-head { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: baseline; }
.track-head .code { font-weight: 800; font-size: var(--fs-m); }
.track-head .date { color: var(--ink-3); font-size: var(--fs-xs); }
.pill {
  display: inline-block; border-radius: var(--radius-pill); padding: 3px 12px;
  font-size: var(--fs-xs); font-weight: 700;
}
.pill.ok { background: #e4f4e8; color: #1b7a3d; }
.pill.wait { background: #fdf3dd; color: #8c6d1f; }
.pill.bad { background: #fdeaea; color: #b3261e; }

.timeline {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  margin: 20px 0 6px; overflow-x: auto; padding-bottom: 4px;
}
.tl-step { text-align: center; min-width: 92px; }
.tl-track { display: flex; align-items: center; justify-content: center; }
.tl-line { height: 2px; flex: 1; background: var(--c-line); }
.tl-dot {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--c-line);
  background: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; color: var(--ink-3); flex: none;
}
/* completed steps are always the leading run, so: colour the whole track of a
   done step, then take the trailing half of the current step back to grey */
.tl-step.done .tl-dot { background: var(--emerald); border-color: var(--emerald); color: #fff; }
.tl-step.done .tl-line { background: var(--emerald); }
.tl-step.now .tl-line.after { background: var(--c-line); }
.tl-step.now .tl-dot { box-shadow: 0 0 0 4px var(--emerald-soft); }
.tl-step.canceled .tl-dot { background: var(--c-error); border-color: var(--c-error); }
/* no dangling connector at the two ends (must stay last to win) */
.tl-step:first-child .tl-line.before,
.tl-step:last-child .tl-line.after { background: transparent; }

.tl-body { padding: 8px 4px 0; }
.tl-title { font-weight: 700; font-size: var(--fs-xs); }
.tl-sub { color: var(--ink-3); font-size: 0.72rem; margin-top: 3px; line-height: 1.7; }
@media (max-width: 560px) {
  .tl-sub { display: none; }
  .tl-step { min-width: 66px; }
  .tl-dot { width: 22px; height: 22px; }
}

.track-items { margin-top: 10px; border-top: 1px solid var(--c-line); }
.track-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

/* ---------- payment result ---------- */
.pay-result {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--cream); padding: 30px 20px;
}
.pay-card {
  background: var(--cream-2); border: 1px solid var(--c-line); border-radius: var(--radius-l);
  padding: 34px 26px; max-width: 520px; text-align: center; box-shadow: var(--shadow-m);
}
.pay-card h1 { font-size: var(--fs-l); margin: 14px 0 12px; }
.pay-card p { color: var(--ink-2); font-size: var(--fs-s); line-height: 2; margin: 0 0 6px; }
.pay-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 62px; height: 62px; border-radius: 50%; font-size: 1.9rem; font-weight: 700; color: #fff;
}
.pay-card.ok .pay-icon { background: var(--c-success); }
.pay-card.fail .pay-icon { background: var(--c-error); }
.pay-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }

/* ---------- payment method note (online only) ---------- */
.pay-info {
  display: flex; flex-direction: column; gap: 4px;
  border: 1px solid var(--emerald); background: var(--emerald-soft);
  border-radius: var(--radius-s); padding: 12px 14px; font-size: var(--fs-s);
}
.pay-info span { color: var(--ink-2); font-size: var(--fs-xs); line-height: 1.9; }
.pay-info.off { border-color: var(--c-line); background: var(--cream); }

/* ---------- terms box inside the checkout summary ---------- */
.terms-box {
  max-height: 190px; overflow-y: auto; margin-top: 16px; padding: 12px 14px;
  background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius-s);
  font-size: var(--fs-xs); line-height: 2.1; color: var(--ink-2);
}
.terms-box:focus { outline: 2px solid var(--emerald); outline-offset: 1px; }
.terms-box h2 { font-size: var(--fs-s); color: var(--ink); margin: 14px 0 6px; }
.terms-box h2:first-child { margin-top: 0; }
.terms-box p, .terms-box li { margin: 0 0 8px; font-size: var(--fs-xs); line-height: 2.1; }
.terms-box ul, .terms-box ol { padding-inline-start: 18px; }
.terms-loading { color: var(--ink-3); text-align: center; }

/* ---------- slim footer used by the shop pages ---------- */
.footer-slim {
  display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: center; }
@media (max-width: 767px) {
  .footer-links { flex-direction: column; gap: 12px; width: 100%; }
  .footer-links a { display: block; }
  .footer-bottom p { line-height: 2.2; }
  .footer-bottom a { display: block; margin-top: 6px; }
}

/* ---------- blog posts written in the admin panel ---------- */
.post-cover {
  width: 100%; height: auto; border-radius: var(--radius-m);
  margin: 0 0 22px; display: block;
}
.post-content img, .post-content video {
  max-width: 100%; height: auto; border-radius: var(--radius-m); display: block; margin: 18px auto;
}
.post-content video { background: #000; }
.post-content iframe { max-width: 100%; border: 0; border-radius: var(--radius-m); margin: 18px 0; aspect-ratio: 16/9; width: 100%; }
.post-content h2 { font-size: var(--fs-l); margin: 30px 0 10px; }
.post-content h3 { font-size: var(--fs-m); margin: 22px 0 8px; }
.post-content p { margin-bottom: 14px; color: var(--ink-2); line-height: 2.1; }
.post-content ul, .post-content ol { margin: 0 0 16px; padding-inline-start: 22px; color: var(--ink-2); }
.post-content ul { list-style: disc; }
.post-content ol { list-style: persian; }
.post-content li { margin-bottom: 8px; }
.post-content blockquote {
  margin: 18px 0; padding: 12px 18px; border-inline-start: 3px solid var(--gold);
  background: var(--cream); border-radius: var(--radius-s); color: var(--ink-2);
}
.post-content a { color: var(--emerald); font-weight: 600; }
