/* ═══════════════════════════════════════════════════════════
   Torvali — Public Storefront Styles
   (accent color is set via CSS variable --accent by JS)
   ═══════════════════════════════════════════════════════════ */

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

:root {
  --accent: #4F46E5;
  --accent-dark: #3730A3;
  --text: #111827;
  --text-muted: #6B7280;
  --border: #E5E7EB;
  --surface: #F9FAFB;
  --white: #FFFFFF;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.07), 0 4px 12px rgba(0,0,0,.05);
}

html { scroll-behavior: smooth; }

html.overlay-lock,
body.overlay-lock {
  overflow: hidden;
}

body {
  font-family: var(--font, 'Inter', system-ui, -apple-system, sans-serif);
  color: var(--text); background: var(--white);
  -webkit-font-smoothing: antialiased;
}

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

/* ─── Storefront nav ────────────────────────────────────── */
.sf-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.95); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.sf-nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  height: 64px; display: flex; align-items: center; gap: 24px;
}
.sf-logo { font-size: 1.2rem; font-weight: 800; color: var(--accent); flex-shrink: 0; }
.sf-logo img { height: 36px; width: auto; }
.sf-search { flex: 1; max-width: 440px; }
.sf-search-input {
  width: 100%; padding: 9px 14px 9px 36px;
  border: 1.5px solid var(--border); border-radius: 8px;
  font-size: .9rem; background: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236B7280' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.867-3.834zm-5.242 1.656a5.5 5.5 0 1 1 0-11 5.5 5.5 0 0 1 0 11z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 10px center;
}
.sf-search-input:focus { outline: none; border-color: var(--accent); background-color: #fff; }

.sf-nav-right { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.sf-account-btn {
  display: flex; align-items: center; gap: 4px; background: none; border: 1.5px solid var(--border);
  border-radius: 20px; cursor: pointer; padding: 6px 12px; color: var(--text); transition: border-color .15s, background .15s;
}
.sf-account-btn:hover { border-color: var(--accent); background: var(--surface); }
.sf-cart-btn {
  position: relative; background: none; border: none; cursor: pointer; padding: 4px;
  font-size: 1.3rem;
}
.sf-cart-count {
  position: absolute; top: -4px; right: -4px;
  background: var(--accent); color: #fff;
  width: 18px; height: 18px; border-radius: 50%; font-size: .65rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* ─── Announcement bar ──────────────────────────────────── */
.sf-announcement {
  background: var(--accent); color: #fff;
  text-align: center; padding: 10px 24px; font-size: .875rem; font-weight: 500;
}

/* ─── Hero ──────────────────────────────────────────────── */
.sf-hero {
  position: relative; overflow: hidden;
  min-height: 480px; display: flex; align-items: center;
  z-index: 0; /* keep below fixed elements */
  isolation: isolate;
}
.sf-hero-bg { position: absolute; inset: 0; z-index: 1; background: linear-gradient(135deg, var(--accent) 0%, #1E1B4B 100%); }
.sf-hero-img { position: absolute; inset: 0; z-index: 0; object-fit: cover; width: 100%; height: 100%; opacity: 1; }
.sf-hero-content { position: relative; z-index: 2; }
/* When a background image is set, replace gradient with a dark translucent overlay */
.sf-hero.has-bg-img .sf-hero-bg { background: rgba(0, 0, 0, 0.48); }
.sf-hero-content { max-width: 1200px; margin: 0 auto; padding: 80px 24px; }
.sf-hero-eyebrow { font-size: .875rem; font-weight: 600; color: rgba(255,255,255,.75); margin-bottom: 12px; }
.sf-hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; color: #fff; line-height: 1.15; margin-bottom: 16px; }
.sf-hero-desc { font-size: 1.1rem; color: rgba(255,255,255,.8); max-width: 520px; margin-bottom: 32px; line-height: 1.7; }
.sf-hero-btn { display: inline-block; background: #fff; color: var(--accent); padding: 14px 28px; border-radius: 8px; font-weight: 700; font-size: 1rem; }
.sf-hero-btn:hover { background: #F3F4F6; }

/* ─── Category bar ──────────────────────────────────────── */
.sf-cats { border-bottom: 2px solid var(--border); background: #fff; }
.sf-cats-inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; display: flex; gap: 4px; overflow-x: auto; overflow-y: visible; }
.sf-cat-btn {
  padding: 14px 16px; font-size: .875rem; font-weight: 500;
  color: var(--text-muted); border: none; background: none; cursor: pointer;
  border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap;
}
.sf-cat-btn:hover { color: var(--text); }
.sf-cat-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ─── Product grid ──────────────────────────────────────── */
.sf-shop { max-width: 1200px; margin: 0 auto; padding: 40px 24px; }
.sf-shop-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.sf-shop-header h2 { font-size: 1.25rem; font-weight: 700; }
.sf-sort { padding: 8px 12px; border: 1.5px solid var(--border); border-radius: 8px; font-size: .875rem; background: #fff; }

.sf-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px; }

.sf-product-card {
  background: #fff; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border); transition: box-shadow .15s, transform .15s;
  cursor: pointer;
}
.sf-product-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

.sf-product-img { aspect-ratio: 1; overflow: hidden; background: var(--surface); }
.sf-product-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.sf-product-card:hover .sf-product-img img { transform: scale(1.04); }

.sf-product-info { padding: 14px; }
.sf-product-brand { font-size: .75rem; color: var(--text-muted); font-weight: 500; margin-bottom: 2px; text-transform: uppercase; letter-spacing: .04em; }
.sf-product-name { font-size: .9rem; font-weight: 600; line-height: 1.4; margin-bottom: 6px; }
.sf-product-price { display: flex; align-items: center; gap: 8px; }
.sf-price { font-size: 1rem; font-weight: 700; color: var(--text); }
.sf-compare-price { font-size: .85rem; color: var(--text-muted); text-decoration: line-through; }
.sf-discount-badge { background: #FEE2E2; color: #B91C1C; font-size: .72rem; font-weight: 700; padding: 2px 7px; border-radius: 4px; }

.sf-rating { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.sf-stars { color: #F59E0B; font-size: .85rem; }
.sf-rating-count { font-size: .78rem; color: var(--text-muted); }

/* ─── Load more ─────────────────────────────────────────── */
.sf-load-more { text-align: center; padding: 32px 0; }
.sf-load-more .btn { background: none; border: 1.5px solid var(--border); color: var(--text); padding: 10px 32px; border-radius: 8px; font-size: .9rem; cursor: pointer; }
.sf-load-more .btn:hover { background: var(--surface); }

/* ─── Featured section ──────────────────────────────────── */
.sf-featured { background: var(--surface); padding: 60px 24px; }
.sf-featured .container { max-width: 1200px; margin: 0 auto; }
.sf-section-title { font-size: 1.4rem; font-weight: 800; margin-bottom: 24px; }

/* ─── Footer ─────────────────────────────────────────────── */
.sf-footer { background: var(--text); color: rgba(255,255,255,.8); padding: 60px 24px 32px; }
.sf-footer-inner { max-width: 1200px; margin: 0 auto; }
.sf-footer-grid { display: flex; flex-wrap: wrap; gap: 40px; margin-bottom: 40px; }
.sf-footer-grid > :first-child { flex: 2 1 200px; }
.sf-footer-grid > :not(:first-child) { flex: 1 1 140px; }
.sf-footer-brand .sf-footer-name { font-size: 1.2rem; font-weight: 800; color: #fff; margin-bottom: 8px; }
.sf-footer-brand p { font-size: .875rem; line-height: 1.7; }
.sf-footer-col h4 { font-size: .875rem; font-weight: 700; color: #fff; margin-bottom: 12px; }
.sf-footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.sf-footer-col ul li a { font-size: .875rem; color: rgba(255,255,255,.6); }
.sf-footer-col ul li a:hover { color: #fff; }
.sf-footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 20px; font-size: .8rem; }

/* ─── Cart sidebar ─────────────────────────────────────── */
.cart-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 300; display: none; }
.cart-overlay.open { display: block; }
.cart-sidebar {
  position: fixed; top: 0; right: 0; bottom: 0; width: 380px; max-width: 100vw;
  background: #fff; z-index: 301; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .25s ease;
  overscroll-behavior: contain;
}
.cart-sidebar.open { transform: none; }
.cart-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.cart-header h3 { font-weight: 700; }
.cart-close { background: none; border: none; cursor: pointer; font-size: 1.4rem; color: var(--text-muted); }
.cart-items { flex: 1; overflow-y: auto; padding: 16px 24px; display: flex; flex-direction: column; gap: 14px; }
.cart-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: start; }
.cart-item-img { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; background: var(--surface); }
.cart-item-name { font-size: .875rem; font-weight: 600; }
.cart-item-variant { font-size: .78rem; color: var(--text-muted); }
.cart-item-price { font-size: .875rem; font-weight: 700; }
.cart-item-qty { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.cart-qty-btn { width: 24px; height: 24px; border-radius: 4px; border: 1px solid var(--border); background: none; cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center; }
.cart-qty-num { font-size: .875rem; font-weight: 600; min-width: 20px; text-align: center; }

.cart-footer { padding: 20px 24px; border-top: 1px solid var(--border); }
.cart-subtotal { display: flex; justify-content: space-between; font-size: .9rem; margin-bottom: 6px; }
.cart-total { display: flex; justify-content: space-between; font-size: 1.05rem; font-weight: 700; margin-bottom: 16px; }
.cart-checkout-btn { width: 100%; padding: 14px; background: var(--accent); color: #fff; border: none; border-radius: 8px; font-size: 1rem; font-weight: 700; cursor: pointer; }
.cart-checkout-btn:hover { filter: brightness(1.1); }

/* ─── Checkout modal ─────────────────────────────────────── */
.checkout-modal-inner {
  background: #fff; border-radius: 20px; padding: 32px;
  max-width: 500px; width: 95%; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.checkout-modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1.5px solid var(--border);
}
.checkout-modal-header h3 { font-size: 1.15rem; font-weight: 800; }
.checkout-modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 1.3rem; color: var(--text-muted); line-height: 1;
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  transition: background .1s, color .1s;
}
.checkout-modal-close:hover { background: var(--surface); color: var(--text); }

/* ─── Shared form styles (checkout + any modal) ──────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
  font-size: .78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted);
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%; box-sizing: border-box;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: .9rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: #9CA3AF; }
.form-group textarea { resize: vertical; min-height: 80px; line-height: 1.6; }

.btn-primary, .btn.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 24px; background: var(--accent); color: #fff;
  border: none; border-radius: 10px; font-size: .95rem; font-weight: 700;
  cursor: pointer; transition: filter .15s;
}
.btn-primary:hover, .btn.btn-primary:hover { filter: brightness(1.07); }
.btn-primary:disabled, .btn.btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-outline {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 24px; background: transparent; color: var(--text);
  border: 1.5px solid var(--border); border-radius: 10px; font-size: .95rem; font-weight: 700;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.btn-outline:hover { border-color: var(--accent); background: var(--surface); }

.alert-error-sf {
  display: flex; align-items: flex-start; gap: 10px;
  background: #FEF2F2; border: 1.5px solid #F87171;
  border-left: 5px solid #DC2626; color: #991B1B;
  border-radius: 10px; padding: 12px 14px;
  font-size: .875rem; font-weight: 600; margin-bottom: 16px; line-height: 1.5;
}
.alert-error-sf::before { content: '⚠'; flex-shrink: 0; }

/* ─── Customer Auth Modal ─────────────────────────────────── */
.auth-overlay {
  position: fixed; inset: 0; z-index: 500;
  display: none; align-items: center; justify-content: center; padding: 16px;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.auth-card {
  background: var(--white, #fff);
  border-radius: 24px;
  width: 100%; max-width: 440px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,.18);
  position: relative;
  animation: authSlideUp .22s ease;
}
@keyframes authSlideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.auth-card-header {
  background: var(--accent);
  border-radius: 24px 24px 0 0;
  padding: 22px 28px;
  position: relative;
  overflow: hidden;
}
.auth-card-header::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.12) 0%, transparent 60%);
  pointer-events: none;
}
.auth-card-header-logo {
  font-size: 1rem; font-weight: 800; color: rgba(255,255,255,.9);
  margin-bottom: 16px; display: block;
}
.auth-card-header-logo img { height: 32px; width: auto; filter: brightness(0) invert(1); opacity: .9; }
.auth-tabs {
  display: flex; gap: 4px;
  background: #f1f5f9;
  border-radius: 12px; padding: 4px;
  margin-bottom: 24px;
}
.auth-tab {
  flex: 1; padding: 9px 20px; border: none; border-radius: 9px; cursor: pointer;
  font-size: .85rem; font-weight: 700; transition: all .15s;
  background: none; color: #64748b; font-family: inherit;
}
.auth-tab:hover { color: #1e293b; }
.auth-tab.active {
  background: #fff; color: var(--accent);
  box-shadow: 0 1px 6px rgba(0,0,0,.10);
}
.auth-card-body { padding: 28px; }
.auth-field { margin-bottom: 16px; }
.auth-field label {
  display: block; font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-muted); margin-bottom: 6px;
}
.auth-input-wrap { position: relative; }
.auth-input-wrap svg {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none; flex-shrink: 0;
}
.auth-input-wrap input {
  width: 100%; padding: 11px 14px 11px 40px;
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: .9rem; background: var(--surface);
  transition: border-color .15s, background .15s, box-shadow .15s;
  box-sizing: border-box;
}
.auth-input-wrap input:focus {
  outline: none; border-color: var(--accent);
  background: var(--white, #fff);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}
.auth-totp-wrap { position: relative; }
.auth-totp-input {
  width: 100%; padding: 13px; border: 2px solid var(--border); border-radius: 10px;
  font-size: 1.5rem; font-weight: 700; letter-spacing: .3em; text-align: center;
  background: var(--surface); box-sizing: border-box; transition: border-color .15s;
}
.auth-totp-input:focus { outline: none; border-color: var(--accent); background: var(--white,#fff); }
.auth-totp-hint {
  font-size: .75rem; color: var(--text-muted); text-align: center; margin-top: 6px;
}
.auth-submit {
  width: 100%; padding: 13px;
  background: var(--accent); color: #fff;
  border: none; border-radius: 12px;
  font-size: .95rem; font-weight: 700; cursor: pointer;
  transition: filter .15s, transform .1s;
  margin-top: 4px;
}
.auth-submit:hover  { filter: brightness(1.08); }
.auth-submit:active { transform: scale(.98); }
.auth-submit:disabled { opacity: .55; cursor: not-allowed; }
.auth-divider {
  display: flex; align-items: center; gap: 12px; margin: 20px 0;
  color: var(--text-muted); font-size: .75rem;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.auth-switch {
  text-align: center; font-size: .82rem; color: var(--text-muted);
}
.auth-switch a { color: var(--accent); font-weight: 700; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }
.auth-terms-wrap {
  display: none;
  background: var(--surface); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 16px;
  border: 1.5px solid var(--border);
}
.auth-terms-wrap label {
  display: flex; align-items: flex-start; gap: 10px;
  cursor: pointer; font-size: .8rem; color: var(--text-muted); line-height: 1.5;
  text-transform: none; letter-spacing: 0; font-weight: 500;
}
.auth-terms-wrap input[type="checkbox"] {
  margin-top: 1px; flex-shrink: 0;
  accent-color: var(--accent); width: 15px; height: 15px;
}
.auth-close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,.2); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1rem; transition: background .15s;
}
.auth-close:hover { background: rgba(255,255,255,.35); }

/* ─── Mobile bottom navigation ──────────────────────────── */
.sf-mobile-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999;
  background: var(--white, #fff);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 24px rgba(0,0,0,.09);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  /* Force own compositing layer so it always paints on top */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: transform;
}
/* Hide bottom nav on desktop */
@media (min-width: 769px) {
  .sf-mobile-nav { display: none !important; }
  body { padding-bottom: 0 !important; }
}
.sf-mobile-nav-inner {
  display: flex; height: 60px;
}
.sf-mobile-nav-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; border: none; background: none;
  cursor: pointer; color: var(--text-muted); font-size: .58rem; font-weight: 600;
  letter-spacing: .02em; transition: color .15s; position: relative;
  -webkit-tap-highlight-color: transparent;
}
.sf-mobile-nav-btn svg { width: 22px; height: 22px; stroke-width: 1.8; }
.sf-mobile-nav-btn.active { color: var(--accent); }
.sf-mobile-cart-badge {
  position: absolute; top: 7px; left: calc(50% + 4px);
  background: var(--accent); color: #fff;
  width: 16px; height: 16px; border-radius: 50%;
  font-size: .55rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--white, #fff);
}

/* ─── Cart toast (mobile add-to-cart notification) ───────── */
#cartToast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1a1a1a;
  color: #fff;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  transition: opacity .2s, transform .2s;
}
#cartToast.cart-toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
#cartToast.cart-toast-hide {
  opacity: 0;
  transform: translateX(-50%) translateY(20px);
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .sf-footer-grid { flex-direction: column; gap: 24px; }
  .sf-footer-grid > :first-child,
  .sf-footer-grid > :not(:first-child) { flex: 1 1 auto; }
  .sf-footer { padding: 40px 16px 24px; }

  /* ── Sidebar / compact layouts: stack sidebar above products on mobile ── */
  body.layout-sidebar .sf-body-wrap,
  body.layout-compact .sf-body-wrap {
    grid-template-columns: 1fr !important;
  }
  body.layout-sidebar .sf-sidebar,
  body.layout-compact .sf-sidebar {
    position: static !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    margin: 8px 12px 0 !important;
    padding: 12px 16px !important;
    overflow: visible !important;
  }
  body.layout-sidebar .sf-sidebar-cats,
  body.layout-compact .sf-sidebar-cats {
    flex-direction: row !important;
    flex-wrap: wrap;
    gap: 6px !important;
  }
  body.layout-sidebar .sf-sidebar-cat-btn,
  body.layout-compact .sf-sidebar-cat-btn {
    width: auto !important;
    padding: 7px 14px !important;
    border-radius: 20px !important;
    border: 1.5px solid var(--border) !important;
    font-size: .8rem !important;
  }
  body.layout-sidebar .sf-sidebar-cat-btn.active,
  body.layout-compact .sf-sidebar-cat-btn.active {
    background: var(--accent) !important;
    color: #fff !important;
    border-color: var(--accent) !important;
  }
  body.layout-sidebar .sf-shop,
  body.layout-compact .sf-shop { padding: 20px 12px 32px !important; }
  body.layout-sidebar .sf-sidebar-section:last-child,
  body.layout-compact .sf-sidebar-section:last-child { display: none; }
  /* Hide the sidebar search on mobile — top nav search/bottom nav search handles it */

  /* Push content above the fixed bottom nav and below the fixed top nav */
  body {
    padding-top: 56px;
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
  }

  /* ── Announcement bar: fixed above nav on mobile ── */
  .sf-announcement { position: fixed; top: 0; left: 0; right: 0; width: 100%; z-index: 201; }
  /* ── Top nav: fixed + compact (override all layout/theme specificity) ── */
  .sf-nav { position: fixed; top: 0; left: 0; right: 0; width: 100%; z-index: 200; }
  body .sf-nav-inner { padding: 0 16px !important; height: 56px !important; gap: 8px !important;
    position: relative !important; max-width: 100% !important; }
  /* Nordic absolute logo → normal flow on mobile */
  body.layout-nordic .sf-logo { position: static !important; transform: none !important; left: auto !important; }
  .sf-search { display: none; }
  #sfNavPages { display: none; }
  .sf-logo { font-size: 1.1rem; }
  /* Hide top nav cart + account on mobile — bottom nav handles them */
  .sf-cart-btn { display: none !important; }
  /* Hide cart close X on mobile — bottom nav cart button toggles it */
  .cart-close { display: none !important; }
  .sf-account-btn { display: none !important; }

  /* ── Hero: shorter ── */
  .sf-hero { min-height: 220px; }
  .sf-hero-content { padding: 36px 20px; }
  .sf-hero h1 { font-size: clamp(1.5rem, 7vw, 2.2rem); margin-bottom: 10px; }
  .sf-hero-desc { font-size: .88rem; margin-bottom: 20px; line-height: 1.6; }
  .sf-hero-btn { padding: 11px 22px; font-size: .9rem; }

  /* ── Category bar: bigger tap targets, hide scrollbar, fix right clip ── */
  .sf-cats-inner { padding: 0 12px; -ms-overflow-style: none; scrollbar-width: none; }
  .sf-cats-inner::-webkit-scrollbar { display: none; }
  .sf-cats-inner::after { content: ''; display: block; min-width: 12px; flex-shrink: 0; }
  .sf-cat-btn { padding: 13px 14px; font-size: .82rem; }

  /* ── Product grid ── */
  .sf-shop { padding: 20px 12px 32px; }
  .sf-shop-header { margin-bottom: 16px; }
  .sf-shop-header h2 { font-size: 1.05rem; }
  .sf-sort { font-size: .8rem; padding: 7px 10px; }
  .sf-products { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .sf-product-info { padding: 10px; }
  .sf-product-brand { font-size: .68rem; }
  .sf-product-name { font-size: .82rem; }
  .sf-price { font-size: .92rem; }
  .sf-compare-price { font-size: .78rem; }
  .sf-discount-badge { font-size: .65rem; padding: 1px 5px; }
  .sf-rating { margin-top: 4px; }
  .sf-stars { font-size: .78rem; }
  .sf-rating-count { font-size: .7rem; }
  .sf-load-more { padding: 20px 0; }

  /* ── Featured ── */
  .sf-featured { padding: 32px 16px; }
  .sf-section-title { font-size: 1.1rem; margin-bottom: 16px; }

  /* ── Cart: slide up from bottom ── */
  .cart-overlay { display: none !important; }
  .cart-sidebar {
    display: none;
  }
  .cart-sidebar.open {
    display: flex;
    position: fixed;
    inset: 0;
    width: 100vw;
    overflow: hidden;
    border-radius: 0;
    z-index: 500;
    background: var(--surface, #f9fafb);
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    flex-direction: column;
  }
  .cart-header {
    border-radius: 0;
    background: var(--white, #fff);
    position: sticky;
    top: 0;
    z-index: 1;
    min-height: 56px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .cart-header h3 {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -.01em;
  }
  .cart-items { 
    flex: 1;
    overflow-y: auto;
    padding: 12px 20px 24px;
  }
  .cart-footer {
    padding: 16px 20px 20px;
    background: var(--white, #fff);
    position: sticky;
    bottom: 0;
  }

  /* ── Checkout modal: full-screen sheet ── */
  #checkoutModal {
    align-items: flex-end !important;
    justify-content: stretch !important;
    padding: 0 !important;
    overflow: hidden;
  }
  .checkout-modal-inner {
    border-radius: 0;
    width: 100%;
    max-width: 100%;
    height: min(100dvh, 100vh);
    max-height: min(100dvh, 100vh);
    margin-top: auto;
    padding: max(18px, calc(12px + env(safe-area-inset-top,0px))) 20px calc(24px + env(safe-area-inset-bottom,0px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .checkout-modal-inner > form > div[style*="grid"] {
    grid-template-columns: 1fr !important;
  }

  /* ── Prevent iOS zoom on input focus (font-size must be >= 16px) ── */
  input, textarea, select,
  .form-group input, .form-group textarea, .form-group select,
  .auth-field input, .auth-field select,
  .sf-search-input, #mobileSearchInput { font-size: 16px !important; }

  /* ── Auth: full screen on mobile ── */
  .auth-overlay { align-items: flex-start; justify-content: flex-start; padding: 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .auth-card { border-radius: 0; width: 100%; max-width: 100%; height: 100%; max-height: 100%; overflow-y: auto; box-shadow: none; animation: none; padding-bottom: calc(60px + env(safe-area-inset-bottom,0px)); }
  .auth-card-header { border-radius: 0; }
  .auth-close { display: none !important; }

  /* ── Mobile account: app-style screen ── */
  .mobile-account-screen {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: var(--surface, #f9fafb);
    display: none;
    flex-direction: column;
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
  }
  .mobile-account-appbar {
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
    position: sticky;
    top: 0;
    z-index: 2;
  }
  .mobile-account-appbar h3 {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -.01em;
  }
  .mobile-orders-appbar {
    position: sticky;
    background: var(--accent);
    border-bottom: none;
    box-shadow: 0 2px 12px rgba(0,0,0,.12);
  }
  .mobile-orders-appbar h3 {
    margin: 0 auto;
    color: #fff;
  }
  .mobile-orders-back,
  .mobile-orders-spacer {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  .mobile-orders-back {
    background: rgba(255,255,255,.18);
    border: none;
    border-radius: 8px;
    color: #fff;
    position: absolute;
    left: 16px;
    top: calc(10px + env(safe-area-inset-top, 0px));
  }
  .mobile-orders-back:active { background: rgba(255,255,255,.28); }
  .mobile-orders-list {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .mobile-order-card {
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 14px;
    background: #fff;
    padding: 14px 14px 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: box-shadow .15s, transform .1s;
  }
  .mobile-order-card-btn:active .mobile-order-card {
    border-color: var(--accent);
    box-shadow: 0 4px 16px rgba(0,0,0,.1);
    transform: scale(.99);
  }
  .mobile-order-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }
  .mobile-order-number {
    font-size: .9rem;
    font-weight: 800;
    color: var(--text);
  }
  .mobile-screen-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .mobile-screen-form label {
    font-size: .7rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-top: 10px;
  }
  .mobile-screen-form label:first-child { margin-top: 0; }
  .mobile-screen-form input,
  #mobile2faSetupBlock input,
  #mobile2faDisableBlock input {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: .95rem;
    font-family: inherit;
    outline: none;
    transition: border-color .15s;
    box-sizing: border-box;
  }
  .mobile-screen-form input:focus,
  #mobile2faSetupBlock input:focus,
  #mobile2faDisableBlock input:focus { border-color: var(--accent); }
  .mobile-screen-btn {
    display: block;
    margin-top: 16px;
    border: 0;
    border-radius: 12px;
    padding: 14px;
    font-size: .95rem;
    font-weight: 700;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    width: 100%;
    letter-spacing: -.01em;
    text-align: center;
  }
  .mobile-screen-btn-danger { background: #b91c1c; }
  .mobile-screen-msg {
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    padding: 10px 12px;
    font-size: .86rem;
    margin-bottom: 8px;
  }
  .mobile-screen-msg-info { color: #1f2937; background: #f8fafc; }
  .mobile-screen-msg-error { color: #991b1b; border-color: #fecaca; background: #fef2f2; }
  .mobile-screen-msg-success { color: #065f46; border-color: #a7f3d0; background: #ecfdf5; }
  .mobile-2fa-qr {
    width: min(200px, 100%);
    max-width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    display: block;
    margin: 8px auto 14px;
    background: #fff;
    padding: 8px;
  }
  .mobile-order-date {
    font-size: .78rem;
    color: var(--text-muted);
  }
  .mobile-order-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }
  .mobile-order-total {
    font-size: .95rem;
    font-weight: 700;
    color: var(--text);
  }
  .mobile-order-status {
    border-radius: 999px;
    padding: 4px 10px;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    border: 1px solid var(--border);
    color: var(--text-muted);
    background: #f8fafc;
    white-space: nowrap;
  }
  .mobile-order-status-fulfilled,
  .mobile-order-status-delivered,
  .mobile-order-status-shipped { color:#065F46; background:#D1FAE5; border-color:#A7F3D0; }
  .mobile-order-status-new,
  .mobile-order-status-confirmed,
  .mobile-order-status-pending { color:#1D4ED8; background:#DBEAFE; border-color:#BFDBFE; }
  .mobile-order-status-processing { color:#92400E; background:#FEF3C7; border-color:#FDE68A; }
  .mobile-order-status-cancelled,
  .mobile-order-status-refunded { color:#991B1B; background:#FEE2E2; border-color:#FECACA; }
  .mobile-orders-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: .88rem;
    padding: 48px 20px;
    border: 1.5px dashed var(--border);
    border-radius: 14px;
    background: #fff;
    line-height: 1.7;
  }
  .mobile-account-content {
    flex: 1;
    overflow-y: auto;
    padding: 14px 14px 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .mobile-account-profile-card {
    background: var(--accent);
    color: #fff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
    display: flex;
    align-items: center;
    gap: 14px;
  }
  .mobile-account-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,.2);
    border: 2px solid rgba(255,255,255,.3);
    font-size: 1.25rem;
    font-weight: 800;
    flex-shrink: 0;
  }
  .mobile-account-profile-info {
    flex: 1;
    min-width: 0;
  }
  .mobile-account-name {
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 2px;
  }
  .mobile-account-email {
    font-size: .82rem;
    opacity: .85;
    word-break: break-word;
  }
  .mobile-account-quick-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .mobile-account-quick-item {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    min-height: 74px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    font-size: .9rem;
    font-weight: 700;
    color: var(--text);
  }
  .mobile-quick-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(0,0,0,.05);
    color: var(--accent);
    display: grid;
    place-items: center;
    flex-shrink: 0;
  }
  .mobile-quick-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: auto;
  }
  .mobile-quick-label svg {
    color: var(--text-muted);
  }
  .mobile-account-menu {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  .mobile-account-menu-item,
  .mobile-account-signout-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 16px;
    border: 0;
    border-bottom: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    text-align: left;
    font-size: .92rem;
    font-weight: 600;
    text-decoration: none;
  }
  .mobile-account-signout-btn {
    color: #b91c1c;
    cursor: pointer;
  }
  .mobile-account-menu-item:last-child,
  .mobile-account-signout-btn:last-child {
    border-bottom: 0;
  }

  /* ── Announcement ── */
  .sf-announcement { font-size: .8rem; padding: 8px 16px; }
}

@media (max-width: 380px) {
  .sf-products { gap: 8px; }
  .sf-product-info { padding: 8px; }
  .sf-product-name { font-size: .78rem; }
}

/* ═══════════════════════════════════════════════════════════
   STOREFRONT THEMES
   Each theme overrides CSS variables + key component styles.
   The accent color is always injected by JS from the merchant's
   accent_color setting — themes only control everything else.
   ═══════════════════════════════════════════════════════════ */

/* ── Theme: Bold ─── Dark, high-contrast, editorial ─────── */
body.theme-bold {
  background: #090909;
  --text: #f0f0f0;
  --text-muted: #888;
  --border: #1c1c1c;
  --surface: #111;
  --white: #090909;
  --radius: 0px;
  --shadow: none;
  font-family: 'Inter', system-ui, sans-serif;
}
body.theme-bold .sf-nav {
  background: rgba(9,9,9,.95); border-bottom: 1px solid #1c1c1c;
}
body.theme-bold .sf-logo {
  font-size: 1.3rem; letter-spacing: -.06em; text-transform: uppercase;
  color: var(--accent);
}
body.theme-bold .sf-search-input {
  background: #111; border-color: #222; color: #f0f0f0;
}
body.theme-bold .sf-announcement { font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .75rem; }
body.theme-bold .sf-hero { min-height: 520px; }
body.theme-bold .sf-hero-bg { background: #090909; }
body.theme-bold .sf-hero-img { opacity: .15; }
body.theme-bold .sf-hero h1 {
  font-size: clamp(2.8rem, 9vw, 6rem); letter-spacing: -.04em; line-height: 1;
  border-left: 5px solid var(--accent); padding-left: 24px;
}
body.theme-bold .sf-hero-btn { background: var(--accent); color: #fff; border-radius: 0; padding: 16px 36px; font-size: 1rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
body.theme-bold .sf-cats { background: #090909; border-color: #1c1c1c; }
body.theme-bold .sf-cat-btn { color: #555; border-bottom-color: transparent; }
body.theme-bold .sf-cat-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
body.theme-bold .sf-product-card { border: 1.5px solid #1c1c1c; border-radius: 0; background: #111; }
body.theme-bold .sf-product-card:hover { border-color: var(--accent); box-shadow: none; transform: none; }
body.theme-bold .sf-product-name { text-transform: uppercase; letter-spacing: .04em; font-size: .82rem; font-weight: 700; }
body.theme-bold .sf-price { color: var(--accent); }
body.theme-bold .sf-section-title { text-transform: uppercase; letter-spacing: -.02em; }
body.theme-bold .sf-featured { background: #0a0a0a; }
body.theme-bold .sf-sort { background: #111; border-color: #222; color: #f0f0f0; }
body.theme-bold .sf-load-more .btn { border-color: #1c1c1c; color: #888; border-radius: 0; }
body.theme-bold .sf-footer { background: #000; border-top: 1px solid #1c1c1c; }
body.theme-bold .cart-sidebar { background: #111; }
body.theme-bold .cart-header, body.theme-bold .cart-footer { border-color: #1c1c1c; }
body.theme-bold .cart-header h3, body.theme-bold .cart-item-name, body.theme-bold .cart-item-price { color: #f0f0f0; }
body.theme-bold .cart-checkout-btn { border-radius: 0; text-transform: uppercase; letter-spacing: .08em; }
body.theme-bold .checkout-modal-inner { background: #111; color: #f0f0f0; border-radius: 0; }

/* ── Theme: Warm ─── Cream, serif, artisanal ─────────────── */
body.theme-warm {
  background: #fdf6ed;
  --text: #2d1f0f;
  --text-muted: #8a6644;
  --border: #e3ceb2;
  --surface: #fdf0e0;
  --white: #fffdf7;
  --radius: 18px;
  --shadow: 0 2px 8px rgba(80,40,0,.08), 0 8px 24px rgba(80,40,0,.06);
}
body.theme-warm body, body.theme-warm { font-family: 'Georgia', 'Times New Roman', serif; }
body.theme-warm .sf-nav { background: rgba(253,246,237,.97); border-color: #e3ceb2; }
body.theme-warm .sf-logo { font-style: italic; color: #7a3d1a; font-size: 1.3rem; }
body.theme-warm .sf-search-input { background: #fdf0e0; border-color: #e3ceb2; }
body.theme-warm .sf-announcement { background: #7a3d1a; }
body.theme-warm .sf-hero-bg { background: linear-gradient(155deg, #c87941 0%, #7a3d1a 100%); }
body.theme-warm .sf-hero h1 { font-style: italic; letter-spacing: -.02em; }
body.theme-warm .sf-hero-btn { background: #fffdf7; color: #7a3d1a; border-radius: 999px; font-style: italic; }
body.theme-warm .sf-cats { background: #fdf6ed; border-color: #e3ceb2; }
body.theme-warm .sf-product-card { background: #fffdf7; border-color: #e3ceb2; }
body.theme-warm .sf-product-card:hover { box-shadow: 0 8px 32px rgba(80,40,0,.15); border-color: #c87941; }
body.theme-warm .sf-section-title { font-style: italic; }
body.theme-warm .sf-featured { background: #f5e8d4; }
body.theme-warm .sf-sort { background: #fdf0e0; border-color: #e3ceb2; font-family: 'Georgia', serif; }
body.theme-warm .sf-footer { background: #2d1f0f; }
body.theme-warm .cart-sidebar { background: #fffdf7; }
body.theme-warm .cart-header, body.theme-warm .cart-footer { border-color: #e3ceb2; }
body.theme-warm .checkout-modal-inner { background: #fffdf7; }

/* ── Theme: Minimal ─── Ultra-clean, whitespace-first ───── */
body.theme-minimal {
  background: #ffffff;
  --border: #e8e8e8;
  --surface: #f9f9f9;
  --shadow: none;
  --radius: 4px;
  font-family: 'Helvetica Neue', Arial, sans-serif;
}
body.theme-minimal .sf-nav { box-shadow: none; border-bottom: 1px solid #e8e8e8; background: #fff; }
body.theme-minimal .sf-logo { font-weight: 400; letter-spacing: .12em; text-transform: uppercase; font-size: .95rem; color: #111; }
body.theme-minimal .sf-hero { min-height: 420px; }
body.theme-minimal .sf-hero-bg { background: #f9f9f9; }
body.theme-minimal .sf-hero h1 { color: #111; font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 300; letter-spacing: -.02em; }
body.theme-minimal .sf-hero-eyebrow { color: #888; }
body.theme-minimal .sf-hero-desc { color: #555; }
body.theme-minimal .sf-hero-btn { background: #111; color: #fff; border-radius: 4px; font-weight: 500; letter-spacing: .04em; }
body.theme-minimal .sf-hero-btn:hover { background: #333; }
body.theme-minimal .sf-announcement { background: #111; }
body.theme-minimal .sf-product-card { border-radius: 4px; border-color: #e8e8e8; box-shadow: none; }
body.theme-minimal .sf-product-card:hover { box-shadow: none; transform: none; border-color: #999; }
body.theme-minimal .sf-product-img { background: #f2f2f2; }
body.theme-minimal .sf-product-name { font-weight: 400; letter-spacing: .01em; }
body.theme-minimal .sf-product-brand { letter-spacing: .12em; }
body.theme-minimal .sf-section-title { font-weight: 300; letter-spacing: -.01em; }
body.theme-minimal .sf-featured { background: #f2f2f2; }
body.theme-minimal .sf-sort { border-color: #e8e8e8; border-radius: 4px; }
body.theme-minimal .sf-load-more .btn { border-radius: 4px; border-color: #ddd; font-weight: 400; }
body.theme-minimal .sf-footer { background: #f9f9f9; color: #444; border-top: 1px solid #e8e8e8; }
body.theme-minimal .sf-footer-brand .sf-footer-name { color: #111; }
body.theme-minimal .sf-footer-col h4 { color: #111; font-weight: 500; }
body.theme-minimal .sf-footer-col ul li a { color: #666; }
body.theme-minimal .sf-footer-bottom { color: #999; }
body.theme-minimal .cart-checkout-btn { border-radius: 4px; font-weight: 500; letter-spacing: .04em; }

/* ── Theme: Vivid ─── Gradient-forward, energetic, Gen-Z ── */
body.theme-vivid {
  background: linear-gradient(160deg, #f0f4ff 0%, #fff5f9 100%);
  background-attachment: fixed;
  --radius: 20px;
  --shadow: 0 4px 24px rgba(80,0,200,.1);
}
body.theme-vivid .sf-nav { background: rgba(255,255,255,.8); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); }
body.theme-vivid .sf-hero { min-height: 600px; }
body.theme-vivid .sf-hero-bg { background: linear-gradient(135deg, var(--accent) 0%, #7c3aed 60%, #db2777 100%); }
body.theme-vivid .sf-hero h1 { font-size: clamp(2.2rem, 6vw, 4rem); }
body.theme-vivid .sf-hero-btn { border-radius: 999px; backdrop-filter: blur(8px); background: rgba(255,255,255,.2); border: 1.5px solid rgba(255,255,255,.4); color: #fff; }
body.theme-vivid .sf-hero-btn:hover { background: rgba(255,255,255,.35); }
body.theme-vivid .sf-product-card { border-radius: 20px; border: none; box-shadow: 0 4px 20px rgba(0,0,0,.07); }
body.theme-vivid .sf-product-card:hover { box-shadow: 0 8px 40px rgba(0,0,0,.14), 0 0 0 2px var(--accent); transform: translateY(-6px); }
body.theme-vivid .sf-section-title {
  background: linear-gradient(90deg, var(--accent), #7c3aed);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
body.theme-vivid .sf-featured { background: linear-gradient(160deg, #f5f0ff, #fff0f6); }
body.theme-vivid .sf-cat-btn.active { border-bottom-color: var(--accent); font-weight: 700; }
body.theme-vivid .sf-discount-badge { border-radius: 999px; background: linear-gradient(90deg, #f43f5e, #ec4899); color: #fff; }
body.theme-vivid .sf-load-more .btn { border-radius: 999px; border-color: var(--accent); color: var(--accent); font-weight: 600; }
body.theme-vivid .sf-footer { background: linear-gradient(160deg, #0f0a2a, #1a0a1e); }
body.theme-vivid .cart-sidebar { background: rgba(255,255,255,.95); backdrop-filter: blur(20px); }

/* ── Theme: Dark ─── Night-mode, immersive shopping ─────── */
body.theme-dark {
  background: #0f1117;
  --text: #e2e4ec;
  --text-muted: #8891a5;
  --border: #1e2330;
  --surface: #161b27;
  --white: #0f1117;
  --shadow: 0 4px 20px rgba(0,0,0,.5);
}
body.theme-dark .sf-nav { background: rgba(15,17,23,.92); border-color: #1e2330; }
body.theme-dark .sf-logo { color: var(--accent); }
body.theme-dark .sf-search-input { background: #161b27; border-color: #1e2330; color: #e2e4ec; }
body.theme-dark .sf-hero { background: #0f1117; }
body.theme-dark .sf-hero-bg { background: linear-gradient(135deg, #1a0533 0%, #0f1117 60%); }
body.theme-dark .sf-hero h1 { color: #fff; }
body.theme-dark .sf-hero-btn { background: var(--accent); color: #fff; border-radius: 10px; }
body.theme-dark .sf-cats { background: #0f1117; border-color: #1e2330; }
body.theme-dark .sf-cat-btn { color: #8891a5; }
body.theme-dark .sf-cat-btn.active { color: var(--accent); border-color: var(--accent); }
body.theme-dark .sf-product-card { background: #161b27; border-color: #1e2330; }
body.theme-dark .sf-product-card:hover { box-shadow: 0 8px 32px rgba(0,0,0,.6), 0 0 0 1px var(--accent); transform: translateY(-2px); }
body.theme-dark .sf-product-img { background: #1e2330; }
body.theme-dark .sf-product-name { color: #e2e4ec; }
body.theme-dark .sf-product-brand { color: #8891a5; }
body.theme-dark .sf-price { color: var(--accent); }
body.theme-dark .sf-compare-price { color: #555e73; }
body.theme-dark .sf-shop-header h2 { color: #e2e4ec; }
body.theme-dark .sf-sort { background: #161b27; border-color: #1e2330; color: #e2e4ec; }
body.theme-dark .sf-featured { background: #13171f; }
body.theme-dark .sf-section-title { color: #e2e4ec; }
body.theme-dark .sf-load-more .btn { background: #161b27; border-color: #1e2330; color: #8891a5; }
body.theme-dark .sf-footer { background: #080a0f; }
body.theme-dark .cart-sidebar { background: #161b27; }
body.theme-dark .cart-header { border-color: #1e2330; }
body.theme-dark .cart-header h3 { color: #e2e4ec; }
body.theme-dark .cart-close { color: #8891a5; }
body.theme-dark .cart-item-name { color: #e2e4ec; }
body.theme-dark .cart-item-price { color: var(--accent); }
body.theme-dark .cart-item-variant { color: #8891a5; }
body.theme-dark .cart-footer { border-color: #1e2330; color: #e2e4ec; }
body.theme-dark .cart-checkout-btn { background: var(--accent); }
body.theme-dark .checkout-modal-inner { background: #161b27; color: #e2e4ec; }
body.theme-dark .checkout-modal-header { border-color: #1e2330; }
body.theme-dark .form-group label { color: #8891a5; }
body.theme-dark .form-group input, body.theme-dark .form-group textarea {
  background: #1e2330; border-color: #2a3040; color: #e2e4ec;
}
body.theme-dark .checkoutSummary { background: #1e2330; border-color: #2a3040; }
body.theme-dark #checkoutSummary { background: #1e2330; border-color: #2a3040; }

/* ── Custom theme loader ─────────────────────────────────── */
/* When theme = 'custom', JS injects a <link> tag for the uploaded CSS */

/* ═══════════════════════════════════════════════════════════
   STOREFRONT LAYOUTS
   Each layout overrides structural CSS (grid, sidebar, spacing).
   Applied via body.layout-{name} class set by JS.
   ═══════════════════════════════════════════════════════════ */

/* ── Sidebar layout base: body-wrap becomes a 2-col grid ── */
.sf-body-wrap { display: block; }
.sf-body-main { display: block; }
.sf-sidebar { display: none; }

/* ── Layout: Sidebar ───────────────────────────────────────
   Left navigation sidebar with categories, main content right */
body.layout-sidebar .sf-cats { display: none !important; }
body.layout-sidebar .sf-body-wrap {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0;
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px;
  align-items: start;
}
body.layout-sidebar .sf-sidebar {
  display: block;
  position: sticky;
  top: 80px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
body.layout-sidebar .sf-sidebar-title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: 10px;
}
body.layout-sidebar .sf-sidebar-cats {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
body.layout-sidebar .sf-sidebar-cat-btn {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: .875rem;
  cursor: pointer;
}
body.layout-sidebar .sf-sidebar-cat-btn:hover { background: var(--surface); color: var(--text); }
body.layout-sidebar .sf-sidebar-cat-btn.active { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); font-weight: 600; }
body.layout-sidebar .sf-body-main { min-width: 0; }
body.layout-sidebar .sf-shop { max-width: none; padding: 0 0 40px 32px; }
body.layout-sidebar .sf-featured { padding: 0 0 40px 32px; }
body.layout-sidebar .sf-featured .container { max-width: none; padding: 0; }

@media (max-width: 768px) {
  /* ── Order detail ── */
  .od-hero {
    background: var(--accent);
    color: #fff;
    padding: 20px 16px 22px;
    margin: -14px -14px 12px;
  }
  .od-hero-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
  }
  .od-hero-label {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    opacity: .75;
    margin-bottom: 3px;
  }
  .od-hero-num {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -.02em;
  }
  .od-hero-badge {
    border-radius: 999px;
    padding: 5px 12px;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    white-space: nowrap;
    background: rgba(255,255,255,.22);
    color: #fff;
    border: 1px solid rgba(255,255,255,.3);
    flex-shrink: 0;
  }
  .od-hero-date {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: .8rem;
    opacity: .8;
  }
  .od-section {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 10px;
  }
  .od-section-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--text-muted);
    padding: 9px 14px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
  }
  .od-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 14px;
    font-size: .88rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
  }
  .od-row:last-child { border-bottom: 0; }
  .od-row > span:first-child { color: var(--text-muted); }
  .od-total-row { background: var(--surface); font-weight: 700; }
  .od-total-row > span:first-child { color: var(--text); font-size: .92rem; }
  .od-total-amount { font-size: 1.05rem; font-weight: 800; color: var(--accent); }
  .od-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
  }
  .od-item:last-child { border-bottom: 0; }
  .od-item-img {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border);
    background: var(--surface);
  }
  .od-item-icon {
    width: 38px;
    height: 38px;
    background: var(--surface);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-muted);
    border: 1px solid var(--border);
  }
  .od-item-info { flex: 1; min-width: 0; }
  .od-item-name {
    font-weight: 600;
    font-size: .88rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .od-item-qty { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }
  .od-item-price { font-weight: 700; font-size: .9rem; color: var(--text); white-space: nowrap; }
  .od-row-right { text-align: right; max-width: 58%; font-size: .84rem; line-height: 1.4; }
  .od-tracking {
    font-family: monospace;
    font-size: .82rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px 7px;
  }
  .od-empty { padding: 16px 14px; font-size: .86rem; color: var(--text-muted); }
  /* legacy classes used by security/profile screens */
  .mobile-order-detail-group {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    padding: 16px;
    overflow: hidden;
  }
  .mobile-order-detail-group + .mobile-order-detail-group { margin-top: 10px; }
  .mobile-order-detail-title {
    font-size: .68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .07em;
    font-weight: 700;
    margin: -16px -16px 14px;
    padding: 9px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .mobile-order-detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 0;
    font-size: .9rem;
    border-bottom: 1px solid var(--border);
  }
  .mobile-order-detail-row:last-child { border-bottom: 0; padding-bottom: 0; }
  .mobile-order-detail-item-name { font-weight: 600; color: var(--text); margin-bottom: 2px; }
  .mobile-order-detail-item-qty { font-size: .78rem; color: var(--text-muted); }
  .mobile-order-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }
  .mobile-order-detail-total strong { font-size: 1rem; }
  .mobile-order-card-btn {
    display: block;
    width: 100%;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
}

/* ── Layout: Magazine ──────────────────────────────────────
   Editorial feel, tall hero, alternating featured layout */
body.layout-magazine .sf-hero { min-height: 600px; }
body.layout-magazine .sf-hero-content { max-width: 1200px; padding: 120px 24px; }
body.layout-magazine .sf-hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); line-height: 1.1; }
body.layout-magazine .sf-featured {
  padding: 60px 24px;
  background: var(--surface);
}
body.layout-magazine .sf-featured .container { max-width: 1200px; }
body.layout-magazine .sf-featured .sf-products {
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}
body.layout-magazine .sf-featured .sf-product-card .sf-product-img { aspect-ratio: 4/3; }
body.layout-magazine .sf-section-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 32px;
  letter-spacing: -.02em;
}
body.layout-magazine .sf-shop { max-width: 1200px; padding: 48px 24px; }
body.layout-magazine .sf-shop-header h2 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
body.layout-magazine .sf-shop-header { border-bottom: 2px solid var(--text); padding-bottom: 16px; margin-bottom: 32px; }
body.layout-magazine .sf-products { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 32px; }

/* ── Layout: Minimal ───────────────────────────────────────
   Clean, centered, generous whitespace, 3-col max */
body.layout-minimal .sf-nav-inner { max-width: 900px; }
body.layout-minimal .sf-hero-content { max-width: 1200px; padding: 100px 24px; }
body.layout-minimal .sf-hero h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 300; letter-spacing: -.03em; }
body.layout-minimal .sf-hero { min-height: 400px; }
body.layout-minimal .sf-cats-inner { max-width: 900px; justify-content: center; }
body.layout-minimal .sf-featured .container { max-width: 900px; }
body.layout-minimal .sf-featured .sf-products { grid-template-columns: repeat(3, 1fr); }
body.layout-minimal .sf-shop { max-width: 900px; }
body.layout-minimal .sf-products { grid-template-columns: repeat(3, 1fr); gap: 32px; }
body.layout-minimal .sf-product-card { border: none; box-shadow: none; border-radius: 0; border-bottom: 1px solid var(--border); }
body.layout-minimal .sf-product-card:hover { transform: none; box-shadow: none; }
body.layout-minimal .sf-product-img { border-radius: 0; }
body.layout-minimal .sf-section-title { font-weight: 300; font-size: 1.8rem; letter-spacing: -.02em; }
body.layout-minimal .sf-shop-header h2 { font-weight: 300; letter-spacing: -.01em; }
@media (max-width: 700px) {
  body.layout-minimal .sf-products { grid-template-columns: repeat(2, 1fr); }
}

/* ── Layout: Boutique ──────────────────────────────────────
   Luxury, tall portrait cards, 2-col, large hero */
body.layout-boutique .sf-hero { min-height: 680px; }
body.layout-boutique .sf-hero-content { max-width: 1200px; padding: 120px 24px; }
body.layout-boutique .sf-hero h1 { font-size: clamp(3rem, 7vw, 5.5rem); font-weight: 800; letter-spacing: -.04em; line-height: 1; }
body.layout-boutique .sf-cats { display: none; }
body.layout-boutique .sf-featured { padding: 80px 24px; }
body.layout-boutique .sf-featured .sf-products { grid-template-columns: repeat(2, 1fr); gap: 40px; }
body.layout-boutique .sf-featured .sf-product-img { aspect-ratio: 3/4; }
body.layout-boutique .sf-shop { max-width: 1200px; padding: 60px 24px; }
body.layout-boutique .sf-products { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 40px; }
body.layout-boutique .sf-product-img { aspect-ratio: 3/4; }
body.layout-boutique .sf-product-card { border: none; box-shadow: none; border-radius: 0; }
body.layout-boutique .sf-product-card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,0,0,.12); }
body.layout-boutique .sf-product-name { font-size: 1rem; font-weight: 400; letter-spacing: .02em; }
body.layout-boutique .sf-product-brand { letter-spacing: .1em; font-size: .7rem; }
body.layout-boutique .sf-price { font-size: 1.1rem; font-weight: 600; }
body.layout-boutique .sf-section-title { font-size: 2.4rem; font-weight: 800; letter-spacing: -.04em; }
body.layout-boutique .sf-shop-header h2 { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; }

/* ── Layout: Compact ───────────────────────────────────────
   Dense 5-col grid, sidebar, space-efficient */
body.layout-compact .sf-cats { display: none !important; }
body.layout-compact .sf-body-wrap {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 24px;
  align-items: start;
}
body.layout-compact .sf-sidebar {
  display: block;
  position: sticky;
  top: 72px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 16px;
}
body.layout-compact .sf-sidebar-title {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
body.layout-compact .sf-sidebar-cats { list-style: none; display: flex; flex-direction: column; gap: 1px; }
body.layout-compact .sf-sidebar-cat-btn {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: .8rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: background .12s, color .12s;
}
body.layout-compact .sf-sidebar-cat-btn:hover { background: #fff; color: var(--text); }
body.layout-compact .sf-sidebar-cat-btn.active { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); font-weight: 600; }
body.layout-compact .sf-body-main { min-width: 0; }
body.layout-compact .sf-shop { max-width: none; padding: 0 0 40px 24px; }
body.layout-compact .sf-featured { padding: 0 0 20px 24px; }
body.layout-compact .sf-featured .container { max-width: none; padding: 0; }
body.layout-compact .sf-products { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
body.layout-compact .sf-product-info { padding: 10px; }
body.layout-compact .sf-product-name { font-size: .82rem; }
body.layout-compact .sf-price { font-size: .9rem; }
body.layout-compact .sf-shop-header { margin-bottom: 16px; }
body.layout-compact .sf-hero { min-height: 320px; }
body.layout-compact .sf-hero h1 { font-size: clamp(1.6rem, 3vw, 2.4rem); }

/* ── Layout: Nordic (Nordstrom-inspired) ──────────────────
   Monochrome luxury department store: centered logo, portrait
   borderless product cards, generous whitespace, thin type ── */
body.layout-nordic {
  background: #fff;
  --text: #1a1a1a;
  --text-muted: #6d6d6d;
  --border: #e6e6e6;
  --surface: #f5f5f5;
  --white: #ffffff;
  --radius: 0px;
  --shadow: none;
  font-family: 'Helvetica Neue', Arial, sans-serif;
}

/* ── Nav: minimal, centered logo ── */
body.layout-nordic .sf-nav {
  background: #fff;
  border-bottom: 1px solid #e6e6e6;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
body.layout-nordic .sf-nav-inner {
  max-width: 1280px;
  height: 68px;
  position: relative;
  gap: 0;
}
body.layout-nordic .sf-logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: .82rem;
  font-weight: 400;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #1a1a1a;
}
body.layout-nordic .sf-search { flex: 1; max-width: 280px; }
body.layout-nordic .sf-search-input {
  background: #f5f5f5;
  border-color: transparent;
  border-radius: 0;
  font-size: .82rem;
}
body.layout-nordic .sf-search-input:focus { border-color: #1a1a1a; background: #fff; }
body.layout-nordic .sf-nav-right { margin-left: auto; }

/* ── Announcement bar ── */
body.layout-nordic .sf-announcement {
  background: #1a1a1a;
  font-size: .75rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 400;
  padding: 8px 24px;
}

/* ── Hero: full editorial, light text, minimal CTA ── */
body.layout-nordic .sf-hero { min-height: 580px; }
body.layout-nordic .sf-hero-bg { background: #1a1a1a; }
body.layout-nordic .sf-hero-img { opacity: .65; }
body.layout-nordic .sf-hero-content { max-width: 1280px; padding: 80px 24px; }
body.layout-nordic .sf-hero h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 300;
  letter-spacing: -.01em;
  line-height: 1.1;
}
body.layout-nordic .sf-hero-eyebrow {
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 400;
}
body.layout-nordic .sf-hero-desc { font-size: 1rem; font-weight: 300; max-width: 440px; }
body.layout-nordic .sf-hero-btn {
  background: #fff;
  color: #1a1a1a;
  border-radius: 0;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 14px 36px;
  border: 1.5px solid #fff;
  transition: background .18s, color .18s;
}
body.layout-nordic .sf-hero-btn:hover { background: transparent; color: #fff; }

/* ── Category bar ── */
body.layout-nordic .sf-cats { background: #fff; border-bottom: 1px solid #e6e6e6; }
body.layout-nordic .sf-cats-inner { max-width: 1280px; }
body.layout-nordic .sf-cat-btn {
  font-size: .78rem;
  letter-spacing: .04em;
  font-weight: 400;
  color: #1a1a1a;
  padding: 14px 16px;
  border-bottom: 2px solid transparent;
}
body.layout-nordic .sf-cat-btn:hover { color: #1a1a1a; }
body.layout-nordic .sf-cat-btn.active { color: #1a1a1a; border-bottom-color: #1a1a1a; font-weight: 600; }

/* ── Product grid: borderless portrait cards ── */
body.layout-nordic .sf-shop { max-width: 1280px; padding: 48px 24px 64px; }
body.layout-nordic .sf-shop-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 32px; padding-bottom: 16px; border-bottom: 1px solid #e6e6e6;
}
body.layout-nordic .sf-shop-header h2 {
  font-size: .82rem; font-weight: 400; letter-spacing: .14em; text-transform: uppercase;
}
body.layout-nordic .sf-sort {
  border-radius: 0; font-size: .78rem; letter-spacing: .04em; border-color: #e6e6e6;
}
body.layout-nordic .sf-products {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 40px 24px;
}
body.layout-nordic .sf-product-card {
  border: none; border-radius: 0; box-shadow: none; background: transparent;
}
body.layout-nordic .sf-product-card:hover { box-shadow: none; transform: none; }
body.layout-nordic .sf-product-img { aspect-ratio: 2/3; background: #f5f5f5; border-radius: 0; }
body.layout-nordic .sf-product-img img { transition: opacity .2s; }
body.layout-nordic .sf-product-card:hover .sf-product-img img { opacity: .85; transform: none; }
body.layout-nordic .sf-product-info { padding: 12px 0 0; }
body.layout-nordic .sf-product-brand {
  font-size: .72rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: #1a1a1a; margin-bottom: 3px;
}
body.layout-nordic .sf-product-name {
  font-size: .82rem; font-weight: 400; color: #6d6d6d; line-height: 1.45; margin-bottom: 8px;
}
body.layout-nordic .sf-price { font-size: .875rem; font-weight: 600; color: #1a1a1a; }
body.layout-nordic .sf-compare-price { font-size: .8rem; color: #9e9e9e; }
body.layout-nordic .sf-discount-badge {
  background: #cc0000; color: #fff; border-radius: 0; font-size: .68rem; font-weight: 700;
}
body.layout-nordic .sf-stars { color: #1a1a1a; font-size: .8rem; }
body.layout-nordic .sf-rating-count { font-size: .72rem; }

/* ── Featured section ── */
body.layout-nordic .sf-featured { background: #f5f5f5; padding: 60px 24px; }
body.layout-nordic .sf-featured .container { max-width: 1280px; }
body.layout-nordic .sf-featured .sf-products { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
body.layout-nordic .sf-section-title {
  font-size: .82rem; font-weight: 400; letter-spacing: .14em;
  text-transform: uppercase; margin-bottom: 32px;
}

/* ── Load more ── */
body.layout-nordic .sf-load-more .btn {
  border-radius: 0; border: 1.5px solid #1a1a1a; color: #1a1a1a;
  font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; padding: 12px 44px;
  background: #fff;
}
body.layout-nordic .sf-load-more .btn:hover { background: #1a1a1a; color: #fff; }

/* ── Footer ── */
body.layout-nordic .sf-footer { background: #1a1a1a; }
body.layout-nordic .sf-footer-col h4 { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }

/* ── Cart & checkout ── */
body.layout-nordic .cart-sidebar { border-radius: 0; }
body.layout-nordic .cart-header h3 { letter-spacing: .06em; text-transform: uppercase; font-size: .9rem; font-weight: 400; }
body.layout-nordic .cart-checkout-btn { border-radius: 0; letter-spacing: .1em; text-transform: uppercase; font-size: .82rem; }
body.layout-nordic .checkout-modal-inner { border-radius: 0; }

/* ═══════════════════════════════════════════════════════════
   STOREFRONT SECTIONS (page builder blocks)
   ═══════════════════════════════════════════════════════════ */

.sf-section { width: 100%; }
.sf-section-inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ── Text Block ── */
.sf-section-text { padding: 64px 0; }
.sf-section-text.align-center { text-align: center; }
.sf-section-text.align-center .sf-section-content { margin: 0 auto; max-width: 720px; }
.sf-section-heading { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; margin-bottom: 16px; line-height: 1.25; color: inherit; }
.sf-section-content { font-size: 1rem; line-height: 1.8; color: var(--text-muted); max-width: 780px; }
.sf-section-content h2,.sf-section-content h3 { color: var(--text); font-weight: 700; margin: 20px 0 10px; }
.sf-section-content p { margin-bottom: 14px; }
.sf-section-content ul,.sf-section-content ol { padding-left: 20px; margin-bottom: 14px; }
.sf-section-content a { color: var(--accent); text-decoration: underline; }

/* ── Image + Text ── */
.sf-section-image-text { padding: 64px 0; }
.sf-img-text-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.sf-img-text-wrap.image-right { direction: rtl; }
.sf-img-text-wrap.image-right > * { direction: ltr; }
.sf-img-text-img img { width: 100%; border-radius: var(--radius); object-fit: cover; aspect-ratio: 4/3; }
.sf-img-text-img-placeholder { aspect-ratio: 4/3; background: var(--surface); border-radius: var(--radius); border: 1.5px dashed var(--border); display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: .875rem; }
.sf-img-text-body { display: flex; flex-direction: column; gap: 16px; }
.sf-section-btn { display: inline-flex; align-items: center; padding: 12px 28px; background: var(--accent); color: #fff; border-radius: var(--radius); font-weight: 700; font-size: .9rem; margin-top: 8px; transition: filter .15s; }
.sf-section-btn:hover { filter: brightness(1.08); }
@media (max-width: 768px) {
  .sf-img-text-wrap { grid-template-columns: 1fr; gap: 28px; direction: ltr !important; }
}

/* ── Full Banner ── */
.sf-section-banner {
  position: relative; min-height: 400px; display: flex; align-items: center;
  background: var(--text); background-size: cover; background-position: center; overflow: hidden;
}
.sf-banner-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.sf-section-banner .sf-section-inner { position: relative; z-index: 1; padding: 80px 24px; }
.sf-section-banner .sf-section-heading { color: #fff; font-size: clamp(1.8rem, 4vw, 3rem); }
.sf-section-banner .sf-section-subheading { color: rgba(255,255,255,.85); font-size: 1.05rem; margin-bottom: 28px; max-width: 560px; line-height: 1.7; }
.sf-section-banner .sf-section-btn { background: #fff; color: var(--text); }
.sf-section-banner .sf-section-btn:hover { background: #f3f4f6; }

/* ── CTA Strip ── */
.sf-section-cta { padding: 48px 0; background: var(--accent); }
.sf-section-cta .sf-section-inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.sf-section-cta .sf-cta-heading { font-size: 1.4rem; font-weight: 800; color: #fff; margin-bottom: 4px; }
.sf-section-cta .sf-cta-subtext { color: rgba(255,255,255,.8); font-size: .95rem; }
.sf-section-cta .sf-section-btn { background: #fff; color: var(--accent); flex-shrink: 0; font-size: .95rem; }
.sf-section-cta .sf-section-btn:hover { background: #f3f4f6; filter: none; }

/* ── Testimonials ── */
.sf-section-testimonials { padding: 64px 0; background: var(--surface); }
.sf-section-testimonials .sf-section-heading { text-align: center; margin-bottom: 40px; }
.sf-testimonials-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.sf-testimonial-card { background: var(--white); border-radius: var(--radius); padding: 24px; border: 1px solid var(--border); }
.sf-testimonial-stars { color: #F59E0B; font-size: 1rem; margin-bottom: 10px; }
.sf-testimonial-text { font-size: .9rem; line-height: 1.7; color: var(--text); margin-bottom: 14px; font-style: italic; }
.sf-testimonial-name { font-size: .8rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }

/* ── Custom HTML ── */
.sf-section-html { padding: 40px 0; }

/* ── Spacer ── */
.sf-section-spacer {}

/* ── Custom/marketplace layout loader ─── */
/* When layout = 'custom' or 'marketplace:*', JS injects a <link> tag */
