/* Pixel y Soporte: tokens y componentes comunes a todas las páginas. */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("../assets/fonts/schibsted-grotesk-latin-var.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Escala tipográfica 1,25 sobre 18 px */
  --step--1: 0.875rem;
  --step-0: 1.125rem;
  --step-1: 1.406rem;
  --step-2: 1.758rem;
  --step-3: 2.197rem;
  --step-4: 2.747rem;

  /* Cuadrícula: la celda del logo marca el ritmo vertical */
  --unit: 8px;
  --gutter: 16px;
  --container: 1200px;
  --radius: 6px;
  --header-height: 72px;
  --fab-size: 56px;
  --fab-offset: 24px;

  --placa: #eef2f7;
  --superficie: #ffffff;
  --trazo: #263041;
  --trazo-2: #505b6e;
  --rejilla: #c9d2de;
  --borde: #7a8597;
  --cobalto: #2b59c3;
  --whatsapp: #25d366;
  --whatsapp-fg: #111b21;
  --header-bg: rgba(238, 242, 247, 0.94);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --placa: #161b24;
  --superficie: #1f2633;
  --trazo: #e6ebf2;
  --trazo-2: #aeb8c7;
  --rejilla: #323c4c;
  --borde: #6b778a;
  --cobalto: #82a8f7;
  --header-bg: rgba(22, 27, 36, 0.94);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--placa);
  color: var(--trazo);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.6;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
}
body.menu-open {
  overflow: hidden;
}
img,
svg {
  display: block;
  max-width: 100%;
}
button {
  font: inherit;
}
a {
  color: inherit;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}
h1,
h2,
h3,
p,
ul,
ol,
dl {
  margin: 0;
}
h1,
h2,
h3 {
  font-weight: 750;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
h2 {
  font-size: clamp(var(--step-2), 3.4vw, var(--step-3));
}
h3 {
  font-size: var(--step-1);
  line-height: 1.2;
}
p,
li,
dd {
  overflow-wrap: break-word;
}
[hidden] {
  display: none !important;
}
main:focus {
  outline: none;
}

/* ---------- Accesibilidad ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link {
  position: fixed;
  z-index: 9999;
  top: 8px;
  left: 8px;
  transform: translateY(-150%);
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--trazo);
  color: var(--placa);
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus {
  transform: none;
}
:focus-visible {
  outline: 2px solid var(--cobalto);
  outline-offset: 3px;
}
:where(a, button, summary, [tabindex]) {
  scroll-margin-block: calc(var(--header-clearance, var(--header-height)) + 24px) 24px;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Maquetación ---------- */
.container {
  width: min(calc(100% - 2 * var(--gutter)), var(--container));
  margin-inline: auto;
}
@media (min-width: 768px) {
  :root {
    --gutter: 40px;
  }
}
.section {
  padding-block: clamp(64px, 9vw, 112px);
}
.section-title {
  max-width: 22ch;
}
.section-intro {
  max-width: 36em;
  margin-top: 16px;
  color: var(--trazo-2);
}

/* ---------- Botones ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 20px;
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}
.button svg {
  width: 20px;
  height: 20px;
  flex: none;
}
/* Glifo oficial de WhatsApp: solo se escala. */
.button img {
  width: 20px;
  height: 20px;
  flex: none;
}
.button-primary {
  background: var(--cobalto);
  color: var(--placa);
}
.button-primary:hover {
  background: color-mix(in srgb, var(--cobalto) 85%, var(--trazo));
}
.button-whatsapp {
  background: var(--whatsapp);
  color: var(--whatsapp-fg);
}
.button-whatsapp:hover {
  background: color-mix(in srgb, var(--whatsapp) 86%, var(--whatsapp-fg));
}
.button-secondary {
  border-color: var(--borde);
  background: transparent;
  color: var(--trazo);
}
.button-secondary:hover {
  border-color: var(--trazo);
  background: var(--superficie);
}

/* ---------- Cabecera ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--rejilla);
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header-height);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 44px;
  color: var(--trazo);
  font-size: 1.125rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.brand img {
  width: 40px;
  height: 40px;
  flex: none;
}
.desktop-nav {
  display: flex;
  gap: 4px;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  color: var(--trazo-2);
  font-size: 1rem;
  font-weight: 550;
  text-decoration: none;
}
.nav-link:hover {
  color: var(--trazo);
}
.nav-link[aria-current="page"] {
  color: var(--trazo);
  text-decoration: underline;
  text-decoration-color: var(--cobalto);
  text-decoration-thickness: 2px;
  text-underline-offset: 8px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--trazo-2);
  cursor: pointer;
}
.icon-button:hover {
  border-color: var(--rejilla);
  color: var(--trazo);
}
.icon-button svg {
  width: 20px;
  height: 20px;
}
html[data-theme="light"] [data-theme-icon="sun"],
html[data-theme="dark"] [data-theme-icon="moon"],
html[data-theme="light"] .glyph-on-dark,
html[data-theme="dark"] .glyph-on-light {
  display: none;
}
.menu-button {
  display: none;
}
.header-cta {
  min-height: 44px;
  white-space: nowrap;
}
/* El punto de corte coincide con el de js/main.js (1181 px). */
@media (max-width: 1180px) {
  .desktop-nav,
  .header-actions .header-cta {
    display: none;
  }
  .menu-button {
    display: inline-grid;
  }
}
@media (max-width: 380px) {
  .brand {
    gap: 8px;
    font-size: 1rem;
  }
  .brand img {
    width: 32px;
    height: 32px;
  }
}
@media (max-height: 500px) and (max-width: 860px) {
  .site-header {
    position: relative;
  }
}

/* ---------- Menú móvil ---------- */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 1100;
  padding: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: color-mix(in srgb, var(--trazo) 45%, transparent);
}
.mobile-menu-panel {
  width: min(100%, 400px);
  max-height: calc(100dvh - 24px);
  margin-left: auto;
  overflow-y: auto;
  padding: 16px 20px 20px;
  border: 1px solid var(--rejilla);
  border-radius: var(--radius);
  background: var(--placa);
}
.mobile-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.mobile-nav {
  display: grid;
  border-top: 1px solid var(--rejilla);
}
.mobile-nav .nav-link {
  min-height: 52px;
  padding: 0;
  border-bottom: 1px solid var(--rejilla);
  font-size: var(--step-0);
}
.mobile-menu-cta {
  width: 100%;
  margin-top: 20px;
}

/* ---------- Preguntas frecuentes ---------- */
.faq-section > .container {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: 40px;
  align-items: start;
}
.faq-accordion {
  border-top: 1px solid var(--rejilla);
}
.faq-accordion details {
  border-bottom: 1px solid var(--rejilla);
}
.faq-accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
  padding-block: 16px;
  font-size: var(--step-0);
  font-weight: 650;
  line-height: 1.35;
  list-style: none;
  cursor: pointer;
}
.faq-accordion summary::-webkit-details-marker {
  display: none;
}
.faq-accordion summary:hover {
  color: var(--cobalto);
}
.faq-sign {
  position: relative;
  width: 14px;
  height: 14px;
  flex: none;
}
.faq-sign::before,
.faq-sign::after {
  content: "";
  position: absolute;
  inset: 6px 0;
  background: currentColor;
}
.faq-sign::after {
  inset: 0 6px;
}
details[open] .faq-sign::after {
  display: none;
}
.faq-content {
  max-width: 38em;
  padding-bottom: 24px;
  color: var(--trazo-2);
}
@media (max-width: 860px) {
  .faq-section > .container {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
}

/* ---------- Héroe de página: título en dos frases ---------- */
.hero h1 {
  font-size: clamp(2.25rem, 4.6vw, 3.75rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.03em;
}
.hero h1 span {
  display: block;
}
.hero h1 span + span {
  margin-top: 0.18em;
  font-weight: 600;
  letter-spacing: -0.025em;
}
.hero .lead {
  max-width: 34em;
  margin-top: 28px;
  color: var(--trazo-2);
  font-size: clamp(var(--step-0), 1.6vw, 1.25rem);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}
@media (max-width: 480px) {
  .hero-actions .button {
    flex: 1 1 100%;
  }
}

/* ---------- Ruta de navegación ---------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 16px;
  color: var(--trazo-2);
  font-size: var(--step--1);
}
.breadcrumb a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.breadcrumb [aria-current="page"] {
  color: var(--trazo);
  font-weight: 650;
}

/* ---------- Pictogramas de 8×8 píxeles ---------- */
.pixel-icon {
  width: 48px;
  height: 48px;
  flex: none;
  fill: var(--cobalto);
}

/* ---------- Listas con marcador de píxel ---------- */
.pixel-list {
  display: grid;
  gap: 8px;
  padding: 0;
  list-style: none;
}
.pixel-list li {
  position: relative;
  padding-left: 22px;
}
.pixel-list li::before {
  content: "";
  position: absolute;
  top: 0.62em;
  left: 0;
  width: 8px;
  height: 8px;
  background: var(--cobalto);
}

/* ---------- Pasos unidos por un recorrido ---------- */
.steps-section {
  border-block: 1px solid var(--rejilla);
  background: var(--superficie);
}
.steps {
  --nodo: 14px;
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
  margin-top: 56px;
  padding: 0;
  list-style: none;
}
.steps::before {
  content: "";
  position: absolute;
  top: calc(var(--nodo) / 2 - 1px);
  left: 0;
  right: 0;
  height: 2px;
  background: var(--cobalto);
}
.step {
  position: relative;
  padding-top: calc(var(--nodo) + 28px);
}
.step::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: var(--nodo);
  height: var(--nodo);
  background: var(--cobalto);
}
.step h3 {
  margin-bottom: 12px;
}
.step p {
  max-width: 30em;
  color: var(--trazo-2);
}
@media (max-width: 860px) {
  .steps {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
  }
  .steps::before {
    top: 0;
    bottom: 0;
    left: calc(var(--nodo) / 2 - 1px);
    right: auto;
    width: 2px;
    height: auto;
  }
  .step {
    padding-top: 0;
    padding-left: calc(var(--nodo) + 24px);
  }
  .step::before {
    top: 0.3em;
  }
}

/* Variante vertical en todas las anchuras. */
.steps-vertical {
  grid-template-columns: minmax(0, 1fr);
  gap: 36px;
}
.steps-vertical::before {
  top: 0;
  bottom: 0;
  left: calc(var(--nodo) / 2 - 1px);
  right: auto;
  width: 2px;
  height: auto;
}
.steps-vertical .step {
  padding-top: 0;
  padding-left: calc(var(--nodo) + 24px);
}
.steps-vertical .step::before {
  top: 0.3em;
}

/* ---------- Contacto: WhatsApp y correo como dos acciones ---------- */
.contact-section {
  border-top: 1px solid var(--rejilla);
}
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 48px;
  align-items: start;
}
.contact-actions {
  display: grid;
  gap: 16px;
}
.contact-action {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 88px;
  padding: 20px 24px;
  border: 1.5px solid var(--borde);
  border-radius: var(--radius);
  color: var(--trazo);
  text-decoration: none;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}
.contact-action:hover {
  border-color: var(--trazo);
  background: var(--superficie);
}
.contact-action-whatsapp {
  border-color: var(--whatsapp);
  background: var(--whatsapp);
  color: var(--whatsapp-fg);
}
.contact-action-whatsapp:hover {
  border-color: color-mix(in srgb, var(--whatsapp) 86%, var(--whatsapp-fg));
  background: color-mix(in srgb, var(--whatsapp) 86%, var(--whatsapp-fg));
}
.contact-action img,
.contact-action-icon {
  width: 32px;
  height: 32px;
  flex: none;
}
.contact-action-text {
  display: grid;
  min-width: 0;
}
.contact-action-label {
  font-size: var(--step-1);
  font-weight: 750;
  line-height: 1.2;
}
.contact-action-value {
  overflow-wrap: anywhere;
}
@media (max-width: 960px) {
  .contact-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }
}

/* ---------- Pie ---------- */
.site-footer {
  border-top: 1px solid var(--rejilla);
  padding: 48px 0 calc(var(--fab-size) + var(--fab-offset) * 2);
  color: var(--trazo-2);
  font-size: 1rem;
}
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 32px 48px;
  padding-bottom: 32px;
}
.footer-brand {
  flex: 1 1 260px;
  max-width: 400px;
}
.footer-brand .brand {
  margin-bottom: 8px;
}
.footer-nav {
  min-width: 0;
}
.footer-title {
  color: var(--trazo);
  font-weight: 700;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  column-gap: 24px;
  padding: 0;
  list-style: none;
}
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}
.footer-links a:hover {
  color: var(--trazo);
  text-decoration: underline;
}
.footer-bottom {
  border-top: 1px solid var(--rejilla);
  padding-top: 24px;
  font-size: var(--step--1);
}

/* ---------- Botón flotante de WhatsApp ---------- */
/* Por debajo de la cabecera (1000) y del menú móvil (1100), que lo oculta. */
.floating-whatsapp {
  position: fixed;
  z-index: 900;
  right: max(var(--fab-offset), env(safe-area-inset-right));
  bottom: max(var(--fab-offset), env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  width: var(--fab-size);
  height: var(--fab-size);
  border-radius: 50%;
  background: var(--whatsapp);
  box-shadow: 0 6px 18px rgba(17, 27, 33, 0.25);
}
.floating-whatsapp img {
  width: 30px;
  height: 30px;
}
body.menu-open .floating-whatsapp {
  visibility: hidden;
}
@media (max-width: 480px) {
  :root {
    --fab-offset: 16px;
  }
}

@media print {
  .site-header,
  .floating-whatsapp,
  .mobile-menu {
    display: none !important;
  }
}
