/* =====================================================================
   Blindaje / Introducción — CarArmoring
   Componentes compartidos (reset, nav, botones, section, capas-*,
   lightbox, footer) copiados verbatim de index.css — el spec de diseño
   trata un sistema de componentes compartido como una decisión futura,
   solo "si el piloto lo justifica" (ver docs/superpowers/specs). No se
   abstraen todavía en un archivo común.
   Todos los colores / tipos / espacios provienen de variables.css.
   (En @media no se puede usar var(); se repiten los px de los breakpoints
    ya definidos en los tokens: 768px, 1024px y 1180px.)
   ===================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--color-white);
  color: var(--color-black);
  font-family: var(--font-inter);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---- Layout helpers ---------------------------------------------------- */

.shell {
  width: 100%;
  max-width: var(--content-max-width);
  margin-inline: auto;
  padding-inline: var(--space-md);
}

/* Structural eyebrow: red tick + letter-spaced code label */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-inter);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--color-gray);
  margin: 0 0 var(--space-md);
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--color-accent-red);
  flex: none;
}

.eyebrow .code {
  color: var(--color-black);
}

/* Section code shown at the top-right of section headers, like a file ref */
.section-ref {
  font-family: var(--font-oswald);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.3em;
  color: var(--color-gray);
}

h1,
h2,
h3 {
  font-family: var(--font-oswald);
  font-weight: 600;
  text-transform: uppercase;
  margin: 0;
  line-height: 0.98;
  letter-spacing: 0.01em;
  color: var(--color-black);
}

/* Buttons --------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-oswald);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 14px var(--space-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease,
    border-color 0.18s ease, transform 0.18s ease;
}

.btn-primary {
  background: var(--color-accent-red);
  color: var(--color-white);
}

.btn-primary:hover {
  background: var(--color-accent-red-hover);
}

/* Ghost: borde oscuro sobre fondo claro (se invierte en el footer oscuro) */
.btn-ghost {
  background: transparent;
  color: var(--color-black);
  border-color: color-mix(in srgb, var(--color-black) 28%, transparent);
}

.btn-ghost:hover {
  border-color: var(--color-accent-red);
  color: var(--color-accent-red);
}

.btn:focus-visible,
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-accent-red-focus);
  outline-offset: 3px;
}

/* =====================================================================
   HEADER / NAV — barra blanca
   ===================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--color-white) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid color-mix(in srgb, var(--color-black) 10%, transparent);
}

.site-header .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  width: 100%;
}

.brand img {
  height: 40px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: var(--space-xs);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-family: var(--font-oswald);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--color-black) 68%, transparent);
  padding: 6px 2px;
  white-space: nowrap;
  position: relative;
  transition: color 0.16s ease;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--color-black);
}

.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--color-accent-red);
}

.lang-switch {
  display: flex;
  flex: none;
  font-family: var(--font-oswald);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.06em;
  border: 1px solid color-mix(in srgb, var(--color-black) 20%, transparent);
  overflow: hidden;
}

.lang-switch a,
.lang-switch span {
  padding: 7px 10px;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.lang-switch span {
  background: var(--color-white);
  color: var(--color-black);
}

.lang-switch a {
  background: var(--color-accent-red);
  color: var(--color-white);
}

.lang-switch a:hover {
  background: var(--color-accent-red-hover);
}

.nav-cta {
  flex: none;
}

.nav-toggle {
  display: none;
}

/* =====================================================================
   SECTION scaffolding
   ===================================================================== */

.section {
  padding-block: var(--space-xl);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-md);
  border-bottom: 1px solid color-mix(in srgb, var(--color-black) 12%, transparent);
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-lg);
}

.section-head h2 {
  font-size: clamp(30px, 4vw, 52px);
}

/* =====================================================================
   CAPAS DE BLINDAJE — secuencia fotográfica (patrón compartido)
   ===================================================================== */

.capas {
  position: relative;
  background: color-mix(in srgb, var(--color-black) 3%, var(--color-white));
  border-top: 3px solid var(--color-black);
  border-bottom: 3px solid var(--color-accent-red);
  box-shadow: inset 0 14px 26px -24px color-mix(in srgb, var(--color-black) 65%, transparent);
}

.capas::before {
  content: "";
  position: absolute;
  top: -3px;
  left: 0;
  width: var(--space-xl);
  height: 3px;
  background: var(--color-accent-red);
  z-index: 2;
}

.capas::after {
  content: "";
  position: absolute;
  bottom: -3px;
  right: 0;
  width: var(--space-xl);
  height: 3px;
  background: var(--color-black);
  z-index: 2;
}

.capas-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--space-lg);
  align-items: start;
}

.capas-viewer {
  position: relative;
  margin: 0;
  aspect-ratio: 3 / 2;
  background: var(--color-white);
  border: 1px solid color-mix(in srgb, var(--color-black) 14%, transparent);
  overflow: hidden;
}

.capas-viewer::before,
.capas-viewer::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid var(--color-accent-red);
  z-index: 3;
}

.capas-viewer::before {
  top: 12px;
  left: 12px;
  border-right: none;
  border-bottom: none;
}

.capas-viewer::after {
  bottom: 12px;
  right: 12px;
  border-left: none;
  border-top: none;
}

.capas-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: var(--space-lg);
  transition: opacity 0.2s ease;
}

.capas-count {
  position: absolute;
  top: 12px;
  right: 16px;
  font-family: var(--font-oswald);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.24em;
  color: var(--color-gray);
  z-index: 3;
}

.capas-caption {
  position: absolute;
  left: 16px;
  bottom: 12px;
  font-family: var(--font-oswald);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-black);
  background: color-mix(in srgb, var(--color-white) 80%, transparent);
  padding: 4px 10px;
  z-index: 3;
}

.capas-filmstrip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.capas-thumb {
  position: relative;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--color-black) 14%, transparent);
  background: var(--color-white);
  cursor: pointer;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.capas-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: var(--space-xs);
}

.capas-thumb-no {
  position: absolute;
  top: 4px;
  left: 4px;
  font-family: var(--font-oswald);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--color-gray);
}

.capas-thumb:hover {
  border-color: color-mix(in srgb, var(--color-accent-red) 55%, transparent);
}

.capas-thumb.is-active {
  border-color: var(--color-accent-red);
}

.capas-thumb.is-active .capas-thumb-no {
  color: var(--color-accent-red);
}

/* Lista de capas (controles) */
.layer-list {
  list-style: none;
  margin: 0 0 var(--space-md);
  padding: 0;
  border-top: 1px solid color-mix(in srgb, var(--color-black) 12%, transparent);
}

.layer-list li {
  border-bottom: 1px solid color-mix(in srgb, var(--color-black) 12%, transparent);
}

.layer-btn {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--color-black);
  text-align: left;
  padding: var(--space-sm);
  padding-inline: 0;
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  cursor: pointer;
  font-family: var(--font-inter);
  border-left: 2px solid transparent;
  transition: color 0.16s ease, padding-left 0.16s ease,
    border-color 0.16s ease, background-color 0.16s ease;
}

.layer-btn:hover,
.layer-btn:focus-visible {
  padding-left: var(--space-sm);
}

.layer-btn.is-active {
  padding-left: var(--space-sm);
  border-left-color: var(--color-accent-red);
  background: color-mix(in srgb, var(--color-accent-red) 6%, transparent);
}

.layer-btn .no {
  font-family: var(--font-oswald);
  font-weight: 700;
  font-size: 14px;
  color: var(--color-accent-red);
  flex: none;
  width: 22px;
}

.layer-btn .title {
  font-family: var(--font-oswald);
  font-weight: 500;
  font-size: 19px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.layer-btn .desc {
  display: block;
  font-size: 13px;
  color: var(--color-gray);
  margin-top: 2px;
  letter-spacing: 0.02em;
  text-transform: none;
}

.layer-btn:hover .title,
.layer-btn:focus-visible .title,
.layer-btn.is-active .title {
  color: var(--color-accent-red-hover);
}

.capas-aside .eyebrow {
  margin-bottom: var(--space-sm);
}

.capas-aside h2 {
  font-size: clamp(28px, 3.4vw, 40px);
  margin-bottom: var(--space-sm);
}

.capas-desc {
  color: color-mix(in srgb, var(--color-black) 66%, transparent);
  margin: 0 0 var(--space-md);
  max-width: 42ch;
}

/* Lightbox (dialog) */
.lightbox {
  border: none;
  padding: 0;
  background: transparent;
  max-width: min(960px, 92vw);
}

.lightbox::backdrop {
  background: color-mix(in srgb, var(--color-black) 82%, transparent);
  backdrop-filter: blur(4px);
}

.lightbox-inner {
  background: var(--color-white);
  border: 1px solid color-mix(in srgb, var(--color-black) 14%, transparent);
  padding: var(--space-md);
}

.lightbox-inner header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
}

.lightbox-inner h3 {
  font-size: 22px;
}

.lightbox-close {
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--color-black) 25%, transparent);
  color: var(--color-black);
  width: 40px;
  height: 40px;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

.lightbox-close:hover {
  border-color: var(--color-accent-red);
  color: var(--color-accent-red);
}

.lightbox-inner img {
  width: 100%;
  background: color-mix(in srgb, var(--color-black) 3%, var(--color-white));
}

/* =====================================================================
   FOOTER — sistema blanco/negro/rojo (no una caja negra aislada)
   ===================================================================== */

.site-footer {
  background: var(--color-black);
  color: var(--color-white);
  border-top: 2px solid var(--color-accent-red);
}

.site-footer h2,
.site-footer h3 {
  color: var(--color-white);
}

.site-footer .eyebrow .code {
  color: var(--color-white);
}

.contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  padding-block: var(--space-xl);
}

.contact-pitch h2 {
  font-size: clamp(32px, 4.4vw, 58px);
  margin-bottom: var(--space-md);
}

.contact-pitch p {
  color: color-mix(in srgb, var(--color-white) 70%, transparent);
  max-width: 40ch;
  margin: 0 0 var(--space-lg);
}

.contact-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.contact-meta .row {
  display: flex;
  flex-direction: column;
}

.contact-meta .label {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--color-white) 60%, transparent);
}

.contact-meta .val {
  font-family: var(--font-oswald);
  font-size: 18px;
  letter-spacing: 0.04em;
  color: var(--color-white);
}

.whatsapp-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--color-white);
  border-bottom: 1px solid var(--color-accent-red);
  padding-bottom: 2px;
}

.whatsapp-link:hover {
  color: var(--color-accent-red-focus);
}

.contact-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  align-self: start;
  background: var(--color-white);
  padding: var(--space-md);
  border-top: 3px solid var(--color-accent-red);
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

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

.field label {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-gray);
}

.field input,
.field textarea {
  background: color-mix(in srgb, var(--color-black) 3%, var(--color-white));
  border: 1px solid color-mix(in srgb, var(--color-black) 18%, transparent);
  color: var(--color-black);
  font-family: var(--font-inter);
  font-size: 15px;
  padding: 12px var(--space-sm);
  border-radius: 0;
}

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

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--color-accent-red);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--color-gray);
}

.form-status {
  margin: var(--space-sm) 0 0;
  font-family: var(--font-oswald);
  font-size: 13px;
  letter-spacing: 0.04em;
  min-height: 1em;
  color: var(--color-black);
}

.form-status.is-error {
  color: var(--color-accent-red-hover);
}

.footer-base {
  background: var(--color-white);
  color: var(--color-black);
  border-top: 2px solid var(--color-accent-red);
}

.footer-bottom {
  padding-block: var(--space-md);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.footer-bottom img {
  height: 26px;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-nav a {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--color-black) 60%, transparent);
}

.footer-nav a:hover {
  color: var(--color-black);
}

.footer-social {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.footer-social img {
  height: 20px;
  width: auto;
  opacity: 0.55;
  transition: opacity 0.16s ease;
}

.footer-social a:hover img,
.footer-social a:focus-visible img {
  opacity: 1;
}

.copyright a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.copyright a:hover {
  color: var(--color-black);
}

.copyright {
  width: 100%;
  border-top: 1px solid color-mix(in srgb, var(--color-black) 10%, transparent);
  padding-block: var(--space-md);
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--color-gray);
}

/* =====================================================================
   RESPONSIVE (compartido)
   ===================================================================== */

@media (max-width: 1180px) {
  .nav-links,
  .nav-cta {
    display: none;
  }
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 1px solid color-mix(in srgb, var(--color-black) 25%, transparent);
    color: var(--color-black);
    cursor: pointer;
  }
}

@media (max-width: 1024px) {
  .capas-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .site-header {
    height: var(--header-height-mobile);
  }
  .capas-filmstrip {
    grid-template-columns: repeat(4, 1fr);
  }
  .contact {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  .contact-form {
    grid-template-columns: 1fr;
  }
  .section-head {
    flex-direction: column;
    gap: var(--space-xs);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

/* =====================================================================
   PAGE HERO — compacto, no compite visualmente con el visor de capas
   ===================================================================== */

.page-hero {
  padding-block: var(--space-xl) var(--space-lg);
  background: var(--color-white);
}

.page-hero-title .accent {
  color: var(--color-accent-red);
}

.page-hero-title {
  font-size: clamp(36px, 6vw, 72px);
  max-width: 14ch;
  margin: var(--space-sm) 0 var(--space-md);
}

.page-hero-lede {
  max-width: 56ch;
  color: color-mix(in srgb, var(--color-black) 72%, transparent);
  font-size: 18px;
  margin: 0 0 var(--space-lg);
}

/* =====================================================================
   RECORRIDO DE 6 ETAPAS — mismo patrón de interacción que Portada,
   pero con fotos reales de taller (no renders aislados): el visor y las
   miniaturas pasan de object-fit:contain (producto flotante) a cover
   (fotografía documental a sangre).
   ===================================================================== */

.capas-deep .capas-photo {
  object-fit: cover;
  padding: 0;
}

.capas-deep .capas-thumb img {
  object-fit: cover;
  padding: 0;
}

.capas-filmstrip-6 {
  grid-template-columns: repeat(6, 1fr);
}

/* Overlays (contador, botón de autoplay, caption) necesitan fondo propio
   porque ahora flotan sobre fotografías reales de contenido variable,
   no sobre el blanco de un render aislado. */
.capas-deep .capas-count {
  top: var(--space-sm);
  right: var(--space-sm);
  /* 70% (no 55%) para garantizar >=4.5:1 del texto blanco incluso sobre
     el área más clara de las fotos reales (mismo ajuste que .cert-zoom-hint
     en Portada, Task 8). */
  background: color-mix(in srgb, var(--color-black) 70%, transparent);
  color: var(--color-white);
  padding: 3px 8px;
}

.capas-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: color-mix(in srgb, var(--color-black) 18%, transparent);
  z-index: 4;
}

.capas-progress-fill {
  width: 0;
  height: 100%;
  background: var(--color-accent-red);
}

.capas-viewer.is-autoplay-off .capas-progress {
  opacity: 0;
}

.capas-autoplay-toggle {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-oswald);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-white);
  background: color-mix(in srgb, var(--color-black) 70%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-white) 30%, transparent);
  padding: 5px 10px;
  cursor: pointer;
  transition: background-color 0.16s ease;
}

.capas-autoplay-toggle:hover {
  background: color-mix(in srgb, var(--color-black) 70%, transparent);
}

.capas-autoplay-toggle:focus-visible {
  outline: 2px solid var(--color-accent-red-focus);
  outline-offset: 2px;
}

.capas-autoplay-toggle .icon-pause {
  font-size: 10px;
  line-height: 1;
}

/* =====================================================================
   PROCESO DE INSTALACIÓN — 4 pasos numerados, mismo lenguaje visual
   que las tarjetas de value props de la Portada.
   ===================================================================== */

.process {
  background: var(--color-white);
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: color-mix(in srgb, var(--color-black) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-black) 10%, transparent);
}

.process-step {
  background: var(--color-white);
  padding: var(--space-lg) var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  transition: background-color 0.2s ease;
}

.process-step:hover {
  background: color-mix(in srgb, var(--color-black) 3%, var(--color-white));
}

.process-no {
  font-family: var(--font-oswald);
  font-weight: 700;
  font-size: 34px;
  color: color-mix(in srgb, var(--color-black) 16%, transparent);
  line-height: 1;
}

.process-step h3 {
  font-size: 20px;
  margin-top: var(--space-xs);
}

.process-step p {
  margin: 0;
  color: color-mix(in srgb, var(--color-black) 66%, transparent);
  font-size: 15px;
}

/* =====================================================================
   RESPONSIVE (específico de esta página)
   ===================================================================== */

@media (max-width: 1024px) {
  .capas-filmstrip-6 {
    grid-template-columns: repeat(3, 1fr);
  }
  .process-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .capas-filmstrip-6 {
    grid-template-columns: repeat(3, 1fr);
  }
  .process-grid {
    grid-template-columns: 1fr;
  }
}

/* proceso: esquinas rojas sobresalientes en el recuadro exterior (mismo marco que chalecos) */
.process-grid {
  position: relative;
}

.process-grid::before,
.process-grid::after {
  content: "";
  position: absolute;
  width: 28px;
  height: 28px;
  border: 3px solid var(--color-accent-red);
  pointer-events: none;
  z-index: 1;
}

.process-grid::before {
  top: -2px;
  left: -2px;
  border-right: none;
  border-bottom: none;
}

.process-grid::after {
  bottom: -2px;
  right: -2px;
  border-left: none;
  border-top: none;
}
