/* ============================================================
   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;

  /* Navbar height (móvil: 12 + 56 + 12) */
  --navbar-height: 80px;

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

  /* Contenedor — siempre 100% */
  width: 100%;
  max-width: 1920px;
  margin: 0 auto;
}

/* ============================================================
   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; }

/* ============================================================
   PRODUCTS — encuentra tu próximo iPhone
============================================================ */
.products-section {
  padding: 24px var(--content-inset);
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.products-inner {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}
.section-title-l {
  font-size: 24px;
  font-weight: 700;
  line-height: 27px;
  color: var(--text-primary);
}
/* Carrusel */
.products-carousel {
  position: relative;
  width: 100%;
}
.products-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: 0 calc(0px - var(--content-inset));
  padding: 0 var(--content-inset) 4px;
}
.products-scroll::-webkit-scrollbar { display: none; }
.products-scroll:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}
.products-carousel-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 40px;
  height: 40px;
  margin-top: -20px;
  border: none;
  border-radius: 50%;
  background: var(--bg-white);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.15s;
}
.products-carousel-nav:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.products-carousel-nav:active {
  transform: scale(0.96);
}
.products-carousel-nav[hidden] {
  display: none;
}
.products-carousel-nav--prev { left: var(--content-inset); }
.products-carousel-nav--next { right: var(--content-inset); }
.product-card {
  background: var(--bg-white);
  border-radius: var(--radius-16);
  box-shadow: var(--shadow-flat);
  width: 240px;
  min-width: 240px;
  flex-shrink: 0;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 4px;
  overflow: hidden;
}
.product-card-title-wrap {
  padding: 12px;
}
.product-card-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 22.5px;
  color: var(--text-primary);
}
.product-card-image {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-6);
  overflow: hidden;
  background: var(--bg-white);
  position: relative;
}
.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.product-card-btn-wrap { padding: 12px; }
.page-container .btn-product {
  display: block;
  width: 100%;
  text-align: center;
  background: var(--accent-blue);
  color: var(--text-white);
  font-size: 14px;
  font-weight: 600;
  line-height: 18px;
  padding: 12px 16px;
  border-radius: var(--radius-6);
  transition: background 0.15s;
  white-space: nowrap;
}
.page-container .btn-product:hover { background: var(--accent-blue-dark); }

/* ============================================================
   MOBILE — overrides carrusel (max-width: 767px)
============================================================ */
@media (max-width: 767px) {
  .products-section {
    padding-top: 12px;
    padding-bottom: 20px;
    padding-left: 0;
    padding-right: 0;
    overflow: visible;
  }
  .products-title-desktop {
    padding-inline: var(--content-inset);
  }
  .products-inner {
    gap: 16px;
    overflow: visible;
  }
  /* Carrusel móvil: sin chevrones (gesto horizontal) */
  .products-carousel {
    overflow: visible;
  }
  .products-carousel-nav {
    display: none !important;
  }
  .products-scroll {
    margin: 0;
    padding: 0 4px 4px;
    scroll-padding-inline: 4px;
  }
  .products-scroll .product-card {
    scroll-snap-stop: always;
  }
  .products-scroll .product-card:last-child {
    scroll-snap-align: end;
  }
}

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

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

  /* Products section desktop */
  .products-section {
    padding: 80px 0;
    align-items: center;
  }
  .products-title-desktop {
    font-size: 32px;
    font-weight: 700;
    line-height: 36px;
    text-align: center;
  }
  .products-carousel {
    max-width: 1280px;
  }
  .products-scroll {
    margin: 0;
    padding: 0 0 4px;
  }
  .products-carousel-nav--prev { left: var(--content-inset); }
  .products-carousel-nav--next { right: var(--content-inset); }

  /* Contenedor products desktop */
  .products-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 44px;
    width: 100%;
    align-items: center;
  }
}
