/*
 * Lo que solo usan el inicio, /piezas/ y /cotizar/: la portada, la vitrina que gira,
 * el personalizador y el pedido.
 */

/* ===== Portada: el titular y la pieza, directo sobre el fondo ===== */
.hero { padding-top: 6px; }
.hero-panel { position: relative; isolation: isolate; display: grid; color: var(--night-ink); }
/* La luz cae donde está la pieza: abajo en celular, a la derecha en computador. */
.hero-panel::before { content: ""; position: absolute; z-index: -1; inset: 14% -24% -4%; background: radial-gradient(58% 44% at 50% 52%, rgba(46,104,235,.5), rgba(30,58,112,.24) 46%, transparent 74%); pointer-events: none; }
.hero-copy { display: flex; flex-direction: column; gap: 14px; padding: 22px 2px 0; }
.hero h1 { font-size: clamp(2.9rem, 1.2rem + 7.4vw, 5.8rem); line-height: .93; letter-spacing: -.052em; font-weight: 640; }
.hero .lead { color: #C3CED8; max-width: 26em; }
.hero-demo { min-width: 0; }
.hero-escena { position: relative; height: min(96vw, 470px); margin-inline: calc(var(--gutter) * -1); }
.hero-escena .vitrina-foto, .hero-escena canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-escena .vitrina-foto { object-fit: contain; transition: opacity .5s; }
.hero-escena canvas { opacity: 0; transition: opacity .6s; cursor: grab; touch-action: pan-y; }
.hero-escena.is-3d canvas { opacity: 1; }
.hero-escena.is-3d .vitrina-foto { opacity: 0; }
.dest { display: flex; flex-direction: column; gap: 10px; padding: 0 0 20px; }
.dest-label { padding-inline: 2px; font-size: 14.5px; color: var(--night-soft); }
.dest-fila { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding: 2px var(--gutter); }
.dest-fila::-webkit-scrollbar { display: none; }
.chip-btn { flex: 0 0 auto; min-height: 44px; padding: 10px 16px; border-radius: 999px; border: 1px solid rgba(255,255,255,.24); background: rgba(255,255,255,.04); color: var(--night-ink); cursor: pointer; font-size: 15px; font-weight: 500; white-space: nowrap; transition: background-color .2s, border-color .2s, color .2s; -webkit-tap-highlight-color: transparent; }
.chip-btn:hover { border-color: rgba(255,255,255,.6); }
.chip-btn[aria-pressed="true"] { background: var(--night-ink); border-color: var(--night-ink); color: var(--night); }
.hero-acciones { padding: 0 0 8px; }
.assure { list-style: none; margin: 0; padding: 22px 2px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; font-size: 15px; line-height: 1.35; color: var(--ink-soft); }
.assure li { display: flex; gap: 10px; align-items: flex-start; }
.assure .nodo { margin-top: 4px; }
@media (min-width: 900px) {
  .hero-panel { grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); grid-template-rows: 1fr auto; min-height: min(680px, 78vh); }
  .hero-panel::before { inset: -6% -10% -10% 30%; background: radial-gradient(50% 50% at 58% 48%, rgba(46,104,235,.5), rgba(30,58,112,.24) 48%, transparent 76%); }
  .hero-copy { grid-column: 1; grid-row: 1; align-self: end; gap: 20px; padding: 40px 0 0 4px; }
  .hero-acciones { grid-column: 1; grid-row: 2; align-self: start; padding: 28px 0 48px 4px; }
  .hero-demo { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-direction: column; }
  .hero-escena { flex: 1; height: auto; min-height: 420px; margin-inline: 0; }
  .dest { padding-bottom: 22px; align-items: center; }
  .dest-fila { flex-wrap: wrap; justify-content: center; overflow: visible; margin-inline: 0; padding-inline: 0; }
  .assure { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 22px 4px 0; border-top: 1px solid var(--line); margin-top: 8px; }
}

/* ===== La vitrina de /piezas/: elegir una pieza y girarla ===== */
.showroom { display: grid; gap: 14px; }
.sr-tab { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; min-height: 56px; padding: 9px 16px; border-radius: 14px; border: 1px solid var(--line-strong); background: transparent; cursor: pointer; transition: background-color .2s, border-color .2s, color .2s; -webkit-tap-highlight-color: transparent; }
.sr-tab b { font-family: var(--display); font-size: 16px; font-weight: 620; letter-spacing: -.01em; white-space: nowrap; }
.sr-tab:hover { border-color: var(--ink); }
.sr-tab[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.sr-tab[aria-selected="true"] .medida { color: inherit; opacity: .75; }
.sr-stage { aspect-ratio: 1 / 1; max-height: 72svh; width: 100%; }
.sr-spec { border-radius: var(--r-lg); padding: 22px 20px; display: flex; flex-direction: column; gap: 14px; background: var(--surface); }
.sr-spec h2 { font-size: 26px; letter-spacing: -.03em; line-height: 1.05; }
.sr-spec > p { color: var(--ink-soft); font-size: 16px; }
.specs { margin: 0; display: grid; border-top: 1px solid var(--line); }
.specs div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.specs dt { color: var(--ink-soft); }
.specs dd { margin: 0; }
.price { font-size: 15px; color: var(--ink-soft); }
.price b { display: block; font-family: var(--display); font-size: 30px; font-weight: 600; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.sr-spec .btn { width: 100%; }
.added { font-size: 14px; color: var(--ink-soft); text-align: center; min-height: 1.4em; }
@media (min-width: 900px) {
  .showroom { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px 20px; align-items: stretch; }
  .sr-tabs { grid-column: 1 / -1; flex-wrap: wrap; overflow: visible; margin-inline: 0; padding-inline: 0; }
  .sr-stage { aspect-ratio: auto; min-height: 560px; max-height: none; }
  .sr-spec { padding: 28px; }
  .sr-spec .btn { margin-top: auto; }
}

/* ===== El personalizador =====
   En celular la pieza se queda fija arriba mientras se cambian las opciones debajo. */
.taller { display: grid; gap: 14px; }
/* Queda fija y las opciones pasan por debajo: por eso sí lleva el color del fondo, y se funde abajo. */
.taller-escena { position: sticky; top: calc(var(--nav-h) + 6px); z-index: 5; height: min(46svh, 430px); aspect-ratio: auto; overflow: visible; background: var(--luz), var(--bg); box-shadow: 0 26px 26px -14px var(--bg); }
.taller-escena .plano { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 22px; }
.probar { position: absolute; right: 0; bottom: 10px; z-index: 3; min-height: 44px; padding: 10px 16px; font-size: 15px; }
.probar[disabled] { opacity: .6; cursor: default; }
.taller-pie { position: absolute; left: 0; top: 8px; z-index: 2; max-width: 100%; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.08); font-size: 13px; line-height: 1.3; color: var(--night-ink); pointer-events: none; }
.taller-pie:empty { display: none; }
.ds-controls { display: flex; flex-direction: column; gap: 22px; min-width: 0; padding: 20px 18px; border-radius: var(--r-lg); background: var(--surface); }
.ds-group { display: flex; flex-direction: column; gap: 10px; min-width: 0; margin: 0; padding: 0; border: 0; }
.ds-group > legend, .ds-label { padding: 0; margin-bottom: 10px; font-family: var(--display); font-size: 17px; font-weight: 620; letter-spacing: -.01em; }
.drop { position: relative; display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 14px 16px; border-radius: var(--r-md); border: 1.5px dashed var(--line-strong); background: rgba(255,255,255,.03); cursor: pointer; transition: border-color .2s, background-color .2s; }
.drop:hover, .drop.is-over { border-color: var(--signal); background: var(--signal-soft); }
.drop:focus-within { outline: 2px solid var(--signal); outline-offset: 3px; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop b { display: block; font-family: var(--display); font-size: 18px; font-weight: 620; }
.drop span { font-size: 14px; color: var(--ink-soft); }
.drop .drop-ic { flex-shrink: 0; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--accion); color: var(--on-signal); }
.logo-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--r-md); background: var(--bg); border: 1px solid var(--line); }
.logo-row .thumb { width: 60px; height: 60px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; background: repeating-conic-gradient(var(--surface) 0 25%, var(--bg) 0 50%) 0 0 / 14px 14px; overflow: hidden; }
.logo-row .thumb img { max-width: 52px; max-height: 52px; object-fit: contain; }
.logo-row .info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; font-size: 13px; color: var(--ink-soft); line-height: 1.35; }
.logo-row .info b { font-size: 15px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-btn { border: 0; background: transparent; color: var(--signal); cursor: pointer; font-weight: 600; font-size: 14px; min-height: 44px; padding: 0 6px; }
.radios { display: flex; flex-wrap: wrap; gap: 8px; }
.radio { position: relative; }
.radio input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.radio span { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 15px; transition: background-color .2s, border-color .2s, color .2s; }
.radio input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.radio input:focus-visible + span { outline: 2px solid var(--signal); outline-offset: 3px; }
.radio input:disabled + span { opacity: .45; }
.radio .medida { color: inherit; opacity: .7; font-size: 12px; }
/* Las propuestas de diseño: una miniatura de la pieza en cada estilo */
.ds-ayuda { margin-top: -4px; font-size: 14px; color: var(--ink-soft); }
.estilos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.estilo { position: relative; min-width: 0; }
.estilo input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.estilo span { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 6px 9px; border-radius: var(--r-md); border: 1px solid var(--line-strong); font-size: 13.5px; transition: border-color .2s, background-color .2s; }
.estilo canvas { display: block; width: 100%; height: 96px; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0,0,0,.55)); }
.estilo b { font-weight: 600; white-space: nowrap; }
.estilo input:checked + span { border-color: var(--signal); background: var(--signal-soft); box-shadow: inset 0 0 0 1px var(--signal); }
.estilo input:focus-visible + span { outline: 2px solid var(--signal); outline-offset: 3px; }
.estilo input:disabled + span { opacity: .38; }
.toggle { display: flex; align-items: center; gap: 10px; font-size: 15px; min-height: 44px; cursor: pointer; }
.toggle input { width: 20px; height: 20px; accent-color: var(--accion); }
.ds-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.ds-actions .btn { flex: 1 1 200px; }
.ds-actions .btn-ghost { box-shadow: inset 0 0 0 1px var(--line-strong); }
.ds-note { font-size: 14px; color: var(--ink-soft); }
.status { font-size: 14px; min-height: 1.4em; color: var(--signal); }
@media (min-width: 900px) {
  .taller { grid-template-columns: minmax(0, 1.2fr) minmax(360px, .8fr); gap: 20px; align-items: start; }
  .taller-escena { top: calc(var(--nav-h) + 24px); height: min(76vh, 700px); }
  .ds-controls { padding: 26px; }
}

/* ===== Pedido ===== */
.order { display: grid; gap: 24px; align-items: start; }
.order-build { display: flex; flex-direction: column; gap: 32px; min-width: 0; }
.order fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.order legend { font-family: var(--display); font-size: 20px; font-weight: 620; letter-spacing: -.02em; padding: 0; margin-bottom: 14px; }
.kit-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.kit { text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: transparent; cursor: pointer; transition: border-color .2s, background-color .2s; }
.kit b { font-family: var(--display); font-size: 18px; font-weight: 620; }
.kit span { font-size: 14px; color: var(--ink-soft); line-height: 1.4; }
.kit:hover { border-color: var(--ink); }
.kit[aria-pressed="true"] { border-color: var(--signal); background: var(--signal-soft); box-shadow: inset 0 0 0 1px var(--signal); }
.lines { border-top: 1px solid var(--line); }
.line { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.line-name b { display: block; font-weight: 600; line-height: 1.25; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 14px; overflow: hidden; }
.stepper button { width: 46px; height: 46px; border: 0; background: transparent; cursor: pointer; font-size: 22px; line-height: 1; color: var(--ink); }
.stepper button:hover { background: var(--surface); }
.stepper button:disabled { color: var(--line-strong); cursor: default; background: transparent; }
.stepper output { min-width: 36px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check { position: relative; }
.check input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.check span { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 15px; transition: background-color .2s, border-color .2s, color .2s; }
.check input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.check input:focus-visible + span { outline: 2px solid var(--signal); outline-offset: 3px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.field > span { color: var(--ink-soft); }
.field input { font: inherit; font-size: 17px; color: var(--ink); min-height: 52px; padding: 12px 14px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--bg); }
.field input:focus { outline: 2px solid var(--signal); outline-offset: 1px; border-color: transparent; }
.sum { border-radius: var(--r-lg); padding: 22px 20px; display: flex; flex-direction: column; gap: 14px; }
.sum h3 { font-size: 24px; letter-spacing: -.02em; }
.sum-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.sum-list li { display: flex; justify-content: space-between; gap: 12px; }
.sum-list li span:last-child { font-variant-numeric: tabular-nums; color: var(--ink-soft); white-space: nowrap; }
.sum-empty { font-size: 15px; color: var(--ink-soft); }
.sum-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.sum-total b { font-family: var(--display); font-size: 28px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.sum-note { font-size: 14px; color: var(--ink-soft); }
.sum .btn { width: 100%; }
.sum .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.order-text { font: inherit; font-size: 14px; line-height: 1.45; color: var(--ink); width: 100%; padding: 12px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--bg); resize: vertical; }
@media (min-width: 900px) {
  .order { grid-template-columns: minmax(0, 1fr) 380px; }
  .sum { position: sticky; top: calc(var(--nav-h) + 24px); padding: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .chip-btn, .sr-tab, .radio span, .check span, .kit, .drop { transition: none; }
  .hero-escena .vitrina-foto, .hero-escena canvas { transition: none; }
}
