/* Cardex · ver DESIGN.md */
:root {
  --ink: #04060c;
  --ink-2: #0a1226;
  --ink-3: #0d1a38;
  --blue: #2b82ff;
  --sky: #8fd0ff;
  --mist: #e6f0ff;
  --dim: #9fb3d1;
  --line: rgba(143, 208, 255, .16);
  --line-strong: rgba(143, 208, 255, .34);
  --error: #ffb0b0;
  --ok: #8fe3b8;

  --font-display: "Instrument Serif", "Bitstream Charter", "Iowan Old Style", Georgia, serif;
  --font-body: "Hanken Grotesk", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --t-xs: .8125rem;
  --t-sm: .9375rem;
  --t-md: 1.0625rem;
  --t-lg: 1.25rem;
  --t-h2: clamp(2.25rem, 5.4vw, 3.75rem);
  --t-h1: clamp(3.1rem, 10.4vw, 6.25rem);
  --t-price: clamp(3rem, 9vw, 4.25rem);

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px; --s9: 112px;
  --gutter: 20px;
  --wrap: min(1160px, 100% - var(--gutter) * 2);
  --r-field: 14px;
  --r-panel: 28px;
  --header-h: 68px;
  color-scheme: dark;
}
@media (min-width: 760px) { :root { --gutter: 32px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0; min-height: 100vh; min-height: 100svh;
  background: var(--ink); color: var(--mist);
  font: 400 var(--t-md)/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: clip;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, p, ol, ul, figure, fieldset { margin: 0; padding: 0; }
ol, ul { list-style: none; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 8px; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--s4); top: -80px; z-index: 50; background: var(--mist); color: var(--ink); padding: var(--s3) var(--s4); border-radius: 10px; font-weight: 600; text-decoration: none; }
.skip:focus { top: var(--s3); }

/* Olas de la marca (se dibujan en js/waves.js) */
.waves { position: fixed; left: 0; right: 0; bottom: 0; height: min(38vh, 380px); z-index: 0; pointer-events: none; overflow: hidden; }
.waves svg { position: absolute; left: 0; bottom: 0; height: 100%; will-change: transform; }
.site-header, main, .site-footer { position: relative; z-index: 1; }

.wrap { width: var(--wrap); margin-inline: auto; }

/* Encabezado */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(4, 6, 12, .78); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0); }
.site-header .wrap { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: var(--s5); }
.brand { display: inline-flex; align-items: center; min-height: 44px; }
.brand img { height: 32px; width: auto; }
.nav { display: none; gap: var(--s6); font-size: var(--t-sm); font-weight: 500; color: var(--dim); }
.nav a { text-decoration: none; padding: var(--s2) 0; }
.nav a:hover { color: var(--mist); }
@media (min-width: 760px) { .nav { display: flex; } }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 52px; padding: 0 var(--s6); border-radius: 999px; border: 1.5px solid transparent; font-weight: 600; font-size: var(--t-md); text-decoration: none; cursor: pointer; transition: transform .2s, background-color .2s, border-color .2s, box-shadow .2s; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--blue); color: var(--ink); box-shadow: 0 12px 32px -12px var(--blue); }
.btn--primary:hover { background: #4d96ff; transform: translateY(-2px); box-shadow: 0 18px 36px -12px var(--blue); }
.btn--ghost { border-color: var(--line-strong); color: var(--mist); background: transparent; }
.btn--ghost:hover { border-color: var(--sky); background: rgba(43, 130, 255, .12); }
.btn--small { min-height: 44px; padding: 0 var(--s5); font-size: var(--t-sm); }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .7; cursor: progress; transform: none; }

/* Títulos */
.display { font-family: var(--font-display); font-weight: 400; letter-spacing: -.012em; }
h1.display { font-size: var(--t-h1); line-height: .96; max-width: 11ch; }
h2.display { font-size: var(--t-h2); line-height: 1.02; max-width: 16ch; }
.lead { color: var(--dim); font-size: var(--t-lg); line-height: 1.55; max-width: 34em; }
.sec { padding-block: clamp(56px, 9vw, 112px); }
.sec__head { display: grid; gap: var(--s4); margin-bottom: clamp(32px, 5vw, 56px); }
.sec__head .lead { font-size: var(--t-md); }

/* Inicio */
.hero { overflow-x: clip; display: grid; gap: clamp(40px, 6vw, 72px); align-items: center; padding-block: clamp(32px, 6vw, 72px) clamp(72px, 10vw, 128px); }
@media (min-width: 960px) { .hero { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); } }
.hero__copy { display: grid; gap: var(--s5); justify-items: start; }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s2); }
.hero__note { color: var(--dim); font-size: var(--t-sm); }

/* Demo: tarjetas + celular */
.demo { display: grid; gap: var(--s5); justify-items: center; }
.fan { position: relative; width: min(100%, 460px); aspect-ratio: 1 / 1.1; }
.fan__card { position: absolute; left: 50%; top: 5%; width: 64%; margin: 0; border-radius: 7%; overflow: hidden; box-shadow: 0 40px 70px -34px rgba(43, 130, 255, .7); transform-origin: 50% 90%; transition: transform .7s cubic-bezier(.2, .8, .2, 1), filter .5s, opacity .5s; cursor: pointer; }
.fan__card img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.fan__card[data-pos="front"] { transform: translateX(-50%) rotate(0) scale(1); z-index: 3; }
.fan__card[data-pos="left"] { transform: translateX(-88%) translateY(5%) rotate(-9deg) scale(.9); z-index: 1; filter: brightness(.5) saturate(.8); }
.fan__card[data-pos="right"] { transform: translateX(-12%) translateY(5%) rotate(9deg) scale(.9); z-index: 2; filter: brightness(.5) saturate(.8); }
.phone { position: absolute; right: 1%; bottom: 0; width: 27%; aspect-ratio: 9 / 18; z-index: 5; border-radius: 22px; border: 3px solid rgba(230, 240, 255, .85); background: linear-gradient(160deg, var(--ink-3), var(--ink)); box-shadow: 0 24px 40px -18px rgba(0, 0, 0, .8); display: grid; place-items: center; padding: 12% 8%; transform: rotate(8deg); }
.phone::before { content: ""; position: absolute; top: 3.5%; left: 50%; width: 30%; height: 3%; border-radius: 99px; background: rgba(230, 240, 255, .5); transform: translateX(-50%); }
.phone__label { font-size: .7rem; line-height: 1.2; font-weight: 600; text-align: center; color: var(--sky); opacity: 0; transition: opacity .3s; }
.fan.is-opened .phone__label { opacity: 1; }
.fan__ping { position: absolute; left: 50%; top: 49%; z-index: 4; width: 14%; aspect-ratio: 1; margin: -7% 0 0 -7%; pointer-events: none; }
.fan__ping i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--sky); opacity: 0; }
.fan.is-tap .phone { animation: phone-tap 2.6s cubic-bezier(.3, .8, .2, 1) both; }
.fan.is-tap .fan__ping i { animation: ping 1.3s ease-out 1.05s both; }
.fan.is-tap .fan__ping i:nth-child(2) { animation-delay: 1.3s; }
.fan.is-tap .fan__ping i:nth-child(3) { animation-delay: 1.55s; }
@keyframes phone-tap {
  0% { transform: rotate(8deg) translate(0, 0); }
  38%, 70% { transform: rotate(-3deg) translate(-155%, -92%); }
  100% { transform: rotate(8deg) translate(0, 0); }
}
@keyframes ping { 0% { opacity: .95; transform: scale(.5); } 100% { opacity: 0; transform: scale(5); } }

.picker { display: flex; flex-wrap: wrap; gap: var(--s2); justify-content: center; border: 0; }
.picker label { cursor: pointer; }
.picker span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s5); border-radius: 999px; border: 1.5px solid var(--line-strong); font-size: var(--t-sm); font-weight: 600; color: var(--dim); transition: all .2s; }
.picker input:checked + span { background: var(--mist); border-color: var(--mist); color: var(--ink); }
.picker input:focus-visible + span { outline: 3px solid var(--sky); outline-offset: 3px; }
.picker label:hover span { border-color: var(--sky); }
.demo__caption { color: var(--mist); font-size: var(--t-md); text-align: center; min-height: 3.2em; max-width: 24em; }

/* Cómo funciona */
.how { display: grid; gap: var(--s7); }
@media (min-width: 900px) { .how { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: var(--s9); align-items: start; } }
.steps li { display: grid; grid-template-columns: auto 1fr; gap: var(--s5); padding-block: var(--s6); border-top: 1px solid var(--line); }
.steps li:last-child { border-bottom: 1px solid var(--line); }
.steps__n { font-family: var(--font-display); font-size: 3rem; line-height: 1; color: var(--sky); min-width: 1.2ch; }
.steps h3 { font-size: var(--t-lg); font-weight: 600; line-height: 1.3; margin-bottom: var(--s2); }
.steps p { color: var(--dim); max-width: 34em; }

/* Diseños */
.designs { display: grid; grid-auto-flow: column; grid-auto-columns: 80%; gap: var(--s5); overflow-x: auto; scroll-snap-type: x mandatory; padding: var(--s2) var(--gutter) var(--s6); margin-inline: calc(var(--gutter) * -1); scrollbar-width: none; overscroll-behavior-x: contain; }
.designs::-webkit-scrollbar { display: none; }
.design { scroll-snap-align: center; display: grid; gap: var(--s4); align-content: start; }
.design__img { border-radius: var(--r-panel); overflow: hidden; box-shadow: 0 34px 60px -36px rgba(43, 130, 255, .75); }
.design h3 { font-family: var(--font-display); font-weight: 400; font-size: 1.9rem; line-height: 1.1; }
.design p { color: var(--dim); margin-top: calc(var(--s1) * -2); }
.design .btn { justify-self: start; }
.designs__note { color: var(--dim); font-size: var(--t-sm); margin-top: var(--s2); }
@media (min-width: 800px) {
  .designs { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; padding: 0; margin-inline: 0; gap: var(--s6); }
}

/* Comprar */
.shop { display: grid; gap: var(--s7); align-items: start; }
@media (min-width: 960px) { .shop { grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: var(--s8); } .summary { position: sticky; top: calc(var(--header-h) + 24px); } }
.group { display: block; margin-bottom: var(--s7); border: 0; min-width: 0; }
.group > * + * { margin-top: var(--s4); }
.group legend { display: flex; align-items: baseline; gap: var(--s3); padding: 0; margin-bottom: var(--s4); font-family: var(--font-display); font-size: 1.75rem; line-height: 1.1; }
.group legend b { font-weight: 400; color: var(--sky); }
.choices { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s3); }
@media (min-width: 560px) { .choices--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice__body { display: flex; align-items: center; gap: var(--s4); height: 100%; padding: var(--s4); border-radius: 18px; border: 1.5px solid var(--line-strong); background: rgba(10, 18, 38, .97); transition: border-color .2s, background-color .2s; }
.choice__body img { width: 56px; height: 56px; border-radius: 12px; flex: none; }
.choice b { display: block; font-weight: 600; line-height: 1.25; }
.choice small { display: block; color: var(--dim); font-size: var(--t-xs); line-height: 1.35; margin-top: 2px; }
.choice:hover .choice__body { border-color: var(--sky); }
.choice input:checked + .choice__body { border-color: var(--blue); background: rgba(43, 130, 255, .16); box-shadow: inset 0 0 0 1px var(--blue); }
.choice input:focus-visible + .choice__body { outline: 3px solid var(--sky); outline-offset: 3px; }
.choice--qty .choice__body { display: block; }
.choice--qty b { font-size: var(--t-lg); }
.choice--qty .save { color: var(--sky); }

.fields { display: grid; gap: var(--s4); grid-template-columns: repeat(6, minmax(0, 1fr)); }
.field { grid-column: span 6; display: grid; gap: var(--s2); align-content: start; }
@media (min-width: 560px) { .field--half { grid-column: span 3; } .field--third { grid-column: span 2; } .field--two-thirds { grid-column: span 4; } }
.field label { font-weight: 600; font-size: var(--t-sm); }
.field .opt { color: var(--dim); font-weight: 400; }
.field input, .field select { width: 100%; min-height: 52px; padding: 0 var(--s4); border-radius: var(--r-field); border: 1.5px solid var(--line-strong); background: rgba(10, 18, 38, .97); font-size: 1rem; transition: border-color .2s, box-shadow .2s; }
.field select { appearance: none; -webkit-appearance: none; padding-right: 44px; background-image: linear-gradient(45deg, transparent 50%, var(--sky) 50%), linear-gradient(135deg, var(--sky) 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.field select option { background: var(--ink-2); color: var(--mist); }
.field input::placeholder { color: rgba(159, 179, 209, .6); }
.field input:focus, .field select:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 3px rgba(143, 208, 255, .28); }
.field .hint { color: var(--dim); font-size: var(--t-xs); line-height: 1.45; }
.field .err { color: var(--error); font-size: var(--t-xs); font-weight: 500; min-height: 0; }
.field [aria-invalid="true"] { border-color: var(--error); }
.field .err:empty { display: none; }
.field--target { margin-top: var(--s2); }
.subgroup { grid-column: 1 / -1; font-weight: 600; font-size: var(--t-sm); color: var(--sky); margin-top: var(--s3); }

.summary { border: 1px solid var(--line); border-radius: var(--r-panel); padding: clamp(24px, 4vw, 36px); background: linear-gradient(160deg, rgba(13, 26, 56, .94), rgba(4, 6, 12, .94)); display: grid; gap: var(--s4); }
.summary__what { color: var(--dim); font-size: var(--t-sm); }
.summary__what strong { display: block; color: var(--mist); font-size: var(--t-lg); font-weight: 600; margin-top: 2px; }
.summary__total { font-family: var(--font-display); font-size: var(--t-price); line-height: 1; letter-spacing: -.01em; }
.summary__lines { display: grid; gap: var(--s2); padding-top: var(--s4); border-top: 1px solid var(--line); font-size: var(--t-sm); color: var(--dim); }
.summary__lines div { display: flex; justify-content: space-between; gap: var(--s4); }
.summary__lines dd { margin: 0; color: var(--mist); }
.summary dl { margin: 0; }
.summary__secure { color: var(--dim); font-size: var(--t-xs); line-height: 1.5; }
.form-status { min-height: 0; font-size: var(--t-sm); font-weight: 500; }
.form-status:not(:empty) { padding: var(--s3) var(--s4); border-radius: 12px; border: 1px solid rgba(255, 176, 176, .4); background: rgba(255, 176, 176, .08); color: var(--error); }
.bump { animation: bump .4s cubic-bezier(.2, .8, .2, 1); }
@keyframes bump { from { opacity: .3; transform: translateY(8px); } }

/* Preguntas */
.faq { max-width: 820px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: var(--s4); padding: var(--s5) var(--s1); min-height: 64px; font-size: var(--t-lg); font-weight: 600; line-height: 1.3; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 11px; height: 11px; border-right: 2.5px solid var(--sky); border-bottom: 2.5px solid var(--sky); transform: rotate(45deg); transition: transform .25s; margin-right: 4px; }
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq details p { padding: 0 var(--s1) var(--s5); color: var(--dim); max-width: 46em; animation: fade-in .35s ease-out; }
@keyframes fade-in { from { opacity: 0; transform: translateY(-6px); } }

/* Contacto */
.contact { display: grid; gap: var(--s5); padding-top: var(--s7); border-top: 1px solid var(--line); }
@media (min-width: 800px) { .contact { grid-template-columns: 1fr auto; align-items: center; } }
.contact p { color: var(--dim); max-width: 32em; margin-top: var(--s3); }

.site-footer { padding: var(--s7) 0 calc(var(--s8) + env(safe-area-inset-bottom, 0)); color: var(--dim); font-size: var(--t-sm); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: var(--s4); align-items: center; justify-content: space-between; }
.site-footer img { height: 26px; width: auto; }

/* Página del pedido */
.order { min-height: 60vh; display: grid; align-content: center; gap: var(--s5); justify-items: start; padding-block: clamp(48px, 10vw, 120px); }
.order h1 { font-size: clamp(2.5rem, 8vw, 4.5rem); line-height: 1; max-width: 14ch; }
.order__ref { font-family: var(--font-display); font-size: 1.75rem; color: var(--sky); }
.order__actions { display: flex; flex-wrap: wrap; gap: var(--s3); }

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