/* ==========================================================================
   WISMAPS — Sistema visual
   Tres direcciones estéticas (Linen / Forest / Midnight) controladas por
   data-aesthetic en <body>.  El chrome del editor (light/dark/minimal) y
   la densidad (compact/comfy/spacious) se controlan por separado.
   ========================================================================== */

:root {
  /* Type stacks */
  --serif: 'Fraunces', 'Cormorant Garamond', Georgia, serif;
  --serif-display: 'Instrument Serif', 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, monospace;

  /* Geometry */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Default palette tokens — overridden by [data-aesthetic] below */
  --ink:        #1a1a1f;
  --ink-soft:   #2c2c33;
  --paper:      #f4efe6;
  --paper-warm: #ece4d4;
  --paper-deep: #e3d8c4;
  --line:       rgba(26, 26, 31, 0.12);
  --line-soft:  rgba(26, 26, 31, 0.06);
  --muted:      rgba(26, 26, 31, 0.55);
  --muted-soft: rgba(26, 26, 31, 0.38);
  --accent:     #c9694e;          /* terracota cálida */
  --accent-ink: #ffffff;
  --pin:        #c9694e;

  /* Editor chrome tokens (overridden by [data-chrome]) */
  --c-bg:       #faf8f3;
  --c-panel:    #ffffff;
  --c-panel-2:  #f7f3eb;
  --c-text:     var(--ink);
  --c-text-soft:var(--muted);
  --c-line:     var(--line);
  --c-hover:    rgba(0,0,0,0.04);
  --c-nav-bg:   #1a1a1f;
  --c-nav-text: rgba(255,255,255,0.55);
  --c-nav-active: #ffffff;

  /* Densities */
  --d-pad: 16px;
  --d-gap: 12px;
  --d-control-h: 38px;

  --maplibre-canvas-h: 100%;
}

/* === Aesthetic palettes ================================================ */
body[data-aesthetic="linen"] {
  --ink:        #1f1d1a;
  --ink-soft:   #2c2925;
  --paper:      #f4efe6;
  --paper-warm: #ece4d4;
  --paper-deep: #ddd0b8;
  --line:       rgba(31, 29, 26, 0.12);
  --line-soft:  rgba(31, 29, 26, 0.06);
  --muted:      rgba(31, 29, 26, 0.55);
  --muted-soft: rgba(31, 29, 26, 0.38);
  --accent:     #c9694e;
  --accent-ink: #ffffff;
  --pin:        #c9694e;
}
body[data-aesthetic="forest"] {
  --ink:        #1d2924;
  --ink-soft:   #2a3a33;
  --paper:      #ece6d6;
  --paper-warm: #e1d8c1;
  --paper-deep: #cfc09e;
  --line:       rgba(29, 41, 36, 0.14);
  --line-soft:  rgba(29, 41, 36, 0.06);
  --muted:      rgba(29, 41, 36, 0.55);
  --muted-soft: rgba(29, 41, 36, 0.38);
  --accent:     #b6884c;
  --accent-ink: #1d2924;
  --pin:        #8a3f2f;
}
body[data-aesthetic="midnight"] {
  --ink:        #0f1115;
  --ink-soft:   #1b1f27;
  --paper:      #f5f2ec;
  --paper-warm: #ecddbf;
  --paper-deep: #d9c597;
  --line:       rgba(15, 17, 21, 0.14);
  --line-soft:  rgba(15, 17, 21, 0.05);
  --muted:      rgba(15, 17, 21, 0.55);
  --muted-soft: rgba(15, 17, 21, 0.38);
  --accent:     #c9a84c;
  --accent-ink: #0f1115;
  --pin:        #b94a36;
}

/* === Editor chrome ==================================================== */
body[data-chrome="light"] {
  --c-bg:       #faf8f3;
  --c-panel:    #ffffff;
  --c-panel-2:  #f7f3eb;
  --c-text:     var(--ink);
  --c-text-soft:var(--muted);
  --c-line:     var(--line);
  --c-hover:    rgba(0,0,0,0.04);
  --c-nav-bg:   var(--ink);
  --c-nav-text: rgba(255,255,255,0.6);
  --c-nav-active: #ffffff;
}
body[data-chrome="dark"] {
  --c-bg:       #14131a;
  --c-panel:    #1c1b22;
  --c-panel-2:  #25232c;
  --c-text:     #eeeae0;
  --c-text-soft:rgba(238,234,224,0.6);
  --c-line:     rgba(255,255,255,0.09);
  --c-hover:    rgba(255,255,255,0.05);
  --c-nav-bg:   #0a090e;
  --c-nav-text: rgba(255,255,255,0.45);
  --c-nav-active: #ffffff;
}
body[data-chrome="minimal"] {
  --c-bg:       var(--paper);
  --c-panel:    var(--paper);
  --c-panel-2:  var(--paper-warm);
  --c-text:     var(--ink);
  --c-text-soft:var(--muted);
  --c-line:     var(--line);
  --c-hover:    rgba(0,0,0,0.04);
  --c-nav-bg:   transparent;
  --c-nav-text: var(--muted);
  --c-nav-active: var(--ink);
}

/* === Density =========================================================== */
body[data-density="compact"]  { --d-pad: 12px; --d-gap: 8px;  --d-control-h: 32px; }
body[data-density="comfy"]    { --d-pad: 18px; --d-gap: 12px; --d-control-h: 38px; }
body[data-density="spacious"] { --d-pad: 24px; --d-gap: 18px; --d-control-h: 44px; }

/* === Base ============================================================== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
a { color: inherit; }
::selection { background: var(--ink); color: var(--paper); }

#root { min-height: 100%; display: flex; flex-direction: column; }

/* ==========================================================================
   LANDING
   ========================================================================== */
.landing { min-height: 100vh; background: var(--paper); color: var(--ink); }

.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 40px;
  border-bottom: 1px solid var(--line-soft);
}
.nav-brand {
  font-family: var(--serif-display);
  font-size: 24px; letter-spacing: 0.18em;
  font-weight: 400;
}
.nav-brand i { font-style: italic; letter-spacing: 0; opacity: 0.6; font-size: 0.7em; }
.nav-links { display: flex; gap: 32px; font-size: 13px; color: var(--muted); }
.nav-links a { text-decoration: none; transition: color 150ms; }
.nav-links a:hover { color: var(--ink); }
.nav-cta {
  background: var(--ink); color: var(--paper);
  border: 0; padding: 10px 20px; border-radius: 999px;
  font-size: 13px; font-weight: 500; letter-spacing: 0.02em;
  transition: transform 200ms, background 200ms;
}
.nav-cta:hover { background: var(--accent); color: var(--accent-ink); }

.hero {
  display: grid; grid-template-columns: 1.05fr 1fr;
  gap: 60px; align-items: center;
  padding: 60px 40px 80px;
  max-width: 1400px; margin: 0 auto;
}
.hero-eyebrow {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; gap: 10px;
}
.hero-eyebrow::before {
  content: ''; width: 28px; height: 1px; background: var(--ink);
}
.hero-title {
  font-family: var(--serif-display);
  font-size: clamp(48px, 6.4vw, 92px);
  line-height: 0.96; letter-spacing: -0.015em;
  font-weight: 400;
  margin: 22px 0 24px;
  color: var(--ink);
}
.hero-title em {
  font-style: italic;
  color: var(--accent);
}
.hero-sub {
  font-size: 17px; line-height: 1.55;
  color: var(--muted);
  max-width: 480px;
  margin-bottom: 36px;
}
.hero-ctas { display: flex; gap: 14px; align-items: center; }
.btn-primary {
  background: var(--ink); color: var(--paper);
  border: 0; padding: 16px 30px; border-radius: 999px;
  font-size: 15px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 10px;
  transition: transform 200ms, background 200ms;
}
.btn-primary:hover { background: var(--accent); color: var(--accent-ink); transform: translateY(-1px); }
.btn-primary svg { transition: transform 200ms; }
.btn-primary:hover svg { transform: translateX(3px); }
.btn-ghost {
  background: transparent; color: var(--ink);
  border: 1px solid var(--line);
  padding: 16px 24px; border-radius: 999px;
  font-size: 14px; font-weight: 500;
}
.btn-ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.hero-meta {
  display: flex; gap: 28px;
  margin-top: 36px;
  font-size: 12px; color: var(--muted);
}
.hero-meta-item { display: flex; align-items: center; gap: 8px; }
.hero-meta-item svg { color: var(--accent); }

/* Hero visual — stacked posters */
.hero-visual {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center;
}
.hero-poster {
  position: absolute;
  width: 56%; aspect-ratio: 3 / 4;
  background: #fff;
  box-shadow: 0 30px 80px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.06);
}
.hero-poster.p1 { transform: translate(-22%, -2%) rotate(-6deg); z-index: 1; }
.hero-poster.p2 { transform: translate(15%,  4%) rotate(7deg); z-index: 2; }
.hero-poster.p3 { transform: translate(-2%, -10%) rotate(-1deg); z-index: 3; }
.hero-poster-img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}

/* Intent picker (under hero) */
.intent-section { padding: 60px 40px 100px; background: var(--paper-warm); }
.intent-wrap { max-width: 1200px; margin: 0 auto; }
.intent-title {
  font-family: var(--serif-display);
  font-size: 38px; font-weight: 400; letter-spacing: -0.01em;
  text-align: center; margin: 0 0 12px;
}
.intent-title em { font-style: italic; color: var(--accent); }
.intent-sub {
  text-align: center; color: var(--muted);
  font-size: 15px; margin: 0 auto 48px; max-width: 560px;
}
.intent-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.intent-card {
  background: var(--paper); border: 1px solid var(--line);
  padding: 32px 26px; cursor: pointer;
  transition: transform 250ms, box-shadow 250ms, border-color 250ms;
  display: flex; flex-direction: column; gap: 14px;
  text-align: left;
  position: relative; overflow: hidden;
}
.intent-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.08);
  border-color: var(--ink);
}
.intent-card-icon {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: var(--ink); color: var(--paper); border-radius: 50%;
}
.intent-card-title {
  font-family: var(--serif); font-size: 22px; font-weight: 500;
  margin: 0;
}
.intent-card-desc { color: var(--muted); font-size: 13px; margin: 0; }
.intent-card-tag {
  position: absolute; top: 18px; right: 18px;
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted-soft);
}

/* Template picker grid */
.template-section { padding: 80px 40px; background: var(--paper); }
.template-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
  max-width: 1200px; margin: 0 auto;
}
.template-grid-3 {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  max-width: 1100px; margin: 0 auto;
}
.template-grid-4 {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 26px;
  max-width: 1200px; margin: 0 auto;
}
/* "Create from scratch" tile */
.template-thumb-blank {
  background: var(--paper-warm, #f5f1ea);
  border: 2px dashed var(--line, rgba(0,0,0,0.22));
  box-shadow: none;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 250ms, box-shadow 250ms, background 250ms;
}
.template-card-lg:hover .template-thumb-blank {
  border-color: var(--accent);
  box-shadow: 0 20px 40px rgba(0,0,0,0.10);
  background: #fff;
}
.blank-inner {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  text-align: center; padding: 20px; color: var(--muted, #6b7280);
}
.blank-icon { font-size: 42px; line-height: 1; }
.blank-text { font-size: 13px; line-height: 1.5; }

/* Language toggle ES / EN */
.lang-toggle {
  display: inline-flex; border: 1px solid var(--line, rgba(0,0,0,0.15));
  border-radius: 999px; overflow: hidden; background: var(--c-bg, #fff);
}
.lang-toggle button {
  border: 0; background: transparent; cursor: pointer;
  padding: 5px 11px; font-size: 12px; font-weight: 600; letter-spacing: 0.03em;
  color: var(--c-text-soft, #6b7280); transition: background 160ms, color 160ms;
}
.lang-toggle button.active {
  background: var(--ink, #1a1a1f); color: #fff;
}

/* Wall preview — frame is only a simulation, not part of the product */
.wall-view { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.wall-frame-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center;
}
.wall-frame-label { font-size: 12px; color: var(--c-text-soft, #6b7280); }
.wall-frame-swatch {
  width: 34px; height: 34px; padding: 0; cursor: pointer;
  border: 2px solid transparent; border-radius: 8px; overflow: hidden;
  background: var(--c-bg, #fff);
  display: flex; align-items: center; justify-content: center;
  transition: border-color 180ms, transform 180ms;
}
.wall-frame-swatch:hover { transform: translateY(-1px); }
.wall-frame-swatch.active { border-color: var(--accent); }
.wall-frame-note {
  font-size: 12px; color: var(--c-text-soft, #6b7280);
  max-width: 360px; text-align: center; line-height: 1.5; margin: 0;
}
.template-card-lg {
  background: transparent; border: 0;
  cursor: pointer; padding: 0;
  display: flex; flex-direction: column; gap: 16px;
  text-align: left;
  transition: transform 250ms;
}
.template-card-lg:hover { transform: translateY(-6px); }
.template-thumb-lg {
  aspect-ratio: 3 / 4;
  background: #fff;
  padding: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.12);
  transition: box-shadow 250ms;
}
.template-card-lg:hover .template-thumb-lg {
  box-shadow: 0 30px 60px rgba(0,0,0,0.2);
}
.template-thumb-img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.template-meta-lg {
  display: flex; flex-direction: column; gap: 4px;
  padding: 0 4px;
}
.template-meta-lg h4 {
  margin: 0;
  font-family: var(--serif-display); font-size: 22px; font-weight: 500;
  color: var(--ink); letter-spacing: -0.005em;
}
.template-tag {
  font-family: var(--mono);
  font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted);
}
.template-card {
  background: #fff; border-radius: 4px; overflow: hidden;
  cursor: pointer; transition: transform 250ms, box-shadow 250ms;
  border: 1px solid var(--line);
}
.template-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 48px rgba(0,0,0,0.12);
}
.template-thumb {
  aspect-ratio: 3 / 4; background: var(--paper-warm);
  position: relative; overflow: hidden;
}
.template-meta {
  padding: 14px 16px;
}
.template-meta h4 {
  margin: 0 0 4px; font-family: var(--serif); font-size: 16px; font-weight: 500;
}
.template-meta p {
  margin: 0; font-size: 12px; color: var(--muted);
}

/* iOS: a finger touching + dragging a card image would pop a giant drag
   preview / callout. Disable it, and remove the 300ms double-tap zoom on the
   tappable cards/buttons so touch feels like a normal tap. */
.template-thumb-img, .template-thumb-lg, .template-thumb,
.hero-poster-img, .hero-slide, .template-thumb-blank {
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  -webkit-user-select: none;
  user-select: none;
}
.template-card-lg, .template-card, .intent-card,
.btn-primary, .btn-ghost, .nav-cta {
  touch-action: manipulation;
}

/* ==========================================================================
   EDITOR
   ========================================================================== */
.editor {
  height: 100vh; height: 100dvh;
  background: var(--c-bg); color: var(--c-text);
  display: flex; flex-direction: column;
  overflow: hidden;
}

.editor-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  background: var(--c-panel);
  border-bottom: 1px solid var(--c-line);
  height: 60px; flex-shrink: 0;
}
.editor-topbar .nav-brand {
  font-size: 18px; letter-spacing: 0.18em; color: var(--c-text);
}
.editor-topbar-actions { display: flex; gap: 8px; align-items: center; }
.editor-topbar-actions .btn-ghost {
  border-color: var(--c-line); color: var(--c-text);
  padding: 8px 16px; font-size: 13px;
}
.editor-topbar-actions .btn-ghost:hover { background: var(--c-text); color: var(--c-panel); }

/* ===== Editor (Option B): big stage + lower dock (chips + buy) + control sheet ===== */
.eb-dock {
  flex-shrink: 0;
  background: var(--c-panel);
  border-top: 1px solid var(--c-line);
}
.eb-chips {
  display: flex; gap: 8px;
  padding: 10px 16px;
  overflow-x: auto;
  border-bottom: 1px solid var(--c-line);
  scrollbar-width: none;
}
.eb-chips::-webkit-scrollbar { display: none; }
.eb-chip {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px; border-radius: 999px;
  background: var(--c-panel-2); border: 1px solid var(--c-line);
  color: var(--c-text-soft); font-size: 13px; font-weight: 500;
  white-space: nowrap; transition: background 150ms, color 150ms, border-color 150ms;
}
.eb-chip svg { width: 16px; height: 16px; }
.eb-chip:hover { border-color: var(--c-text-soft); color: var(--c-text); }
.eb-chip.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
body[data-chrome="dark"] .eb-chip.active { background: var(--paper); color: var(--ink); }

.eb-buybar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 20px;
}
.eb-price { display: flex; flex-direction: column; line-height: 1.15; }
.eb-price .price { font-size: 26px; }
.eb-file { font-size: 11px; color: var(--c-text-soft); }
.eb-buybar .btn-buy { flex: 0 0 auto; padding: 13px 28px; }

.eb-sheet {
  position: absolute; z-index: 30;
  left: 0; right: 0; bottom: 0;
  background: var(--c-panel);
  border-top: 1px solid var(--c-line);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -14px 40px rgba(0,0,0,0.18);
  max-height: 74%;
  display: flex; flex-direction: column;
  animation: ebSheetUp 220ms ease;
}
@keyframes ebSheetUp { from { transform: translateY(101%); } to { transform: translateY(0); } }
.eb-sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--c-line); margin: 8px auto 0; flex-shrink: 0; }
.eb-sheet-close {
  position: absolute; top: 12px; right: 14px; z-index: 2;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--c-panel-2); border: 1px solid var(--c-line); color: var(--c-text-soft);
  display: flex; align-items: center; justify-content: center;
}
.eb-sheet-close:hover { color: var(--c-text); }
.eb-sheet-body { overflow-y: auto; min-height: 0; }

/* Desktop: the control sheet floats as a card on the left; the poster shifts right. */
@media (min-width: 721px) {
  .eb-sheet {
    left: 24px; right: auto; bottom: 24px;
    width: 384px; max-height: calc(100% - 48px);
    border: 1px solid var(--c-line); border-radius: 16px;
  }
  .eb-sheet-grip { display: none; }
  .editor-canvas.sheet-open .canvas-stage { padding-left: 432px; }
}
.panel-header {
  padding: 18px var(--d-pad) 8px;
}
.panel-header h3 {
  margin: 0 0 4px;
  font-family: var(--serif); font-size: 22px; font-weight: 500; letter-spacing: -0.005em;
  color: var(--c-text);
}
.panel-header p {
  margin: 0; font-size: 12px; color: var(--c-text-soft);
}

.panel-body {
  flex: 1; overflow-y: auto;
  padding: var(--d-pad);
  display: flex; flex-direction: column; gap: var(--d-gap);
}

.price-row {
  display: flex; align-items: baseline; justify-content: space-between;
}
.price {
  font-family: var(--serif-display); font-size: 32px; font-weight: 400; color: var(--c-text);
}
.price-label { font-size: 11px; color: var(--c-text-soft); letter-spacing: 0.05em; text-transform: uppercase; }
.btn-buy {
  background: var(--ink); color: var(--paper);
  border: 0; padding: 14px; border-radius: 999px;
  font-size: 14px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: background 200ms;
}
body[data-chrome="dark"] .btn-buy { background: var(--paper); color: var(--ink); }
.btn-buy:hover { background: var(--accent); color: var(--accent-ink); }

/* Panel controls */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--c-text-soft); font-weight: 500;
}
.input,
.textarea {
  width: 100%;
  background: var(--c-bg);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  height: var(--d-control-h);
  font-size: 14px; color: var(--c-text);
  transition: border-color 150ms;
}
.textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 60px; }
.input:focus, .textarea:focus { outline: none; border-color: var(--c-text); }

.search-wrap { position: relative; }
.search-results {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 50;
  background: var(--c-panel); border: 1px solid var(--c-line);
  border-radius: var(--radius-sm); overflow: hidden;
  max-height: 280px; overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0,0,0,0.08);
}
.search-row {
  padding: 10px 12px; cursor: pointer;
  border-bottom: 1px solid var(--c-line);
  font-size: 13px;
}
.search-row:hover { background: var(--c-hover); }
.search-row:last-child { border-bottom: 0; }
.search-row .sub { font-size: 11px; color: var(--c-text-soft); }
.search-row em { font-style: normal; background: var(--accent); color: var(--accent-ink); padding: 0 2px; border-radius: 2px; }

/* Style picker grid */
.style-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.style-tile {
  cursor: pointer; padding: 0;
  background: var(--c-panel); border: 2px solid transparent;
  border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
  transition: transform 240ms cubic-bezier(.2,.8,.2,1),
              box-shadow 240ms cubic-bezier(.2,.8,.2,1),
              border-color 180ms ease;
  position: relative;
}
.style-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.14);
}
.style-tile.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent),
              0 8px 20px rgba(0,0,0,0.12);
}
.style-tile-thumb {
  width: 100%; aspect-ratio: 3 / 4;
  background-size: cover; background-position: center;
  position: relative;
  transition: transform 240ms cubic-bezier(.2,.8,.2,1);
}
.style-tile:hover .style-tile-thumb { transform: scale(1.03); }
.style-tile.active .style-tile-thumb::after {
  content: '✓';
  position: absolute; top: 7px; right: 7px;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--accent-ink);
  border-radius: 50%; font-size: 13px; font-weight: 700;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  animation: styleCheckPop 220ms cubic-bezier(.2,1.4,.4,1);
}
@keyframes styleCheckPop {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.style-tile-label {
  display: block; padding: 8px 4px 7px;
  font-size: 11.5px; font-weight: 500; letter-spacing: 0.01em;
  color: var(--c-text); text-align: center;
  background: var(--c-panel);
}

/* Frame picker */
.frame-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.frame-tile {
  aspect-ratio: 1; border: 2px solid transparent;
  background: var(--c-bg); border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 200ms;
  padding: 0;
}
.frame-tile:hover { border-color: var(--c-line); }
.frame-tile.active { border-color: var(--accent); }

/* Color swatches */
.swatch-row { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch {
  width: 28px; height: 28px; border-radius: 50%;
  cursor: pointer; border: 2px solid transparent;
  transition: transform 150ms;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 12px;
}
.swatch:hover { transform: scale(1.1); }
.swatch.active { border-color: var(--c-text); }

/* Icon picker (pin/heart/home) */
.icon-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.icon-tile {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 6px;
  background: var(--c-bg); border: 2px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer; transition: border-color 150ms;
  color: var(--c-text-soft); font-size: 11px;
}
.icon-tile:hover { border-color: var(--c-line); }
.icon-tile.active { border-color: var(--accent); color: var(--c-text); }

/* Toggle group */
.toggle-group {
  display: flex; background: var(--c-bg);
  border: 1px solid var(--c-line); border-radius: var(--radius-sm);
  padding: 3px; gap: 3px;
}
.toggle-group button {
  flex: 1; padding: 7px 10px; border-radius: 6px; border: 0;
  background: transparent; color: var(--c-text-soft); font-size: 12px;
  font-weight: 500; transition: background 150ms, color 150ms;
}
.toggle-group button.active {
  background: var(--c-panel); color: var(--c-text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* 3D orientation pad */
.tilt-pad {
  position: relative;
  width: 100%; aspect-ratio: 1.4;
  background: var(--c-bg); border: 1px solid var(--c-line);
  border-radius: var(--radius);
  cursor: crosshair;
  overflow: hidden;
  background-image:
    linear-gradient(var(--c-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--c-line) 1px, transparent 1px);
  background-size: 20% 20%;
}
.tilt-knob {
  position: absolute;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--c-panel);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.tilt-hint {
  position: absolute; bottom: 6px; left: 8px;
  font-size: 10px; color: var(--c-text-soft);
  font-family: var(--mono);
}

/* ==========================================================================
   CANVAS (right side) — Poster preview area
   ========================================================================== */
.editor-canvas {
  position: relative;
  flex: 1; min-height: 0;
  background:
    radial-gradient(ellipse at center, rgba(0,0,0,0.04) 0%, transparent 70%),
    var(--c-bg);
  display: flex; flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.canvas-toolbar {
  position: absolute; top: 18px; left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex; align-items: center; gap: 8px;
  background: var(--c-panel);
  border: 1px solid var(--c-line);
  border-radius: 999px;
  padding: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.canvas-toolbar button {
  background: transparent; border: 0;
  padding: 8px 16px; border-radius: 999px;
  font-size: 12px; font-weight: 500; color: var(--c-text-soft);
  display: flex; align-items: center; gap: 6px;
  transition: background 150ms, color 150ms;
}
.canvas-toolbar button.active {
  background: var(--c-text); color: var(--c-panel);
}
.canvas-toolbar svg { width: 14px; height: 14px; }

.canvas-watermark-note {
  position: absolute;
  bottom: 18px; left: 50%; transform: translateX(-50%);
  z-index: 10;
  background: var(--c-panel);
  border: 1px solid var(--c-line);
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 12px; color: var(--c-text-soft);
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
  max-width: calc(100% - 40px);
}
.canvas-watermark-note svg { color: var(--accent); flex-shrink: 0; }

.canvas-zoom {
  position: absolute; top: 18px; right: 18px;
  z-index: 10;
  display: flex; gap: 4px;
  background: var(--c-panel);
  border: 1px solid var(--c-line);
  border-radius: 999px; padding: 4px;
}
.canvas-zoom button {
  width: 32px; height: 32px; border-radius: 50%;
  background: transparent; border: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--c-text-soft);
}
.canvas-zoom button:hover { background: var(--c-hover); color: var(--c-text); }

.canvas-stage {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 28px 40px 76px;
  min-height: 0;
  position: relative;
}

/* ==========================================================================
   POSTER
   ========================================================================== */
.poster-shell {
  position: relative;
  /* NOTE: must be box-shadow, NOT filter/drop-shadow. A CSS filter on an ancestor
     of the WebGL map canvas makes the browser cache a snapshot of the map and stop
     refreshing it after zoom (it stays blurry until another repaint is forced).
     box-shadow gives the same look without freezing the live map. */
  box-shadow: 0 30px 60px rgba(0,0,0,0.18);
}

.poster-frame-wrap {
  position: relative;
  padding: 22px;
  background:
    linear-gradient(135deg, #fcfbf8 0%, #f5f1ea 100%);
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,0.08),
    inset 0 0 0 12px rgba(0,0,0,0.02);
}
.poster-frame-wrap.frame-walnut {
  background:
    linear-gradient(135deg, #6e4a2e 0%, #4d3320 100%);
}
.poster-frame-wrap.frame-walnut::before {
  content: ''; position: absolute; inset: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(0,0,0,0.4);
  pointer-events: none;
}
.poster-frame-wrap.frame-black {
  background: linear-gradient(135deg, #1d1d1d 0%, #0d0d0d 100%);
}
.poster-frame-wrap.frame-none { padding: 0; background: transparent; box-shadow: none; }

.poster {
  width: var(--poster-width, 360px);
  aspect-ratio: 3 / 4;
  background: var(--p-bg, #ffffff);
  position: relative;
  overflow: hidden;
  display: flex; flex-direction: column;
}

/* Per-theme poster tokens */
/* 4 themes, mapped from the 4 MapTiler styles */
.poster.theme-classic   { --p-bg: #ffffff; --p-text: #1a1a1f; --p-soft: rgba(0,0,0,0.55); --p-rule: rgba(0,0,0,0.3);  --p-headline-font: var(--serif-display); --p-tracking: 0.005em; --p-headline-weight: 500; }
.poster.theme-vintage   { --p-bg: #f1e2c0; --p-text: #3a2614; --p-soft: rgba(58,38,20,0.75); --p-rule: rgba(58,38,20,0.5); --p-headline-font: var(--serif-display); --p-tracking: 0.005em; --p-headline-weight: 500; }
.poster.theme-noir      { --p-bg: #0f1115; --p-text: #f5f2ec; --p-soft: rgba(245,242,236,0.75); --p-rule: rgba(245,242,236,0.45); --p-headline-font: var(--serif-display); --p-tracking: 0.005em; --p-headline-weight: 500; }

.poster-map-area {
  position: relative;
  flex: 1; min-height: 0;
  overflow: hidden;
  background: var(--p-bg);
}

.poster-pin {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -100%);
  z-index: 6;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
  user-select: none;
}
.poster-pin:active { cursor: grabbing !important; }


/* Labels: compact, map-dominant. Map ~80% of poster, labels ~20%. */
.poster-labels {
  background: var(--p-bg);
  padding: 4% 8% 5%;
  text-align: center;
  flex-shrink: 0;
  position: relative;
  z-index: 4;
}
.poster-headline {
  font-family: var(--p-headline-font);
  font-size: var(--p-headline-size, 22px);
  font-weight: var(--p-headline-weight);
  letter-spacing: var(--p-tracking);
  color: var(--p-text);
  margin: 0;
  line-height: 1.1;
  text-transform: uppercase;
}
.poster-headline.case-normal { text-transform: none; }
.poster-coords {
  margin-top: 6px;
  font-family: var(--serif);
  font-size: 0.36em;       /* relative to headline size */
  letter-spacing: 0.02em;
  color: var(--p-text);
  font-style: normal;
}
.poster-coords-sep { margin: 0 8px; opacity: 0.6; }
.poster-tagline {
  margin-top: 4px;
  font-family: var(--serif);
  font-size: 0.38em;
  font-style: normal;
  color: var(--p-text);
  letter-spacing: 0.01em;
}
.poster-brand {
  position: absolute;
  bottom: 6px; right: 10px;
  font-family: var(--sans);
  font-size: 6px; letter-spacing: 0.22em;
  color: var(--p-soft);
  opacity: 0.55;
  font-weight: 500;
}
/* Inherit em-based sizing from headline */
.poster-headline { font-size: var(--p-headline-size, 22px); }
.poster-coords, .poster-tagline { font-size: max(8px, calc(var(--p-headline-size, 22px) * 0.34)); }
.poster-coords { font-size: max(7px, calc(var(--p-headline-size, 22px) * 0.30)); }

/* Watermark — a single bold red "WISMAPS" across the map, clearly visible on every
   style. Only on the on-screen preview; the delivered file has none. */
.poster-watermark {
  position: absolute; inset: 0;
  pointer-events: none; z-index: 5;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.poster-watermark span {
  font-family: var(--serif-display);
  font-size: clamp(40px, 24%, 130px);
  font-weight: 700;
  letter-spacing: 0.22em;
  color: #e0322b;
  opacity: 0.34;
  transform: rotate(-24deg);
  white-space: nowrap;
  text-transform: uppercase;
}
.poster.theme-noir .poster-watermark span { color: #ff5a4d; opacity: 0.45; }

/* ==========================================================================
   WALL MOCKUP — photorealistic lifestyle scene
   Based on user reference: framed map on a wood shelf, plant on the right,
   neutral wall background. Aspect ratio similar to phone-shot product photos.
   ========================================================================== */
.wall-photo-scene {
  position: relative;
  width: 100%;
  max-width: 640px;
  aspect-ratio: 4 / 5;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0,0,0,0.18);
  background: #ece5d8;
}
.wall-photo-wall {
  position: absolute; inset: 0 0 22% 0;
  background:
    radial-gradient(ellipse 80% 60% at 30% 25%, rgba(255,255,255,0.7), transparent 70%),
    radial-gradient(ellipse 50% 40% at 80% 70%, rgba(0,0,0,0.04), transparent 70%),
    linear-gradient(180deg, #f3eee2 0%, #e8e0cf 100%);
}
.wall-photo-shelf {
  position: absolute; left: 0; right: 0; bottom: 0; height: 22%;
  background:
    linear-gradient(180deg,
      #6e4d2e 0%, #6e4d2e 8%,
      #5a3e23 9%,
      #4d3320 60%, #3a2616 100%);
  box-shadow: 0 -1px 0 rgba(0,0,0,0.15);
}
.wall-photo-shelf::before {
  /* wood grain */
  content: '';
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0px, transparent 50px,
      rgba(0,0,0,0.06) 50px, rgba(0,0,0,0.06) 51px,
      transparent 51px, transparent 120px,
      rgba(0,0,0,0.04) 120px, rgba(0,0,0,0.04) 121px
    );
  opacity: 0.5;
}
.wall-photo-poster {
  position: absolute;
  left: 12%;
  bottom: 18%;
  z-index: 2;
  filter: drop-shadow(0 30px 30px rgba(0,0,0,0.25));
  transform: rotate(0deg);
}
.wall-photo-plant {
  position: absolute;
  right: -4%;
  bottom: 8%;
  width: 45%;
  height: auto;
  z-index: 3;
  filter: drop-shadow(0 20px 24px rgba(0,0,0,0.2));
}
/* Old wall-scene styles kept harmless */
.wall-scene {
  position: relative;
  width: 100%; max-width: 720px;
  aspect-ratio: 4 / 3;
  background: #ece4d4;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0,0,0,0.15);
}
.wall-scene::before {
  /* wall texture noise */
  content: '';
  position: absolute; inset: 0 0 50% 0;
  background:
    radial-gradient(circle at 20% 40%, rgba(0,0,0,0.04), transparent 40%),
    radial-gradient(circle at 80% 60%, rgba(0,0,0,0.05), transparent 50%);
}
.wall-scene::after {
  /* floor */
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 50%;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(0,0,0,0.06) 0px,
      rgba(0,0,0,0.06) 1px,
      transparent 1px,
      transparent 60px
    ),
    linear-gradient(180deg, #b8a986 0%, #9a8b6a 100%);
  transform: perspective(600px) rotateX(60deg);
  transform-origin: top;
}

.wall-plant {
  position: absolute;
  left: 6%; bottom: 4%;
  z-index: 2;
  width: 90px;
}
.wall-poster {
  position: absolute;
  top: 16%; left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  filter: drop-shadow(0 24px 40px rgba(0,0,0,0.25));
}
.wall-poster .poster { width: 220px; }

/* Map canvas inside poster */
.poster-map-area .maplibregl-map { width: 100%; height: 100%; }
.poster-map-area .maplibregl-ctrl-attrib { display: none !important; }
.poster-map-area .maplibregl-ctrl-bottom-left,
.poster-map-area .maplibregl-ctrl-bottom-right,
.poster-map-area .maplibregl-ctrl-top-right,
.poster-map-area .maplibregl-ctrl-top-left { display: none; }
.poster-map-area canvas { display: block; }

/* ==========================================================================
   CHECKOUT MODAL
   ========================================================================== */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15, 15, 20, 0.55);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.modal {
  background: var(--paper);
  width: 100%; max-width: 980px;
  max-height: 90vh; overflow: hidden;
  border-radius: var(--radius);
  display: grid; grid-template-columns: 1fr 1.1fr;
  box-shadow: 0 40px 80px rgba(0,0,0,0.3);
}
.modal-side {
  background: var(--paper-warm);
  padding: 32px;
  display: flex; flex-direction: column; gap: 18px;
  overflow-y: auto;
}
.modal-main {
  padding: 32px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 18px;
}
.modal-close {
  position: absolute; top: 18px; right: 18px;
  width: 32px; height: 32px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,0.9);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 2;
}
.modal-title {
  font-family: var(--serif-display);
  font-size: 30px; font-weight: 400; letter-spacing: -0.005em;
  margin: 0 0 4px;
}
.modal-sub { font-size: 13px; color: var(--muted); margin: 0; }

.checkout-final-preview { display: flex; justify-content: center; padding: 6px 0 2px; }
.checkout-final-preview .poster-frame-wrap { box-shadow: 0 12px 32px rgba(0,0,0,0.16); }
.checkout-format-chip {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  padding: 8px 16px; border-radius: 999px;
  background: var(--paper-warm); border: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}
.checkout-format-chip b { color: var(--ink); font-weight: 600; }

.size-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.size-card {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex; flex-direction: column; gap: 4px;
  text-align: left;
}
.size-card:hover { border-color: var(--ink); }
.size-card.active { border-color: var(--accent); background: rgba(201, 105, 78, 0.05); }
.size-card-name { font-family: var(--serif); font-size: 15px; font-weight: 500; }
.size-card-meta { font-size: 11px; color: var(--muted); }
.size-card-tag {
  display: inline-block; margin-top: 4px;
  font-size: 10px; padding: 2px 8px; border-radius: 999px;
  background: var(--ink); color: var(--paper);
  align-self: flex-start;
  font-family: var(--mono); letter-spacing: 0.05em;
}

.summary-row {
  display: flex; justify-content: space-between;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--line-soft);
}
.summary-row.total {
  margin-top: 8px; padding-top: 12px;
  border-top: 1px solid var(--ink);
  border-bottom: 0;
  font-family: var(--serif-display); font-size: 22px;
}

.checkout-mini-poster {
  background: #fff; padding: 8px;
  align-self: center;
  width: 180px;
  box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}
.checkout-mini-poster .poster { width: 164px; aspect-ratio: 3/4; }

/* ==========================================================================
   FAQ
   ========================================================================== */
.faq-section { padding: 80px 40px; background: var(--paper-warm); }
.faq-wrap { max-width: 900px; margin: 0 auto; }
.faq-wrap > h2 { margin-bottom: 36px; }
.faq-list { display: flex; flex-direction: column; gap: 4px; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-q {
  width: 100%; background: transparent; border: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 4px;
  cursor: pointer;
  font-family: var(--serif); font-size: 18px; font-weight: 500;
  color: var(--ink); text-align: left;
}
.faq-toggle {
  font-family: var(--sans);
  font-size: 22px; color: var(--accent);
  font-weight: 300;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
}
.faq-a {
  padding: 0 4px 22px;
  font-size: 14px; color: var(--muted); line-height: 1.6;
  max-width: 720px;
}

/* ==========================================================================
   SUCCESS PAGE
   ========================================================================== */
.success {
  min-height: 100vh; background: var(--paper);
  display: flex; flex-direction: column;
}
.success-hero {
  flex: 1;
  display: grid; grid-template-columns: 1fr 1fr; gap: 60px;
  padding: 80px 40px;
  max-width: 1400px; margin: 0 auto; width: 100%;
  align-items: center;
}
.success-check {
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 24px;
}
.success-title {
  font-family: var(--serif-display); font-size: 56px; font-weight: 400;
  letter-spacing: -0.015em; line-height: 1;
  margin: 0 0 18px;
}
.success-title em { font-style: italic; color: var(--accent); }
.success-text {
  font-size: 16px; color: var(--muted); margin: 0 0 20px;
  max-width: 460px;
}
.success-email {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  background: #fff; border-radius: var(--radius);
  border: 1px solid var(--line);
  font-size: 13px;
  max-width: 460px;
  margin-bottom: 24px;
}
.success-email svg { color: var(--accent); }
.success-email b { font-family: var(--mono); font-weight: 500; }
.success-files {
  display: flex; gap: 12px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.success-file {
  background: #fff; border: 1px solid var(--line);
  padding: 14px 18px; border-radius: var(--radius);
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
  cursor: pointer; transition: border-color 200ms;
}
.success-file:hover { border-color: var(--ink); }
.success-file svg { color: var(--accent); }
.success-file .size { color: var(--muted); font-size: 11px; }

.success-preview {
  display: flex; align-items: center; justify-content: center;
}

/* Email preview card — shows the user what arrives in their inbox */
.email-preview {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.18);
  overflow: hidden;
  width: 100%; max-width: 440px;
  font-family: var(--sans);
}
.email-header {
  padding: 14px 18px;
  background: #f5f4f0;
  border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 4px;
  font-size: 12px;
}
.email-header .em-from { font-weight: 600; color: var(--ink); }
.email-header .em-to { color: var(--muted); }
.email-header .em-subject { font-size: 14px; color: var(--ink); font-weight: 500; margin-top: 4px; }
.email-body { padding: 28px 24px; display: flex; flex-direction: column; gap: 16px; }
.email-brand {
  font-family: var(--serif-display);
  font-size: 22px; letter-spacing: 0.18em; text-align: center;
  padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.email-brand i { font-style: italic; letter-spacing: 0; opacity: 0.6; font-size: 0.7em; }
.email-greeting { font-family: var(--serif); font-size: 20px; color: var(--ink); }
.email-text { font-size: 13.5px; color: var(--ink); line-height: 1.6; }
.email-preview-img {
  background: #f0ebe0;
  padding: 18px;
  border-radius: 6px;
  display: flex; justify-content: center;
}
.email-btn {
  display: block;
  text-align: center;
  background: var(--ink); color: var(--paper);
  padding: 14px 24px; border-radius: 8px;
  font-size: 14px; font-weight: 500; text-decoration: none;
}
.email-attachments {
  display: flex; flex-direction: column; gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px; color: var(--muted);
}
.email-attach-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0;
}
.email-attach-row svg { color: var(--accent); }
.email-foot { font-size: 11px; color: var(--muted); text-align: center; }

/* Footer */
.footer {
  background: var(--ink); color: var(--paper);
  padding: 60px 40px 40px;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  max-width: 1400px; margin: 0 auto;
}
.footer-brand .nav-brand { color: var(--paper); font-size: 28px; }
.footer-blurb { color: rgba(255,255,255,0.6); font-size: 13px; margin-top: 12px; max-width: 320px; }
.footer-col h5 {
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(255,255,255,0.5); margin: 0 0 14px; font-weight: 500;
}
.footer-col a {
  display: block; text-decoration: none;
  color: rgba(255,255,255,0.8); font-size: 13px;
  padding: 4px 0;
}
.footer-bottom {
  max-width: 1400px; margin: 60px auto 0;
  padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.1);
  display: flex; justify-content: space-between;
  font-size: 11px; color: rgba(255,255,255,0.4);
}

/* ==========================================================================
   Utility / responsive guard
   ========================================================================== */
.hide-below-lg { display: none; }
@media (min-width: 1024px) { .hide-below-lg { display: block; } }

@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; }
  .editor-body { grid-template-columns: 56px 320px 1fr; }
  .intent-grid { grid-template-columns: 1fr; }
  .modal { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .success-hero { grid-template-columns: 1fr; }
}

/* ==========================================================================
   MOBILE (phones)
   ========================================================================== */
@media (max-width: 720px) {
  /* ---- Landing nav ---- */
  .nav { padding: 14px 18px; }
  .nav-links { display: none; }
  .nav-cta { padding: 8px 14px; font-size: 12px; }

  /* ---- Hero ---- */
  .hero { padding: 28px 20px 44px; gap: 30px; }
  .hero-title {
    font-size: clamp(30px, 8vw, 42px); line-height: 1.02;
    margin: 16px 0 18px; overflow-wrap: break-word;
  }
  .hero-sub { font-size: 15px; margin-bottom: 22px; }
  .hero-ctas { flex-direction: column; align-items: stretch; }
  .hero-ctas .btn-primary, .hero-ctas .btn-ghost { justify-content: center; text-align: center; width: 100%; }
  .hero-meta { flex-wrap: wrap; gap: 12px 22px; margin-top: 26px; }
  .hero-visual { aspect-ratio: 4 / 3; max-width: 360px; width: 100%; margin: 0 auto; }

  /* ---- Memories / templates ---- */
  .template-section { padding: 44px 18px; }
  .intent-title { font-size: 23px; margin-bottom: 24px; overflow-wrap: break-word; }
  .intent-sub { font-size: 14px; }
  .template-grid-4 { grid-template-columns: repeat(2, 1fr); gap: 16px; }

  /* ---- FAQ / footer ---- */
  .faq-section { padding: 44px 18px; }
  .footer { padding: 40px 18px 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer-bottom { flex-direction: column; gap: 6px; text-align: center; }

  /* ---- Editor (Option B): big stage on top, chips + buy dock at the bottom ---- */
  .editor-topbar { padding: 8px 12px; height: 52px; }
  .editor-topbar .nav-brand { font-size: 16px; }
  .editor-topbar > div:first-child { gap: 8px; }
  .editor-topbar-actions { gap: 6px; }
  .editor-topbar .lang-toggle button { padding: 4px 9px; }

  .canvas-stage { padding: 16px 12px 12px; }
  .canvas-watermark-note {
    bottom: 6px; padding: 5px 12px;
    font-size: 10.5px; line-height: 1.3;
    max-width: calc(100% - 20px); text-align: center;
  }

  /* Control sheet + dock, compact for phones */
  .eb-sheet { max-height: 66%; }
  .panel-header { padding: 12px var(--d-pad) 4px; }
  .panel-header h3 { font-size: 17px; margin-bottom: 2px; }
  .panel-header p { display: none; }   /* save vertical space on mobile */

  .eb-chips { padding: 8px 12px; gap: 7px; }
  .eb-chip { padding: 8px 13px; font-size: 12.5px; }
  .eb-buybar { padding: 10px 16px; }
  .eb-price .price { font-size: 22px; }
  .eb-buybar .btn-buy { padding: 12px 22px; }

  /* Compact style picker: 3 small columns */
  .style-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .style-tile-thumb { aspect-ratio: 1 / 1; }
  .style-tile-label { padding: 4px 2px; font-size: 10px; }
  .style-tile.active .style-tile-thumb::after {
    width: 18px; height: 18px; font-size: 11px; top: 4px; right: 4px;
  }

  /* Wall preview view */
  .wall-view { gap: 10px; }

  /* ---- Checkout modal: single scrollable column ---- */
  .modal-backdrop { padding: 0; }
  .modal {
    display: block; overflow-y: auto;
    max-width: 100%; width: 100%; max-height: 100vh;
    border-radius: 0;
  }
  .modal-side, .modal-main { overflow: visible; padding: 24px 20px; }
  .modal-side { order: 2; }
  .modal-title { font-size: 24px; }
  .size-grid { grid-template-columns: repeat(2, 1fr); }

  /* ---- Success page ---- */
  .success-hero { padding: 40px 20px; gap: 32px; }
}

/* Very small phones */
@media (max-width: 380px) {
  .template-grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* ===== Cart (carrito de varios mapas) ===== */
.eb-cart-btn {
  position: relative; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--c-line); background: var(--c-panel); color: var(--c-text);
  display: flex; align-items: center; justify-content: center;
}
.eb-cart-btn:hover { background: var(--c-panel-2); }
.eb-cart-badge {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 9px; background: #e0322b; color: #fff; font-size: 11px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.cart-modal {
  background: var(--paper, #fff); border-radius: 16px; max-width: 460px; width: 92%;
  padding: 28px 26px; position: relative; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0,0,0,0.3);
}
.cart-items { display: flex; flex-direction: column; gap: 10px; margin: 18px 0; }
.cart-item { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line, #e5e7eb); border-radius: 10px; }
.cart-item-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cart-item-info b { font-family: var(--serif); font-size: 15px; color: var(--ink, #1a1a1f); }
.cart-item-info span { font-size: 12px; color: var(--muted, #777); }
.cart-item-price { font-weight: 600; font-size: 14px; color: var(--ink, #1a1a1f); }
.cart-item-remove { width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent; color: var(--muted, #999); display: flex; align-items: center; justify-content: center; }
.cart-item-remove:hover { color: #e0322b; background: rgba(0,0,0,0.04); }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 2px 6px; border-top: 1px solid var(--line, #e5e7eb); font-size: 14px; color: var(--muted, #777); }
.cart-total b { font-family: var(--serif-display); font-size: 26px; color: var(--ink, #1a1a1f); }
.cart-actions { display: flex; gap: 10px; margin-top: 14px; }
.cart-actions .btn-ghost { flex: 1; justify-content: center; border: 1px solid var(--line, #e5e7eb); padding: 13px; border-radius: 999px; font-size: 13px; }
.cart-actions .btn-buy { flex: 1.5; }

/* ===== Hero auto-slider (fotos lifestyle) ===== */
.hero-slider {
  position: relative; width: 100%; aspect-ratio: 4 / 3;
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 30px 70px rgba(0,0,0,0.20);
  justify-self: center;
}
.hero-slide {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; transition: opacity 1100ms ease;
}
.hero-slide.active { opacity: 1; }
.hero-slider-dots {
  position: absolute; bottom: 12px; left: 0; right: 0;
  display: flex; gap: 7px; justify-content: center; z-index: 2;
}
.hero-slider-dots span {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,255,255,0.55); box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  transition: background 300ms, width 300ms;
}
.hero-slider-dots span.on { background: #fff; width: 18px; border-radius: 4px; }
@media (max-width: 720px) {
  .hero-slider { max-width: 420px; margin: 0 auto; }
}
