/* Shop (فروشگاه) — cards, listing, product page, cart, checkout, tracking. RTL, mobile-first. */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sp-muted { color: var(--muted); }
.sp-link { font-weight: 600; color: var(--muted); }
.sp-link:hover { color: var(--accent); }
.sp-center { text-align: center; }
.sp-block { width: 100%; }

/* ---------- hero + search ---------- */
.sp-hero { padding-bottom: 2.2rem; }
.sp-hero .post-back { margin-bottom: 0.4rem; }
.sp-search { margin: 1.6rem auto 0; max-width: 36rem; display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem; padding-inline-start: 1rem; background: var(--paper); border: 1.5px solid var(--ink); border-radius: 999px; box-shadow: 4px 4px 0 var(--tint); }
.sp-search svg { flex: none; color: var(--muted); }
.sp-search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 1rem; padding: 0.55rem 0.2rem; color: var(--ink); }
.sp-search input:focus { outline: none; }
.sp-search:focus-within { box-shadow: 4px 4px 0 var(--accent); }
.sp-search .btn { min-height: 2.7rem; padding-inline: 1.2rem; }

/* ---------- layout ---------- */
.sp-shop, .sp-page, .sp-product, .sp-home-inner, .sp-field { max-width: var(--max); margin-inline: auto; padding-inline: 1.5rem; }
.sp-shop { padding-bottom: 5rem; }
.sp-cats { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-bottom: 1.4rem; }
.sp-cats--center { justify-content: center; margin-bottom: 2rem; }
.sp-chip { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.5rem 1rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper); font-size: 0.92rem; font-weight: 600; color: var(--ink); transition: border-color 0.2s, background 0.2s, color 0.2s; }
.sp-chip span { font-size: 0.75rem; min-width: 1.4rem; padding: 0.05rem 0.4rem; border-radius: 999px; background: var(--bg-2); color: var(--muted); text-align: center; }
.sp-chip:hover { border-color: var(--ink); }
.sp-chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.sp-chip.is-active span { background: rgba(255, 255, 255, 0.18); color: #fff; }
.sp-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.3rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.sp-count { margin: 0; color: var(--muted); }
.sp-count strong { color: var(--ink); }
.sp-count a { color: var(--accent); font-weight: 600; }
.sp-sort { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; color: var(--muted); }
.sp-sort select { font: inherit; font-size: 0.9rem; color: var(--ink); padding: 0.45rem 0.9rem; padding-inline-end: 2rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2315131C' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat left 0.8rem center; appearance: none; cursor: pointer; }
.sp-sort select:focus { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- product grid + card ---------- */
.sp-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.3rem; }
.sp-card { position: relative; display: flex; flex-direction: column; background: var(--paper); border: 1.5px solid var(--ink); border-radius: 1.35rem; overflow: hidden; transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease); box-shadow: 0 0 0 var(--tint); }
.sp-card:hover { transform: translate(-3px, -3px); box-shadow: 6px 6px 0 var(--tint); }
.sp-card-media { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--accent-soft); overflow: hidden; border-bottom: 1.5px solid var(--ink); }
.sp-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s var(--ease); }
.sp-card:hover .sp-card-media img { transform: scale(1.045); }
.sp-noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--accent-mid); }
.sp-badges { position: absolute; top: 0.7rem; inset-inline-start: 0.7rem; inset-inline-end: 0.7rem; display: flex; flex-wrap: wrap; gap: 0.35rem; pointer-events: none; }
.sp-badge { font-size: 0.72rem; font-weight: 700; border-radius: 999px; padding: 0.12rem 0.6rem; border: 1px solid var(--ink); background: rgba(255, 252, 247, 0.94); color: var(--ink); line-height: 1.6; }
.sp-badge--sample { background: var(--gold); border-color: var(--ink); color: var(--ink); }
.sp-badge--sale { background: var(--accent); color: #fff; }
.sp-badge--dec { margin-inline-start: auto; font-weight: 600; font-size: 0.68rem; }
.sp-badge[hidden] { display: none; }
.sp-card-body { flex: 1; display: flex; flex-direction: column; gap: 0.35rem; padding: 0.95rem 1rem 1rem; }
.sp-card-cat { align-self: flex-start; font-size: 0.78rem; font-weight: 600; color: var(--accent); }
.sp-card-cat:hover { text-decoration: underline; }
.sp-card-title { margin: 0; font-size: 1.02rem; line-height: 1.6; font-weight: 700; letter-spacing: -0.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sp-card-title a::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.sp-card-title a:focus-visible { outline: none; }
.sp-card:has(.sp-card-title a:focus-visible) { outline: 3px solid var(--accent); outline-offset: 3px; }
.sp-card-stock, .sp-stock { display: inline-flex; align-items: center; gap: 0.4rem; margin: 0; font-size: 0.8rem; color: var(--muted); }
.sp-card-stock span, .sp-stock span { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--gold); }
.sp-stock--in_stock span { background: #2f8a5b; }
.sp-stock--out_of_stock span { background: #c0392b; }
.sp-stock--on_order span { background: var(--accent-mid); }
.sp-card-foot { margin-top: auto; padding-top: 0.6rem; display: flex; align-items: flex-end; justify-content: space-between; gap: 0.6rem; }
.sp-price { display: flex; flex-direction: column; line-height: 1.4; }
.sp-price strong { font-size: 1.08rem; font-weight: 800; color: var(--ink); }
.sp-price small { font-size: 0.72rem; font-weight: 600; color: var(--muted); }
.sp-price s { font-size: 0.8rem; color: var(--muted); }
.sp-price--ask strong { font-size: 0.92rem; font-weight: 700; color: var(--accent); }
.sp-add { position: relative; z-index: 1; margin: 0; }
.sp-add-btn { width: 2.7rem; height: 2.7rem; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; border: 1.5px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); cursor: pointer; transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s; }
.sp-add-btn:hover { background: var(--accent-hover); transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.sp-add-btn:active { transform: translate(1px, 1px); box-shadow: 0 0 0 var(--ink); }
.sp-add-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.is-busy { opacity: 0.6; pointer-events: none; }

.sp-empty { text-align: center; padding: 3.5rem 1rem; border: 1.5px dashed var(--line); border-radius: var(--radius); background: var(--paper); }
.sp-empty p { margin: 0.3rem 0; }
.sp-empty .btn { margin-top: 1rem; }
.sp-empty-icon { display: inline-grid; place-items: center; width: 5rem; height: 5rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent); margin-bottom: 0.6rem; }
.sp-pager { display: flex; justify-content: center; gap: 0.4rem; margin-top: 2rem; }
.sp-pager a { min-width: 2.5rem; height: 2.5rem; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--line); background: var(--paper); font-weight: 600; }
.sp-pager a.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.sp-info { margin-top: 3rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.sp-info div { padding: 1.1rem 1.2rem; border-radius: 1.2rem; background: var(--accent-soft); display: flex; flex-direction: column; gap: 0.25rem; }
.sp-info strong { color: var(--accent); }
.sp-info span { color: var(--muted); font-size: 0.9rem; line-height: 1.8; }
.sp-info a { color: var(--accent); font-weight: 600; }

/* ---------- flashes + toast ---------- */
.sp-flashes { margin: 0 0 1.2rem; }
.sp-flash { margin: 0 0 0.5rem; padding: 0.8rem 1.1rem; border-radius: 1rem; border: 1.5px solid var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sp-flash a { color: inherit; text-decoration: underline; margin-inline-start: 0.4rem; }
.sp-flash--error { border-color: #b3261e; background: #fdecea; color: #8c1d18; }
.sp-toast { position: fixed; z-index: 90; bottom: calc(1.2rem + env(safe-area-inset-bottom)); left: 50%; transform: translate(-50%, 1.5rem); opacity: 0; pointer-events: none; display: flex; align-items: center; gap: 0.9rem; max-width: calc(100vw - 2rem); padding: 0.75rem 0.8rem 0.75rem 1.1rem; padding-inline-start: 1.1rem; border-radius: 999px; background: var(--ink); color: #fff; font-size: 0.92rem; box-shadow: 0 12px 30px rgba(21, 19, 28, 0.25); transition: opacity 0.3s var(--ease), transform 0.3s var(--ease); }
.sp-toast.is-on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.sp-toast a { flex: none; padding: 0.35rem 0.85rem; border-radius: 999px; background: var(--gold); color: var(--ink); font-weight: 700; font-size: 0.85rem; }
.sp-toast.is-error { background: #8c1d18; }
.sp-has-buybar .sp-toast { bottom: calc(5.6rem + env(safe-area-inset-bottom)); }

/* ---------- product page ---------- */
.sp-product { padding-top: 1.6rem; padding-bottom: 5rem; }
.sp-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; font-size: 0.86rem; color: var(--muted); margin-bottom: 1.3rem; }
.sp-crumbs a:hover { color: var(--accent); }
.sp-crumbs [aria-current] { color: var(--ink); font-weight: 600; }
.sp-product-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: 2.4rem; align-items: start; }
.sp-gallery { position: sticky; top: calc(var(--nav-h) + 1rem); }
.sp-main-img { position: relative; display: block; width: 100%; padding: 0; border: 1.5px solid var(--ink); border-radius: var(--radius); overflow: hidden; background: var(--accent-soft); aspect-ratio: 4 / 3; cursor: zoom-in; box-shadow: 6px 6px 0 var(--tint); }
.sp-main-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sp-main-img--empty { cursor: default; }
.sp-main-img .sp-badges { top: 1rem; inset-inline-start: 1rem; inset-inline-end: 1rem; }
.sp-zoom { position: absolute; bottom: 0.9rem; inset-inline-end: 0.9rem; width: 2.4rem; height: 2.4rem; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 252, 247, 0.94); border: 1px solid var(--ink); color: var(--ink); }
.sp-main-img:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.sp-credit { margin: 0.7rem 0 0; font-size: 0.76rem; color: var(--muted); text-align: end; }
.sp-credit[hidden] { display: none; }
.sp-thumbs { list-style: none; margin: 0.9rem 0 0; padding: 0; display: flex; gap: 0.6rem; overflow-x: auto; scrollbar-width: thin; }
.sp-thumb { display: block; width: 5.4rem; aspect-ratio: 4 / 3; padding: 0; border-radius: 0.8rem; overflow: hidden; border: 1.5px solid var(--line); background: var(--accent-soft); cursor: pointer; opacity: 0.75; transition: opacity 0.2s, border-color 0.2s; }
.sp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sp-thumb:hover, .sp-thumb.is-active { opacity: 1; border-color: var(--ink); }
.sp-thumb.is-active { box-shadow: 0 0 0 2px var(--accent); }
.sp-buy-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem; }
.sp-buy-tags .sticker-mini { margin-bottom: 0; }
.sp-sample-note { font-size: 0.78rem; font-weight: 700; padding: 0.15rem 0.65rem; border-radius: 999px; background: var(--gold); border: 1px solid var(--ink); }
.sp-title { margin: 0.9rem 0 0.4rem; font-size: clamp(1.7rem, 3.2vw, 2.4rem); line-height: 1.35; letter-spacing: -0.03em; }
.sp-meta { margin: 0 0 0.6rem; color: var(--muted); font-size: 0.9rem; }
.sp-summary { margin: 0.4rem 0 1.4rem; color: var(--muted); line-height: 2; }
.sp-buybox { padding: 1.4rem; border: 1.5px solid var(--ink); border-radius: var(--radius); background: var(--paper); box-shadow: 6px 6px 0 var(--accent); display: flex; flex-direction: column; gap: 1rem; }
.sp-buybox-price { display: flex; flex-direction: column; gap: 0.2rem; }
.sp-buybox-price s { color: var(--muted); font-size: 0.95rem; }
.sp-big-price { font-size: 1.85rem; font-weight: 800; letter-spacing: -0.02em; }
.sp-big-price small { font-size: 0.9rem; color: var(--muted); font-weight: 600; }
.sp-big-price--ask { font-size: 1.45rem; color: var(--accent); }
.sp-buybox-price .sp-muted { font-size: 0.88rem; line-height: 1.9; }
.sp-buybox-price a { color: var(--accent); font-weight: 700; }
.sp-buyform { display: flex; gap: 0.7rem; align-items: stretch; flex-wrap: wrap; margin: 0; }
.sp-addcart { flex: 1; min-width: 12rem; }
.sp-qty { display: inline-flex; align-items: center; border: 1.5px solid var(--ink); border-radius: 999px; background: #fff; overflow: hidden; height: 3.15rem; }
.sp-qty button { width: 2.7rem; height: 100%; border: 0; background: transparent; font-size: 1.25rem; font-weight: 600; cursor: pointer; color: var(--ink); }
.sp-qty button:hover { background: var(--accent-soft); }
.sp-qty input { width: 2.8rem; height: 100%; border: 0; text-align: center; font: inherit; font-weight: 700; background: transparent; -moz-appearance: textfield; appearance: textfield; }
.sp-qty input::-webkit-outer-spin-button, .sp-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sp-qty input:focus { outline: none; background: var(--accent-soft); }
.sp-qty--sm { height: 2.5rem; }
.sp-qty--sm button { width: 2.2rem; }
.sp-qty--sm input { width: 2.3rem; }
.sp-incart { margin: 0; font-size: 0.88rem; color: var(--muted); }
.sp-incart a { color: var(--accent); font-weight: 700; }
.sp-assure { list-style: none; margin: 0; padding: 1rem 0 0; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 0.45rem; font-size: 0.88rem; color: var(--muted); }
.sp-assure li { display: flex; gap: 0.5rem; line-height: 1.8; }
.sp-assure li::before { content: ""; flex: none; width: 1rem; height: 1rem; margin-top: 0.35rem; border-radius: 50%; background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23263C37' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center / 0.65rem no-repeat; }

.sp-details { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.6rem; margin-top: 3.2rem; align-items: start; }
.sp-details > :only-child { grid-column: 1 / -1; }
.sp-specs, .sp-desc { padding: 1.5rem; border-radius: var(--radius); background: var(--paper); border: 1.5px solid var(--line); }
.sp-specs h2, .sp-desc h2 { font-size: 1.25rem; margin: 0 0 1rem; }
.sp-specs table { width: 100%; border-collapse: collapse; }
.sp-specs th, .sp-specs td { text-align: start; padding: 0.75rem 0.4rem; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.8; }
.sp-specs tbody th { width: 42%; color: var(--muted); font-weight: 600; }
.sp-specs tr:last-child th, .sp-specs tr:last-child td { border-bottom: 0; }
.sp-desc.post-body { max-width: none; margin: 0; font-size: 0.98rem; }
.sp-related { margin-top: 4rem; }
.sp-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.3rem; }
.sp-section-head h2 { margin: 0; font-size: 1.5rem; }
.sp-section-head a { color: var(--accent); font-weight: 600; }

/* sticky mobile buy bar */
.sp-buybar { display: none; }

/* lightbox */
.sp-lb { position: fixed; inset: 0; z-index: 200; background: rgba(13, 18, 16, 0.93); display: grid; place-items: center; padding: 3.6rem 4.5rem; }
.sp-lb[hidden] { display: none; }
.sp-lb-figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 0.8rem; }
.sp-lb-figure img { max-width: min(92vw, 78rem); max-height: calc(100vh - 9rem); object-fit: contain; border-radius: 1rem; background: #111; }
.sp-lb-figure figcaption { color: #e8e4da; font-size: 0.9rem; text-align: center; max-width: 46rem; line-height: 1.8; }
.sp-lb-close, .sp-lb-nav { position: absolute; width: 3rem; height: 3rem; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, 0.45); background: rgba(255, 255, 255, 0.08); color: #fff; font-size: 1.25rem; cursor: pointer; display: grid; place-items: center; }
.sp-lb-close:hover, .sp-lb-nav:hover { background: rgba(255, 255, 255, 0.2); }
.sp-lb-close { top: 1rem; inset-inline-end: 1rem; }
.sp-lb-prev { right: 1rem; top: 50%; transform: translateY(-50%); }
.sp-lb-next { left: 1rem; top: 50%; transform: translateY(-50%); }
.sp-lb-nav[hidden] { display: none; }
.sp-lb-count { position: absolute; top: 1.6rem; inset-inline-start: 1.4rem; margin: 0; color: #cfcac0; font-size: 0.9rem; }
html.sp-lock, html.sp-lock body { overflow: hidden; }

/* ---------- cart / checkout / pages ---------- */
.sp-page { padding-top: 2.6rem; padding-bottom: 5rem; }
.sp-page--narrow { max-width: 46rem; }
.sp-page-head { text-align: center; margin-bottom: 2rem; }
.sp-page-head .page-title { font-size: clamp(2rem, 4.6vw, 3rem); }
.sp-lede { color: var(--muted); line-height: 2; max-width: 34rem; margin: 0.8rem auto 0; }
.sp-steps { list-style: none; display: flex; justify-content: center; gap: 0.4rem; margin: 1.2rem 0 0; padding: 0; counter-reset: s; flex-wrap: wrap; }
.sp-steps li { counter-increment: s; display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.35rem 0.85rem; border-radius: 999px; font-size: 0.85rem; color: var(--muted); background: var(--paper); border: 1.5px solid var(--line); }
.sp-steps li::before { content: counter(s, persian); width: 1.35rem; height: 1.35rem; border-radius: 50%; display: grid; place-items: center; font-size: 0.75rem; font-weight: 700; background: var(--bg-2); color: var(--muted); }
.sp-steps li.is-on { border-color: var(--ink); color: var(--ink); font-weight: 700; }
.sp-steps li.is-on::before { background: var(--accent); color: #fff; }
.sp-steps li.is-done::before { content: "✓"; background: var(--accent-soft); color: var(--accent); }
.sp-steps a { color: inherit; }
.sp-cart-grid { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; gap: 1.8rem; align-items: start; }
.sp-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.8rem; }
.sp-line { display: grid; grid-template-columns: 6.2rem minmax(0, 1fr) auto 8.5rem 2.4rem; align-items: center; gap: 1rem; padding: 0.8rem; padding-inline-end: 1rem; border: 1.5px solid var(--line); border-radius: 1.2rem; background: var(--paper); }
.sp-line-img { display: block; aspect-ratio: 4 / 3; border-radius: 0.8rem; overflow: hidden; background: var(--accent-soft); }
.sp-line-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sp-line-info { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.sp-line-title { font-weight: 700; line-height: 1.6; }
.sp-line-title:hover { color: var(--accent); }
.sp-line-info .sp-muted { font-size: 0.82rem; }
.sp-line-total { text-align: end; font-size: 0.95rem; }
.sp-ask { color: var(--accent); font-weight: 700; }
.sp-remove { width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 1.5px solid transparent; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.sp-remove:hover { border-color: #b3261e; color: #b3261e; }
.sp-cart-actions { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 1.2rem; flex-wrap: wrap; }
.sp-cart-actions .btn.is-dirty { border-color: var(--accent); background: var(--accent); color: #fff; }
.sp-summary-box { position: sticky; top: calc(var(--nav-h) + 1rem); padding: 1.4rem; border: 1.5px solid var(--ink); border-radius: var(--radius); background: var(--paper); box-shadow: 6px 6px 0 var(--tint); }
.sp-summary-box h2 { font-size: 1.15rem; margin: 0 0 1rem; }
.sp-summary-box dl { margin: 0 0 1rem; display: flex; flex-direction: column; gap: 0.65rem; }
.sp-summary-box dl div { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.92rem; }
.sp-summary-box dt { color: var(--muted); }
.sp-summary-box dd { margin: 0; font-weight: 600; text-align: end; }
.sp-summary-box .sp-total { padding-top: 0.8rem; border-top: 1.5px dashed var(--line); font-size: 1rem; }
.sp-summary-box .sp-total dt { color: var(--ink); font-weight: 700; }
.sp-summary-box .sp-total dd { font-weight: 800; color: var(--accent); }
.sp-note { margin: 0 0 0.9rem; font-size: 0.84rem; color: var(--muted); line-height: 1.9; }
.sp-summary-box .btn { margin-top: 0.3rem; }
.sp-side { display: flex; flex-direction: column; gap: 1rem; }
.sp-side .sp-summary-box { position: static; }
.sp-mini-lines { padding: 1rem; border-radius: 1.2rem; background: var(--accent-soft); display: flex; flex-direction: column; gap: 0.7rem; }
.sp-mini { display: grid; grid-template-columns: 3.6rem minmax(0, 1fr) auto; gap: 0.7rem; align-items: center; font-size: 0.88rem; }
.sp-mini img { width: 3.6rem; height: 2.7rem; object-fit: cover; border-radius: 0.5rem; }
.sp-mini strong { font-size: 0.85rem; }
.sp-mini-lines .sp-link { font-size: 0.85rem; color: var(--accent); }

.sp-form { display: flex; flex-direction: column; gap: 1.1rem; }
.sp-form fieldset { margin: 0; padding: 1.4rem; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--paper); display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.sp-form legend { font-weight: 800; font-size: 1.08rem; padding: 0 0.4rem; }
.sp-form label { display: flex; flex-direction: column; gap: 0.4rem; font-weight: 600; font-size: 0.92rem; }
.sp-form input[type=text], .sp-form input[type=tel], .sp-form textarea { width: 100%; font: inherit; font-weight: 400; font-size: 1rem; padding: 0.75rem 0.95rem; border: 1.5px solid var(--line); border-radius: 0.95rem; background: #fff; color: var(--ink); line-height: 1.8; }
.sp-form input[dir=ltr] { text-align: left; }
.sp-form input[dir=ltr]::placeholder { text-align: left; }
.sp-form textarea { resize: vertical; }
.sp-form input:focus, .sp-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sp-form [aria-invalid=true] { border-color: #b3261e; }
.sp-err { color: #b3261e; font-size: 0.82rem; font-weight: 600; }
.sp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.sp-hp { position: absolute !important; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sp-pay { gap: 0.7rem !important; }
.sp-pay-opt { flex-direction: row !important; align-items: flex-start; gap: 0.8rem !important; padding: 0.9rem 1rem; border: 1.5px solid var(--line); border-radius: 1rem; cursor: pointer; background: #fff; transition: border-color 0.2s, background 0.2s; }
.sp-pay-opt:hover { border-color: var(--ink); }
.sp-pay-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 3px 3px 0 var(--tint); }
.sp-pay-opt input { margin-top: 0.35rem; accent-color: var(--accent); width: 1.1rem; height: 1.1rem; flex: none; }
.sp-pay-opt span { display: flex; flex-direction: column; gap: 0.15rem; }
.sp-pay-opt small { color: var(--muted); font-weight: 400; font-size: 0.84rem; line-height: 1.8; }
.sp-form .btn[disabled] { opacity: 0.6; }

.sp-thanks { text-align: center; padding: 2.2rem 1.4rem; border: 1.5px solid var(--ink); border-radius: var(--radius); background: var(--paper); box-shadow: 6px 6px 0 var(--accent); margin-bottom: 1.4rem; }
.sp-thanks .page-title { font-size: clamp(1.8rem, 4vw, 2.5rem); margin-top: 0.8rem; }
.sp-check { display: inline-grid; place-items: center; width: 4.4rem; height: 4.4rem; border-radius: 50%; background: var(--accent); color: #fff; box-shadow: 0 0 0 8px var(--accent-soft); }
.sp-code { margin: 1.4rem auto 0.8rem; display: inline-flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; justify-content: center; padding: 0.6rem 0.7rem 0.6rem 1.1rem; padding-inline-start: 1.1rem; border-radius: 999px; background: var(--accent-soft); border: 1.5px dashed var(--accent); }
.sp-code span { color: var(--muted); font-size: 0.9rem; }
.sp-code strong { font-size: 1.35rem; letter-spacing: 0.08em; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; color: var(--accent); }
.sp-copy { border: 1.5px solid var(--ink); background: var(--paper); border-radius: 999px; padding: 0.3rem 0.9rem; font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; }
.sp-card-box { padding: 1.4rem; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--paper); margin-bottom: 1.4rem; }
.sp-card-box h2 { font-size: 1.15rem; margin: 0 0 1rem; }
.sp-next { margin: 0; padding-inline-start: 1.3rem; display: flex; flex-direction: column; gap: 0.55rem; line-height: 1.9; }
.sp-cardinfo { margin-top: 1.2rem; padding: 1rem 1.1rem; border-radius: 1rem; background: #fbf5e6; border: 1.5px solid var(--gold); }
.sp-cardinfo p { margin: 0.4rem 0; line-height: 2; white-space: normal; }
.sp-cardinfo small { color: var(--muted); }
.sp-items { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.sp-items th, .sp-items td { text-align: start; padding: 0.65rem 0.4rem; border-bottom: 1px solid var(--line); }
.sp-items thead th { color: var(--muted); font-weight: 600; font-size: 0.82rem; }
.sp-items td:nth-child(2), .sp-items th:nth-child(2) { text-align: center; width: 4rem; }
.sp-items td:last-child, .sp-items th:last-child { text-align: end; }
.sp-items tfoot th, .sp-items tfoot td { border-bottom: 0; font-weight: 800; padding-top: 0.9rem; }
.sp-center-actions { display: flex; justify-content: center; gap: 0.7rem; flex-wrap: wrap; }
.sp-track-form { padding: 1.4rem; border: 1.5px solid var(--ink); border-radius: var(--radius); background: var(--paper); box-shadow: 6px 6px 0 var(--tint); margin-bottom: 1.4rem; }
.sp-track-form .btn { align-self: flex-start; }
.sp-track-result { margin-top: 0.4rem; }
.sp-track-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.sp-track-head strong { font-family: ui-monospace, Menlo, monospace; letter-spacing: 0.06em; font-size: 1.1rem; }
.sp-status { padding: 0.25rem 0.85rem; border-radius: 999px; font-size: 0.85rem; font-weight: 700; background: var(--accent-soft); color: var(--accent); border: 1.5px solid var(--accent); }
.sp-status--cancelled { background: #fdecea; color: #8c1d18; border-color: #b3261e; }
.sp-status--delivered { background: var(--accent); color: #fff; }
.sp-progress { list-style: none; margin: 1.3rem 0 1.4rem; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.3rem; counter-reset: s; }
.sp-progress li { counter-increment: s; position: relative; text-align: center; font-size: 0.78rem; color: var(--muted); padding-top: 2.1rem; line-height: 1.6; }
.sp-progress li::before { content: counter(s, persian); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 1.7rem; height: 1.7rem; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); font-weight: 700; z-index: 1; }
.sp-progress li::after { content: ""; position: absolute; top: 0.82rem; right: 50%; width: 100%; height: 2px; background: var(--line); }
.sp-progress li:first-child::after { display: none; }
.sp-progress li.is-done::before { content: "✓"; background: var(--accent-soft); color: var(--accent); }
.sp-progress li.is-done::after, .sp-progress li.is-on::after { background: var(--accent); }
.sp-progress li.is-on { color: var(--ink); font-weight: 700; }
.sp-progress li.is-on::before { background: var(--accent); color: #fff; box-shadow: 0 0 0 4px var(--accent-soft); }
.sp-h3 { font-size: 1rem; margin: 1.4rem 0 0.6rem; }
.sp-events { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.sp-events li { padding: 0.7rem 0.9rem; border-radius: 0.9rem; background: var(--bg); font-size: 0.9rem; }
.sp-events p { margin: 0.3rem 0 0; color: var(--muted); }

/* ---------- home + field landing ---------- */
.sp-home { padding-block: 5.5rem 1rem; }
.sp-home .section-head, .sp-field .section-head { text-align: center; }
.sp-home .section-lede, .sp-field .section-lede { max-width: 36rem; margin-inline: auto; }
.sp-home .work-more, .sp-field .work-more { display: flex; justify-content: center; margin-top: 2rem; }
.sp-field { padding-block: 4rem 1rem; }
.sp-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .sp-grid, .sp-grid--4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sp-cart-grid { grid-template-columns: minmax(0, 1fr) 19rem; }
  .sp-line { grid-template-columns: 5rem minmax(0, 1fr) auto 2.4rem; }
  .sp-line-total { grid-column: 2 / 3; text-align: start; }
}
@media (max-width: 860px) {
  .sp-product-grid, .sp-details, .sp-cart-grid { grid-template-columns: 1fr; }
  .sp-gallery, .sp-summary-box { position: static; }
  .sp-product-grid { gap: 1.6rem; }
  .sp-details { margin-top: 2rem; }
  .sp-info { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .sp-shop, .sp-page, .sp-product, .sp-home-inner, .sp-field { padding-inline: 1.15rem; }
  .sp-grid, .sp-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; }
  .sp-card { border-radius: 1.1rem; }
  .sp-card:hover { transform: none; box-shadow: none; }
  .sp-card-body { padding: 0.7rem 0.75rem 0.8rem; gap: 0.25rem; }
  .sp-card-title { font-size: 0.9rem; line-height: 1.65; }
  .sp-card-stock { font-size: 0.72rem; }
  .sp-price strong { font-size: 0.95rem; }
  .sp-price--ask strong { font-size: 0.8rem; }
  .sp-add-btn { width: 2.35rem; height: 2.35rem; }
  .sp-badges { top: 0.45rem; inset-inline-start: 0.45rem; inset-inline-end: 0.45rem; gap: 0.25rem; }
  .sp-badge { font-size: 0.64rem; padding: 0.05rem 0.45rem; }
  .sp-badge--dec { display: none; }
  .sp-main-img .sp-badge--dec { display: inline-block; }
  .sp-cats { flex-wrap: nowrap; overflow-x: auto; margin-inline: -1.15rem; padding: 0.2rem 1.15rem 0.5rem; scrollbar-width: none; scroll-snap-type: x proximity; }
  .sp-cats::-webkit-scrollbar { display: none; }
  .sp-chip { flex: none; scroll-snap-align: start; padding: 0.45rem 0.85rem; font-size: 0.86rem; }
  .sp-cats--center { flex-wrap: wrap; justify-content: center; margin-inline: 0; padding-inline: 0; overflow: visible; }
  .sp-search { padding-inline-start: 0.85rem; }
  .sp-search .btn { padding-inline: 0.95rem; }
  .sp-toolbar { gap: 0.6rem; }
  .sp-sort label { display: none; }
  .sp-main-img { border-radius: 1.2rem; box-shadow: 4px 4px 0 var(--tint); }
  .sp-buybox { padding: 1.1rem; box-shadow: 4px 4px 0 var(--accent); }
  .sp-big-price { font-size: 1.55rem; }
  .sp-row { grid-template-columns: 1fr; }
  .sp-form fieldset { padding: 1.1rem; }
  .sp-line { grid-template-columns: 4.4rem minmax(0, 1fr) 2.2rem; gap: 0.7rem; padding: 0.7rem; }
  .sp-line-img { grid-row: span 2; }
  .sp-line .sp-qty { grid-column: 2; justify-self: start; }
  .sp-line-total { grid-column: 2; grid-row: 3; font-size: 0.9rem; }
  .sp-line .sp-remove { grid-column: 3; grid-row: 1; align-self: start; }
  .sp-lb { padding: 3.6rem 0.6rem 5rem; }
  .sp-lb-figure img { max-width: 96vw; max-height: calc(100vh - 11rem); border-radius: 0.7rem; }
  .sp-lb-prev, .sp-lb-next { top: auto; bottom: 1rem; transform: none; }
  .sp-lb-prev { right: 1.2rem; }
  .sp-lb-next { left: 1.2rem; }
  .sp-progress li { font-size: 0.66rem; }
  .sp-home { padding-top: 4rem; }
  /* sticky add-to-cart bar */
  .sp-buybar { display: flex; position: fixed; z-index: 70; inset-inline: 0; bottom: 0; align-items: center; justify-content: space-between; gap: 0.8rem; padding: 0.7rem 1rem calc(0.7rem + env(safe-area-inset-bottom)); background: rgba(255, 252, 247, 0.97); border-top: 1.5px solid var(--ink); box-shadow: 0 -10px 30px rgba(21, 19, 28, 0.1); transform: translateY(110%); transition: transform 0.3s var(--ease); }
  .sp-buybar.is-on { transform: none; }
  .sp-buybar-price { display: flex; flex-direction: column; min-width: 0; line-height: 1.5; }
  .sp-buybar-price span { font-size: 0.78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sp-buybar-price strong { font-size: 1rem; }
  .sp-buybar-price small { font-size: 0.72rem; color: var(--muted); }
  .sp-buybar .btn { flex: none; min-height: 2.9rem; padding-inline: 1.1rem; font-size: 0.92rem; }
  .sp-has-buybar .sp-product { padding-bottom: 7rem; }
  body.sp-has-buybar .chw { bottom: calc(5.6rem + env(safe-area-inset-bottom)); }
}
@media (max-width: 370px) {
  .sp-grid, .sp-grid--4 { gap: 0.6rem; }
  .sp-card-foot { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  .sp-card, .sp-card-media img, .sp-toast, .sp-buybar, .nav-cart-count { transition: none !important; animation: none !important; }
}
.sp-card-cat { position: relative; z-index: 1; }
.sp-toast { width: max-content; border-radius: 1.2rem; }
.sp-toast span { flex: 1; min-width: 0; line-height: 1.7; }
@media (max-width: 800px) { .sp-toast { width: calc(100vw - 2rem); padding: 0.7rem 0.9rem; font-size: 0.86rem; } }
@media (max-width: 800px) { .sp-steps { gap: 0.25rem; flex-wrap: nowrap; } .sp-steps li { padding: 0.28rem 0.55rem; font-size: 0.74rem; gap: 0.3rem; white-space: nowrap; } .sp-steps li::before { width: 1.15rem; height: 1.15rem; font-size: 0.68rem; } }
.sp-next { list-style: persian; }
.sp-progress li::after { right: auto; left: 50%; }
.sp-items tfoot td { white-space: nowrap; }
