/* ==========================================================
   Rejilla Industrial · Hoja de estilos
   Paleta: negro, grises, blanco y azul de énfasis
   ========================================================== */

:root {
  --black: #000000;
  --steel: #1E2226;
  --gray-700: #3D434A;
  --gray-500: #6A7178;
  --gray-200: #DDE0E4;
  --gray-100: #EEF0F2;
  --white: #FFFFFF;
  --blue: #0B57D0;
  --blue-dark: #0842A0;
  --blue-light: #5E97FF;

  --text: #22262B;
  --text-muted: #555C63;

  --font: "Archivo", "Helvetica Neue", Arial, system-ui, sans-serif;
  --wrap: 72rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --header-h: 4.25rem;
  --radius: 4px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + 1rem);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

img, svg { max-width: 100%; height: auto; display: block; }

h1, h2, h3 {
  font-stretch: 75%;
  line-height: 1.05;
  margin: 0 0 0.6em;
  letter-spacing: -0.005em;
}
h2 { font-size: clamp(2rem, 4.2vw, 3.1rem); font-weight: 750; }
h3 { font-size: 1.35rem; font-weight: 700; line-height: 1.15; }
p { margin: 0 0 1em; }

a { color: var(--blue); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--blue-dark); text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--blue-light);
  outline-offset: 3px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem; top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--blue);
  color: var(--white);
  font-weight: 600;
}
.skip-link:focus { top: calc(1rem + env(safe-area-inset-top, 0px)); color: var(--white); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--blue);
  border-radius: var(--radius);
  background: var(--blue);
  color: var(--white);
  font-weight: 650;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  text-align: center;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.btn:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: var(--white); text-decoration: none; }

.btn-ghost { background: transparent; border-color: rgba(255, 255, 255, 0.7); }
.btn-ghost:hover { background: var(--white); border-color: var(--white); color: var(--black); }

.btn-small { min-height: 2.5rem; padding: 0.5rem 1.1rem; font-size: 0.95rem; }
.btn-large { min-height: 3.5rem; padding: 1rem 2rem; font-size: 1.1rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--black);
  color: var(--white);
  padding-top: env(safe-area-inset-top, 0px);
  border-bottom: 1px solid var(--gray-700);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--white);
  text-decoration: none;
}
.brand:hover { color: var(--white); text-decoration: none; }
.brand-mark { width: 2rem; height: 2rem; color: var(--white); }
.brand-rods { fill: var(--blue-light); }
.brand-name {
  font-stretch: 75%;
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: 0.01em;
}

.menu-toggle {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
}
.menu-button { display: none; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}
.site-nav ul {
  display: flex;
  gap: 1.5rem;
  margin: 0; padding: 0;
  list-style: none;
}
.site-nav ul a {
  color: var(--gray-200);
  text-decoration: none;
  font-size: 0.98rem;
  font-weight: 500;
  padding-block: 0.4rem;
  border-bottom: 2px solid transparent;
}
.site-nav ul a:hover { color: var(--white); border-bottom-color: var(--blue-light); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: min(88vh, 52rem);
  min-height: min(88svh, 52rem);
  padding-block: clamp(4rem, 10vw, 7rem);
  color: var(--white);
  background-color: var(--black);
  background-image:
    linear-gradient(90deg, rgba(0, 0, 0, 0.94) 0%, rgba(0, 0, 0, 0.78) 45%, rgba(0, 0, 0, 0.2) 100%),
    url("../img/rejilla-hero.svg");
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
}

/* Franja inferior que evoca las soleras de una rejilla */
.hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 10px;
  background: repeating-linear-gradient(90deg, var(--blue) 0 6px, transparent 6px 22px);
}

.hero-inner { position: relative; }

.hero h1 {
  max-width: 15ch;
  margin-bottom: 0.45em;
  padding-left: clamp(1rem, 2.5vw, 1.75rem);
  border-left: clamp(6px, 1vw, 12px) solid var(--blue);
  font-size: clamp(2.7rem, 7vw, 5.75rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.01em;
}

.hero-sub {
  max-width: 36rem;
  margin-bottom: 2rem;
  padding-left: calc(clamp(1rem, 2.5vw, 1.75rem) + clamp(6px, 1vw, 12px));
  font-size: clamp(1.1rem, 1.8vw, 1.3rem);
  line-height: 1.55;
  color: var(--gray-200);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  padding-left: calc(clamp(1rem, 2.5vw, 1.75rem) + clamp(6px, 1vw, 12px));
}

/* ---------- Secciones ---------- */
.section { padding-block: clamp(4rem, 9vw, 7rem); }
.section-white { background: var(--white); }
.section-gray { background: var(--gray-100); }
.section-black { background: var(--black); color: var(--gray-200); }
.section-black h2,
.section-black h3 { color: var(--white); }

.section-head { max-width: 42rem; margin-bottom: clamp(2rem, 5vw, 3.25rem); }
.section-head p { color: var(--text-muted); font-size: 1.12rem; }
.section-black .section-head p { color: #B9BFC6; }

.prose { max-width: 42rem; }
.prose-wide { max-width: 50rem; }
.prose p { color: var(--text); }

.split {
  display: grid;
  gap: clamp(2rem, 5vw, 4.5rem);
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  align-items: start;
}

/* Resumen lateral */
.summary {
  padding: 1.75rem;
  background: var(--gray-100);
  border-top: 4px solid var(--blue);
}
.summary h3 { font-size: 1.3rem; }
.summary ul { margin: 0; padding-left: 1.1rem; }
.summary li { margin-bottom: 0.55rem; }
.summary li::marker { color: var(--blue); }

/* Tipos */
.types {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--gray-200);
}
.type {
  padding: 1.6rem 2rem 1.6rem 0;
  border-bottom: 1px solid var(--gray-200);
}
.type:nth-child(even) { padding: 1.6rem 0 1.6rem 2rem; border-left: 1px solid var(--gray-200); }
.type dt {
  font-stretch: 75%;
  font-weight: 700;
  font-size: 1.4rem;
  line-height: 1.15;
  margin-bottom: 0.4rem;
  color: var(--black);
}
.type dd { margin: 0; color: var(--text-muted); }

.section-link { margin: 2rem 0 0; font-weight: 600; font-size: 1.08rem; }

/* Aplicaciones */
.uses {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.5rem 2.25rem;
}
.use { padding-top: 1.1rem; border-top: 3px solid var(--black); }
.use p { color: var(--text-muted); margin: 0; }

.industries {
  max-width: 50rem;
  margin: clamp(2.5rem, 5vw, 3.5rem) 0 0;
  padding-top: 2rem;
  border-top: 1px solid var(--gray-200);
  font-size: 1.1rem;
}

/* Beneficios */
.benefits {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0; padding: 0;
  list-style: none;
  border-top: 1px solid var(--gray-700);
}
.benefits li {
  padding: 2rem 2rem 2rem 0;
  border-bottom: 1px solid var(--gray-700);
}
.benefits li:not(:nth-child(3n + 1)) { padding-left: 2rem; border-left: 1px solid var(--gray-700); }
.benefits h3 { color: var(--white); }
.benefits h3::before {
  content: "";
  display: block;
  width: 2.25rem;
  height: 4px;
  margin-bottom: 1rem;
  background: var(--blue-light);
}
.benefits p { margin: 0; }

/* Pasos para elegir (secuencia real) */
.steps {
  margin: 0; padding: 0;
  list-style: none;
  counter-reset: paso;
}
.steps li {
  position: relative;
  counter-increment: paso;
  padding: 0 0 1.75rem 4rem;
  border-left: 2px solid var(--gray-200);
  margin-left: 1.25rem;
}
.steps li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps li::before {
  content: counter(paso);
  position: absolute;
  left: -1.3rem; top: -0.15rem;
  display: grid;
  place-items: center;
  width: 2.5rem; height: 2.5rem;
  background: var(--blue);
  color: var(--white);
  font-weight: 700;
  font-stretch: 75%;
  font-size: 1.2rem;
  border-radius: 50%;
}
.steps h3 { margin-bottom: 0.3rem; padding-top: 0.2rem; }
.steps p { margin: 0; color: var(--text-muted); }

/* ---------- Preguntas frecuentes ---------- */
.faq-wrap { max-width: 56rem; }
.faq { border-top: 2px solid var(--black); }
.faq details { border-bottom: 1px solid var(--gray-200); background: var(--white); }
.faq summary {
  position: relative;
  display: block;
  cursor: pointer;
  list-style: none;
  padding: 1.35rem 3.5rem 1.35rem 1.5rem;
  font-weight: 650;
  font-size: 1.12rem;
  line-height: 1.4;
  color: var(--black);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  position: absolute;
  right: 1.5rem; top: 50%;
  width: 14px; height: 14px;
  margin-top: -7px;
  background:
    linear-gradient(var(--blue), var(--blue)) center / 14px 2px no-repeat,
    linear-gradient(var(--blue), var(--blue)) center / 2px 14px no-repeat;
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { color: var(--blue); }
.faq details p {
  margin: 0;
  padding: 0 1.5rem 1.5rem;
  max-width: 46rem;
  color: var(--text-muted);
}

/* ---------- Llamada a la acción ---------- */
.cta {
  background: var(--steel);
  color: var(--gray-200);
  padding-block: clamp(3.5rem, 8vw, 5.5rem);
  border-top: 6px solid var(--blue);
}
.cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem 3rem;
}
.cta h2 { color: var(--white); max-width: 18ch; }
.cta p { max-width: 36rem; margin: 0; font-size: 1.12rem; }
.cta .btn { flex-shrink: 0; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--black);
  color: #A9AFB6;
  padding-top: 3.5rem;
  font-size: 0.97rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
}
.footer-brand {
  font-stretch: 75%;
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--white);
  margin-bottom: 0.5rem;
}
.footer-about p:last-child { max-width: 30rem; }
.footer-title { color: var(--white); font-weight: 650; margin-bottom: 0.75rem; }
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer li { margin-bottom: 0.5rem; }
.site-footer a { color: #C9CED4; text-decoration: none; }
.site-footer a:hover { color: var(--blue-light); text-decoration: underline; }
.footer-bottom {
  padding-block: 1.5rem;
  border-top: 1px solid var(--gray-700);
  font-size: 0.88rem;
}
.footer-bottom p { margin: 0; }

/* ==========================================================
   Responsivo
   ========================================================== */
@media (max-width: 960px) {
  .uses { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .benefits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .benefits li,
  .benefits li:not(:nth-child(3n + 1)) { padding: 2rem 1.5rem 2rem 0; border-left: 0; }
  .benefits li:nth-child(even) { padding-left: 1.5rem; border-left: 1px solid var(--gray-700); }
  .cta-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 860px) {
  /* Menú móvil (funciona sin JavaScript) */
  .menu-button {
    display: grid;
    place-items: center;
    width: 2.75rem; height: 2.75rem;
    margin-right: -0.5rem;
    cursor: pointer;
  }
  .menu-icon,
  .menu-icon::before,
  .menu-icon::after {
    display: block;
    width: 1.5rem; height: 2px;
    background: var(--white);
    transition: transform 0.2s ease, background-color 0.2s ease;
  }
  .menu-icon { position: relative; }
  .menu-icon::before,
  .menu-icon::after { content: ""; position: absolute; left: 0; }
  .menu-icon::before { top: -7px; }
  .menu-icon::after { top: 7px; }

  .menu-toggle:focus-visible + .menu-button { outline: 3px solid var(--blue-light); outline-offset: 2px; }
  .menu-toggle:checked + .menu-button .menu-icon { background: transparent; }
  .menu-toggle:checked + .menu-button .menu-icon::before { transform: translateY(7px) rotate(45deg); }
  .menu-toggle:checked + .menu-button .menu-icon::after { transform: translateY(-7px) rotate(-45deg); }

  .site-nav {
    display: none;
    position: absolute;
    left: 0; right: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem var(--gutter) 1.5rem;
    background: var(--black);
    border-bottom: 1px solid var(--gray-700);
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
  }
  .menu-toggle:checked ~ .site-nav { display: flex; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav ul a {
    display: block;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--gray-700);
    font-size: 1.1rem;
  }
  .site-nav ul a:hover { border-bottom-color: var(--gray-700); color: var(--blue-light); }
  .site-nav .btn { margin-top: 1.25rem; min-height: 3rem; }

  .split { grid-template-columns: 1fr; }
  .types { grid-template-columns: 1fr; }
  .type,
  .type:nth-child(even) { padding: 1.4rem 0; border-left: 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  body { font-size: 1rem; }
  .hero { min-height: auto; background-position: 70% bottom; }
  .hero h1 { max-width: none; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
  .uses,
  .benefits { grid-template-columns: 1fr; }
  .benefits li,
  .benefits li:nth-child(even),
  .benefits li:not(:nth-child(3n + 1)) { padding: 1.6rem 0; border-left: 0; }
  .steps li { padding-left: 2.75rem; }
  .faq summary { padding: 1.2rem 3rem 1.2rem 1.1rem; font-size: 1.05rem; }
  .faq summary::after { right: 1.1rem; }
  .faq details p { padding: 0 1.1rem 1.25rem; }
  .cta .btn { width: 100%; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* ---------- Accesibilidad: menos movimiento ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after { transition: none !important; animation: none !important; }
}

/* ---------- Impresión ---------- */
@media print {
  .site-header, .hero::after, .cta, .menu-button { display: none; }
  .hero { min-height: auto; background: none; color: #000; }
  .hero-sub { color: #000; }
  .section-black { background: none; color: #000; }
  .section-black h2, .section-black h3 { color: #000; }
}
