/* Soy de Pádel · configurador de camiseta
   Réplica del configurador de Lovable (zona de diseño: estudio claro + camiseta Daytona marino,
   banderas, nombre, logo y patrocinador en las mismas posiciones) integrada en la web oscura
   (fondo marino casi negro, Montserrat, lima). Mobile-first, sin dependencias. */

@font-face { font-family: "SDP Display"; src: url("assets/brand/fonts/montserrat-latin-900-italic.woff2") format("woff2"), url("assets/brand/fonts/montserrat-latin-900-italic.woff") format("woff"); font-weight: 900; font-style: italic; font-display: swap; }
@font-face { font-family: "SDP Display"; src: url("assets/brand/fonts/montserrat-latin-800-normal.woff2") format("woff2"), url("assets/brand/fonts/montserrat-latin-800-normal.woff") format("woff"); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: "SDP Display"; src: url("assets/brand/fonts/montserrat-latin-600-normal.woff2") format("woff2"), url("assets/brand/fonts/montserrat-latin-600-normal.woff") format("woff"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  --bg: #070B14;
  --bg-2: #0D1424;
  --bg-3: #131C31;
  --navy: var(--brand-navy, #1B2A4A);
  --lime: var(--brand-lime, #D1D367);
  --lime-hi: #E2E47C;
  --text: #F3F4EF;
  --muted: #98A1B3;
  --line: rgba(255, 255, 255, .12);
  --line-2: rgba(255, 255, 255, .22);
  --wa: #1FAF57;

  /* colores del configurador de Lovable (oklch convertidos a hex) */
  --studio: #E9EDF2;
  --shirt-print: #F9F8F5;
  --flag-spain-red: #A9131F;
  --flag-spain-yellow: #F2BC00;
  --flag-andalusia-green: #00772F;
  --flag-white: #FFFFFF;

  --font-body: var(--brand-font-body, "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  --font-display: "SDP Display", "Montserrat", "Arial Black", "Helvetica Neue", Arial, sans-serif;
  /* tipografía del nombre en la camiseta: la misma que el configurador de Lovable */
  --font-print: Arial, "Helvetica Neue", Helvetica, sans-serif;

  --top-h: 56px;
  --r: 6px;
  --ease: cubic-bezier(.2, .75, .2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); overflow-x: hidden; overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font-body); -webkit-font-smoothing: antialiased; }
body.no-scroll { overflow: hidden; }
img, svg { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
p, h1, h2 { margin: 0; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; }
:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; border-radius: 2px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- barra superior ---------- */
.cfg-top {
  position: sticky; top: 0; z-index: 30; height: var(--top-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  padding: 0 16px; background: rgba(7, 11, 20, .92); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.cfg-top__back { display: inline-flex; align-items: center; gap: 4px; justify-self: start; color: var(--text); text-decoration: none; font-weight: 600; font-size: .9rem; padding: 8px 4px 8px 0; }
.cfg-top__back:hover { color: var(--lime); }
.cfg-top__brand img { height: 22px; width: auto; }
.cfg-top__price {
  justify-self: end; font: italic 900 1rem/1 var(--font-display); color: var(--navy); background: var(--lime);
  padding: 7px 10px; border-radius: 3px; letter-spacing: -.01em;
}

/* ---------- layout ---------- */
.cfg { display: grid; }

/* zona de diseño: "estudio" claro como en Lovable */
.cfg-stage {
  position: sticky; top: var(--top-h); z-index: 10;
  display: flex; align-items: center; justify-content: center;
  --stage-h: clamp(280px, 46svh, 520px);
  height: var(--stage-h);
  background: var(--studio); overflow: hidden;
  padding: 10px 16px;
  box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .7);
}
.cfg-stage__label {
  position: absolute; top: 14px; left: 16px; z-index: 2;
  font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: #64748B;
}

/* ---------- la camiseta (posiciones copiadas del configurador de Lovable) ---------- */
.shirt {
  position: relative; aspect-ratio: 1 / 1;
  width: min(100%, calc(var(--stage-h) - 20px));
  container-type: inline-size;
}
.shirt__base { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.shirt__flags {
  position: absolute; top: 13.3%; left: 50%; transform: translateX(-50%);
  display: flex; gap: 2.2cqw;
}
.shirt__flags svg { width: 5cqw; height: auto; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .12)); }
.shirt__name {
  position: absolute; top: 23%; left: 50%; transform: translateX(-50%);
  width: 51%; display: flex; flex-direction: column; align-items: center; text-align: center;
  font-family: var(--font-print); font-weight: 800; text-transform: uppercase;
  color: var(--shirt-print); font-size: calc(var(--fs, 42) / 760 * 100cqw);
}
.shirt__name span { display: block; white-space: nowrap; line-height: .98; }
.shirt__logo, .shirt__sponsor { height: auto; max-width: none; user-select: none; -webkit-user-drag: none; }
.shirt__logo { position: absolute; top: 59.41%; left: 50%; width: 27.25%; transform: translateX(-50%); }
.shirt__sponsor { position: absolute; top: 76%; left: 50%; width: 36%; transform: translateX(-50%); }

/* ---------- panel ---------- */
.cfg-panel { padding: 28px 16px 48px; }
.cfg-panel__head { padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.cfg-kicker { font: 700 .72rem/1 var(--font-body); letter-spacing: .18em; text-transform: uppercase; color: var(--lime); margin-bottom: 10px; }
.cfg-title {
  font: italic 900 clamp(2rem, 9vw, 2.6rem)/.92 var(--font-display);
  text-transform: uppercase; letter-spacing: -.025em;
}
.cfg-sub { margin-top: 10px; color: var(--muted); font-size: .95rem; }

.cfg-field { padding: 24px 0; border-bottom: 1px solid var(--line); }
.cfg-legend { float: left; display: block; width: 100%; margin-bottom: 14px; font-weight: 700; font-size: .95rem; }
.cfg-legend + * { clear: both; }
.cfg-legend--split { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.cfg-legend small { font-weight: 500; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.cfg-help { margin: -6px 0 14px; font-size: .8rem; color: var(--muted); }
.cfg-hint { margin-top: 10px; font-size: .8rem; color: var(--muted); }
.cfg-hint:empty { display: none; }
.cfg-hint.is-warn { color: #F5B97A; }

/* banderas */
.flag-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.flag-btn {
  display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: var(--r); background: var(--bg-2);
  cursor: pointer; text-align: left; font-weight: 600; transition: border-color .15s, background-color .15s;
}
.flag-btn > span:not(.flag-btn__order) { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.flag-btn svg { width: 30px; height: 20px; flex: none; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.flag-btn:hover { border-color: rgba(209, 211, 103, .55); }
.flag-btn[aria-pressed="true"] { border-color: var(--lime); background: rgba(209, 211, 103, .14); color: #fff; }
.flag-btn__order {
  margin-left: auto; flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: .72rem; font-weight: 800; background: var(--lime); color: var(--navy);
}

/* nombre */
.cfg-input {
  width: 100%; height: 52px; padding: 0 14px; border-radius: var(--r);
  border: 1px solid var(--line-2); background: #fff; color: #0F141C;
  font-weight: 700; font-size: 16px; letter-spacing: .02em; text-transform: uppercase;
}
.cfg-input::placeholder { color: #8A94A6; }
.cfg-input:focus { outline: 3px solid var(--lime); outline-offset: 1px; }
.cfg-counter { margin-top: 8px; text-align: right; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.cfg-counter .is-full { color: var(--lime); font-weight: 700; }

/* distribución de líneas */
.words {
  display: flex; flex-wrap: wrap; align-items: center; row-gap: 8px; min-height: 52px;
  padding: 8px 12px; border-radius: var(--r); border: 1px solid var(--line-2); background: #fff; color: #0F141C;
}
.words__word { font-weight: 700; font-size: .9rem; }
.words__empty { font-size: .88rem; color: #8A94A6; }
.words__gap {
  width: 32px; height: 32px; margin: 0 4px; border-radius: var(--r); border: 0; background: transparent;
  color: #8A94A6; font-weight: 700; cursor: pointer; display: grid; place-items: center;
}
.words__gap:hover { background: #EEF1F4; color: #0F141C; }
.words__gap[aria-pressed="true"] { background: var(--navy); color: var(--lime); }

/* tamaño de letra (slider como el de Lovable: pista clara + relleno oliva/lima) */
.cfg-range { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; cursor: pointer; --p: 50%; }
.cfg-range::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: linear-gradient(90deg, var(--lime) var(--p), rgba(255, 255, 255, .16) var(--p)); }
.cfg-range::-moz-range-track { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .16); }
.cfg-range::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--lime); }
.cfg-range::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%; background: #fff; border: 3px solid var(--lime); box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.cfg-range::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--lime); }
.cfg-range__ends { display: flex; justify-content: space-between; margin-top: 4px; font-size: 11px; color: var(--muted); }

/* tallas */
.size-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.size-btn {
  height: 48px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--bg-2);
  font: italic 900 1rem/1 var(--font-display); cursor: pointer; transition: border-color .15s, background-color .15s, color .15s;
}
.size-btn:hover { border-color: rgba(209, 211, 103, .55); }
.size-btn[aria-checked="true"] { background: var(--lime); border-color: var(--lime); color: var(--navy); }
.size-grid.is-missing .size-btn { border-color: rgba(245, 185, 122, .6); }

/* botones */
.cfg-reset { padding-top: 24px; }
.cfg-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em; width: 100%;
  min-height: 52px; padding: 0 20px; border-radius: 4px; border: 0; cursor: pointer; text-decoration: none;
  font: italic 900 1rem/1 var(--font-display); text-transform: uppercase; letter-spacing: .01em; white-space: nowrap;
  transition: transform .2s var(--ease), background-color .2s, border-color .2s, filter .2s;
}
.cfg-btn:active { transform: scale(.98); }
.cfg-btn--ghost { min-height: 46px; border: 1px solid var(--line-2); background: transparent; color: var(--text); font: 600 .92rem/1 var(--font-body); text-transform: none; }
.cfg-btn--ghost:hover { border-color: var(--text); }
.cfg-btn--accent { background: var(--lime); color: var(--navy); box-shadow: 0 10px 30px -10px rgba(209, 211, 103, .55); }
.cfg-btn--accent:hover { background: var(--lime-hi); }
.cfg-btn--line { background: transparent; color: var(--text); border: 2px solid var(--line-2); }
.cfg-btn--line:hover { border-color: var(--lime); color: var(--lime); }
.cfg-btn--wa { background: var(--wa); color: #fff; font: 700 1rem/1 var(--font-body); text-transform: none; }
.cfg-btn--wa:hover { filter: brightness(1.07); }
.cfg-btn[aria-busy="true"] { opacity: .6; pointer-events: none; }

/* resumen */
.summary {
  margin-top: 32px; padding: 22px 18px; border-radius: 8px;
  background: linear-gradient(160deg, var(--bg-3), var(--bg-2)); border: 1px solid var(--line);
  scroll-margin-top: calc(var(--top-h) + 16px);
}
.summary__title { font: italic 900 1.7rem/.95 var(--font-display); text-transform: uppercase; letter-spacing: -.02em; }
.summary__list { margin: 18px 0 0; }
.summary__list > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px dashed var(--line-2); }
.summary__list dt { color: var(--muted); font-size: .88rem; }
.summary__list dd { margin: 0; text-align: right; font-weight: 700; overflow-wrap: anywhere; }
.summary__list dd.is-missing { color: #F5B97A; }
.summary__total { border-bottom: 0 !important; align-items: baseline; }
.summary__total dd { font: italic 900 2rem/1 var(--font-display); color: var(--lime); }
.summary__warn { margin-top: 6px; font-size: .85rem; color: #F5B97A; }
.summary__actions { display: grid; gap: 10px; margin-top: 18px; }
.summary__note { margin-top: 14px; font-size: .8rem; color: var(--muted); }

/* modo recepción */
.reception {
  position: fixed; inset: 0; z-index: 60; background: rgba(4, 7, 13, .96);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.reception__inner { position: relative; width: 100%; max-width: 640px; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.reception__img { width: auto; max-width: 100%; max-height: calc(100svh - 90px); border-radius: 8px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .8); }
.reception__close {
  position: absolute; top: -6px; right: -4px; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line-2); background: var(--bg-2); color: #fff; cursor: pointer; display: grid; place-items: center;
}
.reception .cfg-kicker { margin: 10px 48px 0 0; align-self: flex-start; line-height: 1.4; }

@media (max-width: 599px) { .cfg-stage__label { display: none; } }

/* ---------- escritorio: estudio fijo a la izquierda + panel de 430px (como Lovable) ---------- */
@media (min-width: 960px) {
  .cfg { grid-template-columns: minmax(0, 1fr) 430px; max-width: 1480px; margin-inline: auto; }
  .cfg-stage {
    position: sticky; top: var(--top-h); height: calc(100svh - var(--top-h));
    padding: 32px 40px; box-shadow: none;
  }
  .cfg-stage__label { top: 32px; left: 40px; }
  .shirt { width: min(100%, 760px, calc(100svh - var(--top-h) - 64px)); }
  .cfg-panel { padding: 40px 36px 56px; border-left: 1px solid var(--line); }
  .cfg-title { font-size: 2.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
