:root {
  --bg: #FAF7F2;
  --surface: #FFFFFF;
  --sand: #F1EAE0;
  --ink: #16241C;
  --primary: #1B3B2B;
  --accent: #C26D4F;
  --sage: #6E8575;
  --muted: #5C6860;
  --border: #E5DDD1;
  --btn-ink: #FFFFFF;
  --hero-grad: linear-gradient(135deg, #FAF7F2 0%, #EFE6D9 100%);
  --shadow-soft: 0 10px 28px rgba(27, 59, 43, 0.07);
  --shadow-card: 0 18px 40px rgba(27, 59, 43, 0.11);
  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-sans: "DM Sans", system-ui, -apple-system, sans-serif;
  --font-ar: "IBM Plex Sans Arabic", "DM Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

html[data-style="midnight"] {
  --bg: #101713;
  --surface: #17211C;
  --sand: #1F2B24;
  --ink: #F3EFE8;
  --primary: #C9A96E;
  --accent: #D48464;
  --sage: #8BA895;
  --muted: #A3B0A8;
  --border: #2A3931;
  --btn-ink: #101713;
  --hero-grad: linear-gradient(135deg, #101713 0%, #1A2620 100%);
  --shadow-soft: 0 12px 30px rgba(0, 0, 0, 0.35);
  --shadow-card: 0 20px 44px rgba(0, 0, 0, 0.45);
}

html[data-style="rose"] {
  --bg: #FBF5F3;
  --surface: #FFFFFF;
  --sand: #F3E6E2;
  --ink: #2E1C20;
  --primary: #5E2B35;
  --accent: #B86B68;
  --sage: #8E7578;
  --muted: #6E5A5E;
  --border: #E8D7D3;
  --btn-ink: #FFFFFF;
  --hero-grad: linear-gradient(135deg, #FBF5F3 0%, #F2E2DE 100%);
  --shadow-soft: 0 10px 28px rgba(94, 43, 53, 0.08);
  --shadow-card: 0 18px 40px rgba(94, 43, 53, 0.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  transition: background 220ms ease, color 220ms ease;
}
html[dir="rtl"] body { font-family: var(--font-ar); }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }

.sf-container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 20px; }

/* Preview Utility Bar */
.sf-preview-bar {
  background: var(--primary);
  color: var(--btn-ink);
  font-size: 12px;
  padding: 8px 0;
}
.sf-preview-bar__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.sf-preview-note {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 600; opacity: 0.95;
}
.sf-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: inline-block; flex-shrink: 0; }
.sf-style-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sf-style-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700;
  border: 1px solid color-mix(in srgb, var(--btn-ink) 32%, transparent);
  color: var(--btn-ink); background: transparent; transition: 160ms ease;
}
.sf-style-btn.is-active {
  background: var(--btn-ink); color: var(--primary); border-color: var(--btn-ink);
}
.sf-swatch { width: 9px; height: 9px; border-radius: 50%; border: 1px solid rgba(128,128,128,0.4); display: inline-block; }

/* Header */
.sf-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.sf-header__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; height: 68px;
}
.sf-brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-serif); font-size: 26px; font-weight: 700; letter-spacing: 0.08em;
}
html[dir="rtl"] .sf-brand { font-family: var(--font-ar); letter-spacing: 0; font-size: 22px; }
.sf-brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--primary); color: var(--btn-ink);
  display: grid; place-items: center; font-family: var(--font-serif); font-size: 17px; font-weight: 700;
}
.sf-nav { display: flex; align-items: center; gap: 22px; font-size: 14px; font-weight: 500; color: var(--muted); }
.sf-nav a:hover { color: var(--ink); }
.sf-header-actions { display: flex; align-items: center; gap: 8px; }
.sf-btn-ghost {
  height: 38px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px;
  transition: 160ms ease;
}
.sf-btn-ghost:hover { border-color: var(--primary); }
.sf-bag-btn {
  height: 38px; padding: 0 14px; border-radius: 999px;
  background: var(--primary); color: var(--btn-ink);
  font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 7px;
  transition: 160ms ease;
}
.sf-bag-btn:hover { opacity: 0.92; }
.sf-bag-count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
  display: inline-grid; place-items: center;
}
.sf-menu-toggle { display: none; }

/* Buttons & Pills */
.sf-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  background: var(--sand); border: 1px solid var(--border);
  color: var(--accent); font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
}
html[dir="rtl"] .sf-pill { font-family: var(--font-ar); letter-spacing: 0; text-transform: none; font-size: 12px; }
.sf-btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 26px; border-radius: 999px;
  background: var(--primary); color: var(--btn-ink);
  font-size: 14px; font-weight: 700; transition: 180ms ease;
}
.sf-btn-primary:hover { background: var(--accent); color: #fff; }
.sf-btn-outline {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: 999px;
  border: 1.5px solid var(--primary); color: var(--ink); background: transparent;
  font-size: 14px; font-weight: 700; transition: 180ms ease;
}
.sf-btn-outline:hover { background: var(--sand); }

/* Hero */
.sf-hero {
  background: var(--hero-grad);
  padding: 58px 0 68px;
  border-bottom: 1px solid var(--border);
}
.sf-hero__grid {
  display: grid; grid-template-columns: 1.02fr 0.98fr; gap: 46px; align-items: center;
}
.sf-hero h1 {
  margin-top: 18px;
  font-family: var(--font-serif); font-size: clamp(38px, 5vw, 62px);
  font-weight: 700; line-height: 1.07; letter-spacing: -0.015em;
}
html[dir="rtl"] .sf-hero h1 { font-family: var(--font-ar); line-height: 1.24; letter-spacing: 0; font-size: clamp(32px, 4.4vw, 52px); }
.sf-hero p { margin-top: 18px; color: var(--muted); font-size: 17px; max-width: 540px; }
.sf-hero__actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; }
.sf-hero__meta {
  margin-top: 28px; display: flex; flex-wrap: wrap; gap: 18px;
  font-size: 12px; font-weight: 600; color: var(--muted);
}
.sf-hero-media {
  border-radius: 26px; overflow: hidden; border: 1px solid var(--border);
  box-shadow: var(--shadow-card); background: var(--sand);
  aspect-ratio: 6 / 5;
}
.sf-hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: 86% 52%; }

/* Trust Bar */
.sf-trust {
  background: var(--surface); border-bottom: 1px solid var(--border); padding: 26px 0;
}
.sf-trust__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.sf-trust__item { text-align: center; padding: 6px 10px; }
.sf-trust__title { font-weight: 700; font-size: 14px; color: var(--ink); }
.sf-trust__sub { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* Sections */
.sf-section { padding: 72px 0; }
.sf-section--sand { background: var(--sand); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.sf-section-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 30px;
}
.sf-section-head h2 {
  margin-top: 10px;
  font-family: var(--font-serif); font-size: clamp(30px, 3.6vw, 44px); font-weight: 700; line-height: 1.15;
}
html[dir="rtl"] .sf-section-head h2 { font-family: var(--font-ar); font-size: clamp(26px, 3.2vw, 38px); }
.sf-section-head p { color: var(--muted); font-size: 15px; max-width: 560px; margin-top: 6px; }

/* Filter Bar & Product Grid */
.sf-filters {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-bottom: 26px; padding: 14px 16px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--border);
}
.sf-filter-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.sf-chip {
  padding: 7px 14px; border-radius: 999px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--border); background: var(--bg); color: var(--muted); transition: 150ms ease;
}
.sf-chip.is-active, .sf-chip:hover {
  background: var(--primary); color: var(--btn-ink); border-color: var(--primary);
}
.sf-filter-selects { display: flex; gap: 8px; flex-wrap: wrap; }
.sf-select {
  padding: 7px 12px; border-radius: 10px; font-size: 12px; font-weight: 600;
  background: var(--bg); color: var(--ink); border: 1px solid var(--border);
}
.sf-products-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px;
}
.sf-product-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  padding: 14px; display: flex; flex-direction: column; justify-content: space-between;
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}
.sf-product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); border-color: var(--accent); }
.sf-product-img-wrap {
  position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 9 / 11; background: var(--sand);
}
.sf-product-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 350ms ease; }
.sf-product-card:hover .sf-product-img-wrap img { transform: scale(1.03); }
.sf-badge {
  position: absolute; top: 10px; inset-inline-start: 10px;
  padding: 4px 10px; border-radius: 999px; font-size: 10px; font-weight: 700;
  background: var(--accent); color: #fff; letter-spacing: 0.05em; text-transform: uppercase;
}
.sf-vol-badge {
  position: absolute; bottom: 10px; inset-inline-end: 10px;
  padding: 3px 9px; border-radius: 999px; font-size: 10px; font-weight: 700;
  background: color-mix(in srgb, var(--surface) 90%, transparent); color: var(--ink);
  border: 1px solid var(--border); font-family: var(--font-mono);
}
.sf-product-meta { padding: 14px 4px 6px; }
.sf-product-cat { font-size: 11px; font-weight: 700; color: var(--sage); text-transform: uppercase; letter-spacing: 0.06em; }
html[dir="rtl"] .sf-product-cat { letter-spacing: 0; text-transform: none; }
.sf-product-title {
  margin-top: 4px; font-family: var(--font-serif); font-size: 21px; font-weight: 700; line-height: 1.22;
}
html[dir="rtl"] .sf-product-title { font-family: var(--font-ar); font-size: 17px; }
.sf-product-short { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.sf-price-row { margin-top: 10px; display: flex; align-items: baseline; gap: 8px; }
.sf-price { font-size: 17px; font-weight: 800; color: var(--primary); direction: ltr; unicode-bidi: isolate; }
.sf-price-old { font-size: 13px; color: var(--muted); text-decoration: line-through; direction: ltr; unicode-bidi: isolate; }
.sf-card-actions { margin-top: 12px; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.sf-add-btn {
  padding: 10px 14px; border-radius: 999px; background: var(--primary); color: var(--btn-ink);
  font-size: 12px; font-weight: 700; transition: 160ms ease;
}
.sf-add-btn:hover { background: var(--accent); color: #fff; }
.sf-qv-btn {
  padding: 10px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg);
  font-size: 12px; font-weight: 700; color: var(--ink);
}
.sf-qv-btn:hover { border-color: var(--primary); }

/* 3-Step Ritual Bundle Builder */
.sf-ritual-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: center;
}
.sf-ritual-img {
  border-radius: 24px; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-card);
}
.sf-ritual-list { margin-top: 22px; display: flex; flex-direction: column; gap: 12px; }
.sf-ritual-step {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 16px; border-radius: 16px;
  background: var(--surface); border: 1.5px solid var(--border);
  transition: 160ms ease; cursor: pointer;
}
.sf-ritual-step.is-checked { border-color: var(--primary); box-shadow: var(--shadow-soft); }
.sf-ritual-left { display: flex; align-items: center; gap: 12px; }
.sf-ritual-step input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); flex-shrink: 0; }
.sf-ritual-summary {
  margin-top: 20px; padding: 18px 20px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.sf-bundle-prices { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sf-bundle-total { font-size: 24px; font-weight: 800; color: var(--primary); direction: ltr; unicode-bidi: isolate; }
.sf-save-badge {
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent);
}

/* Ingredient Glossary & Architecture Cards */
.sf-cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.sf-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 24px;
  transition: 180ms ease;
}
.sf-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.sf-card-eyebrow { font-family: var(--font-mono); font-size: 11px; font-weight: 700; color: var(--accent); }
.sf-card h3 { margin-top: 8px; font-family: var(--font-serif); font-size: 24px; font-weight: 700; }
html[dir="rtl"] .sf-card h3 { font-family: var(--font-ar); font-size: 19px; }
.sf-card p { margin-top: 8px; font-size: 13.5px; color: var(--muted); }
.sf-inci-tag {
  margin-top: 12px; display: inline-block; font-family: var(--font-mono); font-size: 11px;
  padding: 4px 9px; border-radius: 8px; background: var(--sand); color: var(--ink);
  direction: ltr; unicode-bidi: isolate;
}

/* FAQ Accordion */
.sf-faq-list { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.sf-faq-list details {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px 20px;
}
.sf-faq-list details[open] { border-color: var(--primary); }
.sf-faq-list summary {
  cursor: pointer; font-weight: 700; font-size: 15px; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.sf-faq-list summary::after { content: "+"; font-size: 20px; color: var(--accent); line-height: 1; }
.sf-faq-list details[open] summary::after { content: "\2212"; }
.sf-faq-list details p { margin-top: 10px; font-size: 14px; color: var(--muted); }

/* Architecture File Inspector */
.sf-arch-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 28px;
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 28px; align-items: start;
}
.sf-tree {
  background: #121A16; color: #D8E4DD; border-radius: 14px; padding: 18px;
  font-family: var(--font-mono); font-size: 12px; line-height: 1.65; overflow-x: auto;
  direction: ltr; text-align: left;
}
.sf-spec-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.sf-spec-card { background: var(--bg); border: 1px solid var(--border); border-radius: 14px; padding: 14px; }
.sf-spec-num { font-family: var(--font-serif); font-size: 28px; font-weight: 700; color: var(--primary); line-height: 1.1; }
.sf-spec-lbl { font-size: 12px; color: var(--muted); margin-top: 4px; font-weight: 600; }

/* Footer */
.sf-footer {
  background: var(--sand); border-top: 1px solid var(--border); padding: 48px 0 32px;
  font-size: 13px; color: var(--muted);
}
.sf-footer__inner { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: center; }
.sf-footer-links { display: flex; flex-wrap: wrap; gap: 18px; font-weight: 600; }
.sf-footer-links a:hover { color: var(--primary); }

/* Slide-out Mini-Cart Drawer (Right in LTR, Left x=0 in RTL) */
.sf-backdrop {
  position: fixed; inset: 0; background: rgba(16, 23, 19, 0.55); z-index: 80;
  opacity: 0; pointer-events: none; transition: opacity 220ms ease;
}
.sf-backdrop.is-open { opacity: 1; pointer-events: auto; }
.sf-drawer {
  position: fixed; top: 0; bottom: 0; right: 0; width: min(420px, 100vw);
  background: var(--surface); color: var(--ink); z-index: 90;
  border-inline-start: 1px solid var(--border);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 250ms cubic-bezier(0.22, 1, 0.36, 1);
}
html[dir="rtl"] .sf-drawer { right: auto; left: 0; transform: translateX(-100%); }
.sf-drawer.is-open,
html[dir="rtl"] .sf-drawer.is-open { transform: translateX(0); }
.sf-drawer__head {
  padding: 18px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.sf-drawer__head h3 { font-family: var(--font-serif); font-size: 24px; font-weight: 700; }
html[dir="rtl"] .sf-drawer__head h3 { font-family: var(--font-ar); font-size: 20px; }
.sf-ship-bar { padding: 14px 20px; background: var(--sand); border-bottom: 1px solid var(--border); font-size: 12.5px; font-weight: 600; }
.sf-ship-track { height: 6px; border-radius: 999px; background: var(--border); margin-top: 8px; overflow: hidden; }
.sf-ship-fill { height: 100%; background: var(--primary); transition: width 240ms ease; }
.sf-drawer__body { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.sf-cart-item {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center;
  padding-bottom: 14px; border-bottom: 1px solid var(--border);
}
.sf-cart-item img { width: 64px; height: 76px; object-fit: cover; border-radius: 10px; }
.sf-qty { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; margin-top: 6px; }
.sf-qty button { width: 26px; height: 26px; font-weight: 700; }
.sf-qty span { min-width: 24px; text-align: center; font-size: 12px; font-weight: 700; }
.sf-drawer__foot { padding: 18px 20px; border-top: 1px solid var(--border); background: var(--bg); }
.sf-subtotal-row { display: flex; justify-content: space-between; font-size: 16px; font-weight: 800; margin-bottom: 12px; }

/* Quick View Modal */
.sf-modal {
  position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity 200ms ease;
}
.sf-modal.is-open { opacity: 1; pointer-events: auto; }
.sf-modal__card {
  width: min(760px, 100%); max-height: 90vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 24px;
  box-shadow: var(--shadow-card); display: grid; grid-template-columns: 0.92fr 1.08fr; position: relative;
}
.sf-modal__media { background: var(--sand); }
.sf-modal__media img { width: 100%; height: 100%; object-fit: cover; }
.sf-modal__body { padding: 26px; display: flex; flex-direction: column; justify-content: space-between; gap: 14px; }
.sf-modal__close {
  position: absolute; top: 14px; inset-inline-end: 14px; width: 34px; height: 34px;
  border-radius: 50%; background: var(--surface); border: 1px solid var(--border); font-weight: 700;
}
.sf-size-row { display: flex; gap: 8px; margin-top: 10px; }
.sf-size-btn {
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border); font-size: 12px; font-weight: 700;
}
.sf-size-btn.is-active { background: var(--primary); color: var(--btn-ink); border-color: var(--primary); }
.sf-inci-box {
  margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--bg);
  border-inline-start: 3px solid var(--accent); font-size: 12px; color: var(--muted);
}

/* Top Toast (Never overlaps drawer checkout button!) */
.sf-toast {
  position: fixed; top: 84px; left: 50%; transform: translate(-50%, -14px);
  background: var(--primary); color: var(--btn-ink);
  padding: 10px 18px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  box-shadow: var(--shadow-card); z-index: 100; opacity: 0; pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease; white-space: nowrap; max-width: 92vw; overflow: hidden; text-overflow: ellipsis;
}
.sf-toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* Responsive */
@media (max-width: 1024px) {
  .sf-products-grid { grid-template-columns: repeat(2, 1fr); }
  .sf-hero__grid, .sf-ritual-grid, .sf-arch-box { grid-template-columns: 1fr; }
  .sf-cards-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .sf-nav { display: none; }
  .sf-menu-toggle { display: inline-flex; }
  .sf-trust__grid { grid-template-columns: repeat(2, 1fr); }
  .sf-products-grid, .sf-cards-3, .sf-modal__card { grid-template-columns: 1fr; }
  .sf-preview-bar__inner { justify-content: center; text-align: center; }
  .sf-hero { padding: 36px 0 44px; }
  .sf-section { padding: 50px 0; }
}
