/* =========================================================
   BASE — reset, tipografía, accesibilidad, utilidades y movimiento
   ========================================================= */
@layer base {
  *, *::before, *::after { box-sizing: border-box; }

  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-total) + 16px);
    background: var(--linen);
  }

  body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--linen);
    color: var(--ink);
    font-family: var(--font);
    font-size: var(--fs-base);
    line-height: var(--lh-body);
    -webkit-font-smoothing: antialiased;
    font-synthesis: none;
    overflow-x: hidden;
  }
  body.is-locked { overflow: hidden; }
  main { flex: 1 0 auto; outline: none; }

  img, svg, video { display: block; max-width: 100%; }
  img, video { height: auto; }
  a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
  button, input, select, textarea { font: inherit; color: inherit; }
  button { cursor: pointer; background: none; border: 0; padding: 0; }
  ul, ol { margin: 0; padding: 0; list-style: none; }
  h1, h2, h3, h4, p, figure, dl, dd, fieldset, blockquote { margin: 0; }
  fieldset { border: 0; padding: 0; min-width: 0; }
  hr { border: 0; border-top: 1px solid var(--line); margin: 8px 0; }
  [hidden] { display: none !important; }

  :focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
  ::selection { background: var(--ink); color: #fff; }

  /* Tipografía (estilo sereno, 28/10): títulos en Jost 500, livianos y sin mayúsculas, con el interletrado apenas cerrado;
     el resto en Instrument Sans. */
  h1, h2, .h1, .h2, .display { font-family: var(--font-display); font-weight: var(--heading-weight); letter-spacing: -0.018em; line-height: var(--lh-tight); text-wrap: balance; }
  h3, .h3 { font-family: var(--font-display); font-weight: 500; font-size: var(--fs-lg); line-height: 1.3; letter-spacing: -0.005em; }
  .h1 { font-size: clamp(2.125rem, 1.5rem + 2.6vw, 3.5rem); }
  .h2 { font-size: var(--fs-2xl); }
  .display { font-size: var(--fs-display); line-height: 1.02; letter-spacing: -0.02em; }
  .lead { font-size: var(--fs-lg); color: var(--ink-2); line-height: 1.55; }
  .eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); font-weight: 500; color: var(--muted); }
  .eyebrow--light { color: var(--on-dark-muted); }
  p { text-wrap: pretty; }

  .icon { width: 20px; height: 20px; flex: none; }
  .icon--lg { width: 28px; height: 28px; }
  .icon--sm { width: 14px; height: 14px; }
  .icon--flip { transform: scaleX(-1); }

  /* Accesibilidad */
  .sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .skip-link { position: fixed; left: 12px; top: -64px; z-index: 1000; background: var(--espresso); color: var(--on-dark); padding: 12px 18px; border-radius: var(--radius-sm); transition: top var(--fast); }
  .skip-link:focus { top: 12px; }
  .sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
  /* Campo trampa antibots: fuera de pantalla (no display:none para que los bots lo completen) */
  .hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
  .noscript { padding: 14px; text-align: center; background: var(--warn-soft); color: var(--warn); }
  .center { text-align: center; }

  /* Ambientes: el color suave de cada categoría */
  .room--cocina { --room: var(--room-cocina); }
  .room--hogar { --room: var(--room-hogar); }
  .room--cuidado-personal { --room: var(--room-cuidado); }
  .room--descanso { --room: var(--room-descanso); }
  .room--tecnologia { --room: var(--room-tecnologia); }
  .room--mascotas { --room: var(--room-mascotas); }

  /* Carga */
  .skeleton { position: relative; overflow: hidden; background: var(--tile); border-radius: 0; }
  .skeleton::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgb(255 255 255 / 60%) 50%, transparent 80%); transform: translateX(-100%); animation: shimmer 1.6s infinite; }
  .skeleton--card { aspect-ratio: 4 / 5.9; }
  .skeleton--cat { aspect-ratio: 1; }
  .skeleton--pdp { aspect-ratio: 1; }
  .skeleton--line { height: 28px; margin-bottom: 14px; }
  .skeleton--short { width: 55%; }
  .skeleton--block { height: 220px; }
  @keyframes shimmer { to { transform: translateX(100%); } }
  @keyframes spin { to { transform: rotate(360deg); } }
  @keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } }
  @keyframes fadeIn { from { opacity: 0; } }

  /* Aparición suave al bajar, solo en grillas de productos. Usa la línea de tiempo de scroll del navegador:
     si el navegador no la soporta, el contenido se ve igual (nunca queda oculto esperando JavaScript).
     E7 (16/10/2026): solo se mueve un poco, sin transparencia: aunque la animación no corra (captura de página completa,
     buscadores, sin bajar), todo se ve. */
  @supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
      .product-grid > .card { animation: riseIn linear both; animation-timeline: view(); animation-range: entry 0% entry 35%; }
    }
  }
  @keyframes riseIn { from { translate: 0 14px; } to { translate: 0 0; } }

  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  }
}

/* Transición suave entre páginas (20/10): fundido corto del contenido y la foto de la tarjeta que "viaja" a la ficha
   (main.js le pone el nombre a la foto tocada). Va fuera de las capas porque es una regla de navegación, no de estilo.
   Con «reducir movimiento» no hay transición, y los navegadores sin soporte navegan como siempre. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 180ms; }
::view-transition-group(product-photo) { animation-duration: 320ms; animation-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1); }
.pdp__img { view-transition-name: product-photo; }
