/* =========================================================
   MEXPACK · paleta y tipografía del PRD (sección 4)
   Blanco 60% · Negro 25% · Verde 10% · Rojo 4% (solo CTA) · Azul 1% (solo enlaces de contacto)
   ========================================================= */
/* Fuentes servidas desde el sitio (subconjunto latino de Google Fonts, licencia OFL): sin CSS externo que bloquee el render */
@font-face { font-family: "Lato"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/lato-400.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/lato-700.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url("/assets/fonts/poppins-500.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/poppins-600.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/poppins-700.woff2") format("woff2"); }
:root {
  --ink: #111314;
  --white: #ffffff;
  --green: #1a7444;
  --red: #e31f26;
  --red-dark: #c4161c;
  --blue: #006eb8;
  --paper: #f3f4f2;
  --line: #e2e4e1;
  --steel: #565c61;

  --font-head: "Poppins", system-ui, sans-serif;
  --font-body: "Lato", system-ui, sans-serif;

  --nav-h: 92px; /* espacio que ocupa el header flotante (12px de margen + píldora + aire) */
  --gutter: clamp(16px, 4vw, 48px);
  --radius: 10px;
  --radius-lg: 20px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--nav-h); }
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-family: var(--font-head); font-weight: 600; line-height: 1.08; letter-spacing: -.025em; }
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
address { font-style: normal; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--green); color: var(--white); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; padding: 10px 16px; background: var(--ink); color: var(--white); border-radius: var(--radius); }
.skip:focus { top: 12px; }

.wrap { max-width: 1280px; margin-inline: auto; padding-inline: var(--gutter); }
.h1 { font-size: clamp(2.25rem, 5vw, 4rem); }
.h2 { font-size: clamp(2rem, 4vw, 3.25rem); max-width: 18ch; }
.h3 { font-size: 1.5rem; }
.lead { font-size: clamp(1.0625rem, 1.4vw, 1.25rem); color: var(--steel); max-width: 38em; }

/* ---------- Botones y enlaces ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 26px;
  border: 1.5px solid transparent; border-radius: 999px;
  font: 600 1rem/1 var(--font-head); letter-spacing: -.01em;
  text-decoration: none; cursor: pointer;
  transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.btn:active { transform: scale(.98); }
.btn--sm { min-height: 42px; padding: 0 20px; font-size: .9375rem; }
.btn--red { background: var(--red); color: var(--white); }
.btn--red:hover { background: var(--red-dark); }
.btn--ink { background: var(--ink); color: var(--white); }
.btn--ink:hover { background: #2a2e30; }
.btn--ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn--ghost:hover { background: var(--ink); color: var(--white); }
.btn--light { border-color: rgba(255,255,255,.5); color: var(--white); }
.btn--light:hover { background: var(--white); color: var(--ink); }

.link {
  display: inline-block; font: 600 1rem var(--font-head); color: var(--green);
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px;
  transition: text-underline-offset .2s var(--ease);
}
.link:hover { text-underline-offset: 3px; }

/* ---------- Navegación ---------- */
.nav {
  position: fixed; inset: 12px 0 auto; z-index: 50;
  padding-inline: var(--gutter); pointer-events: none;
}
/* Píldora flotante de vidrio (mismo estilo que Intersoft); el logo crece arriba y se compacta al hacer scroll */
.nav__bar {
  pointer-events: auto;
  height: 72px; max-width: 1280px; margin-inline: auto; padding: 0 10px 0 22px;
  display: flex; align-items: center; gap: 20px;
  border-radius: 999px; border: 1px solid rgb(17 19 20 / .08);
  background: rgb(255 255 255 / .82);
  -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 1px 0 rgb(255 255 255 / .7) inset, 0 4px 14px rgb(17 19 20 / .06);
  transition: height .35s var(--ease), box-shadow .35s var(--ease);
}
.nav.is-scrolled .nav__bar { height: 62px; box-shadow: 0 1px 0 rgb(255 255 255 / .7) inset, 0 10px 30px rgb(17 19 20 / .12); }
.nav__logo { display: flex; align-items: center; flex-shrink: 0; }
.nav__logo img { height: 52px; width: auto; transition: height .35s var(--ease); }
.nav.is-scrolled .nav__logo img { height: 44px; }
.nav__links { display: none; margin-left: auto; gap: 2px; }
.nav__links a, .nav__sheet a {
  font: 500 .9375rem var(--font-head); text-decoration: none; color: var(--ink);
}
.nav__links a { padding: 9px 13px; border-radius: 999px; transition: color .2s var(--ease), background-color .2s var(--ease); }
.nav__links a:hover { background: var(--paper); }
.nav__links a[aria-current="page"], .nav__links a.is-active { color: var(--green); font-weight: 600; }
.nav__cta { margin-left: auto; }
.nav__toggle {
  width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: var(--white); padding: 0; cursor: pointer;
  display: grid; place-content: center; gap: 5px; flex-shrink: 0;
}
.nav__toggle span { display: block; width: 18px; height: 2px; background: var(--ink); transition: transform .3s var(--ease); }
.nav.is-open .nav__toggle span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav.is-open .nav__toggle span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
/* Menú móvil: tarjeta flotante que entra y sale por el mismo camino */
.nav__sheet {
  pointer-events: auto;
  /* fuera del flujo: así nav.offsetHeight es solo la píldora (main.js lo usa para el scroll a secciones) */
  position: absolute; top: 100%; left: var(--gutter); right: var(--gutter);
  display: grid; max-width: 1280px; margin: 8px auto 0; padding: 10px;
  border-radius: 24px; border: 1px solid rgb(17 19 20 / .08);
  background: rgb(255 255 255 / .94);
  -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 18px 40px rgb(17 19 20 / .16);
  transform-origin: top right; opacity: 0; transform: scale(.96) translateY(-6px); visibility: hidden;
  transition: opacity .3s var(--ease), transform .3s var(--ease), visibility 0s linear .3s;
}
.nav.is-open .nav__sheet { opacity: 1; transform: none; visibility: visible; transition-delay: 0s; }
.nav__sheet a { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-radius: 14px; font-size: 1.125rem; font-weight: 600; }
.nav__sheet a::after { content: ""; width: 8px; height: 8px; border-top: 2px solid var(--steel); border-right: 2px solid var(--steel); transform: rotate(45deg); }
.nav__sheet a:active, .nav__sheet a:hover { background: var(--paper); }
@media (max-width: 999px) {
  .nav__bar { height: 64px; padding-left: 16px; gap: 10px; }
  .nav.is-scrolled .nav__bar { height: 58px; }
  .nav__logo img { height: 44px; }
  .nav.is-scrolled .nav__logo img { height: 40px; }
}
@media (min-width: 1000px) {
  .nav__links { display: flex; }
  .nav__cta { margin-left: 8px; }
  .nav__toggle, .nav__sheet { display: none; }
}
main { padding-top: var(--nav-h); }

/* =========================================================
   Inicio: hero + foam a la medida (foam-3d.js)
   La escena 3D ocupa toda la pantalla (sticky) y el texto corre encima:
   a la izquierda en desktop y en la parte baja en celular.
   ========================================================= */
.hero { padding: 32px var(--gutter) 40px; }
.hero__place { font: 500 .9375rem var(--font-head); color: var(--green); }
/* título en 3 líneas como máximo: tamaño contenido y renglones equilibrados */
.hero__title { margin-top: 12px; font-size: clamp(2rem, 3.4vw, 3rem); font-weight: 700; line-height: 1.06; letter-spacing: -.035em; max-width: 12em; text-wrap: balance; }
.hero__lead { margin-top: 18px; font-size: clamp(1rem, 1.2vw, 1.125rem); line-height: 1.55; color: var(--steel); max-width: 30em; text-wrap: pretty; }
.hero__actions { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 12px; }
.hero__hint { margin-top: 32px; font-size: .9375rem; color: var(--steel); display: flex; align-items: center; gap: 10px; }
/* entrada del hero: solo CSS (sin GSAP al cargar). "backwards" para no pisar el desvanecido por scroll de foam-3d.js */
.hero > * { animation: rise .8s cubic-bezier(.2,.7,.2,1) backwards; }
.hero > .hero__title { animation-name: rise-title; animation-duration: 1s; animation-delay: .05s; }
.hero > .hero__lead { animation-delay: .25s; }
.hero > .hero__actions { animation-delay: .35s; }
.hero > .hero__hint { animation-delay: .45s; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
@keyframes rise-title { from { transform: translateY(22px); } }
.hero__hint::before { content: ""; width: 1.5px; height: 28px; background: var(--ink); animation: hint 1.8s var(--ease) infinite; transform-origin: top; }
@keyframes hint { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

.chapter {
  padding: 40px var(--gutter);
  display: flex; flex-direction: column; justify-content: center; gap: 16px;
}
.chapter__title { font-size: clamp(2rem, 4vw, 3.5rem); font-weight: 700; letter-spacing: -.035em; max-width: 13ch; }
.chapter p { color: var(--steel); font-size: clamp(1.0625rem, 1.3vw, 1.1875rem); max-width: 28em; }
.chapter::before {
  content: attr(data-chapter);
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--green); color: var(--white);
  font: 700 .875rem var(--font-head);
}
.chapter__img { display: none; }

.foam {
  --stage-bg: #eef0ed; /* igual que BG en foam-3d.js */
  --stage-h: calc(100svh - var(--nav-h));
  position: relative;
  display: grid;
  grid-template-areas: "main";
}
/* la sección sube detrás del header flotante: arriba de la escena se ve el mismo gris, no una franja blanca */
.foam:not(.no-3d) { margin-top: calc(-1 * var(--nav-h)); padding-top: var(--nav-h); background: var(--stage-bg); }
.foam__stage {
  grid-area: main; align-self: start;
  position: sticky; top: var(--nav-h); z-index: 0;
  height: var(--stage-h);
  /* imagen fija del primer cuadro: se ve hasta que la escena 3D arranca (con la primera interacción) */
  background: var(--stage-bg) url("/assets/img/foam-poster-m.webp") center / cover no-repeat;
  overflow: hidden;
}
.foam__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .5s var(--ease); }
.foam__stage.is-live .foam__canvas { opacity: 1; }
@media (min-width: 900px) { .foam__stage { background-image: url("/assets/img/foam-poster-d.webp"); } }
/* viñeta de estudio + velo detrás del texto (abajo en celular, a la izquierda en desktop) */
.foam__stage::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to top, rgb(238 240 237 / .97) 0%, rgb(238 240 237 / .9) 34%, rgb(238 240 237 / 0) 58%),
    radial-gradient(130% 95% at 50% 30%, transparent 55%, rgb(17 19 20 / .07));
}
.foam__pills {
  position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 2;
  display: flex; gap: 4px;
  padding: 4px; border-radius: 999px;
  background: rgb(255 255 255 / .9); /* sin backdrop-filter: sobre un canvas animado obliga a recomponer cada cuadro */
  box-shadow: 0 1px 2px rgb(17 19 20 / .06), 0 8px 24px rgb(17 19 20 / .06);
  white-space: nowrap;
}
.foam__pills button {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 0 12px; border: 0; border-radius: 999px;
  background: none; color: var(--steel); cursor: pointer;
  font: 500 .75rem var(--font-head);
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
.foam__pills button:hover { color: var(--ink); }
.foam__pills button.is-active { background: var(--green); color: var(--white); }
/* en celulares angostos solo el paso activo muestra su nombre */
@media (max-width: 479px) { .foam__pills button:not(.is-active) span { display: none; } }

/* el texto va encima de la escena; solo sus enlaces y botones reciben clics */
.foam__copy { grid-area: main; position: relative; z-index: 1; pointer-events: none; }
.foam__copy a, .foam__copy button { pointer-events: auto; }
.foam .hero, .foam .chapter { min-height: var(--stage-h); justify-content: flex-end; }
.foam .hero { display: flex; flex-direction: column; }
/* en celular el hero es alto: un velo detrás del texto deja ver solo la parte alta de la escena */
@media (max-width: 899px) { .foam .hero { background: linear-gradient(to bottom, rgb(238 240 237 / 0) 8%, rgb(238 240 237 / .93) 34%); } }
.foam__cta {
  min-height: 70svh;
  display: flex; flex-wrap: wrap; align-content: flex-end; align-items: center; gap: 16px 24px;
  padding: 48px var(--gutter) 56px;
}
.foam__cta-title { font-size: clamp(1.75rem, 3vw, 2.5rem); width: 100%; }

@media (min-width: 900px) {
  .foam__stage::after {
    background:
      linear-gradient(90deg, rgb(238 240 237 / .95) 0%, rgb(238 240 237 / .75) 30%, rgb(238 240 237 / 0) 50%),
      radial-gradient(120% 95% at 62% 42%, transparent 55%, rgb(17 19 20 / .08));
  }
  .foam__pills { top: auto; bottom: 28px; left: 66%; }
  .foam__pills button { font-size: .8125rem; }
  .foam__copy > * { max-width: min(560px, 44vw); }
  .foam .hero, .foam .chapter { justify-content: center; padding-block: 48px; }
  .foam__cta { align-content: center; }
}

/* Sin WebGL o con movimiento reducido: solo quedan las pills (sticky) y cada paso muestra su foto */
.foam.no-3d { grid-template-areas: "stage" "copy"; }
.foam.no-3d .foam__stage { grid-area: stage; height: auto; z-index: 2; background: rgb(255 255 255 / .94); border-bottom: 1px solid var(--line); }
.foam.no-3d .foam__stage::after, .foam.no-3d .foam__canvas { display: none; }
.foam.no-3d .foam__stage { background-image: none; }
.foam.no-3d .foam__pills { position: relative; left: auto; top: auto; bottom: auto; transform: none; width: fit-content; max-width: 100%; margin: 8px auto; background: var(--paper); box-shadow: none; }
.foam.no-3d .foam__copy { grid-area: copy; pointer-events: auto; }
.foam.no-3d .foam__copy > * { max-width: none; }
.foam.no-3d .hero, .foam.no-3d .chapter, .foam.no-3d .foam__cta { min-height: 0; justify-content: flex-start; }
.foam.no-3d .chapter { border-top: 1px solid var(--line); }
.foam.no-3d .chapter__img { display: block; width: 180px; background: var(--paper); border-radius: var(--radius-lg); }

/* ---------- Secciones ---------- */
.lines, .about, .industries, .branches, .faq, .contact { padding-block: clamp(72px, 10vw, 140px); }
.section-head { display: grid; gap: 18px; margin-bottom: clamp(36px, 5vw, 64px); }
.section-head__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

/* Flecha de "ver más": círculo que se llena de verde al pasar (filas, tarjetas) */
.go { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s var(--ease); }

/* Líneas de producto: cada fila muestra productos reales de la línea y una flecha */
.lines__list { border-top: 1.5px solid var(--ink); }
.lines__row a {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px;
  padding: 18px 12px; margin-inline: -12px; border-bottom: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none;
  transition: background-color .25s var(--ease);
}
.lines__thumbs { display: flex; width: 104px; height: 64px; align-items: center; }
.lines__thumbs img {
  width: 56px; height: 56px; object-fit: contain; padding: 5px;
  background: var(--paper); border: 2px solid var(--white); border-radius: 12px;
  transition: transform .35s var(--ease);
}
.lines__thumbs img + img { margin-left: -32px; }
.lines__thumbs img:nth-child(2) { transform: translateY(-4px) rotate(4deg); }
.lines__thumbs img:nth-child(3) { transform: translateY(3px) rotate(-3deg); }
.lines__text { display: grid; gap: 4px; min-width: 0; }
.lines__name { font: 600 clamp(1.5rem, 3.4vw, 2.5rem)/1.1 var(--font-head); letter-spacing: -.03em; transition: color .25s var(--ease); }
.lines__desc { color: var(--steel); font-size: .9375rem; max-width: 46em; display: none; }
.lines__count { display: none; font: 500 .875rem var(--font-head); color: var(--steel); white-space: nowrap; }
.lines__go {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  border: 1.5px solid var(--ink); color: var(--ink);
  transition: background-color .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease);
}
.lines__row a:hover, .lines__row a:focus-visible { background: var(--paper); }
.lines__row a:hover .lines__name, .lines__row a:focus-visible .lines__name { color: var(--green); }
.lines__row a:hover .lines__go, .lines__row a:focus-visible .lines__go { background: var(--green); border-color: var(--green); color: var(--white); }
.lines__row a:hover .go { transform: translateX(3px); }
.lines__row a:hover .lines__thumbs img:nth-child(1) { transform: translateX(-6px) rotate(-6deg); }
.lines__row a:hover .lines__thumbs img:nth-child(3) { transform: translateX(8px) rotate(6deg); }
@media (min-width: 700px) {
  .lines__desc { display: block; }
}
@media (min-width: 900px) {
  .lines__row a { grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 28px; padding: 22px 16px; margin-inline: -16px; }
  .lines__thumbs { width: 176px; height: 88px; }
  .lines__thumbs img { width: 80px; height: 80px; padding: 7px; }
  .lines__thumbs img + img { margin-left: -32px; }
  .lines__count { display: block; }
  .lines__go { width: 56px; height: 56px; }
}

/* Nosotros */
.about { background: var(--ink); color: var(--white); }
.about .lead, .about p { color: rgba(255,255,255,.78); }
.about__grid { display: grid; gap: 32px; }
.about__facts { margin-top: 36px; display: grid; gap: 24px; }
.about__facts dt { font: 600 1rem var(--font-head); color: var(--white); }
.about__facts dd { margin-top: 6px; color: rgba(255,255,255,.72); }
.pillars { margin-top: clamp(48px, 7vw, 96px); display: grid; gap: 1px; background: rgba(255,255,255,.14); border-block: 1px solid rgba(255,255,255,.14); }
.pillars li { background: var(--ink); padding: 28px 0; }
.pillars h3 { font-size: 1.375rem; }
.pillars p { margin-top: 8px; max-width: 28em; }
@media (min-width: 900px) {
  .about__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 64px; }
  .pillars { grid-template-columns: repeat(3, 1fr); }
  .pillars li { padding: 32px 32px 32px 0; }
  .pillars li + li { padding-left: 32px; }
}

/* Industrias */
.industries__list { display: grid; border-top: 1.5px solid var(--ink); }
.industries__list > div { padding: 22px 0; border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
.industries__list dt { font: 600 1.25rem var(--font-head); letter-spacing: -.02em; }
.industries__list dd { color: var(--steel); max-width: 36em; }
@media (min-width: 900px) {
  .industries__list > div { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 32px; padding: 26px 0; }
}

/* Sucursales */
.branches { background: var(--paper); }
.branches__grid { display: grid; gap: 40px; }
.branch { margin-top: 32px; display: grid; gap: 16px; justify-items: start; }
.branch + .branch { padding-top: 32px; border-top: 1px solid var(--line); }
.branch h3 { font-size: 1.5rem; color: var(--green); }
.branch address { font-size: 1.125rem; }
.branch__contact { display: grid; gap: 6px; }
.branch__contact a, .contact__direct a:not(.btn) { color: var(--blue); text-underline-offset: 4px; }
.map { min-height: 360px; border-radius: var(--radius-lg); overflow: hidden; background: var(--line); display: grid; place-items: center; padding: 24px; text-align: center; color: var(--steel); }
.map iframe { width: 100%; height: 100%; min-height: 360px; border: 0; display: block; }
.map.is-loaded { padding: 0; }
@media (min-width: 900px) {
  .branches__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; align-items: stretch; }
  .map, .map iframe { min-height: 460px; }
}

/* Preguntas */
.faq__grid { display: grid; gap: 32px; }
.faq__list { border-top: 1.5px solid var(--ink); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; gap: 24px; align-items: center;
  padding: 22px 0; font: 600 1.125rem/1.3 var(--font-head); letter-spacing: -.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 14px; height: 14px; background: linear-gradient(var(--ink), var(--ink)) center/100% 2px no-repeat, linear-gradient(var(--ink), var(--ink)) center/2px 100% no-repeat; transition: transform .3s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq__a { overflow: hidden; }
.faq__a p { padding-bottom: 22px; color: var(--steel); max-width: 42em; }
@media (min-width: 900px) { .faq__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; } }

/* Contacto */
.contact { border-top: 1px solid var(--line); }
.contact__grid { display: grid; gap: 48px; }
.contact__direct { margin-top: 28px; display: grid; gap: 14px; justify-items: start; font-size: 1.0625rem; }
.form { display: grid; gap: 18px; }
.form__row { display: grid; gap: 18px; }
.form label { display: grid; gap: 6px; font: 500 .9375rem var(--font-head); }
.form input, .form select, .form textarea {
  width: 100%; min-height: 50px; padding: 12px 14px;
  font: 400 1rem var(--font-body); color: var(--ink);
  background: var(--white); border: 1.5px solid #c9ccc8; border-radius: var(--radius);
  transition: border-color .2s var(--ease);
}
.form textarea { resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(26,116,68,.18); }
.form [aria-invalid="true"] { border-color: var(--red); }
.form .btn { justify-self: start; }
.form__status { min-height: 1.5em; font-size: .9375rem; }
.form__status.is-ok { color: var(--green); }
.form__status.is-error { color: var(--red-dark); }
.hp { position: absolute; left: -9999px; }
@media (min-width: 700px) { .form__row { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .contact__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; } }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: rgba(255,255,255,.78); padding: 72px var(--gutter) 32px; }
.footer__grid { max-width: 1280px; margin-inline: auto; display: grid; gap: 40px; }
.footer__lema { font: 700 clamp(1.75rem, 3vw, 2.5rem)/1.1 var(--font-head); letter-spacing: -.03em; color: var(--white); max-width: 14ch; margin-bottom: 14px; }
.footer__brand .btn { margin-top: 24px; }
.footer__h { font: 600 1rem var(--font-head); color: var(--white); margin-bottom: 14px; letter-spacing: 0; }
.footer ul { display: grid; gap: 8px; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--white); text-decoration: underline; text-underline-offset: 4px; }
.footer__legal { max-width: 1280px; margin: 56px auto 0; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.14); font-size: .875rem; }
@media (min-width: 900px) { .footer__grid { grid-template-columns: 2fr 1fr 1.4fr; } }

/* WhatsApp flotante (rojo: CTA según el PRD) */
.wa-float {
  position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 40;
  width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--red); color: var(--white);
  box-shadow: 0 10px 24px rgba(227,31,38,.32);
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.wa-float svg { width: 28px; height: 28px; fill: currentColor; }
.wa-float:hover { transform: scale(1.06); }
.wa-float.is-hidden { opacity: 0; transform: translateY(16px); pointer-events: none; }

/* =========================================================
   Catálogo
   ========================================================= */
.catalog, .product { max-width: 1280px; margin-inline: auto; padding: clamp(28px, 4vw, 56px) var(--gutter) clamp(72px, 9vw, 120px); }
.catalog__head { display: grid; gap: 18px; }
.crumbs { font-size: .9375rem; color: var(--steel); display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { color: var(--steel); text-underline-offset: 3px; }
.crumbs a:hover { color: var(--ink); }
.catalog__tools { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.search { position: relative; flex: 1 1 320px; max-width: 520px; }
.search svg { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; fill: none; stroke: var(--steel); stroke-width: 2; stroke-linecap: round; }
.search input {
  width: 100%; height: 52px; padding: 0 20px 0 50px;
  font: 400 1rem var(--font-body); border: 1.5px solid #c9ccc8; border-radius: 999px; background: var(--white);
}
.search input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(26,116,68,.18); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 6px; margin-top: 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips a {
  flex: none; display: inline-flex; gap: 6px; align-items: center;
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line);
  font: 500 .9375rem var(--font-head); text-decoration: none; white-space: nowrap;
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.chips a span { color: var(--steel); font-weight: 400; }
.chips a:hover { border-color: var(--ink); }
.chips a[aria-current="page"] { background: var(--green); border-color: var(--green); color: var(--white); }
.chips a[aria-current="page"] span { color: rgba(255,255,255,.92); } /* .8 no llega a 4.5:1 sobre el verde */
.catalog__count { margin: 32px 0 16px; font-size: .9375rem; color: var(--steel); }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 16px; }
.tile a { display: grid; gap: 4px; text-decoration: none; }
.tile__img { position: relative; display: block; aspect-ratio: 1; background: var(--paper); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 10px; }
.tile__go {
  position: absolute; right: 12px; bottom: 12px;
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--white); color: var(--ink);
  transition: background-color .25s var(--ease), color .25s var(--ease);
}
.tile__go .go { width: 18px; height: 18px; }
.tile a:hover .tile__go, .tile a:focus-visible .tile__go { background: var(--green); color: var(--white); }
.tile a:hover .go { transform: translateX(2px); }
.tile a:hover .tile__name { color: var(--green); }
.tile__img img { width: 100%; height: 100%; object-fit: contain; padding: 10%; transition: transform .5s var(--ease); }
.tile a:hover .tile__img img { transform: scale(1.06) rotate(-1.5deg); }
.tile__name { font: 600 1.0625rem/1.25 var(--font-head); letter-spacing: -.01em; }
.tile__cat { font-size: .875rem; color: var(--steel); }
.tile[hidden] { display: none; }
.catalog__empty { margin-top: 24px; padding: 40px; background: var(--paper); border-radius: var(--radius-lg); display: grid; gap: 18px; justify-items: start; }
@media (min-width: 700px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 24px; } }
@media (min-width: 1100px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Ficha de producto */
.product__grid { margin-top: 24px; display: grid; gap: 32px; }
/* fondo cuadriculado tipo tapete de corte: la foto se lee como pieza sobre la mesa de trabajo */
.product__media {
  aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; border-radius: var(--radius-lg);
  background: linear-gradient(rgb(17 19 20 / .055) 1px, transparent 1px) 0 0 / 32px 32px, linear-gradient(90deg, rgb(17 19 20 / .055) 1px, transparent 1px) 0 0 / 32px 32px, var(--paper);
}
.product__media img { width: 100%; height: 100%; object-fit: contain; padding: 6%; filter: drop-shadow(0 18px 22px rgb(17 19 20 / .14)); }
.product__info { display: grid; gap: 22px; align-content: start; }
.product__cat {
  justify-self: start; display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px; background: rgb(26 116 68 / .1);
  font: 600 .875rem var(--font-head); color: var(--green); text-decoration: none;
}
.product__cat:hover { background: rgb(26 116 68 / .16); }
.product__name { font-size: clamp(2.25rem, 4.4vw, 3.75rem); font-weight: 700; letter-spacing: -.035em; max-width: 14ch; }

.specs__title { font: 600 1rem var(--font-head); letter-spacing: 0; margin-bottom: 10px; }
.specs dl { border-top: 1.5px solid var(--ink); }
.specs dl > div { display: grid; grid-template-columns: minmax(96px, 1fr) 2.4fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.specs dt { font: 600 .9375rem var(--font-head); }
.specs dd { color: var(--ink); }
.specs .specs__feat { grid-template-columns: 1fr; gap: 0; padding-left: 28px; position: relative; }
.specs .specs__feat dt { position: absolute; }
.specs .specs__feat::before {
  content: ""; position: absolute; left: 0; top: 16px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center/11px no-repeat;
}

/* Bloque de cotización: el único bloque oscuro de la ficha, para que la acción no se pierda */
.quote { display: grid; gap: 18px; padding: clamp(22px, 3vw, 32px); border-radius: var(--radius-lg); background: var(--ink); color: var(--white); }
.quote__title { font: 600 1.375rem var(--font-head); letter-spacing: -.02em; }
.quote .hint { color: rgb(255 255 255 / .72); font-size: .9375rem; }
.quote__tel { font-size: .9375rem; color: rgb(255 255 255 / .72); }
.quote__tel a { color: var(--white); font-weight: 700; text-underline-offset: 4px; }
.product__variants { display: grid; gap: 16px; }
.variants { border: 0; margin: 0; padding: 0; }
.variants legend { font: 600 .9375rem var(--font-head); margin-bottom: 8px; padding: 0; }
.variants div { display: flex; flex-wrap: wrap; gap: 8px; }
.variants label { cursor: pointer; }
.variants input { position: absolute; opacity: 0; pointer-events: none; }
.variants span { display: inline-block; padding: 9px 16px; border: 1.5px solid rgb(255 255 255 / .28); border-radius: 999px; font: 500 .9375rem var(--font-head); transition: border-color .2s var(--ease), background-color .2s var(--ease), color .2s var(--ease); }
.variants label:hover span { border-color: var(--white); }
.variants input:checked + span { background: var(--white); border-color: var(--white); color: var(--ink); }
.variants input:focus-visible + span { outline: 2px solid var(--white); outline-offset: 2px; }
.product__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Cómo cotizar: proceso real de 3 pasos */
.howto { counter-reset: paso; margin-top: clamp(48px, 7vw, 88px); display: grid; gap: 1px; background: var(--line); border-block: 1px solid var(--line); }
.howto li { counter-increment: paso; background: var(--white); padding: 24px 0; display: grid; gap: 6px; }
.howto li::before {
  content: counter(paso); display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 6px;
  border-radius: 50%; background: var(--green); color: var(--white); font: 700 .875rem var(--font-head);
}
.howto strong { font: 600 1.125rem var(--font-head); letter-spacing: -.01em; }
.howto span { color: var(--steel); font-size: .9375rem; max-width: 30em; }

.related { margin-top: clamp(56px, 7vw, 96px); }
.related__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; }
.related .tiles { margin-top: 24px; }
@media (min-width: 900px) {
  .product__grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 64px; align-items: start; }
  .product__media { position: sticky; top: calc(var(--nav-h) + 24px); }
  .howto { grid-template-columns: repeat(3, 1fr); }
  .howto li { padding: 28px 28px 28px 0; }
  .howto li + li { padding-left: 28px; }
}

/* ---------- 404 ---------- */
.notfound { min-height: calc(100svh - var(--nav-h)); display: grid; place-content: center; justify-items: center; gap: 20px; text-align: center; padding: 48px var(--gutter); }
.notfound .lead { margin-inline: auto; }
.notfound__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 8px; }
.notfound__box svg { width: min(260px, 60vw); overflow: visible; }
.nf-body { fill: #c99b66; }
.nf-flap { fill: #b5874f; transform-box: fill-box; }
.nf-flap--l { transform-origin: 100% 100%; animation: flap-l 3.2s var(--ease) infinite; }
.nf-flap--r { transform-origin: 0% 100%; animation: flap-r 3.2s var(--ease) infinite; }
.nf-tape { fill: rgba(255,255,255,.35); }
.notfound__box text { font: 700 34px var(--font-head); fill: var(--ink); }
@keyframes flap-l { 0%, 100% { transform: rotate(0); } 45%, 60% { transform: rotate(-28deg); } }
@keyframes flap-r { 0%, 100% { transform: rotate(0); } 45%, 60% { transform: rotate(28deg); } }

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
