@import url("https://fonts.googleapis.com/css2?family=Bodoni+Moda:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&family=Cormorant+Garamond:wght@500;600&display=swap");

@font-face {
  font-family: "Antro Vectra";
  src: url("./fonts/Antro_Vectra_20201208.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-1: #efe4d6;
  --bg-2: #f7f1e9;
  --bg-3: #eadcca;
  --card: rgba(255, 250, 243, 0.82);
  --card-strong: rgba(255, 250, 243, 0.94);
  --line: rgba(76, 52, 33, 0.11);
  --ink: #18120e;
  --ink-soft: #7b6657;
  --shadow: 0 22px 70px rgba(67, 41, 20, 0.15);
  --hero: "Cormorant Garamond", serif;
  --ui: "Manrope", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body.customizer-page {
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--ui);
  background:
    radial-gradient(circle at 12% 10%, rgba(194, 153, 114, 0.25), transparent 22%),
    radial-gradient(circle at 88% 8%, rgba(224, 205, 179, 0.38), transparent 18%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 50%, var(--bg-3) 100%);
}

body.customizer-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 11px),
    linear-gradient(120deg, rgba(255, 255, 255, 0.34), transparent 34%);
  opacity: 0.45;
}

body.modal-open {
  overflow: hidden;
}

.mobile-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 10px calc(18px + env(safe-area-inset-bottom));
}

.mobile-header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4px 0 12px;
}

.section-kicker {
  margin: 0;
  color: #9a7a63;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.studio-logo {
  width: min(64vw, 224px);
  height: auto;
}

.preview-panel,
.controls-panel,
.zoom-sheet {
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.preview-panel {
  border-radius: 28px;
  padding: 12px;
}

.preview-message-block {
  margin-top: 10px;
}

.section-copy {
  display: block;
  margin-bottom: 10px;
}

.inline-kicker {
  margin-bottom: 2px;
}

.section-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.section-note,
.field-note {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.45;
}

.section-note,
.field-note-inline {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.preview-stage-wrap {
  border-radius: 22px;
  overflow: hidden;
}

.bottle-stage {
  position: relative;
  min-height: 252px;
  aspect-ratio: 1 / 0.94;
  overflow: hidden;
  background: transparent;
}

.stage-glow,
.stage-sheen {
  position: absolute;
  pointer-events: none;
}

.stage-glow {
  display: none;
}

.stage-glow-left {
  width: 160px;
  height: 160px;
  left: -46px;
  top: 44px;
  background: rgba(255, 255, 255, 0.32);
}

.stage-glow-right {
  width: 180px;
  height: 180px;
  right: -56px;
  bottom: 26px;
  background: rgba(212, 182, 157, 0.16);
}

.stage-sheen {
  inset: 16px 16px 16px;
  border-radius: 16px;
  background:
    linear-gradient(106deg, rgba(255,255,255,0.11) 10%, transparent 28%),
    linear-gradient(90deg, transparent 66%, rgba(255,255,255,0.06) 80%, transparent 92%);
}

.render-shell {
  position: absolute;
  inset: 16px 16px 16px;
  border: 1px solid rgba(77, 53, 34, 0.06);
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(247,247,245,0.98), rgba(240,240,237,0.98));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18);
}

.render-shell canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.render-status,
.render-fallback {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(71, 47, 28, 0.08);
  background: rgba(255, 252, 247, 0.82);
  backdrop-filter: blur(10px);
  color: #8b6e5a;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.render-status.is-hidden {
  display: none;
}

.finish-toggle,
.preset-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(68, 45, 27, 0.12);
  background: rgba(255, 252, 247, 0.88);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.finish-toggle,
.preset-chip,
.swatch,
.zoom-close,
.zoom-fab {
  cursor: pointer;
}

.zoom-fab {
  position: absolute;
  right: 26px;
  bottom: 24px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  width: 29px;
  height: 29px;
  border: 1px solid rgba(68, 45, 27, 0.14);
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.96);
  color: rgba(71, 49, 32, 0.82);
  font: inherit;
  font-size: 21px;
  font-weight: 400;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(86, 58, 36, 0.12);
  backdrop-filter: blur(8px);
}

.controls-panel {
  margin-top: 10px;
  border-radius: 28px;
  padding: 10px;
}

.control-block + .control-block,
.message-block {
  margin-top: 10px;
}

.control-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.control-meta {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
}

.control-meta #summary-color,
.control-meta #summary-cap {
  color: #9a7a63;
  font-size: 10px;
  font-weight: 600;
}

.control-head h2 {
  margin: 0;
  font-family: var(--hero);
  font-size: 1.22rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.control-head span {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 600;
}

.swatch-scroll {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
}

.scroll-indicator {
  position: absolute;
  top: -1px;
  height: 66px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  padding: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
}

.scroll-indicator-left {
  left: 2px;
  background: linear-gradient(90deg, rgba(247, 241, 234, 0.8) 0%, rgba(247, 241, 234, 0.38) 40%, rgba(247, 241, 234, 0) 100%);
}

.scroll-indicator-right {
  right: -1px;
  background: linear-gradient(270deg, rgba(247, 241, 234, 0.9) 0%, rgba(247, 241, 234, 0.55) 42%, rgba(247, 241, 234, 0) 100%);
}

.swatch-scroll.is-left-visible .scroll-indicator-left,
.swatch-scroll.is-right-visible .scroll-indicator-right {
  opacity: 1;
}

.scroll-indicator-glyph {
  position: relative;
  display: block;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.9);
  border: 1px solid rgba(77, 53, 34, 0.1);
  box-shadow: 0 10px 20px rgba(86, 58, 36, 0.1);
  backdrop-filter: blur(8px);
}

.scroll-indicator-glyph::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-top: 1.8px solid rgba(82, 60, 43, 0.78);
  border-right: 1.8px solid rgba(82, 60, 43, 0.78);
}

.scroll-indicator-left .scroll-indicator-glyph::before {
  transform: translate(-35%, -50%) rotate(-135deg);
}

.scroll-indicator-right .scroll-indicator-glyph::before {
  transform: translate(-65%, -50%) rotate(45deg);
}

.swatch-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 62px;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  padding-right: 42px;
  scrollbar-width: none;
}

.swatch-grid::-webkit-scrollbar {
  display: none;
}

.swatch {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
}

.swatch::before {
  content: "";
  width: 100%;
  aspect-ratio: 1;
  border-radius: 18px;
  border: 1px solid rgba(74, 50, 31, 0.12);
  background:
    linear-gradient(120deg, rgba(255,255,255,0.22), transparent 34%),
    linear-gradient(180deg, var(--swatch), color-mix(in srgb, var(--swatch) 72%, black 28%));
  box-shadow: inset 0 -10px 14px rgba(0, 0, 0, 0.14);
}

.swatch span {
  font-size: 9px;
  font-weight: 700;
  line-height: 1.1;
}

.swatch.active::before,
.finish-toggle.active,
.preset-chip.active,
.finish-toggle:focus-visible,
.preset-chip:focus-visible,
.swatch:focus-visible::before,
.engraving-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(118, 77, 45, 0.16), 0 12px 26px rgba(70, 44, 23, 0.08);
}

.toggle-row,
.preset-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.engraving-input {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 18px;
  border: 1px solid rgba(67, 46, 29, 0.12);
  background: rgba(255, 252, 247, 0.9);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}

.finish-toggle {
  gap: 8px;
  justify-content: center;
  min-height: 44px;
}

.cap-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(75, 51, 32, 0.12);
  flex: 0 0 14px;
}

.cap-dot.gold {
  background: linear-gradient(135deg, #f4ddb0, #b57d37 58%, #6c4212);
}

.cap-dot.silver {
  background: linear-gradient(135deg, #f7f9fb, #bfc5cb 58%, #727b86);
}

.zoom-modal[hidden] {
  display: none;
}

.zoom-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
}

.zoom-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 11, 8, 0.48);
  backdrop-filter: blur(10px);
}

.zoom-sheet {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  border-radius: 28px;
  padding: 14px;
  background: var(--card-strong);
}

.zoom-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.zoom-sheet-head strong {
  font-size: 14px;
}

.zoom-close {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(68, 45, 27, 0.12);
  background: rgba(255, 252, 247, 0.95);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}

.zoom-canvas-wrap {
  border-radius: 22px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 14%, rgba(255,255,255,0.98), rgba(245,238,229,0.94) 50%, rgba(236,224,210,0.94) 100%);
  border: 1px solid rgba(77, 53, 34, 0.08);
}

#zoomCanvas {
  display: block;
  width: 100%;
  height: 260px;
}

@media (min-width: 431px) {
  .mobile-shell {
    padding-bottom: 28px;
  }
}
