/* =============================================================
   SuitCraft Pro Configurator — Main Stylesheet
   BEM naming: .sc-[block]__[element]--[modifier]
   ============================================================= */

/* ── Design Tokens ────────────────────────────────────────── */
:root {
  --sc-font:         'Inter', 'Segoe UI', system-ui, sans-serif;
  --sc-font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  /* Palette — Light Theme */
  --sc-bg:           #ffffff;
  --sc-surface:      #f8f8f8;
  --sc-surface-2:    #f0f0f0;
  --sc-surface-3:    #e8e8e8;
  --sc-border:       #e0e0e0;
  --sc-border-light: rgba(0,0,0,.06);

  --sc-gold:         #111111;
  --sc-gold-light:   #333333;
  --sc-gold-dim:     rgba(0,0,0,.08);

  --sc-text:         #111111;
  --sc-text-muted:   #6b7280;
  --sc-text-dim:     #9ca3af;

  --sc-accent:       #111111;
  --sc-accent-hover: #333333;
  --sc-danger:       #e05c5c;
  --sc-success:      #5ce08a;

  /* Spacing */
  --sc-radius:       10px;
  --sc-radius-lg:    16px;
  --sc-radius-xl:    24px;
  --sc-gap:          20px;

  /* Shadows */
  --sc-shadow-sm:    0 2px 8px rgba(0,0,0,.08);
  --sc-shadow-md:    0 8px 24px rgba(0,0,0,.12);
  --sc-shadow-lg:    0 20px 60px rgba(0,0,0,.15);

  /* Transitions */
  --sc-ease:         cubic-bezier(.4,0,.2,1);
  --sc-dur:          220ms;
  --sc-dur-fast:     140ms;

  /* Canvas */
  --sc-canvas-ratio: 6 / 7;
}

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

/* ── Reset scoped to plugin ──────────────────────────────── */
.sc-configurator *,
.sc-configurator *::before,
.sc-configurator *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.sc-configurator {
  font-family: var(--sc-font);
  background: var(--sc-bg);
  color: var(--sc-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Top Bar ─────────────────────────────────────────────── */
.sc-topbar {
  display: flex;
  align-items: center;
  gap: var(--sc-gap);
  padding: 14px 28px;
  background: var(--sc-surface);
  border-bottom: 1px solid var(--sc-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.sc-topbar__back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--sc-text-muted);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--sc-border);
  background: var(--sc-bg);
  white-space: nowrap;
  transition: color .15s, border-color .15s, background .15s;
  flex-shrink: 0;
}
.sc-topbar__back:hover {
  color: var(--sc-text);
  border-color: var(--sc-gold);
  background: var(--sc-gold-dim);
}

.sc-topbar__title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.3px;
  white-space: nowrap;
  color: var(--sc-text);
}

/* Step navigation pills */
.sc-step-nav {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
  justify-content: center;
}

.sc-step-pip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: none;
  border: 1px solid var(--sc-border);
  border-radius: var(--sc-radius);
  color: var(--sc-text-muted);
  font-family: var(--sc-font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--sc-dur) var(--sc-ease);
  white-space: nowrap;
}

.sc-step-pip:hover {
  border-color: var(--sc-gold-dim);
  color: var(--sc-text);
}

.sc-step-pip--active {
  border-color: var(--sc-gold);
  color: var(--sc-gold);
  background: var(--sc-gold-dim);
}

.sc-step-pip__num {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--sc-border);
  font-size: 11px;
  font-weight: 700;
}

.sc-step-pip--active .sc-step-pip__num {
  background: var(--sc-gold);
  color: var(--sc-bg);
}

.sc-step-pip__connector {
  width: 32px;
  height: 1px;
  background: var(--sc-border);
  display: block;
}

/* Price display */
.sc-topbar__price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  white-space: nowrap;
}

.sc-price-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--sc-text-muted);
}

.sc-price-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--sc-gold);
  letter-spacing: -.5px;
  transition: color var(--sc-dur-fast);
}

/* ── Body Layout ─────────────────────────────────────────── */
.sc-body {
  display: grid;
  grid-template-columns: 45fr 55fr;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ── LEFT: Preview ───────────────────────────────────────── */
.sc-preview {
  background: var(--sc-surface);
  border-right: 1px solid var(--sc-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sc-preview__sticky {
  position: sticky;
  top: 0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* View toggle */
.sc-preview__view-toggle {
  display: flex;
  gap: 4px;
  background: var(--sc-surface-2);
  border: 1px solid var(--sc-border);
  border-radius: var(--sc-radius);
  padding: 4px;
}

.sc-view-btn {
  padding: 6px 18px;
  font-family: var(--sc-font);
  font-size: 12px;
  font-weight: 500;
  background: none;
  border: none;
  border-radius: 7px;
  color: var(--sc-text-muted);
  cursor: pointer;
  transition: all var(--sc-dur-fast);
}

.sc-view-btn--active {
  background: var(--sc-surface-3);
  color: var(--sc-text);
}

.sc-view-btn:disabled {
  opacity: .35;
  cursor: not-allowed;
}

/* 4-tab garment layout: tighter padding so all 4 buttons fit */
.sc-preview__view-toggle--tabs .sc-view-btn {
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1;
  justify-content: center;
  white-space: nowrap;
}

.sc-view-btn__icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Layer Canvas */
.sc-layer-canvas {
  position: relative;
  width: 100%;
  max-width: 420px;
  aspect-ratio: var(--sc-canvas-ratio);
  border-radius: var(--sc-radius-lg);
  overflow: hidden;
  background: var(--sc-surface-2);
  box-shadow: var(--sc-shadow-lg);
}

.sc-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transition: opacity var(--sc-dur) var(--sc-ease);
  user-select: none;
  pointer-events: none;
  /* z-index set via inline style from layer map data */
}

.sc-layer[src=""],
.sc-layer[src="#"],
.sc-layer:not([src]) {
  opacity: 0;
}

.sc-layer--fabric {
  mix-blend-mode: multiply;
}

.sc-layer--shadow {
  mix-blend-mode: multiply;
  opacity: .6;
}

/* Fabric layer fade transition */
.sc-layer--fading-out { opacity: 0 !important; }
.sc-layer--fading-in  { opacity: 1;             }

/* Preview loader overlay */
.sc-preview-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(2px);
  z-index: 200;
  border-radius: inherit;
}

.sc-preview-loader[hidden] {
  display: none;
}

.sc-preview-loader__spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--sc-border);
  border-top-color: var(--sc-primary, #1a1a2e);
  border-radius: 50%;
  animation: sc-spin 0.7s linear infinite;
}

@keyframes sc-spin {
  to { transform: rotate(360deg); }
}

/* Preview summary */
.sc-preview__summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  width: 100%;
  max-width: 420px;
}

.sc-preview__summary-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sc-summary-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--sc-text-dim);
}

.sc-summary-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--sc-text);
}

/* ── RIGHT: Configurator Panels ──────────────────────────── */
.sc-panels {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 0;
  background: var(--sc-bg);
}

.sc-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  animation: sc-step-in var(--sc-dur) var(--sc-ease) both;
}

.sc-step--hidden {
  display: none;
}

@keyframes sc-step-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.sc-step__inner {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sc-step__header { display: flex; flex-direction: column; gap: 6px; }

.sc-step__title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.4px;
  color: var(--sc-text);
}

.sc-step__desc {
  font-size: 14px;
  color: var(--sc-text-muted);
  line-height: 1.5;
}

/* Step footer nav */
.sc-step-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-top: 1px solid var(--sc-border);
  background: var(--sc-surface);
  position: sticky;
  bottom: 0;
  z-index: 10;
}

/* ── Buttons ─────────────────────────────────────────────── */
.sc-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  font-family: var(--sc-font);
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--sc-radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--sc-dur) var(--sc-ease);
  white-space: nowrap;
  text-decoration: none;
}

.sc-btn--primary {
  background: var(--sc-gold);
  color: var(--sc-bg);
  border-color: var(--sc-gold);
}
.sc-btn--primary:hover {
  background: var(--sc-gold-light);
  border-color: var(--sc-gold-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
}

.sc-btn--ghost {
  background: none;
  color: var(--sc-text-muted);
  border-color: var(--sc-border);
}
.sc-btn--ghost:hover {
  border-color: var(--sc-border-light);
  color: var(--sc-text);
}

.sc-btn--cta {
  background: linear-gradient(135deg, var(--sc-gold), var(--sc-gold-light));
  color: var(--sc-bg);
  border: none;
  padding: 13px 28px;
  font-size: 15px;
}
.sc-btn--cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.18);
}
.sc-btn--cta:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── Fabric Step ─────────────────────────────────────────── */
.sc-fabric-bar {
  display: flex;
  gap: 10px;
  align-items: center;
}

.sc-search-wrap {
  flex: 1;
  position: relative;
}

.sc-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
  color: var(--sc-text-muted);
  pointer-events: none;
  z-index: 1;
}

.sc-search-input {
  width: 100%;
  background: var(--sc-surface-2);
  border: 1px solid var(--sc-border);
  border-radius: var(--sc-radius);
  color: var(--sc-text);
  font-family: var(--sc-font);
  font-size: 14px;
  padding: 11px 36px 11px 38px;
  outline: none;
  transition: border-color var(--sc-dur-fast);
}
.sc-search-input:focus { border-color: var(--sc-gold); }
.sc-search-input::placeholder { color: var(--sc-text-dim); }

.sc-search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--sc-text-muted);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 4px;
}

.sc-filter-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 11px 16px;
  background: var(--sc-surface-2);
  border: 1px solid var(--sc-border);
  border-radius: var(--sc-radius);
  color: var(--sc-text-muted);
  font-family: var(--sc-font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--sc-dur-fast);
  white-space: nowrap;
}
.sc-filter-toggle svg { width: 15px; height: 15px; }
.sc-filter-toggle:hover,
.sc-filter-toggle[aria-expanded="true"] {
  border-color: var(--sc-gold);
  color: var(--sc-gold);
}

.sc-filter-count {
  background: var(--sc-gold);
  color: var(--sc-bg);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Filter Drawer */
.sc-filter-drawer {
  background: var(--sc-surface-2);
  border: 1px solid var(--sc-border);
  border-radius: var(--sc-radius-lg);
  overflow: hidden;
  animation: sc-drawer-in var(--sc-dur) var(--sc-ease);
}

@keyframes sc-drawer-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.sc-filter-drawer__inner {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sc-filter-group__title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .9px;
  color: var(--sc-text-muted);
  margin-bottom: 10px;
}

.sc-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sc-chip {
  padding: 5px 12px;
  background: var(--sc-surface-3);
  border: 1px solid var(--sc-border);
  border-radius: 100px;
  color: var(--sc-text-muted);
  font-family: var(--sc-font);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--sc-dur-fast);
}
.sc-chip:hover { border-color: var(--sc-gold-dim); color: var(--sc-text); }
.sc-chip--active {
  background: var(--sc-gold-dim);
  border-color: var(--sc-gold);
  color: var(--sc-gold);
}

/* Price range */
.sc-price-range { display: flex; flex-direction: column; gap: 8px; }
.sc-price-range__labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--sc-text-muted);
}
.sc-range-track {
  position: relative;
  height: 4px;
  background: var(--sc-surface-3);
  border-radius: 2px;
  margin: 12px 0;
}
.sc-range-fill {
  position: absolute;
  height: 100%;
  background: var(--sc-gold);
  border-radius: 2px;
  pointer-events: none;
}
.sc-range-input {
  position: absolute;
  width: 100%;
  top: 50%;
  transform: translateY(-50%);
  appearance: none;
  height: 4px;
  background: none;
  outline: none;
  pointer-events: none;
}
.sc-range-input::-webkit-slider-thumb {
  appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--sc-gold);
  border: 2px solid var(--sc-bg);
  box-shadow: var(--sc-shadow-sm);
  cursor: pointer;
  pointer-events: all;
  transition: transform var(--sc-dur-fast);
}
.sc-range-input::-webkit-slider-thumb:hover { transform: scale(1.15); }
.sc-range-input::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--sc-gold);
  border: 2px solid var(--sc-bg);
  cursor: pointer;
  pointer-events: all;
}

/* Toggle */
.sc-toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--sc-text-muted);
}
.sc-toggle-input { position: absolute; opacity: 0; width: 0; height: 0; }
.sc-toggle-track {
  width: 36px; height: 20px;
  background: var(--sc-surface-3);
  border: 1px solid var(--sc-border);
  border-radius: 100px;
  position: relative;
  flex-shrink: 0;
  transition: background var(--sc-dur-fast);
}
.sc-toggle-track::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--sc-text-muted);
  transition: transform var(--sc-dur-fast), background var(--sc-dur-fast);
}
.sc-toggle-input:checked + .sc-toggle-track { background: var(--sc-gold-dim); border-color: var(--sc-gold); }
.sc-toggle-input:checked + .sc-toggle-track::after { transform: translateX(16px); background: var(--sc-gold); }

.sc-filter-drawer__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid var(--sc-border);
  padding-top: 16px;
}

/* Active filter chips */
.sc-active-filters { display: flex; flex-wrap: wrap; gap: 6px; }

/* Fabric Grid */
.sc-fabric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

/* Fabric Card */
.sc-fabric-card {
  position: relative;
  background: var(--sc-surface-2);
  border: 2px solid var(--sc-border);
  border-radius: var(--sc-radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--sc-dur) var(--sc-ease),
              transform var(--sc-dur) var(--sc-ease),
              box-shadow var(--sc-dur) var(--sc-ease);
}
.sc-fabric-card:hover {
  border-color: var(--sc-gold-dim);
  transform: translateY(-2px);
  box-shadow: var(--sc-shadow-md);
}
.sc-fabric-card--selected {
  border-color: var(--sc-gold) !important;
  box-shadow: 0 0 0 3px var(--sc-gold-dim), var(--sc-shadow-md);
}
.sc-fabric-card--selected::after {
  content: '✓';
  position: absolute;
  top: 6px; right: 8px;
  width: 20px; height: 20px;
  background: var(--sc-gold);
  color: var(--sc-bg);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sc-fabric-card__swatch {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--sc-surface-3);
}
.sc-fabric-card__swatch img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--sc-dur) var(--sc-ease);
}
.sc-fabric-card:hover .sc-fabric-card__swatch img { transform: scale(1.05); }

.sc-fabric-card__body {
  padding: 10px 12px;
}
.sc-fabric-card__name {
  font-size: 12px;
  font-weight: 600;
  color: var(--sc-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sc-fabric-card__sku  {
  font-size: 10px;
  color: var(--sc-text-dim);
  font-family: var(--sc-font-mono);
  margin-top: 1px;
}
.sc-fabric-card__price {
  font-size: 11px;
  font-weight: 600;
  color: var(--sc-gold);
  margin-top: 4px;
}
.sc-fabric-card__tags { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 5px; }
.sc-fabric-card__tag {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  padding: 2px 6px;
  background: var(--sc-surface-3);
  border-radius: 4px;
  color: var(--sc-text-dim);
}
.sc-fabric-card__tag--premium { background: var(--sc-gold-dim); color: var(--sc-gold); }

/* Skeleton loading */
.sc-fabric-card--skeleton { pointer-events: none; }
.sc-fabric-card--skeleton .sc-fabric-card__swatch,
.sc-skeleton-line {
  background: linear-gradient(90deg, var(--sc-surface-2) 25%, var(--sc-surface-3) 50%, var(--sc-surface-2) 75%);
  background-size: 200% 100%;
  animation: sc-shimmer 1.4s ease infinite;
  border-radius: 4px;
}
.sc-skeleton-line--title { height: 12px; width: 80%; margin-bottom: 6px; }
.sc-skeleton-line--sub   { height: 10px; width: 50%; }

@keyframes sc-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Empty state */
.sc-empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 60px 20px;
  color: var(--sc-text-muted);
}
.sc-empty-state svg { width: 60px; height: 60px; opacity: .3; }
.sc-empty-state p { font-size: 14px; text-align: center; }

/* Selected fabric bar */
.sc-fabric-selection-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--sc-gold-dim);
  border: 1px solid var(--sc-gold);
  border-radius: var(--sc-radius);
  animation: sc-step-in var(--sc-dur-fast) var(--sc-ease);
}
.sc-fabric-selection-bar__swatch {
  width: 40px; height: 40px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--sc-surface-3);
}
.sc-fabric-selection-bar__swatch img { width: 100%; height: 100%; object-fit: cover; }
.sc-fabric-selection-bar__info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.sc-fabric-selection-bar__info strong { font-size: 13px; font-weight: 600; color: var(--sc-text); }
.sc-fabric-selection-bar__info span   { font-size: 11px; color: var(--sc-text-muted); font-family: var(--sc-font-mono); }
.sc-fabric-selection-bar__price { font-size: 14px; font-weight: 700; color: var(--sc-gold); }

/* ── Style Step ──────────────────────────────────────────── */
.sc-option-group { display: flex; flex-direction: column; gap: 12px; }

.sc-option-group__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--sc-text-muted);
  text-transform: uppercase;
  letter-spacing: .8px;
}
.sc-option-group__title--muted { opacity: .45; }

.sc-option-tiles {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.sc-option-tiles--sm .sc-option-tile { min-width: 90px; }
.sc-option-tiles--future { opacity: .4; pointer-events: none; }

.sc-option-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 10px;
  min-width: 80px;
  background: var(--sc-surface-2);
  border: 1.5px solid var(--sc-border);
  border-radius: var(--sc-radius);
  cursor: pointer;
  transition: all var(--sc-dur) var(--sc-ease);
  font-family: var(--sc-font);
  position: relative;
}
.sc-option-tile:hover {
  border-color: var(--sc-gold-dim);
  transform: translateY(-2px);
}
.sc-option-tile--selected {
  border-color: var(--sc-gold);
  background: var(--sc-gold-dim);
}
.sc-option-tile--disabled { opacity: .35; cursor: not-allowed; }

.sc-option-tile__icon {
  width: 40px; height: 40px;
  border-radius: 6px;
  background: var(--sc-surface-3);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sc-option-tile__img {
  width: 100%; height: 100%;
  object-fit: contain;
  position: absolute;
  inset: 0;
}
.sc-option-tile__letter {
  font-size: 14px;
  font-weight: 700;
  color: var(--sc-text-dim);
}
.sc-option-tile__img:not([src=""]) + .sc-option-tile__letter { display: none; }

.sc-option-tile__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--sc-text);
  text-align: center;
  line-height: 1.2;
}
.sc-option-tile__price {
  font-size: 10px;
  font-weight: 600;
  color: var(--sc-gold);
}

/* Future badges */
.sc-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  padding: 3px 7px;
  border-radius: 4px;
}
.sc-badge--soon { background: var(--sc-surface-3); color: var(--sc-text-dim); }
.sc-badge--price { background: var(--sc-gold-dim); color: var(--sc-gold); border-radius: 6px; padding: 4px 10px; font-size: 12px; font-weight: 600; }

/* Future stubs section */
.sc-future-options { opacity: .5; pointer-events: none; }
.sc-future-list { display: flex; flex-direction: column; gap: 8px; }
.sc-future-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--sc-surface-2);
  border: 1px solid var(--sc-border);
  border-radius: var(--sc-radius);
}
.sc-future-item__label { font-size: 13px; color: var(--sc-text-muted); }

/* ── Accents Step ────────────────────────────────────────── */
.sc-accent-group { display: flex; flex-direction: column; gap: 12px; }
.sc-accent-group--future { opacity: .5; pointer-events: none; }

.sc-accent-group__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--sc-text-muted);
  text-transform: uppercase;
  letter-spacing: .8px;
}
.sc-accent-group__price { margin-left: auto; font-size: 12px; color: var(--sc-gold); font-weight: 600; text-transform: none; letter-spacing: 0; }

.sc-color-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sc-color-swatch {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid var(--sc-border);
  cursor: pointer;
  transition: transform var(--sc-dur-fast), border-color var(--sc-dur-fast), box-shadow var(--sc-dur-fast);
  position: relative;
}
.sc-color-swatch:hover { transform: scale(1.1); }
.sc-color-swatch--selected,
.sc-color-swatch[aria-checked="true"] {
  border-color: var(--sc-gold);
  box-shadow: 0 0 0 3px var(--sc-gold-dim);
}
.sc-color-swatch--skeleton {
  background: var(--sc-surface-3);
  animation: sc-shimmer 1.4s ease infinite;
  pointer-events: none;
}
.sc-color-grid--sm .sc-color-swatch { width: 28px; height: 28px; }

/* Monogram */
.sc-monogram-wrap { display: flex; flex-direction: column; gap: 12px; }
.sc-monogram-toggle-row { display: flex; align-items: center; gap: 12px; }
.sc-monogram-fields { display: flex; flex-direction: column; gap: 10px; animation: sc-step-in var(--sc-dur-fast) var(--sc-ease); }
.sc-field-label { font-size: 12px; font-weight: 600; color: var(--sc-text-muted); text-transform: uppercase; letter-spacing: .7px; }
.sc-text-input {
  background: var(--sc-surface-2);
  border: 1px solid var(--sc-border);
  border-radius: var(--sc-radius);
  color: var(--sc-text);
  font-family: var(--sc-font);
  font-size: 15px;
  font-weight: 600;
  padding: 10px 14px;
  outline: none;
  width: 100%;
  letter-spacing: 2px;
  transition: border-color var(--sc-dur-fast);
}
.sc-text-input:focus { border-color: var(--sc-gold); }
.sc-field-hint { font-size: 11px; color: var(--sc-text-dim); }

/* ── Action Bar ──────────────────────────────────────────── */
.sc-action-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  background: var(--sc-surface);
  border-top: 1px solid var(--sc-border);
  position: sticky;
  bottom: 0;
  z-index: 100;
}

.sc-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  background: none;
  border: 1px solid var(--sc-border);
  border-radius: var(--sc-radius);
  color: var(--sc-text-muted);
  font-family: var(--sc-font);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--sc-dur-fast);
  white-space: nowrap;
}
.sc-action-btn:hover { border-color: var(--sc-gold-dim); color: var(--sc-text); }
.sc-action-btn--wishlist[aria-pressed="true"] { border-color: var(--sc-gold); color: var(--sc-gold); }
.sc-action-btn .sc-icon { width: 15px; height: 15px; }

.sc-action-bar__spacer { flex: 1; }

.sc-action-bar__price { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.sc-action-bar__price-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .8px; color: var(--sc-text-dim); }
.sc-action-bar__price-value { font-size: 20px; font-weight: 700; color: var(--sc-gold); letter-spacing: -.5px; transition: color var(--sc-dur-fast); }

/* ── Share Modal ─────────────────────────────────────────── */
.sc-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: sc-modal-in var(--sc-dur) var(--sc-ease);
}

@keyframes sc-modal-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.sc-modal[hidden] { display: none; }

.sc-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(4px);
}

.sc-modal__box {
  position: relative;
  background: var(--sc-surface);
  border: 1px solid var(--sc-border);
  border-radius: var(--sc-radius-xl);
  padding: 32px;
  max-width: 480px;
  width: 90%;
  box-shadow: var(--sc-shadow-lg);
  animation: sc-modal-box var(--sc-dur) var(--sc-ease);
}

@keyframes sc-modal-box {
  from { transform: scale(.95) translateY(16px); }
  to   { transform: scale(1) translateY(0); }
}

.sc-modal__close {
  position: absolute;
  top: 12px; right: 16px;
  background: none;
  border: none;
  color: var(--sc-text-muted);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: color var(--sc-dur-fast);
}
.sc-modal__close:hover { color: var(--sc-text); }

.sc-modal__title { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.sc-modal__desc  { font-size: 14px; color: var(--sc-text-muted); margin-bottom: 20px; }
.sc-modal__copied { font-size: 13px; color: var(--sc-success); margin-top: 8px; }

.sc-share-link-wrap {
  display: flex;
  gap: 8px;
}
.sc-share-link-input {
  flex: 1;
  background: var(--sc-surface-2);
  border: 1px solid var(--sc-border);
  border-radius: var(--sc-radius);
  color: var(--sc-text);
  font-family: var(--sc-font-mono);
  font-size: 12px;
  padding: 10px 14px;
  outline: none;
}

/* ── Loading Overlay ─────────────────────────────────────── */
.sc-loader {
  position: fixed;
  inset: 0;
  background: rgba(15,15,19,.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}
.sc-loader[hidden] { display: none; }
.sc-loader__spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--sc-border);
  border-top-color: var(--sc-gold);
  border-radius: 50%;
  animation: sc-spin .7s linear infinite;
}
@keyframes sc-spin {
  to { transform: rotate(360deg); }
}

/* ── Icons ───────────────────────────────────────────────── */
.sc-icon { width: 18px; height: 18px; flex-shrink: 0; }
.sc-icon--sm { width: 14px; height: 14px; }

/* ── Error state ─────────────────────────────────────────── */
.sc-error {
  padding: 16px;
  background: rgba(224,92,92,.1);
  border: 1px solid var(--sc-danger);
  border-radius: var(--sc-radius);
  color: var(--sc-danger);
  font-size: 14px;
}

/* ── Accent subgroup (conditional) ──────────────────────── */
.sc-accent-subgroup {
  margin-left: 16px;
  padding-left: 16px;
  border-left: 3px solid var(--sc-border);
}
.sc-accent-group__title--sub {
  font-size: 13px;
  color: var(--sc-text-muted);
}

/* ── Sizing Section ──────────────────────────────────────── */
.sc-sizing-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--sc-border);
}
.sc-sizing-section__title {
  margin-bottom: 4px;
}
.sc-sizing-section__desc {
  font-size: 13px;
  color: var(--sc-text-muted);
  margin: 0 0 20px;
}
.sc-sizing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.sc-sizing-group__title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--sc-text-muted);
  margin: 0 0 12px;
}
.sc-sizing-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sc-sizing-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sc-sizing-field--full {
  grid-column: 1 / -1;
}
.sc-sizing-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--sc-text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.sc-sizing-unit {
  font-size: 10px;
  font-weight: 400;
  color: var(--sc-text-dim);
  background: var(--sc-surface-2);
  border-radius: 3px;
  padding: 1px 4px;
}
.sc-sizing-input {
  background: var(--sc-surface-2);
  border: 1px solid var(--sc-border);
  border-radius: var(--sc-radius);
  color: var(--sc-text);
  font-family: var(--sc-font);
  font-size: 14px;
  padding: 9px 12px;
  outline: none;
  transition: border-color var(--sc-dur-fast);
  width: 100%;
}
.sc-sizing-input:focus { border-color: var(--sc-accent); }
.sc-sizing-textarea {
  background: var(--sc-surface-2);
  border: 1px solid var(--sc-border);
  border-radius: var(--sc-radius);
  color: var(--sc-text);
  font-family: var(--sc-font);
  font-size: 14px;
  padding: 9px 12px;
  outline: none;
  resize: vertical;
  width: 100%;
  transition: border-color var(--sc-dur-fast);
}
.sc-sizing-textarea:focus { border-color: var(--sc-accent); }
.sc-fit-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.sc-fit-option {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.sc-fit-radio {
  accent-color: var(--sc-accent);
  cursor: pointer;
}
.sc-fit-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--sc-text);
}

/* ── Responsive ──────────────────────────────────────────── */

/* Tablet: 768–1199px */
@media (max-width: 1199px) {
  .sc-body { grid-template-columns: 40fr 60fr; }
}

@media (max-width: 991px) {
  .sc-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .sc-preview {
    border-right: none;
    border-bottom: 1px solid var(--sc-border);
  }

  .sc-preview__sticky { position: static; padding: 16px; }

  .sc-layer-canvas {
    max-width: 280px;
    margin: 0 auto;
  }

  .sc-preview__summary {
    grid-template-columns: repeat(4, 1fr);
    max-width: none;
  }
}

/* Mobile: < 768px */
@media (max-width: 767px) {
  .sc-topbar {
    flex-wrap: wrap;
    padding: 12px 16px;
    gap: 10px;
  }

  .sc-topbar__title { font-size: 15px; }
  .sc-step-nav { order: 3; width: 100%; justify-content: center; overflow-x: auto; padding-bottom: 4px; }
  .sc-step-pip__label { display: none; }
  .sc-topbar__price { order: 2; }

  .sc-preview { max-height: 280px; overflow: hidden; }
  .sc-preview__sticky { padding: 12px; gap: 12px; }
  .sc-layer-canvas { max-width: 200px; }
  .sc-preview__summary { display: none; }

  .sc-step__inner { padding: 16px; gap: 16px; }
  .sc-step-footer { padding: 12px 16px; }

  .sc-fabric-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }

  .sc-action-bar { padding: 12px 16px; gap: 8px; }
  .sc-action-btn span { display: none; }

  .sc-filter-drawer__inner { padding: 16px; }

  /* Mobile filter: full-screen modal */
  .sc-filter-drawer[data-mobile-open="true"] {
    position: fixed;
    inset: 0;
    z-index: 500;
    border-radius: 0;
    overflow-y: auto;
  }
}

/* ── Print ───────────────────────────────────────────────── */
@media print {
  .sc-action-bar, .sc-step-footer, .sc-panels { display: none; }
  .sc-body { grid-template-columns: 1fr; }
  .sc-layer-canvas { max-width: 400px; }
}

/* ── Customize Button (WooCommerce product page) ─────────── */
.sc-customize-wrap {
  margin-top: 12px;
  margin-bottom: 4px;
  width: 100%;
  clear: both;
}
.sc-customize-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px !important;
  width: 100%;
  background: #111827 !important;
  color: #c9a84c !important;
  border: 2px solid #c9a84c !important;
  border-radius: 6px !important;
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 15px !important;
  font-weight: 600 !important;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none !important;
  cursor: pointer;
  transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
  box-shadow: none !important;
}
.sc-customize-btn:hover,
.sc-customize-btn:focus {
  background: #c9a84c !important;
  color: #111827 !important;
  border-color: #c9a84c !important;
  text-decoration: none !important;
}

/* ── Builder body (sc-builder-body class applied by template) ─── */
/* The builder template is self-contained (no Blocksy header/footer),
   so these rules just ensure the page itself has no default margin/padding. */
body.sc-builder-body,
body.sc-builder-page {
  margin: 0;
  padding: 0;
  background: #0f0f13;
  overflow: hidden;
}

body.sc-builder-body #sc-builder-root,
body.sc-builder-page #sc-builder-root {
  width: 100%;
  height: 100%;
}

/* Ensure the configurator shell fills the full viewport */
body.sc-builder-body .sc-configurator,
body.sc-builder-page .sc-configurator {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
