/* ============================================================
   FUENTES — Proxima Nova desde CDN MercadoLibre
============================================================ */
@font-face {
  font-family: 'Proxima Nova';
  src: url('https://http2.mlstatic.com/ui/webfonts/v3.0.0/proxima-nova/proximanova-regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Proxima Nova';
  src: url('https://http2.mlstatic.com/ui/webfonts/v3.0.0/proxima-nova/proximanova-semibold.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Proxima Nova';
  src: url('https://http2.mlstatic.com/ui/webfonts/v3.0.0/proxima-nova/proximanova-bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

/* ============================================================
   TOKENS — design system (scope CALM: .page-container en lugar de :root)
============================================================ */
.page-container {
  /* ---- COLORES ---- */
  --brand-yellow: #FFE600;
  --accent-blue: #3483FA;
  --accent-blue-dark: #2968C8;
  --text-primary: rgba(0,0,0,0.9);
  --text-secondary: rgba(0,0,0,0.55);
  --text-white: #FFFFFF;
  --text-link: #3483FA;
  --text-positive: #00A650;
  --bg-white: #FFFFFF;
  --bg-gray: #F5F5F5;
  --gray-dark: #1A1A1A;
  --divider: rgba(0,0,0,0.1);
  --shadow-flat: 0 1px 2px rgba(0,0,0,0.12);
  --andes-surface-secondary-idle: #f4f5f9;
  --andes-text-secondary-legal: #646587;
  --andes-text-primary-heavy: #282834;
  --footer-strip-bg: #f7f7f7;

  /* ---- BORDER RADIUS ---- */
  --radius-2: 2px;
  --radius-4: 4px;
  --radius-6: 6px;
  --radius-12: 12px;
  --radius-16: 16px;
  --radius-20: 20px;
  --radius-full: 100px;

  /* ---- ALIAS CALM ---- */
  --r-hero: 24px;
  --r-card: 20px;
  --r-sm: 12px;
  --r-pill: 9999px;

  /* ---- ESPACIADO (escala 8px) ---- */
  --s1: 8px;
  --s2: 16px;
  --s3: 24px;
  --s4: 32px;
  --s5: 40px;
  --s6: 48px;
  --s7: 56px;
  --s8: 64px;
  --s10: 80px;

  /* ---- TIPOGRAFÍA ---- */
  --font: 'Proxima Nova', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Inset horizontal */
  --page-gutter: 8px;
  --content-inset: 20px;

  /* Hero viewport-fill — peek del bloque siguiente */
  --lp-body-pad-top: 8px;  /* padding-top de .page-main */
  --lp-body-gap:     0px;  /* bloque CALM aislado: único hijo en .page-main, sin gap */
  --lp-peek:         20px; /* sneak peek del siguiente bloque CALM */
  --lp-calm-header-h: 48px; /* altura efectiva del navbar nativo de CALM */
  --lp-hero-h: calc(100svh - var(--lp-calm-header-h) - var(--lp-body-pad-top) - var(--lp-body-gap) - var(--lp-peek));
  /* Usa el viewport pequeño: CTA y peek visibles aun con la barra del navegador expandida. */

  /* Contenedor — siempre 100% */
  width: 100%;
  max-width: 1920px;
  margin: 0 auto;
  padding-top: 8px;  /* gap blanco entre borde superior y .page-bg */
}

/* ============================================================
   RESET & BASE
============================================================ */
.page-container img { display: block; max-width: 100%; }
.page-container a { text-decoration: none; color: inherit; }
.page-container button { font-family: var(--font); cursor: pointer; border: none; background: none; }

/* ============================================================
   PAGE WRAPPER — fondo gradiente amarillo
============================================================ */
.page-bg {
  position: relative;
  background:
    linear-gradient(180deg, #FFE600 0%, rgba(255,230,0,0) 100%) no-repeat top / 100% 84%,
    #FFFFFF;
  overflow: visible;
}
.page-main {
  position: relative;
  z-index: 1;
  padding: 0 var(--page-gutter) var(--page-gutter);  /* top-gap viene de .page-container */
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (max-width: 767px) {
  /* Hero flush al top: quitar el padding-top del contenedor (mantener laterales y bottom 8px) */
  .page-container { padding-top: 0; }
  .hero {
    min-height: var(--lp-hero-h);
    max-height: var(--lp-hero-h);
    box-sizing: border-box;
  }
  .hero-image {
    flex: 1 1 0;
    min-height: 0;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: center;
  }
  .page-container .hero-image img {
    position: absolute;
    inset: 0 var(--content-inset);
    width: calc(100% - var(--content-inset) - var(--content-inset));
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: bottom center;
    /* Safari recibe límites definidos antes de ajustar la imagen. */
  }
  .hero-content {
    flex-shrink: 0;
  }
}

/* ============================================================
   HERO — sección amarilla con iPhone
============================================================ */
.hero {
  background: var(--brand-yellow);
  border-radius: var(--radius-16);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding-top: 32px;
  padding-bottom: 24px;
  overflow: hidden;
}
.hero-image {
  width: 100%;
  position: relative;
}
.hero-image img {
  width: 100%;
  display: block;
  max-width: none;
  object-fit: contain;
  object-position: bottom center;
}
.hero-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: flex-start;
  padding: 0 var(--content-inset);
  width: 100%;
  min-width: 0;
}
.hero-text {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  min-width: 0;
}
.badge-psn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  background: var(--gray-dark);
  color: var(--text-white);
  font-size: 14px;
  font-weight: 600;
  line-height: 17.5px;
  text-box-trim: trim-both;
  text-box-edge: cap alphabetic;
  padding: 3px 8px;
  border-radius: var(--radius-2);
  white-space: nowrap;
}
.hero h1 {
  font-size: 32px;
  font-weight: 700;
  line-height: 36px;
  color: var(--text-primary);
  overflow-wrap: break-word;
}
.hero-subtitle {
  font-size: 16px;
  font-weight: 400;
  line-height: 20px;
  color: var(--text-primary);
}
.page-container .btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-blue);
  color: var(--text-white);
  font-size: 16px;
  font-weight: 600;
  line-height: 18px;
  padding: 17px 24px 15px;
  border-radius: var(--radius-6);
  width: 100%;
  text-align: center;
  transition: background 0.15s;
}
.page-container .btn-primary:hover { background: var(--accent-blue-dark); }
.hero-cta { width: 100%; }

/* ============================================================
   DESKTOP — 768px+
============================================================ */
@media (min-width: 768px) {

  .hero-title-mobile-break { display: none; }

  /* Tokens desktop */
  .page-container {
    --content-inset: 40px;
  }

  /* Gradiente oculto en desktop — gaps del hero card quedan en blanco (Figma) */
  .page-bg { background: #FFFFFF; }

  /* Hero CTA desktop */
  .hero-cta { width: auto; }
  .btn-primary { width: auto; padding: 17px 32px 15px; }
}

/* Tablet 768-1023px: sin gradiente (cubierto por el override ≥768px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .page-bg { background: #FFFFFF; }
}

/* ============================================================
   HERO — tablet intermedio (768px–1335px)
============================================================ */
@media (min-width: 768px) and (max-width: 1335px) {
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(200px, 34%);
    align-items: end;
    gap: clamp(24px, 4vw, 40px);
    padding-inline: var(--content-inset);
    padding-top: clamp(24px, 3vw, 40px);
    padding-bottom: clamp(24px, 3vw, 40px);
    overflow: visible;
  }
  .hero-content {
    grid-column: 1;
    grid-row: 1;
    padding: 0;
    min-width: 0;
    gap: clamp(20px, 3vw, 32px);
  }
  .hero-image {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: clamp(260px, 38vw, 400px);
    position: relative;
    align-self: end;
  }
  .hero-image img {
    position: static;
    width: 100%;
    height: auto;
    max-height: clamp(260px, 38vw, 400px);
    object-fit: contain;
    object-position: bottom right;
  }
  .hero-text {
    gap: clamp(12px, 2vw, 16px);
  }
  .hero h1 {
    font-size: clamp(36px, 4.5vw, 56px);
    line-height: 1.05;
    letter-spacing: clamp(-1.2px, -0.15vw, -2.5px);
  }
  .hero-subtitle {
    font-size: clamp(16px, 1.8vw, 18px);
    line-height: 1.25;
  }
}

/* Sub-tier 768–1023: menos ancho para la columna imagen */
@media (min-width: 768px) and (max-width: 1023px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(180px, 30%);
  }
  .hero h1 {
    font-size: clamp(32px, 5vw, 44px);
  }
}

/* ============================================================
   HERO — desktop Figma (≥1336px)
============================================================ */
@media (min-width: 1336px) {
  .hero {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    padding: var(--content-inset);
    padding-top: var(--content-inset);
    padding-bottom: var(--content-inset);
    gap: 60px;
    overflow: visible;
  }
  .hero-image {
    width: 480px;
    height: 455px;
    flex-shrink: 1;
    min-width: 240px;
    position: relative;
    order: 2;
  }
  .hero-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: contain;
    object-position: bottom right;
  }
  .hero-content {
    flex: 0 1 820px;
    width: 100%;
    max-width: 820px;
    min-width: 0;
    padding: 0;
    gap: 32px;
    order: 1;
    align-self: flex-end;
  }
  .hero-text {
    gap: 16px;
  }
  .hero h1 {
    font-size: 70px;
    font-weight: 700;
    line-height: 70px;
    letter-spacing: -3.5px;
    overflow-wrap: break-word;
  }
  .hero-subtitle {
    font-size: 20px;
    line-height: 25px;
  }
}
