/* Secciones de la landing, en orden de aparición. */

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: var(--stage);
  overflow: hidden;
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--red-bg);
  clip-path: polygon(0 0, 52% 0, 41% 100%, 0 100%);
  z-index: -1;
}

.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
  min-height: 700px;
}

.hero-copy {
  color: var(--on-red);
  padding: 64px 0 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 26px;
  max-width: 520px;
}

.hero h1 { font-size: clamp(56px, 7.4vw, 108px); }

.hero-copy p {
  margin: 0;
  font-size: 19px;
  line-height: 1.5;
  max-width: 30em;
}

/* CTA del hero: blanco sobre rojo. */
.hero-copy .btn {
  background: #FFFFFF;
  color: #16090B;
}

.hero-copy .btn:hover { background: #F3F1F1; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: start;
  gap: 0 28px;
  margin: 6px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid rgba(255, 255, 255, .55);
  list-style: none;
}

.stats li {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stats strong {
  font: 600 26px/1 var(--display);
  letter-spacing: .02em;
  text-transform: uppercase;
}

.stats span {
  font-size: 13px;
  line-height: 1.25;
  opacity: .92;
}

/* ---------- Escenario 3D ---------- */
.stage {
  position: relative;
  min-width: 0;
  min-height: 560px;
  display: flex;
  flex-direction: column;
}

.canvas-host {
  position: relative;
  flex: 1;
  min-height: 500px;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
}

.canvas-host canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.fallback {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.fallback img {
  max-height: 100%;
  width: auto;
  object-fit: contain;
}

.stage.nogl .fallback { display: flex; }

/* Sin WebGL: controles invisibles pero conservan su espacio (sin salto de diseño al activarse el 3D). */
.stage.nogl .ctl { visibility: hidden; }
.stage.nogl .pin { display: none; }

.canvas-host.drag { cursor: grabbing; }

/* Pines numerados sobre el modelo (posición por transform desde JS). */
.pin {
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border: 2px solid var(--paper);
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  font: 700 13px/1 var(--body);
  cursor: pointer;
  padding: 0;
  display: none;
  transform: translate(-100px, -100px);
}

.pin[aria-pressed="true"] {
  background: var(--red-bg);
  color: #fff;
}

.pin.on { display: block; }
.pin.dim { opacity: .45; }

/* Tarjeta de lectura: única sombra permitida. */
.readout {
  position: absolute;
  left: 0;
  top: 18px;
  z-index: 1;
  max-width: min(340px, calc(100% - 16px));
  background: var(--paper);
  color: var(--ink);
  border-left: 6px solid var(--red);
  padding: 12px 16px 12px 14px;
  box-shadow: 0 8px 24px rgba(22, 9, 11, .14);
}

.readout b {
  display: block;
  font: 600 22px/1.05 var(--display);
  text-transform: uppercase;
  letter-spacing: .01em;
}

.readout small {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink-2);
}

/* Barra de controles */
.ctl {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 12px 16px;
  margin: 0 0 28px;
}

.ctl label {
  font: 600 13px/1 var(--body);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.range {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 220px;
  min-width: 0;
}

.range output {
  font: 600 15px/1 var(--body);
  min-width: 3.2em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  appearance: none;
  flex: 1;
  min-width: 0;
  height: 28px;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  background: var(--ink);
}

input[type="range"]::-moz-range-track {
  height: 4px;
  background: var(--ink);
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -9px;
  background: var(--red);
  border: 3px solid var(--paper);
  border-radius: 0;
  box-shadow: 0 0 0 1px var(--ink);
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--red);
  border: 3px solid var(--paper);
  border-radius: 0;
  box-shadow: 0 0 0 1px var(--ink);
}

.tgl {
  min-height: 40px;
  padding: 0 14px;
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  font: 600 14px/1 var(--body);
  cursor: pointer;
}

.tgl[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

.hint {
  width: 100%;
  margin: 0;
  font-size: 13px;
  color: var(--ink-2);
}

/* ---------- Normas y certificaciones ---------- */
.norms {
  background: var(--band);
  color: #fff;
  padding: 18px 0;
}

.norms .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 30px;
  align-items: center;
}

.norms h2 {
  margin: 0;
  font: 600 12px/1 var(--body);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent-on-ink);
}

.norms span {
  font: 500 22px/1 var(--display);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.norms hr {
  border: 0;
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, .3);
  margin: 0;
}

/* ---------- Equipo en partes ---------- */
.anat { background: var(--gray); }

.parts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.part {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  align-items: start;
  align-content: start;
  text-align: left;
  background: var(--paper);
  color: var(--ink);
  border: 0;
  border-radius: 0;
  padding: 18px 18px 20px;
  cursor: pointer;
  font: inherit;
}

.part:hover { background: var(--stage); }

.part[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

.part .n {
  grid-row: span 2;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: var(--red-bg);
  color: #fff;
  font: 700 15px/1 var(--body);
}

.part b {
  font: 600 22px/1.05 var(--display);
  text-transform: uppercase;
  letter-spacing: .01em;
}

.part .d {
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink-2);
}

/* Descripción sobre la pieza pulsada: deriva de --paper para mantener contraste en ambos temas. */
.part[aria-pressed="true"] .d {
  color: var(--paper);
  opacity: .85;
}

.part.cta {
  background: var(--red-bg);
  color: #fff;
  text-decoration: none;
}

.part.cta:hover { background: var(--red-hover); }
.part.cta .d { color: #fff; }

.part.cta .n {
  background: #fff;
  color: #B8001B;
}

/* ---------- Servicios / Nuestras líneas ---------- */
.tabs {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--ink);
}

.tab {
  background: transparent;
  border: 0;
  border-bottom: 6px solid transparent;
  border-radius: 0;
  color: var(--ink);
  padding: 16px 20px;
  font: 600 16px/1.1 var(--body);
  cursor: pointer;
  margin-bottom: -2px;
}

.tab[aria-selected="true"] {
  background: var(--ink);
  color: var(--paper);
  border-bottom-color: var(--red);
}

.tab:not([aria-selected="true"]):hover { background: var(--gray); }

.panel {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 48px;
  padding: 48px 0 0;
  align-items: start;
}

.panel h3 { font-size: clamp(40px, 5vw, 68px); }
.panel h3 b { color: var(--red-ink); }

.panel .sub {
  margin: 14px 0 0;
  font: 600 14px/1.3 var(--body);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.panel p.d {
  margin: 22px 0 0;
  max-width: 36em;
}

.items {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.items li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  align-items: start;
}

.items svg {
  margin-top: 4px;
  color: var(--red-ink);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}

.chip {
  display: inline-block;
  padding: 7px 12px;
  border: 1px solid var(--ink);
  font: 600 13px/1 var(--body);
  letter-spacing: .04em;
}

.cta-row { margin-top: 30px; }

.shots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  min-width: 0;
}

.shots figure {
  margin: 0;
  position: relative;
  min-width: 0;
  background: var(--gray);
}

.shots figure:first-child { grid-column: span 2; }

.shots img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4/3;
}

.shots figure:nth-child(n+2) img { aspect-ratio: 4/5; }

.shots figcaption {
  position: absolute;
  left: 0;
  bottom: 0;
  background: var(--band);
  color: #fff;
  font-size: 12px;
  line-height: 1.2;
  padding: 6px 10px;
}

.shots.one figure { grid-column: span 2; }
.shots.one img { aspect-ratio: 16/10; }

.todo {
  grid-column: span 2;
  border: 2px dashed var(--ink-2);
  padding: 20px;
  color: var(--ink-2);
  font-size: 15px;
}

.signs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  grid-column: span 2;
}

.sign {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 8px 14px;
  background: var(--gray);
  text-align: center;
  font: 500 14px/1.2 var(--body);
}

.sign svg {
  width: 84px;
  height: 84px;
}

/* ---------- Elevadores en alquiler ---------- */
.lift { background: var(--gray); }

.lift .wrap {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 40px 64px;
  align-items: center;
}

.lift .sec-head { margin-bottom: 0; }
.lift .sec-head > div { margin-top: 12px; }

.vids {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

/* Videos verticales (576×1024): espacio reservado para que el póster no provoque salto. */
.lift-vid {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  background: var(--band);
}

/* El foco cae en los controles nativos (sombra del navegador): se marca el video con el foco del sitio. */
.lift-vid:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

/* ---------- Sistema integrado ---------- */
.sys {
  background: var(--band);
  color: #fff;
  overflow: hidden;
}

.sys::before {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  width: 36%;
  height: 100%;
  background: var(--red);
  clip-path: polygon(46% 0, 100% 0, 100% 100%, 0 100%);
  opacity: .95;
}

.sys .wrap {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
}

.sys h2 { font-size: clamp(44px, 6vw, 80px); }
.sys h2 b { color: var(--accent-on-ink); }

.benefits {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 24px;
}

.benefits li {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  align-items: start;
  font-weight: 500;
}

.benefits svg { color: var(--accent-on-ink); }

.sys .markets { margin-top: 36px; }

.sys .markets .kicker {
  color: var(--accent-on-ink);
  display: block;
  margin-bottom: 12px;
}

.sys .chip { border-color: rgba(255, 255, 255, .6); }
.sys figure { margin: 0; }

.sys figure.prod {
  background: #fff;
  padding: 20px;
}

.sys figure img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: contain;
}

/* ---------- Proyectos en obra ---------- */
.gal {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}

.gal figure {
  margin: 0;
  position: relative;
  overflow: hidden;
  background: var(--gray);
  min-width: 0;
}

.gal img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gal figcaption {
  position: absolute;
  left: 0;
  bottom: 0;
  background: var(--band);
  color: #fff;
  font-size: 13px;
  line-height: 1.2;
  padding: 7px 12px;
}

.g1,
.g2 { height: clamp(240px, 31vw, 400px); }

.g1 { grid-column: span 7; }
.g2 { grid-column: span 5; }

.g3,
.g4,
.g5 {
  grid-column: span 4;
  aspect-ratio: 4/3;
}

.clients { margin-top: 64px; }

.clients h3 {
  font-size: clamp(30px, 3.4vw, 44px);
  margin-bottom: 22px;
}

.client-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.client-grid li {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 76px;
  padding: 14px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font: 600 22px/1 var(--display);
  letter-spacing: .07em;
  text-transform: uppercase;
  text-align: center;
}

/* Celdas con logo: fondo blanco fijo en ambos temas (los logos son para fondo claro). */
.client-grid li.logo {
  padding: 10px 12px;
  background: #FFFFFF;
}

.client-grid li.logo img {
  width: auto;
  height: auto;
  max-width: 80%;
  max-height: 56px;
  object-fit: contain;
}

/* ---------- Cotizar ---------- */
.quote { background: var(--gray); }

.quote .wrap {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 56px;
  align-items: start;
}

.quote h2 { font-size: clamp(48px, 6.4vw, 88px); }
.quote h2 b { color: var(--red-ink); }

.quote .lead {
  margin: 20px 0 0;
  color: var(--ink-2);
  max-width: 30em;
}

.quote .tel {
  display: block;
  margin-top: 28px;
  font: 600 40px/1 var(--display);
  letter-spacing: .02em;
  text-decoration: none;
}

.quote .tel small {
  display: block;
  font: 500 13px/1.3 var(--body);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 8px;
}

form.q {
  background: var(--paper);
  border-top: 6px solid var(--red);
  padding: 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.fld {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.fld.full { grid-column: 1/-1; }

.fld label {
  font: 600 13px/1 var(--body);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.fld input,
.fld select,
.fld textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--ink-2);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.4 var(--body);
}

.fld textarea {
  min-height: 110px;
  resize: vertical;
}

.fld .err {
  display: none;
  color: var(--red-ink);
  font-size: 14px;
  font-weight: 500;
}

.fld.bad input,
.fld.bad select {
  border-color: var(--red-ink);
  border-width: 2px;
}

.fld.bad .err { display: block; }

form.q .btn {
  grid-column: 1/-1;
  justify-self: start;
}

.done {
  grid-column: 1/-1;
  border: 2px solid var(--ink);
  padding: 20px;
  display: none;
  gap: 14px;
  flex-direction: column;
}

.done.show { display: flex; }
.done p { margin: 0; }

.done.fail { border-color: var(--red-ink); }

form.q .btn:disabled {
  cursor: progress;
  opacity: .7;
}

/* Campo trampa (honeypot): fuera de pantalla, sin foco ni lectura. */
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (max-width: 1040px) {
  .quote .wrap { grid-template-columns: 1fr; }
  .lift .wrap { grid-template-columns: 1fr; }
  .sys .wrap { grid-template-columns: 1fr; }

  .panel {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .signs { grid-column: auto; }
}

@media (max-width: 900px) {
  .hero::before { clip-path: polygon(0 0, 100% 0, 100% 62%, 0 100%); }

  .hero .wrap {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .hero-copy {
    padding: 44px 0 120px;
    max-width: none;
  }

  .stage {
    min-height: 0;
    margin-top: -72px;
  }

  .canvas-host {
    min-height: 420px;
    flex: none;
  }

  .g1,
  .g2 {
    grid-column: span 12;
    height: auto;
    aspect-ratio: 16/10;
  }

  .g3,
  .g4 { grid-column: span 6; }
  .g5 { grid-column: span 12; }
}

@media (max-width: 560px) {
  .stats {
    grid-template-columns: 1fr 1fr;
    gap: 16px 24px;
  }

  .stats li:last-child { grid-column: span 2; }

  .readout { top: 10px; }

  .tab {
    padding: 14px 12px;
    font-size: 15px;
  }

  .signs { grid-template-columns: 1fr 1fr; }
  .benefits { grid-template-columns: 1fr; }

  form.q {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .quote .tel { font-size: 32px; }
}

@media (max-width: 700px) {
  .vids {
    grid-template-columns: 1fr;
    max-width: 420px;
  }
}
