/* =============================================================================
   ALT MEDICAL — Sistema de diseño + secciones de la portada
   Fase 1 (maqueta HTML). Equivale a: variables globales + theme style +
   clases globales de Bricks Builder.

   Convenciones (ver .claude/skills/maqueta-local-figma-to-html/SKILL.md):
   - BEM estricto: bloque__elemento--modificador
   - Ningún HEX a pelo fuera de :root
   - Siempre 0px, nunca 0 (Bricks descarta el 0 sin unidad)
   - flex-direction siempre explícito
   - Media queries SOLO en los breakpoints nativos de Bricks:
     991 (tablet_portrait) · 767 (mobile_landscape) · 478 (mobile_portrait)
   ========================================================================== */

/* -----------------------------------------------------------------------------
   1. TOKENS  →  variables globales + paleta de Bricks
   -------------------------------------------------------------------------- */
:root {
  /* --- Color ------------------------------------------------------------- */
  --brand-navy:      #050a30;              /* texto, pie, círculos, logos de marca */
  --brand-blue:      #0d4291;              /* botón primario */
  --brand-cyan:      #6cc6d9;              /* iconos de beneficios, acento del isotipo */
  --surface-white:   #ffffff;
  --surface-tint-1:  rgba(5, 10, 48, .05); /* fondo de «nosotros»  → #f2f3f4 */
  --surface-tint-2:  rgba(5, 10, 48, .10); /* fondo de «carrusel» y «beneficios» → #e6e6ea */
  --line-arrow:      rgba(5, 10, 48, .10); /* flechas del carrusel */
  --text-body:       #000000;
  --focus-ring:      #0d4291;

  /* --- Tipografía -------------------------------------------------------- */
  --font-ui:  "Poppins", "Helvetica Neue", Arial, sans-serif;
  --font-alt: "Montserrat", "Helvetica Neue", Arial, sans-serif;

  --fs-h1: 58px;    --lh-h1: 81px;    --tr-h1: -1.35px;   /* titular de sección */
  --fs-h2: 38px;    --lh-h2: 53px;    --tr-h2: -0.9px;    /* título de producto */
  --fs-h3: 25px;    --lh-h3: 32px;                        /* etiqueta de beneficio */
  --fs-lead: 22px;  --lh-lead: 27px;                      /* cuerpo largo */
  --fs-body: 18px;  --lh-body: 22px;                      /* cuerpo de ficha */
  --fs-nav: 18px;   --lh-nav: 26px;
  --fs-btn: 16px;   --lh-btn: 20px;
  --fs-legal: 14px; --lh-legal: 17px;

  /* --- Layout ------------------------------------------------------------ */
  --wrap-max: 1214px;              /* 1440 − 113·2 → widthMax del theme style */
  --gutter: min(113px, 7.85vw);    /* fluido: cubre la franja 992–1439 sin breakpoint */
  --radius-pill: 999px;

  /* --- Alturas de sección medidas en el Figma (referencia) --------------- */
  --h-hero: 810px;
  --h-video: 810px;
}

/* -----------------------------------------------------------------------------
   2. BASE  →  theme style de Bricks
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0px;
  background: var(--surface-white);
  color: var(--text-body);
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}

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

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

h1, h2, h3 { margin: 0px; font-weight: 800; color: var(--brand-navy); }

p { margin: 0px; }

ul { margin: 0px; padding: 0px; list-style: none; }

button {
  margin: 0px;
  padding: 0px;
  border: 0px;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

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

/* -----------------------------------------------------------------------------
   3. UTILIDADES
   -------------------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: calc(var(--wrap-max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.u-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0px;
}

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 18px;
  border-radius: 6px;
  background: var(--brand-navy);
  color: var(--surface-white);
  font-size: var(--fs-btn);
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* -----------------------------------------------------------------------------
   4. BOTÓN  →  clase global «btn»
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 6.5px 15px 6.5px 23px;
  border-radius: var(--radius-pill);
  background: var(--brand-blue);
  color: var(--surface-white);
  font-family: var(--font-alt);
  font-weight: 700;
  font-size: var(--fs-btn);
  line-height: var(--lh-btn);
  transition: background-color .18s ease, transform .18s ease;
}
.btn:hover { background: #0a3573; }   /* estado no diseñado en el Figma */
.btn:active { transform: translateY(1px); }
.btn__ico { width: 8px; height: 13px; flex: none; }

/* -----------------------------------------------------------------------------
   5. CABECERA  →  plantilla Header de Bricks
   Flota sobre el hero: sin fondo, posición absoluta.
   -------------------------------------------------------------------------- */
.header {
  position: absolute;
  inset: 0px 0px auto 0px;
  z-index: 20;
}

.header__inner {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  padding-top: 34px;
}

.header__logo { flex: none; }
.header__logo img { width: 167px; height: 125px; }

.nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 45px;                 /* separación extra antes del selector de idioma */
  padding-top: 22px;         /* los enlaces empiezan en y=56 del Figma */
}

.nav__list {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 39px;
}

.nav__link,
.lang__link {
  position: relative;
  display: inline-block;
  color: var(--brand-navy);
  font-size: var(--fs-nav);
  line-height: var(--lh-nav);
  letter-spacing: .14px;
  transition: opacity .18s ease;
}
.nav__link:hover, a.lang__link:hover { opacity: .65; }

/* Idioma todavía no disponible: maquetado, sin enlace (ver CLAUDE.md) */
.lang__link.is-disabled { opacity: .55; cursor: default; }

.nav__link.is-active,
.lang__link.is-active { font-weight: 700; }

.nav__link.is-active::after,
.lang__link.is-active::after {
  content: "";
  position: absolute;
  left: 1px;
  right: 2px;
  bottom: -1px;
  height: 2px;
  background: var(--brand-navy);
}

.lang {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  color: var(--brand-navy);
  font-size: var(--fs-nav);
  line-height: var(--lh-nav);
}

/* Menú móvil: NO está diseñado en el Figma.
   Se resuelve con un atributo (data-open) y no con una clase, porque Bricks no
   tiene acción «toggle class» en sus interacciones. En Bricks esto lo hará el
   elemento Nav Nested con su propio comportamiento. */
.nav__toggle {
  display: none;
  width: 44px;
  height: 44px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.nav__toggle span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--brand-navy);
  transition: transform .2s ease, opacity .2s ease;
}

/* -----------------------------------------------------------------------------
   6. HERO
   100% imagen: el producto y su reflejo vienen horneados en el asset.
   El único texto es el H1 accesible, oculto visualmente (ver CLAUDE.md).
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  aspect-ratio: 1440 / 810;
  background: #dfdfdf url("../img/hero-bg.webp") center / cover no-repeat;
}

.hero__brand {
  width: 310px;
  height: 38px;
  margin-bottom: 51px;
}

/* -----------------------------------------------------------------------------
   7. NOSOTROS
   -------------------------------------------------------------------------- */
.nosotros {
  background: var(--surface-tint-1);
  padding-block: 49px 87px;
}

/* Las tres columnas son las proporciones exactas del Figma (396 · 104 de hueco
   · 579), en fr: escalan solas entre 992 y 1439 sin necesitar un breakpoint. */
.nosotros__inner {
  display: grid;
  grid-template-columns: 396fr 104fr 579fr;
  align-items: start;
  padding-left: 47px;
  padding-right: 88px;
}
.nosotros__media { grid-column: 1; }
.nosotros__body  { grid-column: 3; }

.nosotros__media { margin-top: 21px; }
.nosotros__media img { width: 100%; height: auto; }

.nosotros__title {
  font-size: var(--fs-h1);
  line-height: var(--lh-h1);
  letter-spacing: var(--tr-h1);
}

.nosotros__text {
  margin-top: 4px;
  font-size: var(--fs-lead);
  line-height: var(--lh-lead);
}

.nosotros .btn { margin-top: 20px; }

/* -----------------------------------------------------------------------------
   8. CARRUSEL DE PRODUCTOS
   -------------------------------------------------------------------------- */
.carrusel {
  background: var(--surface-tint-2);
  padding-block: 51px 86px;
}

.carrusel__inner { position: relative; }

.carrusel__viewport { overflow: hidden; }

.carrusel__track {
  display: flex;
  flex-direction: row;
  transition: transform .45s ease;
}

.carrusel__slide {
  flex: 0 0 100%;
  display: flex;
  flex-direction: column;
  gap: 89px;                 /* separación entre las dos fichas del Figma */
}

/* Flechas.
   El Figma las coloca con el centro a 302px del borde de la sección (43% de la
   altura del bloque). Aquí se centran sobre el track, que es el comportamiento
   correcto de un carrusel; son ~69px de desviación respecto al diseño. */
.carrusel__nav {
  position: absolute;
  top: 50%;
  translate: 0px -50%;
  z-index: 2;
  width: 38px;
  height: 72px;
  display: grid;
  place-items: center;
  opacity: .35;
  transition: opacity .18s ease;
}
.carrusel__nav:hover { opacity: .7; }
.carrusel__nav[aria-disabled="true"] { opacity: .18; cursor: default; }
.carrusel__nav img { width: 38px; height: 72px; }
.carrusel__nav--prev { left: calc(var(--gutter) - 6px); }
.carrusel__nav--next { right: calc(var(--gutter) - 6px); }

/* Ficha de producto. Las dos variantes reproducen las proporciones exactas del
   Figma como columnas fr, así que escalan solas entre 992 y 1439. */
.producto {
  display: grid;
  align-items: center;
}
.producto--a { grid-template-columns: 214fr 201fr 132fr 458fr 209fr; }
.producto--a .producto__media { grid-column: 2; }
.producto--a .producto__body  { grid-column: 4; }

.producto--b { grid-template-columns: 156fr 478fr 55fr 370fr 156fr; }
.producto--b .producto__body  { grid-column: 2; }
.producto--b .producto__media { grid-column: 4; }

.producto__media img { width: 100%; height: auto; }

.producto__brand {
  width: auto;
  max-height: 25px;
  margin-bottom: 12px;
}

.producto__title {
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
  letter-spacing: var(--tr-h2);
}

.producto__text {
  margin-top: 2px;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}

/* -----------------------------------------------------------------------------
   9. VÍDEO
   Fachada: el póster es una imagen y el reproductor solo se inyecta al pulsar.
   Evita cargar el iframe de terceros —y sus cookies— en cada visita.
   -------------------------------------------------------------------------- */
.video {
  position: relative;
  aspect-ratio: 1440 / 810;
  background: var(--brand-navy) url("../img/video-bg.webp") center / cover no-repeat;
}

.video__play {
  position: absolute;
  inset: 0px;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}
.video__play img {
  width: 91px;
  height: 96px;
  filter: drop-shadow(0px 2px 18px rgba(0, 0, 0, .35));
  transition: transform .2s ease;
}
.video__play:hover img { transform: scale(1.08); }

.video__frame {
  position: absolute;
  inset: 0px;
  width: 100%;
  height: 100%;
  border: 0px;
}

/* -----------------------------------------------------------------------------
   10. BENEFICIOS
   -------------------------------------------------------------------------- */
.beneficios {
  background: var(--surface-tint-2);
  padding-block: 41px 47px;
}

.beneficios__list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

.beneficio {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.beneficio__ico {
  display: grid;
  place-items: center;
  width: 147px;
  height: 147px;
  margin-bottom: 10px;
  border-radius: 50%;
  background: var(--brand-navy);
}
.beneficio__ico img { width: auto; height: auto; }

.beneficio__label {
  font-weight: 700;
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
  color: var(--text-body);
}

/* -----------------------------------------------------------------------------
   11. PIE  →  plantilla Footer de Bricks
   -------------------------------------------------------------------------- */
.pie {
  background: var(--brand-navy);
  color: var(--surface-white);
}

.pie__inner {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 57px;
}

.pie__legal,
.pie__links {
  font-family: var(--font-alt);
  font-weight: 300;
  font-size: var(--fs-legal);
  line-height: var(--lh-legal);
}
.pie__links a { transition: opacity .18s ease; }
.pie__links a:hover { opacity: .7; }

/* =============================================================================
   RESPONSIVE
   Capas DERIVADAS: el Figma solo trae 1440. Nada de esto está diseñado; solo
   evita que el escritorio se rompa. Pendiente de validar con el cliente.
   Puntos = breakpoints nativos de Bricks (desktop-first).
   ========================================================================== */

/* --- ≤991px · tablet_portrait ------------------------------------------- */
@media (max-width: 991px) {
  :root {
    --gutter: 40px;
    --fs-h1: 44px;    --lh-h1: 58px;    --tr-h1: -0.8px;
    --fs-h2: 32px;    --lh-h2: 44px;
    --fs-h3: 22px;    --lh-h3: 29px;
    --fs-lead: 20px;  --lh-lead: 30px;
    --fs-body: 17px;  --lh-body: 26px;
    --fs-nav: 16px;   --lh-nav: 24px;
    --medida: 620px;                 /* longitud de línea cómoda al apilar */
  }

  .header__inner { padding-top: 24px; }
  .header__logo img { width: 128px; height: 96px; }
  .nav { gap: 28px; padding-top: 14px; }
  .nav__list { gap: 24px; }

  .hero { aspect-ratio: 3 / 2; }
  .hero__brand { width: 240px; height: 30px; margin-bottom: 36px; }

  /* Al apilar, la imagen se centra y el texto conserva su alineación a la
     izquierda con una medida acotada: un párrafo centrado de 900px no se lee. */
  .nosotros { padding-block: 56px; }
  .nosotros__inner {
    grid-template-columns: 1fr;
    row-gap: 36px;
    padding-left: 0px;
    padding-right: 0px;
    justify-items: center;
  }
  .nosotros__media { grid-column: 1; grid-row: 1; margin-top: 0px; max-width: 300px; }
  .nosotros__body  { grid-column: 1; grid-row: 2; width: 100%; max-width: var(--medida); }

  .carrusel { padding-block: 48px 64px; }
  .carrusel__slide { gap: 56px; }

  .producto--a,
  .producto--b {
    grid-template-columns: 1fr;
    row-gap: 28px;
    justify-items: center;
  }
  .producto--a .producto__media,
  .producto--b .producto__media { grid-column: 1; grid-row: 1; }
  .producto--a .producto__body,
  .producto--b .producto__body  { grid-column: 1; grid-row: 2; width: 100%; max-width: var(--medida); }
  .producto__media img { width: auto; max-width: 100%; max-height: 320px; }

  .carrusel__nav { width: 26px; height: 50px; }
  .carrusel__nav img { width: 26px; height: 50px; }
  .carrusel__nav--prev { left: 0px; }
  .carrusel__nav--next { right: 0px; }

  .beneficios { padding-block: 48px; }
  .beneficios__list { grid-template-columns: repeat(2, 1fr); gap: 40px 24px; }
  .beneficio__ico { width: 120px; height: 120px; }
  .beneficio__ico img { max-width: 68px; max-height: 68px; }
}

/* --- ≤767px · mobile_landscape ------------------------------------------ */
@media (max-width: 767px) {
  :root {
    --gutter: 24px;
    --fs-h1: 34px;    --lh-h1: 42px;    --tr-h1: -0.5px;
    --fs-h2: 26px;    --lh-h2: 34px;    --tr-h2: -0.4px;
    --fs-h3: 18px;    --lh-h3: 24px;
    --fs-lead: 18px;  --lh-lead: 28px;
    --fs-body: 16px;  --lh-body: 25px;
  }

  /* -- Cabecera y menú desplegable -- */
  .header__inner { padding-top: 16px; align-items: center; }
  .header__logo img { width: 104px; height: 78px; }

  /* El toggle vuelve a mostrarse: hay que devolver el display explícitamente,
     no basta con redefinir tamaños. */
  .nav__toggle { display: flex; }

  .nav {
    position: absolute;
    inset: 100% 0px auto 0px;
    flex-direction: column;
    align-items: stretch;
    gap: 0px;
    padding: 4px var(--gutter) 16px;
    background: var(--surface-white);
    box-shadow: 0px 16px 32px rgba(5, 10, 48, .14);
    display: none;
  }
  .header[data-open="true"] .nav { display: flex; }
  .header[data-open="true"] .nav__toggle span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .header[data-open="true"] .nav__toggle span:nth-child(2) { opacity: 0; }
  .header[data-open="true"] .nav__toggle span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

  .nav__list { flex-direction: column; align-items: stretch; gap: 0px; }
  .nav__list li + li { border-top: 1px solid var(--surface-tint-2); }
  .nav__link {
    display: block;
    padding-block: 14px;              /* zona táctil ≥44px */
    font-size: 18px;
    line-height: 24px;
  }
  .nav__link.is-active::after { display: none; }
  .nav__link.is-active { color: var(--brand-blue); }
  .lang {
    margin-top: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--surface-tint-2);
    justify-content: flex-start;
  }

  /* -- Hero -- */
  .hero { aspect-ratio: 4 / 3; }
  .hero__brand { width: 200px; height: 25px; margin-bottom: 30px; }

  /* -- Nosotros -- */
  .nosotros { padding-block: 44px 48px; }
  .nosotros__inner { row-gap: 28px; }
  .nosotros__media { max-width: 200px; }
  .nosotros__text { margin-top: 10px; }
  .nosotros .btn { margin-top: 28px; }

  /* -- Carrusel: las flechas bajan del contenido, no le roban ancho -- */
  .carrusel { padding-block: 40px 44px; }
  .carrusel__slide { gap: 44px; }
  .producto--a, .producto--b { row-gap: 22px; justify-items: stretch; }
  .producto__media { display: flex; flex-direction: row; justify-content: center; }
  .producto__media img { max-height: 280px; }
  .producto__brand { margin-bottom: 14px; }
  .producto__text { margin-top: 6px; }

  .carrusel__nav {
    position: static;
    translate: none;
    width: 44px;
    height: 44px;
  }
  .carrusel__nav img { width: 18px; height: 34px; }
  .carrusel__inner {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    row-gap: 20px;
  }
  .carrusel__viewport { grid-row: 1; grid-column: 1; width: 100%; }
  .carrusel__nav--prev { grid-row: 2; grid-column: 1; justify-self: center; translate: -30px 0px; }
  .carrusel__nav--next { grid-row: 2; grid-column: 1; justify-self: center; translate: 30px 0px; }

  /* -- Vídeo: se reencuadra para no perder a las dos personas -- */
  .video {
    aspect-ratio: 4 / 3;
    background-position: 25% center;
  }
  .video__play img { width: 64px; height: 67px; }

  /* -- Beneficios en rejilla 2×2: cuatro apilados eran 700px de scroll -- */
  .beneficios { padding-block: 40px; }
  .beneficios__list { grid-template-columns: repeat(2, 1fr); gap: 32px 20px; }
  .beneficio__ico { width: 112px; height: 112px; margin-bottom: 12px; }
  .beneficio__ico img { max-width: 62px; max-height: 62px; }

  /* -- Pie -- */
  .pie__inner {
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding-block: 18px;
    text-align: center;
  }
}

/* --- ≤478px · mobile_portrait ------------------------------------------- */
@media (max-width: 478px) {
  :root {
    --gutter: 16px;
    --fs-h1: 30px;    --lh-h1: 38px;
    --fs-h2: 24px;    --lh-h2: 32px;
    --fs-h3: 15px;    --lh-h3: 21px;
    --fs-lead: 17px;  --lh-lead: 27px;
    --fs-body: 15px;  --lh-body: 24px;
  }

  .header__inner { padding-top: 12px; }
  .header__logo img { width: 92px; height: 69px; }

  /* Hero en vertical: asset propio recortado del original (el fondo es un
     degradado vertical uniforme, así que el recorte no deja costura).
     Deja aire para la cabecera arriba y para el logo de marca abajo. */
  .hero {
    aspect-ratio: 44 / 63;
    background-image: url("../img/hero-bg-movil.webp");
  }
  .hero__brand { width: 176px; height: 22px; margin-bottom: 28px; }

  .nosotros { padding-block: 36px 40px; }
  .nosotros__media { max-width: 168px; }

  .carrusel { padding-block: 34px 38px; }
  .carrusel__slide { gap: 38px; }
  .producto__media img { max-height: 240px; }

  .video__play img { width: 56px; height: 59px; }

  .beneficios { padding-block: 34px; }
  /* La etiqueta más larga («Socios Comerciales») cabe en dos líneas a partir de
     360px con este hueco y este tracking. Por debajo pasa a tres, que la
     rejilla absorbe sin romperse. */
  .beneficios__list { gap: 26px 10px; }
  .beneficio__label { letter-spacing: -0.2px; }
  .beneficio__ico { width: 96px; height: 96px; margin-bottom: 10px; }
  .beneficio__ico img { max-width: 54px; max-height: 54px; }
}

/* --- Preferencias del usuario ------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
