/* =====================================================================
   Tubos de Escape Espinoza — "taller de noche": asfalto, acero,
   arco de soldadura y amarillo de seguridad
   ===================================================================== */
:root {
  --bg: #131416;          /* asfalto del taller */
  --bg-2: #1C1E21;        /* panel */
  --bg-3: #26292D;        /* acero oscuro */
  --negro: #0B0C0D;
  --ink: #ECEAE5;         /* texto */
  --muted: #959BA4;       /* acero claro */
  --arco: #2E6BFF;        /* arco de soldadura */
  --arco-oscuro: #1F55E0;
  --chispa: #FFB020;      /* amarillo de seguridad */
  --blanco: #FFFFFF;
  --linea: rgba(236, 234, 229, .14);

  /* grano de hormigón, encima de los fondos oscuros */
  --grano: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  /* plancha diamantada */
  --diamante: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36'%3E%3Cg fill='%23ffffff' fill-opacity='.05'%3E%3Cpath d='M4 14 L14 4 L17 7 L7 17Z'/%3E%3Cpath d='M22 32 L32 22 L35 25 L25 35Z'/%3E%3Cpath d='M22 4 L32 14 L29 17 L19 7Z' fill-opacity='.035'/%3E%3Cpath d='M4 22 L14 32 L11 35 L1 25Z' fill-opacity='.035'/%3E%3C/g%3E%3C/svg%3E");

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --pad: clamp(16px, 2.6vw, 40px);
  --gap: clamp(96px, 11vw, 168px);
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: hidden; overflow-x: clip; }
body {
  margin: 0; background: var(--bg) var(--grano); color: var(--ink);
  font-family: var(--font); font-size: 17px; line-height: 1.55; overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--arco); outline-offset: 3px; }
::selection { background: var(--arco); color: var(--blanco); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--arco); color: var(--blanco); padding: 10px 16px; border-radius: 999px; }
.skip:focus { top: 16px; }

/* Cinta de seguridad amarilla y negra entre zonas del taller */
main > .cinta { margin-top: var(--gap); }
.cinta + .porque { margin-top: 0; }
.cinta { height: 12px; background: repeating-linear-gradient(-45deg, var(--chispa) 0 16px, var(--negro) 16px 32px); }

/* Textos chicos de navegación */
.label, .nav a, .mini, .pill, .plate-hint, .footer {
  font-size: 11px; font-weight: 600; letter-spacing: .15em; text-transform: uppercase;
}
.label { color: var(--muted); display: inline-flex; align-items: center; gap: 10px; }
.label::before { content: ""; width: 18px; height: 2px; background: var(--chispa); }
.label-light { color: var(--muted); }

.h2 {
  font-weight: 900; text-transform: uppercase; letter-spacing: -.04em; line-height: .9;
  font-size: clamp(2.6rem, 6.4vw, 6rem);
}
.lead { font-size: 18px; max-width: 46ch; color: #C9CCD1; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 26px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 200ms ease, color 200ms ease, border-color 200ms ease;
}
.btn:active { transform: scale(.97); }
.btn-arco { background: var(--arco); color: var(--blanco); }
.btn-line { border-color: rgba(236, 234, 229, .5); color: var(--ink); }
.btn-white { background: var(--blanco); color: var(--negro); }
@media (hover: hover) and (pointer: fine) {
  .btn-arco:hover { background: var(--arco-oscuro); }
  .btn-line:hover { background: var(--ink); border-color: var(--ink); color: var(--negro); }
  .btn-white:hover { background: var(--negro); color: var(--blanco); }
}

/* Logo */
.logo { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.logo-mark { width: 44px; height: 39px; flex: none; }
.logo-text { font-weight: 900; font-size: 19px; letter-spacing: -.02em; text-transform: uppercase; line-height: .95; display: flex; flex-direction: column; }
.logo-text small { font-size: 9px; font-weight: 600; letter-spacing: .2em; color: var(--muted); margin-top: 5px; }
.logo-light { color: var(--blanco); }

/* Píldora WhatsApp */
.pill {
  display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 18px;
  border-radius: 999px; border: 1px solid rgba(236, 234, 229, .55); background: rgba(11, 12, 13, .55);
  color: var(--ink); text-decoration: none;
  transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease, transform 160ms var(--ease-out);
}
.pill:active { transform: scale(.97); }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--arco); transition: background-color 200ms ease; }
@media (hover: hover) and (pointer: fine) {
  .pill:hover { background: var(--arco); border-color: var(--arco); color: var(--blanco); }
  .pill:hover .dot { background: var(--blanco); }
}

/* ============================== HERO ============================== */
.hero {
  position: relative; display: grid; grid-template-columns: minmax(0, 45fr) minmax(0, 55fr);   /* el auto queda a la derecha del panel */
  height: 100svh; min-height: 680px; max-height: 1100px;
}
/* La foto del BMW es el fondo de todo el hero; las columnas van encima, transparentes */
.hero { --foto-auto: url(../img/hero-auto.webp); background: #04060b; }
/* overflow oculto: el nombre gigante nunca ensancha la página (al girar el celular, el navegador se alejaba) */
.hero-left { position: relative; z-index: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
/* Panel translúcido: toda la columna izquierda, con el nombre en letras transparentes */
.glass {
  position: relative; z-index: 2; flex: 1 1 auto;
  display: flex; flex-direction: column; justify-content: flex-start;
  padding: 24px var(--pad) clamp(18px, 2.4vh, 28px);
  background: rgba(28, 30, 33, .42);
  -webkit-backdrop-filter: blur(18px) saturate(1.15); backdrop-filter: blur(18px) saturate(1.15);
  border-right: 1px solid rgba(236, 234, 229, .2);
}
.topbar { display: flex; align-items: center; gap: 32px; position: relative; z-index: 3; }
.nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.nav a { text-decoration: none; color: var(--ink); transition: color 200ms ease; }
.nav a:hover { color: var(--chispa); }
.menu-btn { display: none; }

.hero-title { position: relative; margin-top: clamp(48px, 18vh, 200px); }
.hero-name {
  display: block; white-space: nowrap; width: max-content;
  font-weight: 900; text-transform: uppercase; letter-spacing: -.045em; line-height: .78;
  font-size: 9vw; padding-bottom: .02em;
  /* letras transparentes: dejan ver la foto nítida a través del vidrio */
  color: transparent;
  background-image: var(--foto-auto); background-repeat: no-repeat;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-stroke: 1px rgba(255, 255, 255, .55);
}

.hero-media { grid-column: 1 / -1; grid-row: 1; }
.hero-left { grid-column: 1; grid-row: 1; }
.hero-right { grid-column: 2; grid-row: 1; }
.hero-body { grid-column: 1; grid-row: 1; align-self: end; position: relative; z-index: 3; padding: 0 var(--pad) 24px; }
.hero-text { margin-top: 14px; font-size: clamp(18px, 1.55vw, 22px); line-height: 1.35; font-weight: 500; max-width: 30ch; color: var(--ink); }
.hero-foot {
  margin-top: clamp(28px, 5vh, 56px);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  padding-top: 16px; border-top: 1px solid var(--linea);
}
.mini { line-height: 1.6; color: var(--muted); text-decoration: none; }
.mini strong, .mini a { color: var(--ink); font-weight: 700; text-decoration: none; }
a.mini:hover strong, .mini a:hover { color: var(--chispa); }

.hero-right { position: relative; z-index: 1; overflow: hidden; }
/* --foco-x / --foco-y: qué parte de la foto queda a la vista cuando no cabe entera (0 = izquierda/arriba) */
.hero-media { position: relative; overflow: hidden; min-height: 0; --foco-x: .45; --foco-y: .5; }
/* la escena tiene la proporción exacta de la foto y hero.js la ajusta para cubrir el hero */
.escena { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.escena picture, .hero-photo { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-photo { object-fit: cover; }
/* Motor en ralentí: vibración mínima y continua */
.is-running .escena { animation: ralenti 90ms steps(2, jump-none) infinite, respiracion 9s ease-in-out infinite alternate; }
@keyframes ralenti { 0% { translate: 0 0; } 100% { translate: .45px -.55px; } }
@keyframes respiracion { from { scale: 1; } to { scale: 1.025; } }
.heat {
  position: absolute; pointer-events: none; border-radius: 50%;
  background-repeat: no-repeat; filter: url(#calor);
  -webkit-mask-image: radial-gradient(closest-side, #000 35%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 35%, transparent 100%);
  opacity: 0; transition: opacity 1.2s ease;
}
.is-running .heat { opacity: 1; }
/* Focos traseros encendidos */
.luz {
  position: absolute; pointer-events: none; border-radius: 50%; mix-blend-mode: screen;
  background: radial-gradient(closest-side, rgba(255, 40, 40, .55), rgba(255, 30, 30, .18) 55%, rgba(255, 0, 0, 0));
  opacity: 0; transition: opacity 1.2s ease .3s;
}
.is-running .luz { opacity: 1; animation: foco 2.6s ease-in-out infinite alternate; }
@keyframes foco { from { opacity: .7; } to { opacity: 1; } }
/* LED de los focos: capa aparte del mismo tamaño que la foto, sumada con "screen" */
.hero-luces { mix-blend-mode: screen; opacity: 0; pointer-events: none; }
.is-running .hero-luces {
  opacity: 1;
  animation: led 2.6s ease-in-out infinite alternate;
}
@keyframes led { from { filter: brightness(1) saturate(1); } to { filter: brightness(1.45) saturate(1.2); } }
/* Taller a oscuras durante la entrada; las luces se encienden con parpadeo de tubo fluorescente */
html.js.intro .glass, html.intro .hero-body, html.intro .hero-right .pill, html.intro .hero-word, html.intro .hero-luces, html.intro .luz { opacity: 0; }
html.intro .hero-media picture { filter: brightness(.06); }
/* velo abajo para que "ESPINOZA" en blanco se lea */
.hero-media::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(4, 6, 11, .75) 0%, rgba(4, 6, 11, .15) 22%, rgba(4, 6, 11, 0) 40%); }
.smoke-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

.hero-right .pill { position: absolute; top: 24px; right: var(--pad); z-index: 4; }
.hero-word {
  position: absolute; z-index: 3; left: 0; right: 0; bottom: -.1em;
  text-align: center; white-space: nowrap;
  font-weight: 900; text-transform: uppercase; letter-spacing: -.05em; line-height: 1;
  font-size: 8vw; color: var(--blanco);
}
.hero-left, .hero-right { --mx: 0; --my: 0; }
[data-parallax] { translate: calc(var(--mx) * var(--p, 0) * 1px) calc(var(--my) * var(--p, 0) * 1px); transition: translate 600ms var(--ease-out); }

.menu-movil { display: none; }

/* Entrada del hero */
.js .glass { opacity: 0; }
.js.is-loaded .glass { opacity: 1; transition: opacity 1.2s ease .2s; }


/* ============================ SECCIONES ============================ */
.section { padding: var(--gap) var(--pad) 0; }
.section-head { display: grid; gap: 18px; margin-bottom: clamp(40px, 5vw, 72px); }
.section-head-row { grid-template-columns: 1fr auto; align-items: end; gap: 32px; }

/* Servicios */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 28px; counter-reset: none; }
.card {
  position: relative; padding: 28px 0 28px; border-bottom: 1px solid var(--linea);
  display: flex; flex-direction: column; gap: 10px;
  transition: transform 220ms var(--ease-out);
}
.card-n { font-weight: 900; font-size: clamp(48px, 5vw, 76px); line-height: .9; letter-spacing: -.04em; color: var(--muted); transition: color 200ms ease; }
.card h3 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin-top: 18px; }
.card p { color: var(--ink); font-size: 16px; max-width: 32ch; }
.cotizar { margin-top: auto; padding-top: 10px; display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; font-weight: 700; text-decoration: none; color: var(--ink); }
.cotizar:hover { color: var(--arco); }
@media (hover: hover) and (pointer: fine) {
  .card:hover { transform: translateY(-4px); }
  .card:hover .card-n { color: var(--arco); }
}

/* Marcas: dos franjas que corren en sentido contrario, separadas por colas de escape como las del logo */
.marcas { margin-top: var(--gap); padding: clamp(28px, 3.4vw, 48px) 0; background: var(--negro); border-block: 1px solid var(--linea); overflow: hidden; }
.marcas[hidden] { display: none; }
.marcas-cab { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 0 var(--pad); margin-bottom: clamp(18px, 2vw, 28px); }
.marcas-pausa { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--linea); background: none; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #C9CCD1; cursor: pointer; }
.marcas.is-pausa .marcas-pista { animation-play-state: paused; }
.marcas-fila { overflow: hidden; }
.marcas-pista { display: flex; width: max-content; animation: franja var(--dur, 60s) linear infinite; }
.marcas-hueca .marcas-pista { animation-direction: reverse; }
.marcas-pista ul { display: flex; flex: none; }
.marcas-pista li {
  display: flex; align-items: center; gap: .4em; padding-right: .4em; white-space: nowrap;
  font-weight: 900; text-transform: uppercase; letter-spacing: -.035em; line-height: 1.08;
  font-size: clamp(40px, 6.4vw, 96px);
}
.marcas-pista li::after {
  content: ""; flex: none; width: .3em; height: .4em; border-radius: 50%;
  background: radial-gradient(ellipse 26% 32% at 58% 50%, var(--arco) 90%, transparent 100%), #8F959B;
}
.marcas-hueca li { color: transparent; -webkit-text-stroke: 1.5px rgba(236, 234, 229, .42); }
.marcas-hueca li::after { opacity: .5; }
@keyframes franja { to { transform: translateX(-50%); } }

/* Escape 3D (sección existente, contenedor adaptado) */
.showcase { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(24px, 4vw, 64px); align-items: center; }
.showcase-plate { display: flex; flex-direction: column; gap: 12px; }
.escape3d { position: relative; aspect-ratio: 1; width: 100%; background: var(--bg-2); overflow: hidden; cursor: grab; border-radius: 4px; }
.escape3d canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; }
.escape3d-fallback img { width: 100%; height: 100%; object-fit: cover; }
.escape3d.is-3d .escape3d-fallback { display: none; }
.plate-hint { color: var(--muted); }
.showcase-side { display: flex; flex-direction: column; gap: 32px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs button {
  min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--linea);
  background: transparent; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease, transform 160ms var(--ease-out);
}
.tabs button:active { transform: scale(.97); }
.tabs button:hover { border-color: var(--ink); }
.tabs button[aria-selected="true"] { background: var(--arco); border-color: var(--arco); color: var(--blanco); }
.pieza-nombre { font-size: clamp(32px, 3.2vw, 48px); font-weight: 900; text-transform: uppercase; letter-spacing: -.04em; line-height: .95; }
.pieza-texto { margin-top: 18px; max-width: 42ch; }
.pieza-sintoma { margin-top: 14px; color: var(--muted); font-size: 15px; max-width: 42ch; }
.pieza > * { transition: opacity 200ms ease, transform 300ms var(--ease-out); }
.pieza.is-changing > * { opacity: 0; transform: translateY(6px); }
.cells { display: flex; flex-wrap: wrap; gap: 10px; }

/* Máquinas: carrusel */
.carousel-ctrl { display: flex; align-items: end; gap: 32px; }
.arrows { display: flex; gap: 8px; }
.arrow {
  width: 52px; height: 52px; border-radius: 50%; border: 1px solid rgba(236, 234, 229, .5); background: transparent;
  font-size: 20px; cursor: pointer; transition: background-color 200ms ease, color 200ms ease, transform 160ms var(--ease-out);
}
.arrow:active { transform: scale(.95); }
@media (hover: hover) and (pointer: fine) { .arrow:hover { background: var(--ink); color: var(--negro); } }
.carousel {
  display: grid; grid-auto-flow: column; grid-auto-columns: clamp(280px, 30vw, 440px); gap: 20px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 var(--pad);
  margin: 0 calc(var(--pad) * -1); padding: 0 var(--pad) 8px;
  scrollbar-width: none; overscroll-behavior-x: contain;
}
.carousel::-webkit-scrollbar { display: none; }
.maquina { scroll-snap-align: start; display: flex; flex-direction: column; gap: 16px; }
.maquina-img { aspect-ratio: 4 / 5; overflow: hidden; background: var(--bg-2); border-radius: 4px; }
.maquina-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 700ms var(--ease-out); }
.maquina.is-estudio .maquina-img img { object-fit: contain; }
@media (hover: hover) and (pointer: fine) { .maquina:hover .maquina-img img { transform: scale(1.05) rotate(-1deg); } }
.maquina h3 { font-size: clamp(22px, 2vw, 30px); font-weight: 900; letter-spacing: -.03em; line-height: 1; text-transform: uppercase; }
.maquina p { color: var(--muted); font-size: 15px; max-width: 36ch; }

/* Trabajos: carrusel como el de máquinas; todas las fotos con el mismo tamaño (4:5, recortadas al centro) */
.trabajo-item { scroll-snap-align: start; }
.trabajo { width: 100%; display: flex; flex-direction: column; text-align: left; border: 0; padding: 0; background: none; cursor: pointer; }
.trabajo-media { position: relative; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 4px; background: var(--bg-2); }
.trabajo-media > img, .trabajo-media .ad, .trabajo-media .ad img { width: 100%; height: 100%; object-fit: cover; }
.trabajo-media img { transition: transform 600ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .trabajo:hover .trabajo-media > img { transform: scale(1.03); } }
.trabajo-info { display: flex; justify-content: space-between; gap: 12px; padding-top: 14px; font-size: 15px; }
.trabajo-info strong { font-weight: 800; }
.trabajo-info span { color: var(--muted); }
.trabajo.is-pendiente { cursor: default; }
.pendiente { display: grid; place-items: center; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; }
.pendiente::after { content: ""; position: absolute; width: 38%; aspect-ratio: 1; border-radius: 50%; border: 1px solid var(--linea); }

/* Antes / después */
.ad { position: relative; overflow: hidden; touch-action: pan-y; cursor: ew-resize; user-select: none; }
.ad img { width: 100%; }
.ad .ad-despues { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--corte, 50%)); }
.ad .ad-despues img { height: 100%; object-fit: cover; }
.ad-linea { position: absolute; top: 0; bottom: 0; left: var(--corte, 50%); width: 2px; background: var(--blanco); translate: -1px 0; }
.ad-linea::after { content: "↔"; position: absolute; top: 50%; left: 50%; translate: -50% -50%; width: 40px; height: 40px; border-radius: 50%; background: var(--blanco); display: grid; place-items: center; font-size: 16px; color: var(--ink); }
.ad-tag { position: absolute; top: 10px; padding: 4px 10px; border-radius: 999px; background: rgba(11, 12, 13, .75); color: var(--blanco); font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.ad-tag.antes { left: 10px; } .ad-tag.despues { right: 10px; }

/* Lightbox */
.lightbox { border: 0; padding: 0; background: transparent; max-width: min(1100px, 92vw); width: 100%; }
.lightbox::backdrop { background: rgba(11, 12, 13, .9); }
.lightbox[open] { animation: aparecer 220ms var(--ease-out); }
@keyframes aparecer { from { opacity: 0; transform: scale(.97); } }
.lightbox-body img { width: 100%; max-height: 82vh; object-fit: contain; }
.lightbox-body p { color: var(--blanco); margin-top: 12px; }
.lightbox-close { position: fixed; top: 16px; right: 16px; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--blanco); font-size: 28px; line-height: 1; cursor: pointer; }

/* Por qué nosotros */
.porque { background: var(--bg-2) var(--diamante); color: var(--ink); margin-top: var(--gap); padding-bottom: var(--gap); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; border-top: 1px solid rgba(255,255,255,.15); }
.stat { padding-top: 28px; }
.stat-n { font-weight: 900; font-size: clamp(64px, 10vw, 168px); line-height: .85; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.stat-t { margin-top: 18px; color: #C9CCCF; max-width: 26ch; }
.perks { margin-top: clamp(56px, 7vw, 96px); display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.perks li { padding-top: 20px; border-top: 1px solid rgba(255,255,255,.15); color: #C9CCCF; }
.perks strong { display: block; color: var(--blanco); font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 6px; }

/* Proceso */
.steps-wrap { position: relative; }
.steps-line { position: absolute; left: 0; right: 0; top: 9px; height: 2px; background: var(--linea); }
.steps-fill { position: absolute; inset: 0; background: var(--arco); transform-origin: left; transform: scaleX(var(--progreso, 0)); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; position: relative; }
.step-dot { display: block; width: 20px; height: 20px; border-radius: 50%; background: var(--bg); border: 2px solid var(--muted); transition: background-color 300ms ease, border-color 300ms ease; }
.step.is-lit .step-dot { background: var(--arco); border-color: var(--arco); }
.step h3 { margin-top: 28px; font-size: clamp(22px, 2vw, 28px); font-weight: 900; letter-spacing: -.03em; line-height: 1.05; text-transform: uppercase; }
.step p { margin-top: 10px; color: var(--ink); max-width: 28ch; }

/* Ubicación */
.ubicacion { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 80px); align-items: center; }
.ubi-info { display: flex; flex-direction: column; gap: 22px; align-items: flex-start; }
.estado { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; padding: 8px 16px; border-radius: 999px; background: var(--bg-2); }
.estado-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.estado.is-open .estado-dot { background: #1FA35A; box-shadow: 0 0 0 4px rgba(31, 163, 90, .2); animation: latido 2s ease-in-out infinite; }
@keyframes latido { 50% { box-shadow: 0 0 0 7px rgba(31, 163, 90, .05); } }
.hours { width: 100%; max-width: 480px; border-collapse: collapse; }
.hours th { text-align: left; font-weight: 500; padding: 14px 16px 14px 0; border-bottom: 1px solid var(--linea); }
.hours td { text-align: right; padding: 14px 0; border-bottom: 1px solid var(--linea); font-variant-numeric: tabular-nums; }
.hours tr.is-today th, .hours tr.is-today td { font-weight: 800; color: var(--arco); }
.ubi-dir { color: var(--muted); }
.ubi-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.ubi-map { aspect-ratio: 1; overflow: hidden; border-radius: 4px; background: var(--bg-2); }
.ubi-map { position: relative; }
.mapa-aviso { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 18px; padding: 24px; text-align: center; background: var(--bg-2) var(--diamante); }
.mapa-nota { max-width: 30ch; color: var(--muted); font-size: 14px; }
.mapa-nota a, .cotizador-nota a { color: var(--ink); text-underline-offset: 3px; }
.ubi-map iframe { width: 100%; height: 100%; border: 0; display: block; filter: grayscale(.85) invert(.92) hue-rotate(180deg) contrast(.95); }

/* CTA */
/* Cotiza tu servicio: título a la izquierda, formulario a la derecha */
.cta {
  margin-top: var(--gap); background: var(--arco); color: var(--blanco); padding: clamp(72px, 9vw, 128px) var(--pad);
  display: grid; grid-template-columns: 1fr minmax(0, 560px); gap: clamp(40px, 6vw, 96px); align-items: start;
  scroll-margin-top: 0;
}
.cta-intro { display: flex; flex-direction: column; gap: 24px; }
.cta-title { font-weight: 900; text-transform: uppercase; letter-spacing: -.05em; line-height: .85; font-size: clamp(3.2rem, 7.4vw, 8.4rem); }
.cta p { font-size: 20px; font-weight: 500; max-width: 34ch; }
.cta .cta-directo { font-size: 16px; }
.cta-directo a { color: var(--blanco); font-weight: 700; text-underline-offset: 4px; white-space: nowrap; }
.cotizador {
  display: grid; grid-template-columns: 1.2fr 1.2fr .8fr; gap: 16px 14px;
  background: var(--bg); color: var(--ink); padding: clamp(20px, 2.6vw, 32px); border-radius: 20px;
}
.campo { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.campo-ancho { grid-column: 1 / -1; }
.campo span { font-size: 13px; font-weight: 700; }
.campo em { font-style: normal; font-weight: 500; color: var(--muted); }
.campo input, .campo select, .campo textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--linea); background: var(--bg-2); color: var(--ink);
  font: inherit; font-size: 16px;    /* 16px: el iPhone no hace zoom al escribir */
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
.campo textarea { resize: vertical; min-height: 96px; }
.campo select { appearance: none; cursor: pointer; padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.campo select:invalid { color: var(--muted); }
.campo ::placeholder { color: var(--muted); opacity: 1; }
.campo input:focus, .campo select:focus, .campo textarea:focus { outline: none; border-color: var(--arco); box-shadow: 0 0 0 3px rgba(46, 107, 255, .35); }
.campo [aria-invalid="true"] { border-color: var(--chispa); }
.cta .cotizador-error { grid-column: 1 / -1; color: var(--chispa); font-weight: 700; font-size: 15px; max-width: none; }
.cotizador .btn { margin-top: 4px; }
.cta .cotizador-nota { font-size: 13px; font-weight: 500; color: var(--muted); text-align: center; max-width: none; }
@media (max-width: 899px) {
  .cta { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .cotizador { grid-template-columns: 1fr 1fr; }
  .cotizador .campo:nth-of-type(4) { grid-column: 1 / -1; }   /* año */
}

/* Footer */
.footer { background: var(--negro); color: #C9CCCF; padding: 56px var(--pad) 28px; line-height: 1.9; }
.footer a { color: var(--blanco); text-decoration: none; }
.footer a:hover { color: var(--arco); }
.footer-cols { margin-top: 40px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.footer-legal { margin-top: 40px; max-width: 70ch; text-transform: none; letter-spacing: 0; font-size: 13px; line-height: 1.6; color: #8E9399; }
.footer-last { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 24px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.12); color: #8E9399; }

/* WhatsApp flotante */
.wa-float {
  position: fixed; right: 20px; bottom: 20px; z-index: 50;
  width: 60px; height: 60px; border-radius: 50%; background: var(--arco); color: var(--blanco);
  display: grid; place-items: center;
  /* aro blanco fino: se distingue también sobre la franja azul de "Cotiza tu servicio" */
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .85), 0 10px 30px rgba(11, 12, 13, .45);
  transition: transform 160ms var(--ease-out), background-color 200ms ease;
}
.wa-float svg { width: 30px; height: 30px; }
.wa-float:active { transform: scale(.94); }
@media (hover: hover) and (pointer: fine) { .wa-float:hover { background: var(--arco-oscuro); transform: translateY(-2px); } }

/* Reveal al hacer scroll */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 700ms var(--ease-out), transform 800ms var(--ease-out); transition-delay: var(--d, 0ms); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ============================ RESPONSIVE ============================ */
@media (max-width: 1100px) {
  .cards { grid-template-columns: repeat(3, 1fr); }
  .nav { gap: 6px 16px; }
}

@media (max-width: 899px) {
  .hero { grid-template-columns: minmax(0, 1fr); height: auto; max-height: none; min-height: 0; }
  .hero-left { min-height: 0; }
  /* celular: nombre arriba, el auto encendido dentro del primer pantallazo, y el texto debajo */
  .hero-left, .hero-right, .hero-body, .hero-media { grid-column: 1; }
  .hero-left { grid-row: 1; } .hero-media, .hero-right { grid-row: 2; } .hero-body { grid-row: 3; }
  .glass { flex: none; min-height: 30svh; gap: 28px; border-right: 0; }
  .hero-title { margin-top: 0; }
  .hero-body { padding-top: 36px; background: var(--bg); border-bottom: 1px solid var(--linea); }
  .hero-right .pill { display: none; }
  .topbar { justify-content: space-between; }
  .nav { display: none; }
  .menu-btn {
    display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
    border: 1px solid var(--ink); background: transparent; cursor: pointer; margin-left: auto;
  }
  .menu-lines, .menu-lines::before, .menu-lines::after { display: block; width: 18px; height: 2px; background: var(--ink); position: relative; transition: transform 200ms var(--ease-out), background-color 200ms ease; }
  .menu-lines::before, .menu-lines::after { content: ""; position: absolute; left: 0; }
  .menu-lines::before { top: -6px; } .menu-lines::after { top: 6px; }
  .menu-btn[aria-expanded="true"] .menu-lines { background: transparent; }
  .menu-btn[aria-expanded="true"] .menu-lines::before { transform: translateY(6px) rotate(45deg); }
  .menu-btn[aria-expanded="true"] .menu-lines::after { transform: translateY(-6px) rotate(-45deg); }
  .menu-movil:not([hidden]) {
    display: flex; flex-direction: column; gap: 6px; position: absolute; z-index: 20; top: 84px; left: var(--pad); right: var(--pad);
    background: var(--bg-3); color: var(--ink); padding: 20px; border-radius: 16px;
    animation: aparecer 200ms var(--ease-out); transform-origin: top right;
  }
  .menu-movil a { text-decoration: none; font-size: 28px; font-weight: 900; text-transform: uppercase; letter-spacing: -.03em; padding: 6px 0; }
  .menu-movil .pill { font-size: 11px; margin-top: 12px; align-self: flex-start; background: var(--arco); border-color: var(--arco); color: var(--blanco); }
  .menu-movil .pill .dot { background: var(--blanco); }

  .hero-foot { grid-template-columns: 1fr 1fr; }
  .hero-foot .mini:last-child { grid-column: 1 / -1; }
  .hero-right { height: 66svh; min-height: 440px; }   /* las colas quedan sobre la palabra ESPINOZA */
  .hero-media { --foco-x: .5; --foco-y: .5; }   /* foto vertical: auto al centro, con los dos pares de colas */

  .section-head-row { grid-template-columns: 1fr; }
  .carousel-ctrl { flex-direction: column; align-items: flex-start; gap: 20px; }
  .arrows { display: none; }
  .carousel { grid-auto-columns: 78vw; }

  .cards { grid-template-columns: 1fr 1fr; }
  .showcase { grid-template-columns: 1fr; }
  .stats, .perks { grid-template-columns: 1fr; }
  .stats { gap: 8px; }
  .steps { grid-template-columns: 1fr; gap: 36px; padding-left: 40px; }
  .steps-line { top: 0; bottom: 0; left: 9px; right: auto; width: 2px; height: auto; }
  .steps-fill { transform-origin: top; transform: scaleY(var(--progreso, 0)); }
  .step-dot { position: absolute; left: -40px; }
  .step h3 { margin-top: 0; }
  .ubicacion { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .cards { grid-template-columns: 1fr; }
  .hero-text { font-size: 18px; }
  .wa-float { width: 56px; height: 56px; right: 16px; bottom: 16px; }
  .footer-cols { grid-template-columns: 1fr; }
  .footer { font-size: 13px; padding-bottom: 96px; }   /* el botón flotante de WhatsApp no tapa el cierre */
  .footer-cols a { display: inline-block; padding: 8px 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .js .glass { opacity: 1; }
  .is-running .luz, .is-running .escena, .is-running .hero-luces, .estado.is-open .estado-dot { animation: none; }
  [data-parallax] { translate: none; }
  .card, .maquina-img img, .trabajo-media img { transition: none; }
  /* sin movimiento: las marcas quedan quietas y en varias líneas */
  .marcas-pista { animation: none; width: auto; padding: 0 var(--pad); }
  .marcas-pista ul { flex-wrap: wrap; }
  .marcas-pista ul + ul, .marcas-hueca, .marcas-pausa { display: none; }
}

/* Aviso del panel (vacaciones, cambio de horario...) */
.aviso { max-width: 480px; padding: 12px 16px; border-left: 3px solid var(--chispa); background: var(--bg-2); font-weight: 600; }

/* Páginas legales (privacidad y términos) */
.legal { max-width: 760px; margin: 0 auto; padding: clamp(32px, 6vw, 80px) var(--pad) 64px; }
.legal-volver { display: flex; width: fit-content; align-items: center; min-height: 44px; margin-bottom: 28px; font-weight: 700; text-decoration: none; }
.legal-volver:hover { color: var(--arco); }
.legal .h2 { margin-top: 14px; font-size: clamp(2.4rem, 7vw, 4.4rem); }
.legal-fecha { margin-top: 18px; color: var(--muted); font-size: 15px; }
.legal h2:not(.h2) { margin-top: 44px; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.legal p, .legal ul { margin-top: 14px; max-width: 68ch; }
.legal ul { list-style: disc; padding-left: 22px; }
.legal li + li { margin-top: 8px; }
.legal a:not(.legal-volver) { text-underline-offset: 3px; }
.legal-pie { padding: 28px var(--pad) 40px; border-top: 1px solid var(--linea); color: var(--muted); font-size: 14px; text-align: center; }

/* Página 404 */
.no-encontrada { min-height: calc(100svh - 12px); display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 22px; padding: 32px var(--pad) 56px; }
.no-encontrada .logo { position: absolute; top: 24px; left: var(--pad); }
.no-encontrada-n {
  display: flex; align-items: center; font-weight: 900; line-height: .8; letter-spacing: -.06em;
  font-size: clamp(140px, 30vw, 380px); color: var(--ink);
}
.cola {
  width: .52em; height: .7em; margin: 0 .04em; border-radius: 50%;
  background: radial-gradient(ellipse 26% 32% at 58% 50%, var(--arco) 90%, transparent 100%), #8F959B;
}
.no-encontrada .lead { color: var(--ink); }
