﻿:root {
  /* از لوگوی رسمی مصرف‌شاپ: قرمز + سبز — کمی شادتر و گرم‌تر */
  --bg: #f3faf7;
  --surface: #ffffff;
  --ink: #16332c;
  --muted: #5d726c;
  --brand: #e11d48;
  --brand-dark: #be123c;
  --brand-soft: #ffe4ea;
  --green: #0d7a63;
  --green-dark: #0a5c4b;
  --green-soft: #e5f8f1;
  --accent: #ff8a2a;
  --accent-soft: #fff3e6;
  --line: #d5ebe3;
  --ok: #0d7a63;
  --shadow: 0 1px 2px rgba(13,122,99,.05), 0 10px 28px rgba(13,122,99,.1);
  --shadow-lg: 0 16px 44px rgba(13,122,99,.16);
  --radius: 14px;
  --radius-lg: 20px;
  --font-vazir: "Vazir", "Vazirmatn", Tahoma, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "Cascadia Mono", monospace;
  --font: var(--font-vazir);
  --header-h: 72px;
  --container: 1280px;
}

* { box-sizing: border-box; }
html { direction: rtl; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-vazir);
  font-feature-settings: "ss01";
  color: var(--ink);
  background:
    radial-gradient(1100px 420px at 100% -8%, rgba(255, 138, 42, 0.14), transparent 52%),
    radial-gradient(900px 380px at -5% 0%, rgba(13, 122, 99, 0.12), transparent 50%),
    var(--bg);
  min-height: 100vh;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
code, kbd, pre, .font-mono, .mp-mono {
  font-family: var(--font-mono);
  font-feature-settings: normal;
}
.product-meta code {
  font-size: .88em;
  letter-spacing: 0.01em;
  direction: ltr;
  unicode-bidi: isolate;
}

.container {
  width: min(var(--container), calc(100% - 2rem));
  margin-inline: auto;
}

/* Top promo */
.promo-bar {
  background: linear-gradient(90deg, #0a5c4b, #12a07c 38%, #e11d48 72%, #ff8a2a);
  color: #fff;
  font-size: .85rem;
  text-align: center;
  padding: .55rem 1rem;
  letter-spacing: .01em;
}
.promo-bar strong { color: #ffe7b8; }

/* Header — Digikala-like */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-main {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.25rem;
  align-items: center;
  min-height: var(--header-h);
  padding: .75rem 0;
}
.brand-lockup {
  display: flex;
  align-items: center;
  gap: .7rem;
  min-width: max-content;
}
.brand-lockup img.brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 0;
  box-shadow: none;
  object-fit: contain;
  background: transparent;
}
.brand-lockup img.brand-mark-mobile { display: none; }
.brand-lockup .brand-name {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--brand);
}
.brand-lockup .brand-tag {
  font-size: .72rem;
  color: var(--green);
  font-weight: 600;
}

.search {
  display: flex;
  align-items: stretch;
  background: #eef8f4;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #d5ebe3;
  transition: .2s ease;
  max-width: 420px;
  width: 100%;
}
.search:focus-within {
  background: #fff;
  border-color: #9fd5c7;
  box-shadow: 0 0 0 3px rgba(11,92,75,.1);
}
.search input {
  flex: 1;
  border: 0;
  background: transparent;
  padding: .55rem .85rem;
  outline: none;
  font-size: .9rem;
}
.search button {
  border: 0;
  cursor: pointer;
  padding: 0 .95rem;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  font-size: .85rem;
  transition: background .2s;
}
.search button:hover { background: var(--green-dark); }

/* Shop / products listing */
.shop-page { margin: 1rem 0 2rem; }
.shop-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem 1rem;
  margin-bottom: 1rem;
}
.shop-status-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem .5rem;
  flex: 1 1 220px;
  min-width: 0;
}
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin: 0;
  padding: .35rem .65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: .8rem;
  font-weight: 600;
  color: #334;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.status-chip:has(input:checked) {
  background: #eef7f4;
  border-color: #b7dcd0;
  color: #1f5c4a;
}
.status-chip input {
  width: auto;
  margin: 0;
}
.shop-filter-toggle { display: none; }
.shop-filters-head { display: none; }
.shop-filters-backdrop { display: none; }
.shop-sort {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .85rem;
}
.shop-sort label { margin: 0; }
.shop-sort select {
  width: auto;
  min-width: 140px;
  padding: .45rem .65rem;
  font-size: .85rem;
  border-radius: 10px;
}
.shop-count { margin-inline-start: auto; font-size: .88rem; }
.shop-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.shop-filters {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: .55rem .65rem .75rem;
  position: sticky;
  top: .75rem;
}
.filter-acc {
  border-bottom: 1px solid var(--line);
  padding: .15rem 0;
}
.filter-acc:last-of-type { border-bottom: 0; }
.filter-acc > summary {
  list-style: none;
  cursor: pointer;
  font-weight: 700;
  font-size: .88rem;
  padding: .55rem .2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  user-select: none;
}
.filter-acc > summary::-webkit-details-marker { display: none; }
.filter-acc > summary::after {
  content: "+";
  color: var(--muted);
  font-weight: 700;
  font-size: 1rem;
}
.filter-acc[open] > summary::after { content: "−"; }
.filter-acc-body {
  padding: 0 .15rem .65rem;
  display: grid;
  gap: .35rem;
  max-height: 220px;
  overflow: auto;
}
.filter-radio, .filter-check {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin: 0;
  font-size: .84rem;
  color: #334;
  font-weight: 500;
  cursor: pointer;
}
.filter-radio-sub { padding-inline-start: .65rem; font-size: .8rem; opacity: .95; }
.shop-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: .75rem;
}
.shop-active-filters .chip {
  display: inline-flex;
  align-items: center;
  padding: .25rem .55rem;
  border-radius: 999px;
  background: #eef7f4;
  border: 1px solid #b7dcd0;
  font-size: .78rem;
  color: #1f5c4a;
}
.filter-radio input, .filter-check input {
  width: auto;
  margin: 0;
}
.price-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: .35rem;
  align-items: center;
}
.price-row input {
  padding: .45rem .5rem;
  font-size: .82rem;
  border-radius: 10px;
}
.filter-actions {
  display: grid;
  gap: .4rem;
  margin-top: .75rem;
}
.filter-actions .btn { width: 100%; justify-content: center; text-align: center; }
.tiny { font-size: .78rem; margin: 0; }
.shop-grid {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: .85rem;
}
.shop-pager {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  align-items: center;
  justify-content: center;
  margin-top: 1.25rem;
}
.shop-pager a, .shop-pager .is-current {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: .4rem .75rem;
  font-size: .85rem;
  text-decoration: none;
  color: inherit;
}
.shop-pager .is-current {
  background: #eef7f4;
  border-color: #b7dcd0;
  font-weight: 700;
}
@media (max-width: 900px) {
  .shop-layout { grid-template-columns: 1fr; }
  .search { max-width: none; }
  .shop-filter-toggle {
    display: inline-flex;
    align-items: center;
    order: 1;
  }
  .shop-status-bar { flex: 1 1 100%; order: 3; }
  .shop-sort { order: 2; }
  .shop-count { order: 4; margin-inline-start: 0; }

  .shop-filters-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(15, 23, 42, 0.45);
    border: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;
  }
  .shop-filters-backdrop[hidden] { display: none !important; }

  .shop-filters {
    position: fixed;
    top: 0;
    bottom: 0;
    inset-inline-start: 0; /* راست در RTL — کنار منوی دسته‌ها */
    inset-inline-end: auto;
    z-index: 85;
    width: min(20rem, 88vw);
    max-height: 100dvh;
    overflow: auto;
    border-radius: 0;
    border: 0;
    border-inline-end: 1px solid var(--line);
    box-shadow: 12px 0 40px rgba(15, 23, 42, 0.16);
    transform: translate3d(-105%, 0, 0);
    transition: transform 0.28s cubic-bezier(.2, .9, .2, 1);
    padding: 0 .85rem 1.25rem;
    background: #fff;
    -webkit-overflow-scrolling: touch;
  }
  [dir="rtl"] .shop-filters {
    transform: translate3d(105%, 0, 0);
    box-shadow: -12px 0 40px rgba(15, 23, 42, 0.16);
  }
  .shop-page.is-filters-open .shop-filters,
  [dir="rtl"] .shop-page.is-filters-open .shop-filters {
    transform: translate3d(0, 0, 0);
  }
  .shop-filters-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    position: sticky;
    top: 0;
    z-index: 1;
    background: #fff;
    padding: .85rem 0 .65rem;
    border-bottom: 1px solid var(--line);
    margin-bottom: .35rem;
  }
  .shop-filters-close {
    border: 0;
    background: #f1f5f9;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 999px;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    color: #334155;
  }
  html.shop-filters-lock,
  html.shop-filters-lock body {
    overflow: hidden;
  }
}

.nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .2rem;
  min-width: max-content;
}
.action-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: #3f4064;
  border: 1px solid transparent;
  transition: .15s ease;
  background: transparent;
  flex-shrink: 0;
}
.action-icon:hover {
  background: #f5f5f6;
  border-color: var(--line);
  color: var(--green-dark);
}
.action-icon.login-cta {
  width: auto;
  padding: 0 .75rem 0 .55rem;
  font-weight: 700;
  font-size: .88rem;
  color: var(--green-dark);
  background: var(--green-soft);
  border-color: #c6e4da;
}
.action-icon.login-cta:hover {
  background: #d8efe8;
}
.action-icon .action-text { line-height: 1; }
.action-icon.cart-icon { color: var(--green-dark); }
.badge-count {
  position: absolute;
  top: 2px;
  inset-inline-start: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: .68rem;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px #fff;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-vazir);
}
.badge-count.is-zero {
  background: #9aa0a6;
}
.account-menu { position: relative; }
.account-trigger {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .3rem .55rem .3rem .35rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: #3f4064;
  cursor: pointer;
  font: inherit;
  transition: .15s ease;
}
.account-trigger:hover,
.account-menu.is-open .account-trigger {
  border-color: #b7dcd0;
  background: var(--green-soft);
  color: var(--green-dark);
}
.account-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--green), var(--green-dark));
  color: #fff;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: -.02em;
}
.account-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.15;
  max-width: 7.5rem;
}
.account-label {
  font-size: .68rem;
  color: var(--muted);
  font-weight: 600;
}
.account-name {
  font-size: .82rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.account-caret { opacity: .65; transition: transform .15s ease; }
.account-menu.is-open .account-caret { transform: rotate(180deg); }
.account-dropdown {
  position: absolute;
  top: calc(100% + .4rem);
  inset-inline-end: 0;
  min-width: 200px;
  padding: .4rem;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: .1rem;
}
.account-dropdown[hidden] { display: none !important; }
.account-dropdown a,
.account-logout button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  width: 100%;
  padding: .65rem .75rem;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: #2f3148;
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  text-align: start;
  cursor: pointer;
}
.account-dropdown a:hover,
.account-logout button:hover {
  background: #f5f6f7;
  color: var(--green-dark);
}
.account-logout { margin: 0; border-top: 1px solid var(--line); padding-top: .2rem; margin-top: .15rem; }
.account-logout button { color: var(--brand); }
.dd-count {
  min-width: 1.25rem;
  padding: 0 .35rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: .72rem;
  font-weight: 800;
  text-align: center;
  line-height: 1.4;
}
/* legacy icon-btn kept for non-header uses */
.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem .85rem;
  border-radius: 12px;
  color: #3f4064;
  font-size: .92rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: .15s ease;
  background: transparent;
  cursor: pointer;
}
.icon-btn:hover {
  background: #f5f5f6;
  border-color: var(--line);
}
.icon-btn.primary {
  background: var(--green);
  color: #fff;
}
.icon-btn.primary:hover { background: var(--green-dark); }

.cat-bar {
  display: flex;
  gap: .35rem;
  overflow-x: auto;
  padding: 0 0 .7rem;
  scrollbar-width: none;
}
.cat-bar::-webkit-scrollbar { display: none; }
.cat-bar a {
  white-space: nowrap;
  padding: .4rem .85rem;
  border-radius: 999px;
  font-size: .86rem;
  color: #35564d;
  font-weight: 600;
  background: rgba(255,255,255,.65);
  border: 1px solid transparent;
}
.cat-bar a:hover,
.cat-bar a.is-active {
  background: linear-gradient(135deg, var(--green), #14b8a6);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(13, 122, 99, .22);
}

/* Buttons */
.btn {
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  border-radius: 12px;
  padding: .75rem 1.25rem;
  background: var(--brand);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.btn:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(196,30,42,.25);
}
.btn.secondary { background: var(--green); }
.btn.secondary:hover { background: var(--green-dark); box-shadow: 0 8px 20px rgba(11,92,75,.25); }
.btn.ghost {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}
.btn.ghost:hover { border-color: #bbb; transform: none; box-shadow: none; }
.btn.small { padding: .45rem .85rem; font-size: .88rem; border-radius: 10px; }
.btn.gold,
.btn.green {
  background: var(--green);
  color: #fff;
}
.btn.gold:hover,
.btn.green:hover { background: var(--green-dark); }

/* Home banners (DB-driven slider / hero) */
.home-banner-stage {
  position: relative;
  margin: 1.25rem 0 1.75rem;
  border-radius: 22px;
  overflow: hidden;
  min-height: clamp(280px, 42vw, 420px);
  /* Dark fallback only — never flash brand green between slides */
  background: #121417;
  box-shadow: var(--shadow-lg);
  color: #fff;
}
.home-banner-track {
  position: relative;
  min-height: clamp(280px, 42vw, 420px);
}
.home-banner-slide {
  --banner-smoke: 0;
  position: absolute;
  inset: 0;
  opacity: 0;
  z-index: 0;
  pointer-events: none;
  /* No opacity transition — crossfade was flashing the stage background */
}
.home-banner-slide.is-active {
  opacity: 1;
  z-index: 1;
  pointer-events: auto;
}
.home-banner-link {
  display: block;
  position: relative;
  min-height: clamp(280px, 42vw, 420px);
  height: 100%;
  color: inherit;
  text-decoration: none;
}
.home-banner-media {
  position: absolute;
  inset: 0;
  background: #121417;
}
.home-banner-media::before,
.home-banner-media::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 38%;
  pointer-events: none;
  z-index: 1;
  opacity: var(--banner-smoke, 0);
  transition: opacity .25s ease;
}
/* Physical sides: green left, red right (matches brand hero look) */
.home-banner-media::before {
  left: 0;
  background: linear-gradient(
    to right,
    rgba(6, 53, 44, 0.92) 0%,
    rgba(6, 53, 44, 0.72) 45%,
    transparent 100%
  );
}
.home-banner-media::after {
  right: 0;
  background: linear-gradient(
    to left,
    rgba(40, 8, 12, 0.9) 0%,
    rgba(122, 24, 32, 0.55) 45%,
    transparent 100%
  );
}
.home-banner-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  position: absolute;
  inset: 0;
  background: #121417;
}
/* HTML text overlays on clean photo backgrounds (admin-managed) */
.home-banner-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  min-height: clamp(280px, 42vw, 420px);
  padding: clamp(1.15rem, 3.2vw, 2.4rem);
  pointer-events: none;
  color: #fff;
}
.home-banner-main {
  position: absolute;
  inset-block-start: clamp(3.25rem, 7vw, 4.5rem);
  inset-inline-end: clamp(1.15rem, 3.2vw, 2.4rem);
  max-width: min(52%, 520px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .55rem;
  text-align: start;
}
.home-banner-brand {
  margin-bottom: .15rem;
}
.home-banner-title {
  margin: 0;
  font-size: clamp(1.45rem, 3.4vw, 2.35rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: .01em;
  color: rgba(255,255,255,.98);
  text-shadow: 0 2px 18px rgba(0,0,0,.4);
}
.home-banner-subtitle {
  margin: 0;
  font-size: clamp(.95rem, 1.8vw, 1.2rem);
  font-weight: 600;
  color: rgba(255,255,255,.92);
  text-shadow: 0 1px 12px rgba(0,0,0,.35);
}
.home-banner-kicker {
  margin: .15rem 0 0;
  font-size: clamp(.72rem, 1.35vw, .9rem);
  font-weight: 500;
  letter-spacing: .02em;
  color: rgba(255,255,255,.82);
  text-shadow: 0 1px 10px rgba(0,0,0,.35);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.home-banner-features {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: clamp(1rem, 3vw, 2.2rem);
  transform: translateY(-50%);
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  align-items: center;
  max-width: 7.5rem;
}
.home-banner-feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  text-align: center;
}
.home-banner-feature-icon {
  width: 2.35rem;
  height: 2.35rem;
  border: 1.5px solid rgba(255,255,255,.85);
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(0,0,0,.12);
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 12px rgba(0,0,0,.2);
}
.home-banner-feature-icon svg {
  width: 1.15rem;
  height: 1.15rem;
}
.home-banner-feature-label {
  font-size: clamp(.68rem, 1.2vw, .78rem);
  font-weight: 600;
  line-height: 1.35;
  color: rgba(255,255,255,.95);
  text-shadow: 0 1px 10px rgba(0,0,0,.4);
  max-width: 6.5rem;
}
.home-banner-slogan {
  position: absolute;
  inset-block-end: clamp(1.1rem, 2.8vw, 1.8rem);
  inset-inline-start: clamp(1.1rem, 3vw, 2.2rem);
  margin: 0;
  font-family: Georgia, "Times New Roman", "Segoe Script", cursive;
  font-style: italic;
  font-size: clamp(.95rem, 1.8vw, 1.25rem);
  font-weight: 500;
  color: rgba(255,255,255,.92);
  text-shadow: 0 2px 14px rgba(0,0,0,.35);
  transform: rotate(-4deg);
  transform-origin: bottom right;
}
.home-banner-cta {
  position: absolute;
  pointer-events: none;
  z-index: 3;
  padding: .45rem 1.15rem;
  border-radius: .65rem;
  font-size: .9rem;
  font-weight: 700;
  background: #c62828;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,.28);
}
.home-banner-cta[data-cta-pos="top-start"],
.home-banner-cta[data-cta-pos="top-end"],
.home-banner-cta[data-cta-pos="top-center"] {
  inset-block-start: clamp(1rem, 2.8vw, 1.6rem);
}
.home-banner-cta[data-cta-pos="bottom-start"],
.home-banner-cta[data-cta-pos="bottom-end"],
.home-banner-cta[data-cta-pos="bottom-center"],
.home-banner-cta:not([data-cta-pos]) {
  inset-block-end: clamp(1rem, 2.8vw, 1.6rem);
}
.home-banner-cta[data-cta-pos="center-start"],
.home-banner-cta[data-cta-pos="center-end"],
.home-banner-cta[data-cta-pos="center"],
.home-banner-cta[data-cta-pos="middle-start"],
.home-banner-cta[data-cta-pos="middle-end"] {
  inset-block-start: 50%;
  transform: translateY(-50%);
}
.home-banner-cta[data-cta-pos="top-start"],
.home-banner-cta[data-cta-pos="center-start"],
.home-banner-cta[data-cta-pos="middle-start"],
.home-banner-cta[data-cta-pos="bottom-start"],
.home-banner-cta:not([data-cta-pos]) {
  inset-inline-start: clamp(1rem, 3vw, 2.2rem);
}
.home-banner-cta[data-cta-pos="top-end"],
.home-banner-cta[data-cta-pos="center-end"],
.home-banner-cta[data-cta-pos="middle-end"],
.home-banner-cta[data-cta-pos="bottom-end"] {
  inset-inline-end: clamp(1rem, 3vw, 2.2rem);
}
.home-banner-cta[data-cta-pos="top-center"],
.home-banner-cta[data-cta-pos="center"],
.home-banner-cta[data-cta-pos="bottom-center"] {
  inset-inline-start: 50%;
  transform: translateX(-50%);
}
.home-banner-cta[data-cta-pos="center"] {
  transform: translate(-50%, -50%);
}
/* Legacy copy block (kept for older markup safety) */
.home-banner-copy {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  min-height: clamp(280px, 42vw, 420px);
  padding: clamp(1.5rem, 4vw, 3rem);
  gap: .85rem;
  pointer-events: none;
}
.home-banner-copy h1 {
  margin: 0;
  font-size: clamp(1.2rem, 2.6vw, 1.7rem);
  font-weight: 700;
  color: rgba(255,255,255,.95);
  text-shadow: 0 2px 16px rgba(0,0,0,.35);
  max-width: 640px;
}
.home-banner-nav {
  position: absolute;
  inset-inline: 0;
  bottom: 1rem;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  padding: 0 1rem;
}
.home-banner-btn {
  width: 2.4rem;
  height: 2.4rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background .2s ease, transform .2s ease;
  display: grid;
  place-items: center;
  padding: 0;
}
.home-banner-btn svg {
  width: 1.1rem;
  height: 1.1rem;
  display: block;
}
.home-banner-btn:hover {
  background: rgba(255,255,255,.32);
  transform: scale(1.05);
}
.home-banner-dots {
  display: flex;
  gap: .4rem;
  align-items: center;
}
.home-banner-dot {
  width: .55rem;
  height: .55rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.4);
  cursor: pointer;
  padding: 0;
  transition: width .25s ease, background .25s ease;
}
.home-banner-dot.is-active {
  width: 1.35rem;
  background: #fff;
}
/* Mobile banners: stage ratio matches storefront art (~2051×767 ≈ 8/3).
   contain = full artwork always; matching ratio ≈ edge-to-edge with no letterbox. */
@media (max-width: 720px) {
  .home-banner-stage {
    margin: .75rem -.25rem 1.25rem;
    width: calc(100% + .5rem);
    max-width: none;
    border-radius: 14px;
    min-height: 0;
    aspect-ratio: 8 / 3;
    background: linear-gradient(145deg, #0d4a3c 0%, #121417 55%, #1a0a0c 100%);
  }
  .home-banner-track,
  .home-banner-link,
  .home-banner-overlay,
  .home-banner-copy {
    min-height: 0;
    height: 100%;
  }
  .home-banner-link {
    aspect-ratio: auto;
    min-height: 0;
  }
  .home-banner-media {
    background-color: transparent;
  }
  .home-banner-media::before,
  .home-banner-media::after {
    display: none;
  }
  .home-banner-media img {
    object-fit: contain;
    object-position: center center;
  }
  /* Desktop-designed HTML overlays clash on phone — keep only CTA */
  .home-banner-main,
  .home-banner-features,
  .home-banner-slogan,
  .home-banner-brand,
  .home-banner-kicker {
    display: none !important;
  }
  .home-banner-overlay {
    padding: 0;
  }
  .home-banner-cta,
  .home-banner-cta[data-cta-pos],
  .home-banner-cta:not([data-cta-pos]) {
    inset-block-start: auto;
    inset-block-end: 1.85rem;
    inset-inline-start: 50%;
    inset-inline-end: auto;
    transform: translateX(-50%);
    font-size: .78rem;
    padding: .32rem .85rem;
    border-radius: 999px;
  }
  .home-banner-cta[data-cta-pos="center"] {
    transform: translateX(-50%);
  }
  .home-banner-nav {
    bottom: .28rem;
    gap: .45rem;
  }
  .home-banner-btn {
    width: 1.85rem;
    height: 1.85rem;
  }
  .home-banner-dot {
    width: .4rem;
    height: .4rem;
  }
  .home-banner-dot.is-active {
    width: .95rem;
  }
}
@media (max-width: 420px) {
  .home-banner-stage {
    aspect-ratio: 8 / 3;
    border-radius: 12px;
  }
  .home-banner-cta,
  .home-banner-cta[data-cta-pos],
  .home-banner-cta:not([data-cta-pos]) {
    inset-block-end: 1.65rem;
    font-size: .72rem;
    padding: .28rem .75rem;
  }
}

/* Hero — brand first, one composition (fallback when no DB banners) */
.hero {
  position: relative;
  margin: 1.25rem 0 1.75rem;
  border-radius: 22px;
  overflow: hidden;
  min-height: clamp(280px, 42vw, 420px);
  display: grid;
  align-items: end;
  background:
    radial-gradient(ellipse 70% 80% at 90% 15%, rgba(196,30,42,.45), transparent 55%),
    radial-gradient(ellipse 55% 65% at 8% 85%, rgba(11,92,75,.5), transparent 50%),
    linear-gradient(125deg, #06352c 0%, #0b5c4b 38%, #7a1820 100%);
  color: #fff;
  box-shadow: var(--shadow-lg);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 1;
  padding: clamp(1.5rem, 4vw, 3rem);
  max-width: 640px;
}
.hero-brand {
  display: flex;
  align-items: center;
  gap: .85rem;
  margin-bottom: 1rem;
}
.hero-brand img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 10px 28px rgba(0,0,0,.28);
  object-fit: cover;
}
.hero-brand span {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.hero h1 {
  margin: 0 0 .65rem;
  font-size: clamp(1.15rem, 2.4vw, 1.55rem);
  font-weight: 600;
  color: rgba(255,255,255,.92);
}
.hero p {
  margin: 0 0 1.35rem;
  color: rgba(255,255,255,.72);
  font-size: 1.02rem;
  max-width: 36ch;
}
.hero .actions { display: flex; flex-wrap: wrap; gap: .65rem; }

/* Stories */
.stories {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: .25rem 0 1.25rem;
  scrollbar-width: none;
}
.stories::-webkit-scrollbar { display: none; }
.story {
  width: 78px;
  text-align: center;
  font-size: .75rem;
  color: var(--muted);
  font-weight: 600;
  flex-shrink: 0;
}
.story .ring {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  padding: 2px;
  margin: 0 auto .4rem;
  background: linear-gradient(135deg, var(--brand), var(--green));
}
.story .ring span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #fff center/cover no-repeat;
  border: 2px solid #fff;
}

/* Sections */
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 1.75rem 0 1rem;
}
.section-title h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.section-title h2::before {
  content: "";
  width: 4px;
  height: 1.1em;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--brand), var(--green));
}
.section-title a {
  color: var(--green);
  font-weight: 700;
  font-size: .9rem;
}

/* Eways-style horizontal product rails */
.product-rail {
  margin: 1.35rem 0 1.75rem;
  font-family: var(--font-vazir);
}
.product-rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: linear-gradient(90deg, #e7f8f1 0%, #fff6ea 100%);
  border-radius: 14px;
  padding: .7rem 1rem;
  margin-bottom: .85rem;
  border: 1px solid #d9eee6;
}
.product-rail-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #222;
  letter-spacing: -.01em;
}
.product-rail-all {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  color: #555;
  font-weight: 700;
  font-size: .88rem;
  white-space: nowrap;
  text-decoration: none;
  transition: color .15s ease;
}
.product-rail-all:hover { color: var(--brand, #e11d48); }
.product-rail-all-ico {
  font-size: 1.15rem;
  line-height: 1;
  font-weight: 400;
  display: inline-flex;
  align-items: center;
}
.product-rail-all-ico svg {
  width: 1rem;
  height: 1rem;
  display: block;
}
.product-rail-body {
  position: relative;
}
.product-rail-track {
  display: flex;
  gap: .75rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  padding: .35rem .15rem 1rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #d0d0d4 transparent;
}
.product-rail-track::-webkit-scrollbar { height: 6px; }
.product-rail-track::-webkit-scrollbar-thumb {
  background: #d0d0d4;
  border-radius: 999px;
}
.product-rail-item {
  flex: 0 0 auto;
  width: min(200px, 72vw);
  scroll-snap-align: start;
}
.product-rail-item .card {
  height: 100%;
  border: 1px solid #e4f2ec;
  border-radius: 14px;
  box-shadow: none;
}
.product-rail-item .card:hover {
  transform: none;
  box-shadow: 0 8px 22px rgba(13, 122, 99, .12);
  border-color: #b7e4d4;
}
.product-rail-item .card .thumb {
  padding: .85rem;
  background: #fff;
}
.product-rail-item .card .thumb img { max-height: 140px; }
.product-rail-item .card .body { padding: .65rem .8rem 1rem; }
.product-rail-item .card .name {
  font-size: .86rem;
  min-height: 2.5em;
  font-weight: 600;
}
.product-rail-item .badge.discount {
  top: .5rem;
  right: .5rem;
  bottom: auto;
  left: auto;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: .72rem;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(225, 29, 72, .25);
}
.product-rail-item .badge.hot,
.product-rail-item .badge.amazing,
.product-rail-item .badge.last-piece {
  top: .5rem;
  right: .5rem;
  bottom: auto;
}
.product-rail-nav {
  position: absolute;
  top: 42%;
  transform: translateY(-50%);
  z-index: 3;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  border: 1px solid #e5e5e8;
  background: rgba(255,255,255,.92);
  color: #444;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
  transition: background .15s ease, opacity .15s ease, box-shadow .15s ease;
}
.product-rail-nav svg {
  width: 1.1rem;
  height: 1.1rem;
  display: block;
}
.product-rail-nav:hover {
  background: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,.12);
}
.product-rail-nav.is-prev { inset-inline-end: -.35rem; }
.product-rail-nav.is-next { inset-inline-start: -.35rem; }
.product-rail-nav.is-disabled,
.product-rail-nav:disabled {
  opacity: .35;
  pointer-events: none;
}
.product-rail-empty {
  padding: .5rem .25rem 1rem;
}
@media (max-width: 720px) {
  .product-rail-head { padding: .6rem .85rem; }
  .product-rail-title { font-size: .98rem; }
  .product-rail-nav { display: none; }
  .product-rail-item { width: min(168px, 58vw); }
}

/* Product grid / cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .85rem;
}
.card {
  background: var(--surface);
  border: 1px solid #e4f2ec;
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s;
  position: relative;
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: #b7e4d4;
}
.card .thumb {
  aspect-ratio: 1;
  background: linear-gradient(180deg, #f7fdfb, #eef6f3);
  display: grid;
  place-items: center;
  padding: 1rem;
}
.card .thumb img {
  max-height: 160px;
  width: auto;
  object-fit: contain;
  transition: transform .35s ease;
}
.card:hover .thumb img { transform: scale(1.05); }
.card .body { padding: .85rem 1rem 1.1rem; }
.card-color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: .28rem;
  margin: .35rem 0 .15rem;
}
.card-color-dot {
  width: .72rem;
  height: .72rem;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,.12);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35);
  flex: 0 0 auto;
}
.card .name {
  font-weight: 700;
  font-size: .92rem;
  min-height: 2.7em;
  line-height: 1.45;
  color: #23254e;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.price {
  color: var(--ink);
  font-weight: 800;
  margin-top: .55rem;
  font-size: 1.05rem;
  display: flex;
  align-items: baseline;
  gap: .35rem;
  flex-wrap: wrap;
}
.price .unit { font-size: .78rem; font-weight: 600; color: var(--muted); }
.price .old {
  color: var(--muted);
  text-decoration: line-through;
  font-weight: 500;
  font-size: .85rem;
  order: -1;
}
.price .sale { font-weight: 800; }
.badge {
  position: absolute;
  top: .65rem;
  right: .65rem;
  background: var(--brand);
  color: #fff;
  border-radius: 8px;
  padding: .2rem .55rem;
  font-size: .72rem;
  font-weight: 800;
  z-index: 2;
}
.badge.amazing {
  background: var(--accent);
  color: #fff;
}
.badge.hot {
  background: #ea580c;
  color: #fff;
}
.badge.discount {
  background: #e11d48;
  color: #fff;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.badge.last-piece {
  background: linear-gradient(135deg, #b45309, #f59e0b 55%, #fbbf24);
  color: #1c1917;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(180, 83, 9, 0.28);
}

/* Panels / forms */
.flash {
  background: #e8f8ef;
  color: #0d6832;
  border: 1px solid #b7ebc9;
  padding: .85rem 1.1rem;
  border-radius: 12px;
  margin: 1rem 0;
}
.error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  padding: .85rem 1.1rem;
  border-radius: 12px;
  margin: 1rem 0;
}
.layout-2 {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 1.25rem;
  margin: 1.25rem 0;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  box-shadow: 0 1px 0 rgba(0,0,0,.02);
}
.panel h1, .panel h2, .panel h3 { margin-top: 0; }
label { display: block; margin: .75rem 0 .35rem; color: var(--muted); font-size: .88rem; font-weight: 600; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .75rem .9rem;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #8ecdbc;
  box-shadow: 0 0 0 3px rgba(11,92,75,.12);
}
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: right;
  padding: .75rem .5rem;
  border-bottom: 1px solid var(--line);
  font-size: .93rem;
}
th { color: var(--muted); font-weight: 700; font-size: .82rem; }

.product-gallery {
  position: relative;
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .85rem;
  min-height: 360px;
  z-index: 2;
  overflow: visible;
}
.gallery-stage {
  position: relative;
  overflow: visible;
}
.gallery-main {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 320px;
  background: linear-gradient(180deg, #fbfdfc, #f3f7f5);
  border-radius: 14px;
  padding: 1rem;
  overflow: hidden;
  cursor: zoom-in;
}
.gallery-main img,
.product-gallery .gallery-main img {
  max-height: 340px;
  max-width: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}
.gallery-zoom-lens {
  position: absolute;
  top: 0;
  left: 0;
  width: 120px;
  height: 120px;
  pointer-events: none;
  background: rgba(239, 68, 68, 0.28);
  border: 1px solid rgba(220, 38, 38, 0.85);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35);
  z-index: 3;
  will-change: transform;
}
.gallery-zoom-result {
  position: absolute;
  top: 0;
  /* Default RTL Digikala: open toward buy box (physical left of gallery). JS may flip. */
  left: calc(-1 * min(420px, 92vw) - 14px);
  right: auto;
  width: 400px;
  height: 400px;
  background-color: #fff;
  background-repeat: no-repeat;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(15, 40, 32, 0.18);
  z-index: 30;
  pointer-events: none;
}
.product-detail { overflow: visible; }
.product-gallery.is-zooming { z-index: 40; }
.layout-2.product-detail { position: relative; z-index: 1; }
.gallery-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.gallery-thumb {
  width: 72px;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .25rem;
  background: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.gallery-thumb img { max-height: 60px; max-width: 60px; object-fit: contain; }
.gallery-thumb.is-active {
  border-color: var(--brand, #0b5c4b);
  box-shadow: 0 0 0 2px rgba(11,92,75,.15);
}

/* Product gallery lightbox */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  font-family: var(--font-vazir);
}
.gallery-lightbox[hidden] { display: none !important; }
.gallery-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 18, 16, 0.72);
  backdrop-filter: blur(6px);
  cursor: zoom-out;
}
.gallery-lightbox-panel {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  max-height: min(92vh, 900px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}
.gallery-lightbox-close {
  position: absolute;
  top: .75rem;
  inset-inline-start: .75rem;
  z-index: 3;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .15s, transform .15s;
}
.gallery-lightbox-close:hover {
  background: #fff;
  transform: scale(1.04);
}
.gallery-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-70%);
  z-index: 3;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .15s, opacity .15s, transform .15s;
}
.gallery-lightbox-nav:hover {
  background: #fff;
  transform: translateY(-70%) scale(1.05);
}
.gallery-lightbox-nav:disabled {
  opacity: .35;
  cursor: default;
  transform: translateY(-70%);
}
/* RTL: prev (previous index) sits on the right; next on the left */
.gallery-lightbox-nav.is-prev { inset-inline-end: .85rem; }
.gallery-lightbox-nav.is-next { inset-inline-start: .85rem; }
.gallery-lightbox-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 3.25rem 3.5rem 1rem;
  background: linear-gradient(180deg, #f8faf9, #eef3f1);
  touch-action: pan-y;
  user-select: none;
}
.gallery-lightbox-stage img {
  max-width: 100%;
  max-height: min(62vh, 560px);
  width: auto;
  height: auto;
  object-fit: contain;
  -webkit-user-drag: none;
}
.gallery-lightbox-footer {
  padding: .85rem 1rem 1.1rem;
  border-top: 1px solid var(--line);
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: .65rem;
  align-items: center;
}
.gallery-lightbox-counter {
  font-size: .9rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: isolate;
}
.gallery-lightbox-thumbs {
  display: flex;
  flex-wrap: nowrap;
  gap: .45rem;
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: .15rem;
  scrollbar-width: thin;
}
.gallery-lightbox-thumb {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .2rem;
  background: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: border-color .15s, box-shadow .15s;
}
.gallery-lightbox-thumb img {
  max-height: 52px;
  max-width: 52px;
  object-fit: contain;
}
.gallery-lightbox-thumb.is-active {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(196, 30, 42, 0.18);
}
body.lightbox-open {
  overflow: hidden;
}

.product-subtitle { margin-top: -.35rem; }
.product-meta { font-size: .92rem; }
.product-highlights ul {
  list-style: none;
  padding: 0;
  margin: .75rem 0 0;
}
.product-highlights li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .45rem 0;
  border-bottom: 1px dashed var(--line);
  font-size: .92rem;
}
.product-highlights li strong { color: var(--muted); font-weight: 600; }
.color-swatches-label {
  display: block;
  margin: 0 0 .55rem;
}
.color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-bottom: .95rem;
}
.color-swatch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  border: 1px solid #d7e0dc;
  border-radius: 999px;
  padding: .35rem .7rem .35rem .4rem;
  cursor: pointer;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.color-swatch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
.color-swatch-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #c5d2cc;
  flex: 0 0 auto;
}
.color-swatch-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}
.color-swatch-name { font-size: .88rem; font-weight: 600; }
.color-swatch.is-selected,
.color-swatch:has(input:checked) {
  border-color: var(--brand, #0b5c4b);
  box-shadow: 0 0 0 2px rgba(11,92,75,.14);
}
.color-swatch.is-selected .color-swatch-dot,
.color-swatch:has(input:checked) .color-swatch-dot {
  box-shadow: 0 0 0 2px var(--brand, #0b5c4b);
}
.color-option {
  border: 1px solid #d7e0dc;
  border-radius: 10px;
  padding: .45rem .7rem;
  cursor: pointer;
  background: #fff;
  display: flex;
  gap: .4rem;
  align-items: flex-start;
}
.color-option input { width: auto; margin-top: .2rem; }
.color-option-body { display: flex; flex-direction: column; gap: .1rem; }
.spec-table th { width: 35%; background: #f7faf9; }
.product-description.prose p { line-height: 1.85; }
.product-description.prose ul { padding-right: 1.2rem; line-height: 1.8; }
.breadcrumb a { color: inherit; text-decoration: none; }
.breadcrumb a:hover { color: var(--brand, #0b5c4b); }
.warn {
  background: #fff8e8;
  border: 1px solid #ffe2a8;
  color: #8a5a00;
  padding: .8rem 1rem;
  border-radius: 12px;
  margin: 1rem 0;
}
.actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1rem; }
.muted { color: var(--muted); }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
}
.stat strong { display: block; font-size: 1.45rem; margin-top: .35rem; }

.admin-nav, .seller-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-bottom: 1.1rem;
}
.admin-nav a, .seller-nav a {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .4rem .9rem;
  font-size: .88rem;
  font-weight: 600;
}
.admin-nav a:hover, .seller-nav a:hover {
  border-color: var(--green);
  color: var(--green);
}

.invoice {
  background: #fff;
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

/* Service tiles (storefront showcase) */
.service-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .75rem;
  margin: 1.75rem 0;
}
.service-tile {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.1rem .9rem;
  text-align: center;
  transition: transform .15s ease, border-color .15s, box-shadow .15s;
}
.service-tile strong { display: block; font-size: .92rem; margin-bottom: .25rem; }
.service-tile span { font-size: .78rem; color: var(--muted); }
.service-tile:hover {
  transform: translateY(-2px);
  border-color: #9fd5c7;
  box-shadow: var(--shadow);
}
.service-tile.is-hot {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.service-tile.is-hot span { color: rgba(255,255,255,.88); }

/* Trust strip */
.trust-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .75rem;
  margin: 2rem 0;
}
.trust-item {
  background: #fff;
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  border: 1px solid var(--line);
}
.trust-item strong {
  display: block;
  font-size: .92rem;
  margin-bottom: .2rem;
}
.trust-item span { font-size: .8rem; color: var(--muted); }

/* Footer */
.site-footer {
  margin-top: 3.5rem;
  background: linear-gradient(180deg, #eefaf5, #ffffff 42%);
  border-top: 1px solid var(--line);
  padding: 2.5rem 0 1.5rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-brand {
  display: flex;
  gap: .85rem;
  align-items: flex-start;
}
.footer-brand img {
  width: 64px;
  height: 64px;
  border-radius: 0;
  background: transparent;
  object-fit: contain;
  box-shadow: none;
}
.footer-brand h3 {
  margin: 0 0 .35rem;
  font-size: 1.15rem;
}
.footer-brand p {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
}
.footer-col h4 {
  margin: 0 0 .75rem;
  font-size: .95rem;
}
.footer-col a {
  display: block;
  color: var(--muted);
  font-size: .9rem;
  margin-bottom: .4rem;
}
.footer-col a:hover { color: var(--green); }
.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: .82rem;
}
.newsletter-row {
  display: flex;
  gap: .5rem;
  margin-top: .75rem;
}
.newsletter-row input { flex: 1; }

@media (max-width: 960px) {
  .header-main {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .75rem;
  }
  .header-main .search {
    grid-column: 1 / -1;
    max-width: none;
    width: 100%;
    min-width: 0;
    order: 3;
  }
  .brand-lockup { min-width: 0; }
  .brand-lockup .brand-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: min(42vw, 11rem);
  }
  .nav-actions {
    justify-content: flex-end;
    overflow: visible;
    flex-shrink: 0;
  }
  .account-meta { display: none; }
  .account-trigger { padding: .25rem; }
  .account-caret { display: none; }
  .layout-2, .stats, .trust-strip, .footer-grid, .service-grid { grid-template-columns: 1fr 1fr; }
  .gallery-zoom-lens,
  .gallery-zoom-result { display: none !important; }
  .gallery-main { cursor: zoom-in; }
  .gallery-lightbox { padding: .5rem; }
  .gallery-lightbox-panel {
    max-height: 96vh;
    border-radius: 14px;
  }
  .gallery-lightbox-stage {
    padding: 3rem 2.75rem .75rem;
  }
  .gallery-lightbox-stage img {
    max-height: min(52vh, 420px);
  }
  .gallery-lightbox-nav {
    width: 40px;
    height: 40px;
  }
}
@media (max-width: 640px) {
  .layout-2, .stats, .trust-strip, .footer-grid { grid-template-columns: 1fr; }
  .service-grid { grid-template-columns: 1fr 1fr; }
  .brand-lockup .brand-tag { display: none; }
  .brand-lockup img.brand-mark { width: 44px; height: 44px; }
  .brand-lockup img.brand-mark-desktop { display: none; }
  .brand-lockup img.brand-mark-mobile { display: block; }
  .action-icon { width: 38px; height: 38px; }
  .action-icon.login-cta .action-text { display: none; }
  .action-icon.login-cta { width: 38px; padding: 0; }
  .icon-btn span.label { display: none; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: .5rem; }
  .color-swatch-meta small { display: none; }
  .gallery-lightbox-stage {
    padding: 2.75rem 1rem .65rem;
  }
  .gallery-lightbox-nav.is-prev { inset-inline-end: .35rem; }
  .gallery-lightbox-nav.is-next { inset-inline-start: .35rem; }
  .gallery-lightbox-thumb {
    width: 56px;
    height: 56px;
  }
}

/* Address book (Digikala-style) */
.account-nav a { font-weight: 600; margin-inline: .15rem; }
.address-select-list { display: flex; flex-direction: column; gap: .65rem; margin-bottom: .75rem; }
.address-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .85rem 1rem;
  background: var(--surface);
  position: relative;
}
.address-card--default { border-color: var(--green-soft); background: var(--green-soft); }
.address-card--selectable {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.address-card--selectable input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.address-card__check {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 2px solid var(--line);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  color: transparent;
  margin-top: .15rem;
}
.address-card--selected {
  border-color: var(--green);
  box-shadow: 0 0 0 1px var(--green);
}
.address-card--selected .address-card__check {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}
.address-badge {
  display: inline-block;
  font-size: .75rem;
  padding: .1rem .45rem;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  margin-inline-start: .35rem;
}
.checkout-new-address--hidden { display: none; }
.address-card__head { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem; }

/* ===== Digikala-style checkout (cart → shipping → payment) ===== */
.dgk-checkout { margin: 1rem 0 2rem; }
.dgk-title { font-size: 1.35rem; margin: .5rem 0 1rem; }
.dgk-title__count { font-size: .9rem; font-weight: 500; }
.dgk-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 1.25rem;
  align-items: start;
}
.dgk-main { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.dgk-side { position: sticky; top: calc(var(--header-h, 72px) + 12px); }
.dgk-block h2 { font-size: 1.05rem; margin: 0 0 .75rem; }
.dgk-block__head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.dgk-block__head h2 { margin: 0; }
.dgk-block__foot { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: .75rem; }
.dgk-link { background: none; border: 0; padding: 0; color: var(--green); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.dgk-link:hover { text-decoration: underline; }
.dgk-back { display: block; text-align: center; margin-top: .75rem; }
.dgk-free { color: var(--green); }

/* stepper */
.dgk-stepper { display: flex; align-items: center; justify-content: center; list-style: none; margin: .25rem 0 1.25rem; padding: 0; gap: .25rem; }
.dgk-step { display: flex; align-items: center; gap: .45rem; color: var(--muted); font-weight: 600; font-size: .9rem; }
.dgk-step a { display: flex; align-items: center; gap: .45rem; color: inherit; text-decoration: none; }
.dgk-step__dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; background: #fff; }
.dgk-step.is-active { color: var(--green); }
.dgk-step.is-active .dgk-step__dot { border-color: var(--green); background: var(--green); color: #fff; }
.dgk-step.is-done { color: var(--green); }
.dgk-step.is-done .dgk-step__dot { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.dgk-step__line { flex: 0 1 70px; height: 2px; background: var(--line); }
.dgk-step__line.is-done { background: var(--green); }

/* cart items */
.dgk-item { display: grid; grid-template-columns: 96px 1fr auto; gap: 1rem; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1rem; }
.dgk-item__img { width: 96px; height: 96px; border-radius: var(--radius); background: #f8fafc; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.dgk-item__img img { width: 100%; height: 100%; object-fit: contain; }
.dgk-item__noimg { font-size: 2rem; }
.dgk-item__name { display: block; font-weight: 700; color: inherit; text-decoration: none; line-height: 1.7; }
.dgk-item__price { font-size: .85rem; margin: .15rem 0 .5rem; }
.dgk-item__actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.dgk-qty { display: flex; gap: .35rem; align-items: center; }
.dgk-qty input { width: 72px; padding: .45rem .6rem; }
.dgk-remove { background: none; border: 0; color: #b91c1c; font: inherit; cursor: pointer; }
.dgk-item__total { font-weight: 800; white-space: nowrap; }
.dgk-item__total small { font-weight: 500; color: var(--muted); }

/* summary */
.dgk-summary h3 { margin: 0 0 .75rem; }
.dgk-summary__row { display: flex; justify-content: space-between; gap: .5rem; padding: .45rem 0; font-size: .92rem; }
.dgk-summary__row--discount { color: #b91c1c; }
.dgk-summary__row--total { border-top: 1px dashed var(--line); margin-top: .35rem; padding-top: .75rem; font-weight: 800; font-size: 1rem; }
.dgk-eta { font-size: .85rem; margin: .25rem 0 .5rem; }
.dgk-coupon { margin: .75rem 0; }
.dgk-coupon__row { display: flex; gap: .5rem; }
.dgk-coupon__row input { flex: 1; }
.dgk-cta { display: block; width: 100%; text-align: center; margin-top: .75rem; padding: .85rem 1rem; font-size: 1rem; box-sizing: border-box; }
.dgk-mobilebar { display: none; }

/* address / options */
.dgk-addr { border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem 1rem; background: var(--surface); line-height: 1.8; }
.dgk-addr--empty { border-style: dashed; }
.dgk-addr__title { font-weight: 700; }
.dgk-addr__meta { font-size: .88rem; }
.dgk-delivery { display: grid; gap: .35rem; margin-top: .75rem; }
.dgk-option { display: flex; align-items: center; gap: .75rem; border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; margin: .5rem 0; cursor: pointer; background: #fff; }
.dgk-option input[type="radio"] { width: 18px; height: 18px; margin: 0; flex-shrink: 0; accent-color: var(--green); }
.dgk-option__main { display: flex; flex-direction: column; gap: .15rem; flex: 1; }
.dgk-option__price { font-weight: 700; white-space: nowrap; }
.dgk-option.is-selected { border-color: var(--green); box-shadow: 0 0 0 1px var(--green); background: var(--green-soft); }
.dgk-card-info { line-height: 1.8; }

/* delivery days / slots */
.dgk-days { display: flex; gap: .6rem; overflow-x: auto; padding-bottom: .35rem; scroll-snap-type: x proximity; }
.dgk-day { flex: 0 0 auto; min-width: 92px; margin: 0; border: 1px solid var(--line); border-radius: var(--radius); padding: .65rem .5rem; text-align: center; cursor: pointer; background: #fff; display: flex; flex-direction: column; gap: .15rem; scroll-snap-align: start; color: inherit; }
.dgk-day input { position: absolute; opacity: 0; pointer-events: none; }
.dgk-day__wd { font-weight: 700; font-size: .9rem; }
.dgk-day__d { font-size: .85rem; color: var(--muted); }
.dgk-day__rel { font-size: .72rem; color: var(--green); font-weight: 700; }
.dgk-day.is-selected { border-color: var(--green); background: var(--green-soft); box-shadow: 0 0 0 1px var(--green); }
.dgk-slots { display: flex; flex-wrap: wrap; gap: .6rem; }
.dgk-slot { margin: 0; border: 1px solid var(--line); border-radius: 999px; padding: .5rem 1rem; cursor: pointer; background: #fff; color: inherit; }
.dgk-slot input { position: absolute; opacity: 0; pointer-events: none; }
.dgk-slot.is-selected { border-color: var(--green); background: var(--green); color: #fff; }

/* payment lines */
.dgk-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.dgk-lines li { display: flex; align-items: center; gap: .6rem; }
.dgk-lines img { width: 44px; height: 44px; object-fit: contain; border-radius: 8px; background: #f8fafc; }
.dgk-lines__name { flex: 1; min-width: 0; }
.dgk-lines__price { font-weight: 700; white-space: nowrap; }
.dgk-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }

/* modal */
.dgk-modal[hidden] { display: none; }
.dgk-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.dgk-modal__backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .55); }
.dgk-modal__panel { position: relative; background: #fff; border-radius: var(--radius-lg); width: min(560px, 100%); max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; }
.dgk-modal__panel > form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.dgk-modal__head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.dgk-modal__head h3 { margin: 0; }
.dgk-modal__x { background: none; border: 0; font-size: 1.1rem; cursor: pointer; color: var(--muted); }
.dgk-modal__body { padding: 1rem 1.25rem; overflow-y: auto; flex: 1; min-height: 0; }
.dgk-modal__foot { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; justify-content: flex-end; padding: .85rem 1.25rem; border-top: 1px solid var(--line); }
.dgk-modal__foot .btn { margin-inline-start: auto; }
body.dgk-modal-open { overflow: hidden; }

@media (max-width: 860px) {
  .dgk-layout { grid-template-columns: 1fr; }
  .dgk-side { position: static; }
  .dgk-cta--desktop { display: none; }
  .dgk-checkout { padding-bottom: 90px; }
  .dgk-mobilebar {
    display: flex; align-items: center; justify-content: space-between; gap: .75rem;
    position: fixed; inset-inline: 0; bottom: 0; z-index: 90;
    background: #fff; border-top: 1px solid var(--line); padding: .65rem 1rem calc(.65rem + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -4px 16px rgba(15, 23, 42, .08);
  }
  body.app-shell .dgk-mobilebar { bottom: calc(var(--app-tabbar-h, 64px) + env(safe-area-inset-bottom, 0px)); padding-bottom: .65rem; }
  body.app-shell .dgk-checkout { padding-bottom: 150px; }
  .dgk-mobilebar__sum { display: flex; flex-direction: column; }
  .dgk-mobilebar .dgk-cta { width: auto; margin: 0; min-width: 150px; }
  .dgk-item { grid-template-columns: 72px 1fr; }
  .dgk-item__img { width: 72px; height: 72px; }
  .dgk-item__total { grid-column: 1 / -1; text-align: end; }
  .dgk-step__line { flex-basis: 28px; }
  .dgk-step__label { font-size: .8rem; }
}

/* ===== Mobile app shell (PWA) ===== */
body.app-shell { padding-bottom: 0; }
.app-tabbar { display: none; }
.pwa-install { display: none; }
@media (max-width: 860px) {
  :root { --header-h: 58px; --app-tabbar-h: 72px; }
  body.app-shell {
    padding-bottom: calc(var(--app-tabbar-h) + env(safe-area-inset-bottom, 0px));
  }
  body.app-shell .site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    padding-top: env(safe-area-inset-top, 0px);
    background: rgba(243, 250, 247, .88);
    backdrop-filter: blur(18px) saturate(1.2);
    border-bottom: 1px solid rgba(13, 122, 99, .12);
  }
  body.app-shell .brand-tag,
  body.app-shell .nav-actions .action-icon:not(.cart-icon):not(.login-cta),
  body.app-shell .account-meta { display: none !important; }
  body.app-shell .header-main {
    grid-template-columns: auto 1fr auto;
    gap: .65rem;
    min-height: var(--header-h);
    padding: .45rem 0;
  }
  body.app-shell .search {
    max-width: none;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(13, 122, 99, .08);
  }
  body.app-shell .cat-bar { display: none; }
  body.app-shell .site-footer { display: none; }
  body.app-shell .promo-bar { font-size: .78rem; padding: .35rem .75rem; }
  /* Keep mint shell radius only — do not override mobile aspect-ratio / min-height:0 */
  body.app-shell .home-banner-stage {
    border-radius: 16px;
    min-height: 0;
    margin-inline: 0;
    width: 100%;
  }
  body.app-shell .card {
    border-radius: 16px;
  }

  .app-tabbar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 60;
    height: calc(var(--app-tabbar-h) + env(safe-area-inset-bottom, 0px));
    padding: .28rem .35rem calc(.28rem + env(safe-area-inset-bottom, 0px));
    overflow: visible;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(20px) saturate(1.25);
    border-top: 0;
    box-shadow: 0 -10px 32px rgba(13, 122, 99, .12);
  }
  .app-tabbar::before {
    content: "";
    position: absolute;
    inset-inline: 12%;
    top: 0;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, var(--green), var(--accent), transparent);
  }
  .app-tab {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .12rem;
    color: #6b8179;
    text-decoration: none;
    font-size: .66rem;
    font-weight: 700;
    border-radius: 14px;
    min-height: 50px;
    transition: color .15s ease, background .15s ease, transform .15s ease;
  }
  .app-tab svg { width: 22px; height: 22px; }
  .app-tab.is-active {
    color: var(--green);
    background: linear-gradient(180deg, #e8f8f1, #d7f3e8);
  }
  .app-tab--cart,
  .app-tab--cart.is-active {
    color: #fff;
    background: transparent;
  }
  .app-tab--cart svg,
  .app-tab--cart span { position: relative; z-index: 1; }
  .app-tab--cart svg { color: #fff; }
  .app-tab--cart::after {
    content: "";
    position: absolute;
    width: 46px;
    height: 46px;
    border-radius: 16px;
    background: linear-gradient(145deg, #14b8a6, var(--green) 55%, #e11d48);
    box-shadow: 0 8px 18px rgba(13, 122, 99, .35);
    transform: translateY(-8px);
  }
  .app-tab--cart span { color: var(--green-dark); margin-top: .15rem; }
  .app-tab--cart.is-active span { color: var(--green); }
  .app-tab--cart.is-active::after {
    box-shadow: 0 10px 22px rgba(13, 122, 99, .42);
  }
  .app-tab-badge {
    position: absolute;
    top: .05rem;
    inset-inline-end: 14%;
    min-width: 1.05rem;
    height: 1.05rem;
    padding: 0 .25rem;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font-size: .65rem;
    font-style: normal;
    font-weight: 800;
    display: grid;
    place-items: center;
    line-height: 1;
    z-index: 2;
    box-shadow: 0 2px 0 #fff;
  }

  .pwa-install {
    display: flex;
    align-items: center;
    gap: .65rem;
    position: fixed;
    inset-inline: .75rem;
    bottom: calc(var(--app-tabbar-h) + env(safe-area-inset-bottom, 0px) + .65rem);
    z-index: 70;
    padding: .8rem .9rem;
    border-radius: 18px;
    background: linear-gradient(135deg, #0d7a63 0%, #128f74 48%, #e11d48 120%);
    color: #fff;
    box-shadow: 0 14px 36px rgba(13, 122, 99, .32);
  }
  .pwa-install[hidden] { display: none !important; }
  .pwa-install__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .15rem;
    min-width: 0;
  }
  .pwa-install__body strong { font-size: .9rem; }
  .pwa-install__body span { font-size: .75rem; opacity: .88; }
  .pwa-install .btn {
    background: #fff;
    color: var(--green);
    border: 0;
    white-space: nowrap;
    box-shadow: none;
  }
  .pwa-install .btn:hover {
    background: #fff6ea;
    color: var(--green-dark);
    transform: none;
  }
  .pwa-install__close {
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 1.25rem;
    line-height: 1;
    padding: .15rem .35rem;
    cursor: pointer;
    opacity: .75;
  }
  body.app-shell .ms-sc {
    bottom: calc(var(--app-tabbar-h) + env(safe-area-inset-bottom, 0px) + 0.85rem) !important;
    inset-inline-start: 0.85rem !important;
    inset-inline-end: auto !important;
  }
}

/* ===== Track / generic overflow fixes ===== */
html, body { max-width: 100%; overflow-x: hidden; }
main.container { max-width: 100%; min-width: 0; }
.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
}
.table-scroll table { min-width: 640px; }

.track-page {
  width: min(920px, 100%);
  margin: 1.25rem auto 2rem;
  padding-bottom: 1rem;
}
.track-hero { margin-bottom: 1rem; }
.track-kicker {
  margin: 0 0 .35rem;
  color: var(--green);
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .02em;
}
.track-hero h1 { margin: 0 0 .35rem; font-size: clamp(1.35rem, 4vw, 1.75rem); }
.track-lead { margin: 0; max-width: 36rem; line-height: 1.7; }
.track-card { margin: 0; }
.track-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .85rem 1rem;
}
.track-actions { margin-top: 1rem; }
.track-results { margin-top: 1.35rem; }
.track-results__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .85rem;
}
.track-results__head h2 { margin: 0; font-size: 1.1rem; }

.track-list { display: none; flex-direction: column; gap: .75rem; }
.track-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow);
}
.track-item.is-focus {
  border-color: #f5d78e;
  background: linear-gradient(180deg, #fffbeb, #fff);
}
.track-item__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .85rem;
}
.track-item__num {
  margin: 0;
  font-weight: 800;
  font-size: .95rem;
  letter-spacing: .01em;
}
.track-item__date { margin: .15rem 0 0; font-size: .8rem; }
.track-status {
  display: inline-flex;
  align-items: center;
  padding: .28rem .65rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 800;
  background: #f1f5f9;
  color: #334155;
  white-space: nowrap;
}
.track-status--cancelled,
.track-status--refunded { background: #fef2f2; color: #b91c1c; }
.track-status--completed,
.track-status--paid { background: var(--green-soft); color: var(--green-dark); }
.track-status--shipped,
.track-status--processing { background: #eff6ff; color: #1d4ed8; }
.track-status--awaiting_payment,
.track-status--pending { background: #fff7ed; color: #c2410c; }
.track-item__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  padding: .75rem 0;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
  margin-bottom: .85rem;
}
.track-item__meta span { display: block; font-size: .75rem; margin-bottom: .15rem; }
.track-item__meta strong { font-size: .95rem; }
.track-item__meta small { font-weight: 600; color: var(--muted); }
.track-item__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
.track-item__actions form { display: inline; margin: 0; }
.track-table-wrap { display: block; }
.track-table .is-focus { background: #fff8e6; }
.track-table__links {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  justify-content: flex-end;
}
.track-table__links a { color: var(--green); font-weight: 700; }

@media (max-width: 860px) {
  .track-page { margin-top: .85rem; }
  .track-fields { grid-template-columns: 1fr; }
  .track-list { display: flex; }
  .track-table-wrap { display: none; }
  .track-actions .btn { width: 100%; }
  .panel {
    padding: 1rem;
    border-radius: 14px;
  }
  /* جلوگیری از بریدگی دکمه‌ها / جدول‌ها در موبایل */
  .actions { display: flex; flex-wrap: wrap; gap: .5rem; }
  .actions .btn { max-width: 100%; }
}

@media (min-width: 861px) {
  .track-list { display: none !important; }
  .track-table-wrap { display: block; }
}
@media (display-mode: standalone), (display-mode: fullscreen) {
  body.app-shell .promo-bar { display: none; }
  body.app-shell .site-header {
    padding-top: max(env(safe-area-inset-top, 0px), .2rem);
  }
}
