/* ╭──────────────────────────────────────────────────────────╮
   │ Sanad Catalog — public stylesheet                       │
   │ Mobile-first · RTL aware · Print-ready                  │
   ╰──────────────────────────────────────────────────────────╯ */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

.sc-catalog {
  --sc-primary: #C75B3C;
  --sc-primary-dark: #A6432B;
  --sc-gold: #B0832A;
  --sc-gold-soft: #E8C97A;
  --sc-cream: #FAF6F0;
  --sc-ivory: #F3EBDC;
  --sc-paper: #FFFFFF;
  --sc-coffee: #2A1E18;
  --sc-coffee-soft: #5C4940;
  --sc-muted: #7A6A5E;
  --sc-line: #E5DCC9;
  --sc-success: #25D366;
  --sc-success-dark: #128C7E;
  --sc-radius: 14px;
  --sc-radius-sm: 8px;
  --sc-radius-pill: 999px;
  --sc-shadow-sm: 0 1px 2px rgba(42,30,24,.06);
  --sc-shadow-md: 0 4px 16px rgba(42,30,24,.08);
  --sc-shadow-lg: 0 12px 32px rgba(42,30,24,.14);
  --sc-fz-sm: 13px;
  --sc-fz-base: 15px;
  --sc-fz-lg: 17px;
  --sc-fz-xl: 22px;
  --sc-fz-xxl: 32px;

  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--sc-coffee);
  background: var(--sc-cream);
  font-size: var(--sc-fz-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  scroll-behavior: smooth;
}

.sc-catalog.sc-rtl {
  font-family: 'Cairo', 'Amiri', sans-serif;
  direction: rtl;
}

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

.sc-catalog a { color: inherit; text-decoration: none; }
.sc-catalog button { font-family: inherit; cursor: pointer; }

.sc-catalog h1, .sc-catalog h2, .sc-catalog h3 {
  margin: 0;
  letter-spacing: -.01em;
}

/* ── Header ───────────────────────────────────── */
.sc-hdr {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(250, 246, 240, .96);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--sc-line);
  padding: 12px 16px 14px;
}
.sc-hdr-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1200px;
  margin: 0 auto;
}
.sc-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.sc-logo { height: 36px; width: auto; max-width: 160px; }
.sc-brand-mark {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--sc-coffee); color: var(--sc-gold-soft);
  display: grid; place-items: center;
  font-family: 'Inter', serif; font-size: 16px; font-weight: 700;
}
.sc-brand-name {
  font-weight: 700; color: var(--sc-coffee);
  font-size: 16px; letter-spacing: .01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sc-lang {
  display: inline-flex; gap: 4px;
  background: var(--sc-paper);
  border: 1px solid var(--sc-line);
  border-radius: var(--sc-radius-pill);
  padding: 3px;
}
.sc-lang a {
  font-size: 12px; font-weight: 600;
  padding: 6px 12px; border-radius: var(--sc-radius-pill);
  color: var(--sc-muted);
  transition: all .15s ease;
}
.sc-lang a.is-active {
  background: var(--sc-coffee); color: var(--sc-cream);
}
.sc-hdr-titles {
  max-width: 1200px; margin: 12px auto 0;
}
.sc-title {
  font-size: clamp(22px, 5vw, var(--sc-fz-xxl));
  font-weight: 700; color: var(--sc-coffee);
  line-height: 1.1;
}
.sc-subtitle {
  margin: 6px 0 0;
  font-size: var(--sc-fz-sm);
  color: var(--sc-muted);
  display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center;
}
.sc-meta-pill {
  background: var(--sc-ivory);
  padding: 3px 10px;
  border-radius: var(--sc-radius-pill);
  font-weight: 500;
  color: var(--sc-coffee-soft);
}

/* ── Filters ──────────────────────────────────── */
.sc-filters {
  position: sticky;
  top: 110px;
  z-index: 25;
  background: var(--sc-cream);
  padding: 14px 16px;
  border-bottom: 1px solid var(--sc-line);
  max-width: 1200px;
  margin: 0 auto;
}
.sc-filters-row {
  display: flex; align-items: center; gap: 10px;
  margin: 0 auto;
}
.sc-filters-search {
  position: relative;
  margin-bottom: 10px;
}
.sc-search-icon {
  position: absolute;
  inset-inline-start: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--sc-muted);
  width: 18px; height: 18px;
  pointer-events: none;
}
.sc-search-icon svg { width: 100%; height: 100%; }
.sc-search {
  flex: 1;
  font-family: inherit;
  font-size: var(--sc-fz-base);
  padding: 12px 14px 12px 38px;
  border: 1.5px solid var(--sc-line);
  border-radius: var(--sc-radius-sm);
  background: var(--sc-paper);
  color: var(--sc-coffee);
  width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.sc-rtl .sc-search { padding: 12px 38px 12px 14px; }
.sc-search:focus {
  outline: none;
  border-color: var(--sc-primary);
  box-shadow: 0 0 0 3px rgba(199,91,60,.15);
}
.sc-reset {
  background: transparent;
  border: 1.5px solid var(--sc-line);
  color: var(--sc-muted);
  font-size: 12px; font-weight: 600;
  padding: 10px 14px;
  border-radius: var(--sc-radius-sm);
  transition: all .15s;
  flex-shrink: 0;
}
.sc-reset:hover { border-color: var(--sc-coffee); color: var(--sc-coffee); }

.sc-cats {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0 8px;
  margin: 0 -16px 10px;
  padding-inline: 16px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.sc-cats::-webkit-scrollbar { height: 4px; }
.sc-cats::-webkit-scrollbar-thumb { background: var(--sc-line); border-radius: 4px; }
.sc-cat-chip {
  background: var(--sc-paper);
  border: 1.5px solid var(--sc-line);
  color: var(--sc-coffee-soft);
  font-size: 13px; font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--sc-radius-pill);
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all .15s ease;
  flex-shrink: 0;
}
.sc-cat-chip:hover { border-color: var(--sc-primary); color: var(--sc-primary); }
.sc-cat-chip.is-active {
  background: var(--sc-coffee);
  color: var(--sc-cream);
  border-color: var(--sc-coffee);
}
.sc-cat-count {
  background: rgba(255,255,255,.18);
  font-weight: 500; font-size: 11px;
  padding: 1px 7px; border-radius: var(--sc-radius-pill);
}
.sc-cat-chip:not(.is-active) .sc-cat-count {
  background: var(--sc-ivory);
  color: var(--sc-muted);
}

.sc-filters-actions {
  flex-wrap: wrap;
  justify-content: space-between;
}
.sc-sort {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--sc-muted);
}
.sc-sort select {
  font-family: inherit;
  font-size: var(--sc-fz-sm);
  padding: 8px 28px 8px 12px;
  border: 1.5px solid var(--sc-line);
  border-radius: var(--sc-radius-sm);
  background-color: var(--sc-paper);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237A6A5E' stroke-width='2'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 14px;
  color: var(--sc-coffee);
  appearance: none;
  cursor: pointer;
}
.sc-rtl .sc-sort select { background-position: left 8px center; padding: 8px 12px 8px 28px; }
.sc-actions-right {
  display: inline-flex; align-items: center; gap: 8px;
}

/* ── Buttons ─────────────────────────────────── */
.sc-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: inherit; font-weight: 600; font-size: var(--sc-fz-sm);
  padding: 10px 14px; border-radius: var(--sc-radius-sm);
  border: 1.5px solid transparent;
  transition: all .15s ease;
  text-decoration: none;
}
.sc-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.sc-btn-ghost {
  background: var(--sc-paper);
  border-color: var(--sc-line);
  color: var(--sc-coffee);
}
.sc-btn-ghost:hover { border-color: var(--sc-coffee); }
.sc-btn-wa {
  background: var(--sc-success);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37,211,102,.30);
}
.sc-btn-wa:hover { background: var(--sc-success-dark); }
.sc-btn-wa-inline { padding: 10px 14px; }
.sc-btn-sm { padding: 8px 12px; font-size: 12px; }

/* ── TOC / quick jump ─────────────────────────── */
.sc-toc {
  display: flex; gap: 6px;
  overflow-x: auto;
  padding: 8px 16px;
  background: var(--sc-paper);
  border-bottom: 1px solid var(--sc-line);
  -webkit-overflow-scrolling: touch;
}
.sc-toc-link {
  font-size: 12px; font-weight: 500;
  color: var(--sc-muted);
  padding: 6px 12px;
  border-radius: var(--sc-radius-pill);
  background: var(--sc-ivory);
  white-space: nowrap;
  flex-shrink: 0;
  transition: all .15s;
}
.sc-toc-link:hover { background: var(--sc-coffee); color: var(--sc-cream); }

/* ── Empty state ──────────────────────────────── */
.sc-empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--sc-muted);
  font-size: var(--sc-fz-base);
}

/* ── Catalog content ──────────────────────────── */
.sc-content { max-width: 1200px; margin: 0 auto; padding: 16px; }

.sc-cat {
  margin-bottom: 32px;
  scroll-margin-top: 200px;
}
.sc-cat-hdr {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
  background: var(--sc-coffee);
  color: var(--sc-cream);
  border-radius: var(--sc-radius);
  position: relative;
}
.sc-cat-hdr::before {
  content: "";
  position: absolute;
  inset-inline-start: 0; top: 50%;
  transform: translateY(-50%);
  width: 4px; height: 60%;
  background: var(--sc-gold);
  border-radius: 0 4px 4px 0;
}
.sc-rtl .sc-cat-hdr::before { border-radius: 4px 0 0 4px; }
.sc-cat-title {
  font-size: clamp(18px, 4vw, var(--sc-fz-xl));
  font-weight: 700;
  padding-inline-start: 8px;
}
.sc-cat-count-lbl {
  font-size: 12px; color: var(--sc-gold-soft);
  font-weight: 500;
}

.sc-products {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

/* ── Product card ─────────────────────────────── */
.sc-product { width: 100%; }
.sc-product-card {
  background: var(--sc-paper);
  border: 1px solid var(--sc-line);
  border-radius: var(--sc-radius);
  box-shadow: var(--sc-shadow-sm);
  transition: box-shadow .2s;
  overflow: hidden;
}
.sc-product-card[open] { box-shadow: var(--sc-shadow-md); border-color: var(--sc-gold-soft); }
.sc-product-card[open] .sc-product-toggle { transform: rotate(180deg); }

.sc-product-summary {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.sc-product-summary::-webkit-details-marker { display: none; }
.sc-product-summary::marker { display: none; content: ''; }

.sc-product-img-wrap {
  width: 56px; height: 56px;
  border-radius: var(--sc-radius-sm);
  overflow: hidden;
  background: var(--sc-ivory);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.sc-product-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.sc-product-img-fallback { font-size: 28px; opacity: .5; }
.sc-product-info {
  min-width: 0;
  display: flex; flex-direction: column; gap: 3px;
}
.sc-product-name {
  font-weight: 600; color: var(--sc-coffee);
  font-size: var(--sc-fz-base); line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.sc-product-name-alt {
  font-size: 12px; color: var(--sc-muted);
  font-weight: 400;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sc-product-price-summary {
  font-size: var(--sc-fz-sm); color: var(--sc-coffee-soft);
  margin-top: 3px;
  display: flex; align-items: baseline; gap: 6px;
  flex-wrap: wrap;
}
.sc-product-price-summary strong {
  color: var(--sc-primary); font-weight: 700;
  font-size: var(--sc-fz-lg);
  font-variant-numeric: tabular-nums;
}
.sc-price-from-lbl {
  font-size: 11px; color: var(--sc-muted);
  text-transform: uppercase; letter-spacing: .08em;
  font-weight: 600;
}
.sc-price-range {
  font-size: 12px; color: var(--sc-muted);
  font-variant-numeric: tabular-nums;
}
.sc-product-toggle {
  width: 32px; height: 32px;
  border-radius: 50%; background: var(--sc-ivory);
  color: var(--sc-coffee);
  display: grid; place-items: center;
  transition: transform .25s ease, background .15s;
}
.sc-product-card:hover .sc-product-toggle { background: var(--sc-gold-soft); }
.sc-product-toggle svg { width: 16px; height: 16px; }

/* ── Variations table ─────────────────────────── */
.sc-variations {
  border-top: 1px solid var(--sc-line);
  padding: 12px 14px 14px;
  background: var(--sc-cream);
}
.sc-var-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--sc-fz-sm);
  background: var(--sc-paper);
  border-radius: var(--sc-radius-sm);
  overflow: hidden;
  box-shadow: var(--sc-shadow-sm);
}
.sc-var-table thead {
  background: var(--sc-ivory);
}
.sc-var-table th {
  padding: 10px 12px;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--sc-coffee-soft);
  text-align: start;
}
.sc-var-table td {
  padding: 10px 12px;
  border-top: 1px solid var(--sc-line);
  color: var(--sc-coffee);
  font-variant-numeric: tabular-nums;
}
.sc-var-format { font-weight: 500; }
.sc-var-sku { color: var(--sc-muted); font-size: 12px; font-family: ui-monospace, 'SF Mono', Consolas, monospace; }
.sc-var-price { text-align: end; }
.sc-var-price strong {
  color: var(--sc-primary); font-weight: 700;
  font-size: var(--sc-fz-base);
}
.sc-var-table tbody tr:hover { background: var(--sc-cream); }

.sc-var-actions {
  display: flex; justify-content: flex-end;
  margin-top: 12px;
}

/* ── Empty cat ────────────────────────────────── */
.sc-cat[data-sc-cat-empty] { display: none; }

/* ── Footer ──────────────────────────────────── */
.sc-footer {
  text-align: center;
  padding: 32px 20px 100px;
  color: var(--sc-muted);
  font-size: var(--sc-fz-sm);
}
.sc-top-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--sc-primary);
  font-weight: 600;
}

/* ── Floating WhatsApp ───────────────────────── */
.sc-fab-wa {
  position: fixed;
  bottom: 20px;
  inset-inline-end: 20px;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--sc-success);
  color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(37,211,102,.50);
  z-index: 100;
  transition: transform .2s ease, box-shadow .2s ease;
  padding-bottom: env(safe-area-inset-bottom);
}
.sc-fab-wa:hover { transform: scale(1.08); box-shadow: 0 12px 28px rgba(37,211,102,.60); }
.sc-fab-wa svg { width: 28px; height: 28px; }

/* ── Responsive (≥640px) ──────────────────────── */
@media (min-width: 640px) {
  .sc-products { grid-template-columns: repeat(2, 1fr); }
  .sc-product-summary { grid-template-columns: 64px 1fr auto; padding: 14px 16px; }
  .sc-product-img-wrap { width: 64px; height: 64px; }
}
@media (min-width: 1024px) {
  .sc-products { grid-template-columns: repeat(3, 1fr); }
}

/* ── Print stylesheet ─────────────────────────── */
@media print {
  body { background: #fff !important; }
  .sc-hdr, .sc-filters, .sc-toc, .sc-fab-wa, .sc-footer, .sc-product-toggle, .sc-var-actions, .sc-reset, .sc-actions-right { display: none !important; }
  .sc-catalog { background: #fff; font-size: 11pt; }
  .sc-content { padding: 0; }
  .sc-cat { page-break-inside: avoid; margin-bottom: 16pt; }
  .sc-cat-hdr { background: #2A1E18 !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sc-products { display: block !important; }
  .sc-product { page-break-inside: avoid; margin-bottom: 6pt; }
  .sc-product-card { box-shadow: none !important; border-color: #ccc !important; }
  /* Force open all details */
  .sc-product-card[open] .sc-variations { display: block !important; }
  .sc-product-card:not([open]) .sc-variations { display: block !important; }
  .sc-var-table { box-shadow: none !important; }
}

/* ── Reduced motion ───────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .sc-catalog * { animation: none !important; transition: none !important; }
}
