/* Configurador de coche · estilos propios de la pagina */
[hidden] { display: none !important; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 200; padding: 10px 14px; background: #fff; color: #111; border-radius: 4px; font-size: 13px; transition: top .2s; }
.skip:focus { top: 12px; }

.page-cfg .nav { background: linear-gradient(180deg, #000 72%, rgba(0,0,0,0)); }
.cfg { padding: 92px var(--pad) clamp(56px, 7vw, 100px); max-width: 1500px; margin: 0 auto; }

.cfg__head { max-width: 760px; padding-bottom: clamp(28px, 4vw, 52px); }
.cfg__back { font-size: 12px; letter-spacing: .06em; color: var(--muted); transition: color .25s; }
.cfg__back:hover { color: #fff; }
.cfg__kicker { margin-top: clamp(28px, 5vh, 48px); font-size: 12px; letter-spacing: .06em; color: var(--muted); }
.cfg h1 { margin-top: 14px; font-size: clamp(34px, 4.6vw, 72px); font-weight: 300; letter-spacing: -.045em; line-height: 1.04; }
.cfg__intro { margin-top: 22px; max-width: 52ch; font-size: 14px; line-height: 1.6; color: #a4a4a4; }

.cfg__layout { display: grid; grid-template-columns: minmax(0, 7fr) minmax(300px, 4.4fr); gap: clamp(32px, 6vw, 110px); align-items: start; margin-top: clamp(28px, 4vw, 52px); }

/* ---------- Formulario ---------- */
.cfg__form { min-width: 0; }
.cfg-sec { border: 0; margin: 0; padding: 0 0 clamp(32px, 4vw, 52px); min-width: 0; }
.cfg-sec + .cfg-sec { padding-top: clamp(28px, 3.5vw, 44px); border-top: 1px solid rgba(255,255,255,.18); }
.cfg-sec legend { float: left; width: 100%; display: flex; align-items: baseline; gap: 16px; padding: 0 0 22px; font-size: clamp(20px, 2vw, 28px); font-weight: 300; letter-spacing: -.035em; }
/* el float evita que el borde del fieldset se corte alrededor de la leyenda */
.cfg-sec legend + * { clear: both; }
.cfg-sec legend span { font-size: 11px; letter-spacing: .2em; color: var(--muted); }

.cfg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 18px; }
.cfg-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cfg-field + .cfg-field { margin-top: 0; }
.cfg-sec > .cfg-field + .cfg-grid, .cfg-sec > .cfg-grid + .cfg-field { margin-top: 20px; }
.cfg-field--wide { grid-column: 1 / -1; }

.cfg label, .cfg-lab { font-size: 12px; letter-spacing: .04em; color: #b4b4b4; }
.cfg label em { font-style: normal; color: #8d8d8d; }

.cfg input[type="text"], .cfg input[type="number"], .cfg input[type="email"], .cfg input[type="tel"], .cfg textarea {
  width: 100%;
  padding: 14px 14px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 4px;
  background: rgba(255,255,255,.04);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 300;
  transition: border-color .2s, background .2s;
  appearance: none;
  -moz-appearance: textfield;
}
.cfg input[type="number"]::-webkit-outer-spin-button, .cfg input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cfg textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
.cfg input:hover, .cfg textarea:hover { border-color: rgba(255,255,255,.55); }
.cfg input:focus, .cfg textarea:focus { outline: 2px solid #fff; outline-offset: 2px; border-color: #fff; background: rgba(255,255,255,.07); }
.cfg [aria-invalid="true"] { border-color: #ff8a80; }

.cfg-unit { position: relative; }
.cfg-unit input { padding-right: 46px; }
.cfg-unit span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 13px; color: #a4a4a4; pointer-events: none; }

.cfg-hint { font-size: 12px; line-height: 1.5; color: #8d8d8d; }
.cfg-err { margin-top: 6px; font-size: 12.5px; line-height: 1.4; color: #ff9a92; }
.cfg-sec > .cfg-err { margin-top: 10px; }

/* ---------- Muestras de color ---------- */
.cfg-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.sw { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 6px 12px; border: 1px solid rgba(255,255,255,.2); border-radius: 4px; cursor: pointer; transition: border-color .2s, background .2s; }
.sw:hover { border-color: rgba(255,255,255,.55); }
.sw input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.sw__dot { width: 34px; height: 34px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 1px rgba(255,255,255,.35), inset 0 -6px 10px rgba(0,0,0,.25), inset 0 5px 8px rgba(255,255,255,.18); }
.sw__dot--none { background: conic-gradient(#b01822, #e6c229, #1f5a3c, #1d3a8a, #b01822); }
.sw__name { font-size: 12px; color: #c4c4c4; text-align: center; line-height: 1.2; }
.sw:has(input:checked) { border-color: #fff; background: rgba(255,255,255,.08); }
.sw:has(input:checked) .sw__name { color: #fff; }
.sw:has(input:focus-visible) { outline: 2px solid #fff; outline-offset: 2px; }

/* ---------- Opciones segmentadas ---------- */
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg span { display: inline-flex; align-items: center; height: 44px; padding: 0 18px; border: 1px solid rgba(255,255,255,.3); border-radius: 999px; font-size: 14px; color: #d0d0d0; transition: background .2s, color .2s, border-color .2s; }
.seg label:hover span { border-color: #fff; }
.seg input:checked + span { background: #fff; border-color: #fff; color: #111; }
.seg input:focus-visible + span { outline: 2px solid #fff; outline-offset: 2px; }

/* ---------- Privacidad y envio ---------- */
.cfg-check { display: flex; align-items: flex-start; gap: 12px; margin-top: 26px; }
.cfg-check input { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: #fff; cursor: pointer; }
.cfg-check input:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.cfg-check label { font-size: 13px; line-height: 1.5; color: #c4c4c4; cursor: pointer; }
.cfg-check a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.cfg-submit { justify-content: center; text-align: center; margin-top: 28px; height: 52px; padding: 0 34px; font-size: 14px; cursor: pointer; }
.cfg-submit[disabled] { opacity: .6; cursor: wait; }
.cfg-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.cfg-summary { margin-bottom: 28px; padding: 16px 18px; border: 1px solid #ff8a80; border-radius: 4px; background: rgba(255,138,128,.08); }
.cfg-summary p { font-size: 14px; margin-bottom: 8px; }
.cfg-summary ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.6; }
.cfg-summary a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.cfg-summary:focus { outline: 2px solid #fff; outline-offset: 2px; }

/* ---------- Vista previa ---------- */
.cfg__preview { position: sticky; top: 92px; align-self: start; }
.cfg-card { cursor: default; transform: none; }
.cfg-card:hover { box-shadow: 0 30px 50px -34px rgba(0,0,0,.9), 0 0 0 1px rgba(255,255,255,.04); }
.cfg-photo { aspect-ratio: 16 / 9; background: #000; }
.cfg-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cfg-card .card__name { min-height: 2.4em; }
.cfg-card .card__name.is-empty { color: #6e6e74; }
.cfg-card dd { min-height: 1.4em; }
.cfg-card dd.is-empty { color: #6e6e74; }
.cfg-stats2 { grid-template-columns: repeat(2, 1fr); border-top: 0 !important; margin-bottom: 0 !important; padding-top: 0 !important; }
.cfg-stats2 div { padding-top: 12px; }
.cfg-stats2 div:nth-child(2) { border-left: 1px solid rgba(255,255,255,.08); padding-left: 12px; }
.cfg-dot { display: inline-block; width: 11px; height: 11px; margin-right: 8px; border-radius: 50%; background: var(--c, #888); box-shadow: 0 0 0 1px rgba(255,255,255,.4); vertical-align: -1px; }
.cfg-extras { min-height: 2.9em; margin: 14px 4px 0; font-size: 12px; line-height: 1.45; color: #a4a4a8; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.cfg-card .card__foot { margin-top: auto; }
.cfg-note { margin-top: 14px; font-size: 12px; line-height: 1.5; color: #8d8d8d; }

/* ---------- Confirmacion ---------- */
.cfg-done { max-width: 760px; margin: 0 auto; padding: clamp(24px, 4vw, 56px) 0; }
.cfg-done:focus { outline: none; }
.cfg-done h2 { margin-top: 12px; font-size: clamp(30px, 4vw, 56px); font-weight: 300; letter-spacing: -.045em; line-height: 1.06; }
.cfg-done > p { margin-top: 18px; font-size: 14px; line-height: 1.6; color: #b4b4b4; max-width: 60ch; }
.cfg-done pre { margin: 28px 0 0; padding: 20px; border: 1px solid rgba(255,255,255,.2); border-radius: 4px; background: rgba(255,255,255,.04); font: inherit; font-size: 13px; line-height: 1.7; color: #e4e4e4; white-space: pre-wrap; word-break: break-word; }
.cfg-done__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.cfg-done .btn { cursor: pointer; justify-content: center; text-align: center; }
.cfg-done .cfg-hint { margin-top: 12px; min-height: 1.4em; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .cfg { padding-top: 62px; }
  .cfg__layout { grid-template-columns: 1fr; gap: 36px; }
  .cfg__preview { position: static; order: -1; max-width: 440px; width: 100%; margin: 0 auto; }
  .cfg-grid { grid-template-columns: 1fr; }
  .cfg-swatches { grid-template-columns: repeat(3, 1fr); }
  .seg span { height: 46px; }
  /* tarjeta mas compacta en movil */
  .cfg-card .card__inner { padding: 12px 12px 14px; }
  .cfg-card .card__name { margin: 12px 4px 10px; min-height: 0; font-size: 18px; }
  .cfg-card .card__stats { padding: 8px 0; }
  .cfg-stats2 div { padding-top: 8px; }
  .cfg-extras { min-height: 0; margin-top: 10px; }
  .cfg-card .card__foot { padding-top: 12px; }
  .cfg-card .card__price { font-size: 20px; }
  .cfg-note { display: none; }
  .cfg-submit { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .cfg *, .skip { transition: none !important; }
}

/* ---------- Intro a pantalla completa ---------- */
html.intro-on { overflow: hidden; }
.intro {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: #000;
  transition: opacity 1s ease, visibility 1s ease;
}
.intro video { display: block; width: 100%; height: 100%; object-fit: cover; background: #000; }
@media (max-aspect-ratio: 6/5) { .intro video { object-fit: contain; } }   /* en vertical se ve entero, sin recortar el coche */
.intro.is-leaving { opacity: 0; visibility: hidden; }
.intro:focus { outline: none; }
.intro { cursor: pointer; display: grid; place-items: center; }
/* en horizontal el video se ve algo mas pequeno, centrado y con los bordes fundidos en negro */
@media (min-aspect-ratio: 6/5) {
  .intro video {
    width: 34%; height: 34%; object-fit: contain;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16%, #000 84%, transparent 100%), linear-gradient(180deg, transparent 0, #000 18%, #000 82%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(90deg, transparent 0, #000 16%, #000 84%, transparent 100%), linear-gradient(180deg, transparent 0, #000 18%, #000 82%, transparent 100%);
    mask-composite: intersect;
  }
}
@media (prefers-reduced-motion: reduce) { .intro { display: none; } html.intro-on { overflow: auto; } }
