/* VÉRAËON Atelier — Premium commerce design system */
:root {
  --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --font-display: Georgia, 'Times New Roman', serif;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 180ms ease;
  --header-h: 56px;
  --touch-min: 44px;
}

[data-theme="dark"] {
  --bg: #0a0a0c;
  --bg-elevated: #141418;
  --bg-card: #1a1a20;
  --text: #f4f2ef;
  --text-muted: #9a9690;
  --accent: #c9a962;
  --accent-hover: #dfc07a;
  --border: #2a2a32;
  --success: #6ecf8a;
  --error: #e87c7c;
  --overlay: rgba(0,0,0,0.6);
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --hero-grad: linear-gradient(135deg, #1a1a24 0%, #0a0a0c 50%, #12101a 100%);
}

[data-theme="light"] {
  --bg: #faf9f7;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --text: #1a1814;
  --text-muted: #6b6560;
  --accent: #9a7b3a;
  --accent-hover: #7a6230;
  --border: #e8e4de;
  --success: #2d8a4e;
  --error: #c0392b;
  --overlay: rgba(0,0,0,0.35);
  --shadow: 0 8px 32px rgba(0,0,0,0.08);
  --hero-grad: linear-gradient(135deg, #f5f0e8 0%, #faf9f7 50%, #ece8e0 100%);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1rem;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.12em;
  font-size: 0.85rem;
  min-height: var(--touch-min);
}

.logo-mark { color: var(--accent); font-size: 1.1rem; }

.nav-main { display: none; gap: 1rem; margin-left: auto; }
@media (min-width: 640px) { .nav-main { display: flex; } }

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  padding: 0.5rem;
  min-height: var(--touch-min);
  display: flex;
  align-items: center;
}
.nav-link:hover { color: var(--text); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}
@media (min-width: 640px) { .header-actions { margin-left: 0; } }

.select-compact {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.5rem;
  font-size: 0.75rem;
  min-height: var(--touch-min);
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  position: relative;
}
.btn-icon:hover { background: var(--bg-card); }

.cart-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--accent);
  color: var(--bg);
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  min-height: var(--touch-min);
  text-decoration: none;
  transition: background var(--transition), transform var(--transition);
}
.btn-primary {
  background: var(--accent);
  color: var(--bg);
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--accent); }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover { color: var(--text); }
.btn-lg { padding: 1rem 1.75rem; font-size: 1rem; }
.btn-sm { padding: 0.5rem 0.875rem; font-size: 0.8rem; min-height: 36px; }

/* Hero */
.hero {
  display: grid;
  gap: 2rem;
  padding: 2rem 1rem 3rem;
  background: var(--hero-grad);
  min-height: 50dvh;
  align-items: center;
}
@media (min-width: 768px) {
  .hero { grid-template-columns: 1fr 1fr; padding: 4rem 2rem; }
}

.hero-content h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 400;
  margin: 0.25rem 0;
  line-height: 1.1;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  color: var(--accent);
  margin: 0;
}

.hero-sub { color: var(--text-muted); margin: 0 0 1.5rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.hero-visual {
  aspect-ratio: 4/5;
  border-radius: var(--radius);
  background: radial-gradient(ellipse at 50% 30%, rgba(201,169,98,0.25), transparent 60%),
              linear-gradient(180deg, var(--bg-card), var(--bg));
  position: relative;
  overflow: hidden;
}
.hero-visual::after {
  content: '';
  position: absolute;
  inset: 20% 30%;
  border: 2px solid var(--accent);
  border-radius: 50%;
  opacity: 0.4;
  animation: pulse-ring 4s ease-in-out infinite;
}
@keyframes pulse-ring {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.05); opacity: 0.6; }
}

.material-obsidian { --mat: #141418; }
.material-aurora { --mat: #b8c4d0; }
.material-rose { --mat: #d9a88a; }
.material-glacier { --mat: #e8ecef; }

/* Trust bar */
.trust-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  list-style: none;
  padding: 1rem;
  margin: 0;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
  justify-content: center;
}

/* Configurator */
.configurator {
  display: grid;
  gap: 2rem;
  padding: 2rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
}
@media (min-width: 900px) {
  .configurator { grid-template-columns: 1fr 1fr; padding: 3rem 2rem; }
}

.canvas-wrap {
  position: relative;
  aspect-ratio: 4/5;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

#halo-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.fallback-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 2rem;
}

.config-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin: 0.5rem 0;
}

.gallery-strip {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.gallery-thumb {
  flex: 1;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  background: linear-gradient(135deg, var(--bg-card), var(--mat, #333));
}
.gallery-thumb:hover, .gallery-thumb:focus { border-color: var(--accent); }

.configurator-panel h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin: 0.25rem 0;
}

.tagline { color: var(--text-muted); margin: 0 0 1rem; }

.rating { color: var(--accent); font-size: 0.875rem; margin-bottom: 1rem; }
.rating span { color: var(--text-muted); margin-left: 0.5rem; }

.price-block { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.75rem; margin-bottom: 0.5rem; }
.price-current { font-size: 1.75rem; font-weight: 600; }
.price-compare { text-decoration: line-through; color: var(--text-muted); font-size: 1.1rem; }
.price-save { color: var(--success); font-size: 0.875rem; }

.qty-breaks { font-size: 0.75rem; color: var(--text-muted); margin: 0 0 0.5rem; }
.stock-status { font-size: 0.875rem; margin-bottom: 1.5rem; }
.in-stock { color: var(--success); }
.out-of-stock { color: var(--error); }

.option-group {
  border: none;
  margin: 0 0 1.25rem;
  padding: 0;
}
.option-group legend {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

.option-grid, .size-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.option-chip, .size-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-height: var(--touch-min);
  transition: border-color var(--transition);
  position: relative;
}
.option-chip input, .size-chip input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.option-chip.selected, .size-chip.selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.option-chip.disabled, .size-chip.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.option-icon { font-size: 1.1rem; margin-bottom: 0.25rem; color: var(--accent); }
.option-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  margin-bottom: 0.25rem;
  border: 1px solid var(--border);
}
.option-label { font-size: 0.8rem; }
.option-delta { font-size: 0.7rem; color: var(--text-muted); }

.input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  font-size: 1rem;
  min-height: var(--touch-min);
}
.input-error { border-color: var(--error); }
.field-error { color: var(--error); font-size: 0.8rem; display: block; margin-top: 0.25rem; }
.field-label { display: block; font-size: 0.875rem; margin-bottom: 0.35rem; }

.config-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0; }
.product-desc { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; }
.sustainability { font-size: 0.75rem; color: var(--accent); margin-top: 1rem; }

/* Fit guide, FBT, Loyalty, Reviews */
.fit-guide, .fbt, .loyalty-card, .reviews, .support-banner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.fit-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}
.fit-form .input { max-width: 120px; }
.fit-result { color: var(--accent); font-weight: 500; }

.loyalty-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin: 1rem 0;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 400ms ease;
}
.daily-reveal {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.review-grid {
  display: grid;
  gap: 1rem;
}
@media (min-width: 640px) { .review-grid { grid-template-columns: repeat(3, 1fr); } }

.review-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 0;
}
.review-card footer { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.75rem; }

.support-banner {
  text-align: center;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  margin-bottom: 2rem;
}

/* Catalog */
.catalog-header { padding: 2rem 1rem 1rem; max-width: 1200px; margin: 0 auto; }
.search-input { max-width: 400px; margin-top: 1rem; }
.search-meta { font-size: 0.875rem; color: var(--text-muted); }

.product-grid {
  list-style: none;
  padding: 1rem;
  margin: 0 auto;
  max-width: 1200px;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.product-link { text-decoration: none; color: inherit; }
.product-thumb {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--bg-elevated), var(--border));
  margin-bottom: 0.75rem;
}
.cat-sculptures { background: linear-gradient(135deg, #1a1a24, #2a2a38); }
.cat-accessories { background: linear-gradient(135deg, #2a2420, #3a3430); }
.cat-care { background: linear-gradient(135deg, #242a24, #343a34); }
.cat-services { background: linear-gradient(135deg, #242028, #343038); }

/* Drawers */
.overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.overlay.visible { opacity: 1; pointer-events: auto; }

.mini-cart, .assistant-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(100%, 420px);
  height: 100dvh;
  background: var(--bg-elevated);
  z-index: 201;
  transform: translateX(100%);
  transition: transform 280ms ease;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}
.mini-cart.open, .assistant-panel.open { transform: translateX(0); }

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}
.drawer-header h2 { margin: 0; font-size: 1.1rem; }
.drawer-body { flex: 1; overflow-y: auto; padding: 1rem; }
.drawer-footer { padding: 1rem; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 0.5rem; }

.cart-line {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.cart-line h3 { margin: 0 0 0.25rem; font-size: 0.95rem; }
.cart-config { font-size: 0.8rem; color: var(--text-muted); margin: 0; }
.cart-warning { color: var(--error); font-size: 0.8rem; }
.cart-line-actions { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; flex-wrap: wrap; }
.input-qty { width: 64px; }
.line-price { font-weight: 600; margin-left: auto; }

.cart-totals { margin-top: 1rem; }
.total-row {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  font-size: 0.875rem;
}
.total-row.save { color: var(--success); }
.total-final { font-size: 1.1rem; font-weight: 600; border-top: 1px solid var(--border); padding-top: 0.75rem; margin-top: 0.5rem; }
.shipping-progress { font-size: 0.75rem; color: var(--accent); }

.coupon-form { margin: 1rem 0; }
.coupon-row { display: flex; gap: 0.5rem; }
.coupon-row .input { flex: 1; }
.coupon-ok { color: var(--success); font-size: 0.8rem; }

/* Checkout */
.checkout-page { max-width: 640px; margin: 0 auto; padding: 1rem; }
.checkout-steps ol {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}
.checkout-steps li {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.checkout-steps li.active { color: var(--accent); font-weight: 600; }
.checkout-steps li.done { color: var(--success); }
.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.checkout-form .field-label { margin-top: 1rem; }

.shipping-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  cursor: pointer;
}
.shipping-option.selected { border-color: var(--accent); }
.payment-mock, .payment-card { color: var(--text-muted); font-size: 0.875rem; }

.checkout-nav { display: flex; gap: 0.75rem; justify-content: space-between; margin-top: 2rem; padding-bottom: 2rem; }

.order-confirm { text-align: center; padding: 3rem 1rem; }
.confirm-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--success);
  color: white;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}
.order-num { font-size: 1.25rem; font-weight: 600; color: var(--accent); }

/* Assistant */
.assistant-body { flex: 1; overflow-y: auto; }
.agent-step {
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  border-left: 3px solid var(--accent);
  animation: step-in 300ms ease;
}
@keyframes step-in {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}
.thinking { color: var(--accent); font-style: italic; }
.chat-msg { padding: 0.5rem; margin: 0.25rem 0; font-size: 0.85rem; border-radius: var(--radius-sm); }
.chat-msg.user { background: var(--bg-card); text-align: right; }
.chat-msg.assistant { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.takeover-note { font-size: 0.75rem; color: var(--text-muted); padding: 0.5rem; }
.assistant-form {
  display: flex;
  gap: 0.5rem;
  padding: 1rem;
  border-top: 1px solid var(--border);
}
.assistant-form .input { flex: 1; }

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  z-index: 300;
  font-size: 0.875rem;
  animation: toast-in 280ms ease;
}
.toast-success { border-color: var(--success); }
.toast-error { border-color: var(--error); }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
}
