/* ═══════════════════════════════════════════════════════
   shop.css — طراحی فروشگاه اینترنتی
   ═══════════════════════════════════════════════════════ */

:root {
  --sp-primary:       #4f46e5;
  --sp-primary-h:     #4338ca;
  --sp-accent:        #f59e0b;
  --sp-success:       #10b981;
  --sp-danger:        #ef4444;
  --sp-bg:            #f3f4f6;
  --sp-surface:       #ffffff;
  --sp-surface2:      #f9fafb;
  --sp-text:          #111827;
  --sp-text-m:        #6b7280;
  --sp-border:        #e5e7eb;
  --sp-radius:        14px;
  --sp-radius-sm:     8px;
  --sp-shadow:        0 1px 4px rgba(0,0,0,.08);
  --sp-shadow-md:     0 4px 16px rgba(0,0,0,.10);
  --sp-font:          'YekanBakhFaNum', system-ui, sans-serif;
  --sp-header-h:      64px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

@font-face {
  font-family: 'YekanBakhFaNum';
  src: url('/static/fonts/YekanBakhFaNum-Regular.woff2') format('woff2');
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: 'YekanBakhFaNum';
  src: url('/static/fonts/YekanBakhFaNum-Black.woff2') format('woff2');
  font-weight: 700; font-display: swap;
}

body.shop-page {
  font-family: var(--sp-font);
  background: var(--sp-bg);
  color: var(--sp-text);
  direction: rtl;
  font-size: 15px;
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── Header ── */
.sh-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--sp-surface);
  border-bottom: 1px solid var(--sp-border);
  box-shadow: var(--sp-shadow);
  height: var(--sp-header-h);
}
.sh-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}
.sh-logo {
  display: flex;
  align-items: center;
  justify-content: flex-end; /* راست در RTL */
  white-space: nowrap;
  flex-shrink: 0;
  grid-column: 1;
}
.sh-logo span { color: var(--sp-accent); }

.sh-search {
  grid-column: 2;
  display: flex;
  align-items: center;
  background: var(--sp-bg);
  border: 1.5px solid var(--sp-border);
  border-radius: 50px;
  padding: 0 .5rem 0 1rem;
  gap: .5rem;
  width: 420px;
  max-width: 480px;
}
.sh-search input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--sp-font);
  font-size: .9rem;
  color: var(--sp-text);
  padding: .55rem 0;
  outline: none;
  direction: rtl;
}
.sh-search button {
  background: var(--sp-primary);
  border: none;
  border-radius: 50px;
  color: #fff;
  padding: .35rem .75rem;
  cursor: pointer;
  font-size: .8rem;
  font-family: var(--sp-font);
  display: flex;
  align-items: center;
  gap: .3rem;
}
.sh-search button:hover { background: var(--sp-primary-h); }

.sh-nav-actions {
  grid-column: 3;
  display: flex;
  align-items: center;
  justify-content: flex-start; /* چپ */
  gap: .5rem;
  flex-shrink: 0;
}
.sh-btn-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid var(--sp-border);
  background: var(--sp-surface);
  color: var(--sp-text);
  cursor: pointer;
  transition: .15s;
  text-decoration: none;
}
.sh-btn-icon:hover { border-color: var(--sp-primary); color: var(--sp-primary); }
.sh-cart-badge {
  position: absolute;
  top: -4px;
  left: -4px;
  background: var(--sp-danger);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sh-account-btn {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .85rem;
  border-radius: 50px;
  border: 1.5px solid var(--sp-primary);
  color: var(--sp-primary);
  font-size: .85rem;
  font-weight: 600;
  font-family: var(--sp-font);
  cursor: pointer;
  transition: .15s;
  background: transparent;
  text-decoration: none;
}
.sh-account-btn:hover { background: var(--sp-primary); color: #fff; }
.sh-account-btn.logged-in { background: var(--sp-primary); color: #fff; }

/* ── Category nav bar ── */
.sh-cats {
  background: var(--sp-surface);
  border-bottom: 1px solid var(--sp-border);
  overflow-x: auto;
  scrollbar-width: none;
}
.sh-cats::-webkit-scrollbar { display: none; }
.sh-cats-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  gap: .25rem;
  white-space: nowrap;
}
.sh-cats a {
  display: inline-block;
  padding: .5rem .9rem;
  font-size: .82rem;
  color: var(--sp-text-m);
  border-bottom: 2.5px solid transparent;
  transition: .15s;
}
.sh-cats a:hover, .sh-cats a.active {
  color: var(--sp-primary);
  border-bottom-color: var(--sp-primary);
}

/* ── Layout container ── */
.sh-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

/* ── Banner slider ── */
.sh-banner-wrap {
  position: relative;
  border-radius: var(--sp-radius);
  overflow: hidden;
  margin-bottom: 2rem;
  background: linear-gradient(135deg,#e8eaf0 0%,#d0d4de 100%);
  /* fallback aspect-ratio for Safari < 15 */
  height: 0;
  padding-bottom: 31.25%; /* 5/16 ratio */
  contain: layout paint;
}
.sh-banner-slides {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  display: flex;
  height: 100%;
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  will-change: transform;
}
.sh-banner-slide {
  min-width: 100%;
  height: 100%;
  position: relative;
  flex-shrink: 0;
}
.sh-banner-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.sh-banner-caption {
  position: absolute;
  bottom: 1.5rem;
  right: 2rem;
  background: rgba(0,0,0,.55);
  color: #fff;
  padding: .5rem 1.2rem;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 600;
}
.sh-banner-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.85);
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--sp-text);
  box-shadow: var(--sp-shadow);
}
.sh-banner-btn.prev { right: 1rem; }
.sh-banner-btn.next { left: 1rem; }
.sh-banner-dots {
  position: absolute;
  bottom: .75rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: .35rem;
}
.sh-banner-dots span {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.6);
  cursor: pointer;
  transition: .2s;
}
.sh-banner-dots span.active { background: #fff; width: 20px; border-radius: 4px; }

/* ── Section title ── */
.sh-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--sp-text);
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.sh-section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.2em;
  background: var(--sp-primary);
  border-radius: 2px;
}
.sh-section-title a {
  margin-right: auto;
  font-size: .82rem;
  font-weight: 400;
  color: var(--sp-primary);
}

/* ── Product grid — mobile-first: همیشه ۲ ستون، در دسکتاپ بیشتر ── */
.sh-product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .6rem;
}
@media (min-width: 640px) {
  .sh-product-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
  }
}

.sh-product-card {
  background: var(--sp-surface);
  border-radius: var(--sp-radius);
  overflow: hidden;
  box-shadow: var(--sp-shadow);
  transition: box-shadow .2s, transform .2s;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}
.sh-product-card:hover {
  box-shadow: var(--sp-shadow-md);
  transform: translateY(-3px);
}
.sh-product-img {
  position: relative;
  /* fallback aspect-ratio for Safari < 15 */
  height: 0;
  padding-bottom: 100%; /* 1:1 ratio */
  overflow: hidden;
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  animation: sh-shimmer 1.5s infinite;
}
/* بعد از لود تصویر، انیمیشن و background حذف می‌شود (از طریق JS style.animation=none) */
.sh-product-img img {
  transition: opacity .35s ease;
}
@keyframes sh-shimmer {
  0%   { background-position:  200% 0; }
  100% { background-position: -200% 0; }
}
.sh-discount-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  background: #ef4444;
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  padding: .18rem .45rem;
  border-radius: 20px;
  line-height: 1.4;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.sh-product-img img {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: .5rem;
  transition: transform .3s;
}
.sh-product-card:hover .sh-product-img img { transform: scale(1.05); }
.sh-product-info {
  padding: .75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.sh-product-cat {
  font-size: .72rem;
  color: var(--sp-text-m);
}
.sh-product-name {
  font-size: .85rem;
  font-weight: 600;
  color: var(--sp-text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sh-product-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--sp-primary);
  margin-top: auto;
}
.sh-product-price small {
  font-size: .7rem;
  font-weight: 400;
  color: var(--sp-text-m);
}
.sh-product-add {
  width: 100%;
  padding: .5rem;
  background: var(--sp-primary);
  color: #fff;
  border: none;
  border-top: 1px solid var(--sp-border);
  font-family: var(--sp-font);
  font-size: .82rem;
  cursor: pointer;
  transition: background .15s;
}
.sh-product-add:hover { background: var(--sp-primary-h); }
.sh-product-add.out-of-stock {
  background: var(--sp-border);
  color: var(--sp-text-m);
  cursor: not-allowed;
}

/* ── Product detail ── */
.sh-product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  background: var(--sp-surface);
  border-radius: var(--sp-radius);
  padding: 2rem;
  box-shadow: var(--sp-shadow);
}
.sh-detail-img-wrap {
  border-radius: var(--sp-radius-sm);
  overflow: hidden;
  background: var(--sp-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  padding: 1rem;
}
.sh-detail-img-wrap img { max-height: 380px; object-fit: contain; }
.sh-detail-info { display: flex; flex-direction: column; gap: 1rem; }
.sh-detail-cat {
  font-size: .8rem;
  color: var(--sp-text-m);
}
.sh-detail-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--sp-text);
  line-height: 1.5;
}
.sh-detail-price-wrap {
  background: var(--sp-bg);
  border-radius: var(--sp-radius-sm);
  padding: 1rem;
}
.sh-detail-price {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--sp-primary);
}
.sh-detail-price small { font-size: .85rem; font-weight: 400; color: var(--sp-text-m); }
.sh-detail-stock {
  font-size: .82rem;
  margin-top: .35rem;
}
.sh-detail-stock.in { color: var(--sp-success); }
.sh-detail-stock.out { color: var(--sp-danger); }
.sh-qty-row {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.sh-qty-input {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--sp-border);
  border-radius: 50px;
  overflow: hidden;
}
.sh-qty-input button {
  width: 36px; height: 36px;
  border: none;
  background: var(--sp-bg);
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--sp-text);
}
.sh-qty-input input {
  width: 48px;
  text-align: center;
  border: none;
  font-family: var(--sp-font);
  font-size: .95rem;
  background: transparent;
  outline: none;
}
.sh-btn-primary {
  background: var(--sp-primary);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: .65rem 1.5rem;
  font-family: var(--sp-font);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  text-decoration: none;
}
.sh-btn-primary:hover { background: var(--sp-primary-h); }
.sh-btn-primary:disabled { background: var(--sp-border); color: var(--sp-text-m); cursor: not-allowed; }
.sh-btn-outline {
  background: transparent;
  color: var(--sp-primary);
  border: 1.5px solid var(--sp-primary);
  border-radius: 50px;
  padding: .6rem 1.2rem;
  font-family: var(--sp-font);
  font-size: .9rem;
  cursor: pointer;
  transition: .15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.sh-btn-outline:hover { background: var(--sp-primary); color: #fff; }

/* ── Cart ── */
.sh-cart-layout { display: grid; grid-template-columns: 1fr 320px; gap: 1.5rem; align-items: start; }
.sh-cart-table { background: var(--sp-surface); border-radius: var(--sp-radius); overflow: hidden; box-shadow: var(--sp-shadow); }
.sh-cart-table-head {
  display: grid;
  grid-template-columns: 1fr 120px 130px 80px;
  padding: .75rem 1rem;
  background: var(--sp-bg);
  font-size: .8rem;
  color: var(--sp-text-m);
  font-weight: 600;
}
.sh-cart-row {
  display: grid;
  grid-template-columns: 1fr 120px 130px 80px;
  padding: 1rem;
  border-top: 1px solid var(--sp-border);
  align-items: center;
}
.sh-cart-product { display: flex; align-items: center; gap: .75rem; }
.sh-cart-product img { width: 64px; height: 64px; object-fit: contain; border-radius: 8px; background: var(--sp-bg); padding: .3rem; }
.sh-cart-product-name { font-size: .88rem; font-weight: 600; }
.sh-cart-product-price { font-size: .78rem; color: var(--sp-text-m); margin-top: .2rem; }
.sh-cart-qty { display: flex; align-items: center; gap: .4rem; }
.sh-cart-qty input { width: 48px; text-align: center; border: 1px solid var(--sp-border); border-radius: 6px; padding: .3rem; font-family: var(--sp-font); font-size: .88rem; }
.sh-cart-qty button { background: none; border: none; color: var(--sp-primary); cursor: pointer; font-size: .8rem; padding: .2rem .4rem; }
.sh-cart-sub { font-weight: 600; color: var(--sp-primary); }
.sh-cart-del button {
  background: none;
  border: none;
  color: var(--sp-danger);
  cursor: pointer;
  padding: .3rem;
  border-radius: 6px;
}
.sh-cart-del button:hover { background: #fee2e2; }

.sh-cart-summary {
  background: var(--sp-surface);
  border-radius: var(--sp-radius);
  box-shadow: var(--sp-shadow);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.sh-summary-row { display: flex; justify-content: space-between; font-size: .9rem; }
.sh-summary-row.total { font-weight: 700; font-size: 1.05rem; border-top: 1px solid var(--sp-border); padding-top: .75rem; }
.sh-summary-btn { width: 100%; }

/* ── Empty state ── */
.sh-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--sp-text-m);
}
.sh-empty svg { width: 64px; height: 64px; opacity: .35; margin: 0 auto 1rem; }
.sh-empty h3 { font-size: 1.1rem; margin-bottom: .5rem; color: var(--sp-text); }

/* ── Auth forms ── */
.sh-auth-wrap {
  min-height: calc(100vh - var(--sp-header-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.sh-auth-card {
  background: var(--sp-surface);
  border-radius: var(--sp-radius);
  box-shadow: var(--sp-shadow-md);
  padding: 2rem;
  width: 100%;
  max-width: 440px;
}
.sh-auth-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 1.5rem; }
.sh-form-group { margin-bottom: 1rem; }
.sh-form-group label {
  display: block;
  font-size: .83rem;
  color: var(--sp-text-m);
  margin-bottom: .35rem;
  font-weight: 500;
}
.sh-form-group input,
.sh-form-group select,
.sh-form-group textarea {
  width: 100%;
  padding: .6rem .9rem;
  border: 1.5px solid var(--sp-border);
  border-radius: var(--sp-radius-sm);
  font-family: var(--sp-font);
  font-size: .9rem;
  color: var(--sp-text);
  background: var(--sp-surface);
  transition: border-color .15s;
  outline: none;
  direction: rtl;
}
.sh-form-group input:focus,
.sh-form-group select:focus,
.sh-form-group textarea:focus { border-color: var(--sp-primary); }
.sh-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.sh-form-hint { font-size: .75rem; color: var(--sp-text-m); margin-top: .25rem; }
.sh-form-divider {
  text-align: center;
  font-size: .83rem;
  color: var(--sp-text-m);
  margin: 1rem 0;
  position: relative;
}
.sh-form-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: 1px;
  background: var(--sp-border);
}
.sh-form-divider span {
  position: relative;
  background: var(--sp-surface);
  padding: 0 .75rem;
}

/* ── Steps indicator (Checkout) ── */
.sh-steps-bar {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: 1.5rem;
  font-size: .82rem;
  overflow: hidden;
}
.sh-step {
  display: flex;
  align-items: center;
  gap: .3rem;
  white-space: nowrap;
  color: var(--sp-text-m);
  flex-shrink: 0;
}
.sh-step-done { color: var(--sp-success); }
.sh-step-active { color: var(--sp-primary); font-weight: 600; }
.sh-step-circle {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem;
  flex-shrink: 0;
  background: var(--sp-success);
  color: #fff;
}
.sh-step-circle-active { background: var(--sp-primary); font-weight: 700; }
.sh-step-circle-muted  { background: var(--sp-border); color: var(--sp-text-m); }
.sh-step-line {
  flex: 1;
  height: 2px;
  background: var(--sp-border);
  min-width: 8px;
}
.sh-step-line-active { background: var(--sp-primary); }
@media (max-width: 400px) {
  .sh-step-lbl { display: none; }
  .sh-steps-bar { gap: .25rem; }
}

/* ── Checkout ── */
.sh-checkout-layout { display: grid; grid-template-columns: 1fr 340px; gap: 1.5rem; align-items: start; }
.sh-checkout-layout > * { min-width: 0; }
.sh-checkout-form {
  background: var(--sp-surface);
  border-radius: var(--sp-radius);
  box-shadow: var(--sp-shadow);
  padding: 1.5rem;
  box-sizing: border-box;
  max-width: 100%;
  overflow: hidden;
}
.sh-checkout-form h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--sp-border);
}
.sh-checkout-actions {
  margin-top: 1rem;
  display: flex;
  gap: .75rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.sh-checkout-actions .sh-btn-primary {
  flex: 1;
  justify-content: center;
  min-width: 180px;
}

/* ── Account tabs ── */
.sh-account-layout { display: grid; grid-template-columns: 240px 1fr; gap: 1.5rem; align-items: start; }
.sh-account-sidebar {
  background: var(--sp-surface);
  border-radius: var(--sp-radius);
  box-shadow: var(--sp-shadow);
  overflow: hidden;
}
.sh-account-user {
  padding: 1.25rem;
  background: var(--sp-primary);
  color: #fff;
  text-align: center;
}
.sh-account-user-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto .75rem;
  font-size: 1.4rem;
  font-weight: 700;
}
.sh-account-user-name { font-size: .95rem; font-weight: 600; }
.sh-account-nav a {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .75rem 1.25rem;
  font-size: .88rem;
  color: var(--sp-text-m);
  border-bottom: 1px solid var(--sp-border);
  transition: .15s;
}
.sh-account-nav a:hover,
.sh-account-nav a.active { color: var(--sp-primary); background: var(--sp-bg); }
.sh-account-nav a:last-child { border-bottom: none; }

.sh-account-content {
  background: var(--sp-surface);
  border-radius: var(--sp-radius);
  box-shadow: var(--sp-shadow);
  padding: 1.5rem;
}
.sh-account-content h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--sp-border);
}

/* ── Orders table ── */
.sh-orders-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.sh-orders-table th {
  background: var(--sp-bg);
  padding: .65rem 1rem;
  text-align: right;
  font-weight: 600;
  font-size: .8rem;
  color: var(--sp-text-m);
  border-bottom: 1px solid var(--sp-border);
}
.sh-orders-table td {
  padding: .8rem 1rem;
  border-bottom: 1px solid var(--sp-border);
  vertical-align: middle;
}
.sh-orders-table tr:hover td { background: var(--sp-bg); }
.sh-badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 50px;
  font-size: .72rem;
  font-weight: 600;
}
.sh-badge-green  { background: #d1fae5; color: #065f46; }
.sh-badge-yellow { background: #fef3c7; color: #92400e; }
.sh-badge-red    { background: #fee2e2; color: #991b1b; }
.sh-badge-gray   { background: var(--sp-bg); color: var(--sp-text-m); }
.sh-badge-blue   { background: #dbeafe; color: #1e40af; }

/* ── Order detail ── */
.sh-order-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
.sh-order-info-card {
  background: var(--sp-bg);
  border-radius: var(--sp-radius-sm);
  padding: 1rem;
}
.sh-order-info-card h4 {
  font-size: .82rem;
  color: var(--sp-text-m);
  margin-bottom: .5rem;
}
.sh-order-info-card p { font-size: .9rem; font-weight: 500; }

/* ── Payment result ── */
.sh-result-wrap {
  min-height: calc(100vh - var(--sp-header-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.sh-result-card {
  background: var(--sp-surface);
  border-radius: var(--sp-radius);
  box-shadow: var(--sp-shadow-md);
  padding: 2.5rem 2rem;
  text-align: center;
  max-width: 440px;
  width: 100%;
}
.sh-result-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 2rem;
}
.sh-result-icon.success { background: #d1fae5; color: var(--sp-success); }
.sh-result-icon.fail    { background: #fee2e2; color: var(--sp-danger); }
.sh-result-title { font-size: 1.3rem; font-weight: 700; margin-bottom: .5rem; }
.sh-result-sub   { font-size: .9rem; color: var(--sp-text-m); margin-bottom: 1.5rem; }
.sh-result-track { font-size: .8rem; color: var(--sp-text-m); margin-top: .5rem; }

/* ── Breadcrumb ── */
.sh-breadcrumb {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .8rem;
  color: var(--sp-text-m);
  margin-bottom: 1rem;
}
.sh-breadcrumb a:hover { color: var(--sp-primary); }
.sh-breadcrumb .sep { opacity: .4; }

/* ── Flash messages ── */
.sh-flash-wrap {
  position: fixed;
  top: calc(var(--sp-header-h) + .75rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  min-width: 300px;
  max-width: 480px;
  width: 90%;
}
.sh-flash {
  padding: .75rem 1.2rem;
  border-radius: var(--sp-radius-sm);
  font-size: .88rem;
  font-weight: 500;
  box-shadow: var(--sp-shadow-md);
  animation: sh-slide-in .25s ease;
}
.sh-flash-success { background: #d1fae5; color: #065f46; border-right: 4px solid var(--sp-success); }
.sh-flash-error   { background: #fee2e2; color: #991b1b; border-right: 4px solid var(--sp-danger); }
.sh-flash-info    { background: #dbeafe; color: #1e40af; border-right: 4px solid var(--sp-primary); }
@keyframes sh-slide-in {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Footer ── */
.sh-footer {
  background: #1f2937;
  color: #d1d5db;
  padding: 2.5rem 1rem 1.5rem;
  margin-top: 3rem;
}
.sh-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
.sh-footer h4 { color: #fff; font-size: .95rem; margin-bottom: .75rem; }
.sh-footer p  { font-size: .83rem; line-height: 1.8; }
.sh-footer ul { list-style: none; }
.sh-footer ul li { margin-bottom: .4rem; }
.sh-footer ul li a { font-size: .83rem; color: #9ca3af; transition: .15s; }
.sh-footer ul li a:hover { color: #fff; }
.sh-footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 1rem;
  border-top: 1px solid #374151;
  font-size: .78rem;
  color: #6b7280;
  text-align: center;
}
.sh-enamad-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,.2);
  transition: transform .18s ease, box-shadow .18s ease;
}
.sh-enamad-box:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0,0,0,.3);
}
.sh-enamad-box img {
  display: block;
  width: 90px;
  height: auto;
}

/* ── Toast notification ── */
#sh-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1f2937;
  color: #fff;
  padding: .65rem 1.4rem;
  border-radius: 50px;
  font-size: .88rem;
  font-family: var(--sp-font);
  z-index: 9999;
  transition: transform .3s ease, opacity .3s ease;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}
#sh-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ── Pagination ── */
.sh-pagination {
  display: flex;
  justify-content: center;
  gap: .4rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}
.sh-pagination a, .sh-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: var(--sp-radius-sm);
  border: 1.5px solid var(--sp-border);
  font-size: .88rem;
  color: var(--sp-text);
  transition: .15s;
  text-decoration: none;
  background: var(--sp-surface);
}
.sh-pagination a:hover { border-color: var(--sp-primary); color: var(--sp-primary); }
.sh-pagination .current { background: var(--sp-primary); color: #fff; border-color: var(--sp-primary); }

/* ── Responsive ── */
@media (max-width: 900px) {
  .sh-product-detail  { grid-template-columns: 1fr; }
  .sh-cart-layout     { grid-template-columns: 1fr; }
  .sh-checkout-layout { grid-template-columns: 1fr; }
  .sh-account-layout  { grid-template-columns: 1fr; }
  .sh-footer-inner    { grid-template-columns: 1fr; gap: 1.5rem; }
}
@media (max-width: 640px) {
  .sh-cart-table-head { display: none; }
  .sh-cart-row { grid-template-columns: 1fr auto; gap: .5rem; }
  .sh-cart-sub, .sh-cart-del { grid-column: 2; }
  .sh-cart-qty { grid-column: 1 2; }
  .sh-form-grid { grid-template-columns: 1fr; }
  .sh-banner-wrap { padding-bottom: 43.75%; /* 7/16 ratio */ }
  .sh-order-detail-grid { grid-template-columns: 1fr; }
  .sh-search { display: none; }
  /* موبایل: grid → flex ساده */
  .sh-header-inner {
    display: flex;
    justify-content: space-between;
  }
  .sh-logo { grid-column: unset; justify-content: unset; }
  .sh-nav-actions { grid-column: unset; justify-content: unset; }
  /* checkout موبایل */
  .sh-container { padding: 1rem .75rem; }
  .sh-checkout-form { padding: 1rem; }
  .sh-checkout-actions { flex-direction: column-reverse; }
  .sh-checkout-actions .sh-btn-primary,
  .sh-checkout-actions .sh-btn-outline { width: 100%; justify-content: center; text-align: center; min-width: 0; }
  .sh-checkout-layout { gap: 1rem; }

  /* ── پنل کاربری موبایل ── */
  .sh-account-layout { gap: .75rem; }
  .sh-account-sidebar { display: flex; flex-direction: column; }
  .sh-account-user {
    display: flex;
    align-items: center;
    gap: .75rem;
    text-align: right;
    padding: .75rem 1rem;
  }
  .sh-account-user-info { flex: 1; min-width: 0; }
  .sh-account-user-avatar {
    width: 40px; height: 40px;
    font-size: 1rem;
    margin: 0;
    flex-shrink: 0;
  }
  .sh-account-user-name { font-size: .85rem; }
  .sh-account-nav { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .sh-account-nav::-webkit-scrollbar { display: none; }
  .sh-account-nav a {
    flex: 1;
    min-width: max-content;
    justify-content: center;
    font-size: .8rem;
    gap: .3rem;
    padding: .6rem .65rem;
    border-bottom: none;
    border-top: 1px solid var(--sp-border);
    border-left: 1px solid var(--sp-border);
  }
  .sh-account-nav a:last-child  { border-left: none; }
  .sh-account-content { padding: 1rem; }

  /* ── جدول سفارش‌ها → کارت موبایل ── */
  .sh-orders-wrap { overflow: visible; }
  .sh-orders-table thead { display: none; }
  .sh-orders-table,
  .sh-orders-table tbody { display: block; }
  .sh-orders-table tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid var(--sp-border);
    border-radius: var(--sp-radius-sm);
    margin-bottom: .75rem;
    overflow: hidden;
    background: var(--sp-surface);
  }
  .sh-orders-table tr:hover td { background: transparent; }
  .sh-orders-table td {
    display: flex;
    flex-direction: column;
    gap: .18rem;
    padding: .6rem .85rem;
    border-bottom: 1px solid var(--sp-border);
    border-left: none;
    font-size: .85rem;
    vertical-align: top;
  }
  .sh-orders-table td::before {
    content: attr(data-label);
    font-size: .7rem;
    color: var(--sp-text-m);
    font-weight: 500;
  }
  /* شماره سفارش — تمام عرض */
  .sh-orders-table td:first-child {
    grid-column: 1 / -1;
    background: var(--sp-bg);
    font-size: .82rem;
  }
  /* دکمه مشاهده — تمام عرض */
  .sh-orders-table td:last-child {
    grid-column: 1 / -1;
    border-bottom: none;
    padding: .6rem .85rem;
    align-items: flex-start;
  }
}

/* ══════════════════════════════════════════════════════════
   No-image placeholder
   ══════════════════════════════════════════════════════════ */
.sh-no-img {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e8eaf6 0%, #dde1f8 40%, #c5cae9 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.sh-no-img::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 30%, rgba(255,255,255,0.4) 0%, transparent 60%);
}
.sh-no-img::after {
  content: '';
  display: block;
  width: 42%;
  height: 42%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238c9eff' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z'/%3E%3Cpolyline points='3.27 6.96 12 12.01 20.73 6.96'/%3E%3Cline x1='12' y1='22.08' x2='12' y2='12'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.55;
}

/* ══════════════════════════════════════════════════════════
   Brand box — صفحه محصول
   ══════════════════════════════════════════════════════════ */
.sh-brand-box {
  background: var(--sp-bg);
  border: 1.5px solid var(--sp-border);
  border-radius: var(--sp-radius-sm);
  padding: .85rem 1.1rem;
  transition: border-color .15s;
  margin-bottom: .5rem;
}
.sh-brand-box:hover { border-color: var(--sp-primary); }
.sh-brand-box a {
  display: flex;
  align-items: center;
  gap: .9rem;
  text-decoration: none;
  color: inherit;
}
.sh-brand-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sp-primary), #818cf8);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(79,70,229,.25);
}
.sh-brand-name {
  font-size: .92rem;
  font-weight: 700;
  color: var(--sp-text);
}
.sh-brand-link {
  font-size: .78rem;
  color: var(--sp-primary);
  margin-top: .18rem;
}

/* ══════════════════════════════════════════════════════════
   Brand page header
   ══════════════════════════════════════════════════════════ */
.sh-brand-header {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  background: var(--sp-surface);
  border-radius: var(--sp-radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--sp-shadow);
}
.sh-brand-header-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sp-primary), #818cf8);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(79,70,229,.3);
}
.sh-brand-header-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--sp-text);
  margin-bottom: .25rem;
}
.sh-brand-header-count {
  font-size: .85rem;
  color: var(--sp-text-m);
}
