/* ==========================================================================
   iCase — DESIGN SYSTEM v2.0  ·  "Bloque"
   Archivo: static/css/icase-tokens.css
   Carga: PRIMERO, antes que cualquier otro CSS de iCase.

   Dirección: el azul #3498db y el fuego del logo son la identidad. Se usan
   como campos sólidos, no como detalles. Nada flota: los bloques se separan
   con filetes de 1px, no con sombras. La UI es recta; las fotos llevan el
   radio de una funda. Minimalista sin parecerse a Apple.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TOKENS
   -------------------------------------------------------------------------- */
:root {

  /* ---- Marca ---- */
  --ic-blue:       #3498db;   /* exacto al de icase.ar */
  --ic-blue-hover: #2C89C9;
  --ic-blue-deep:  #1F6FA8;   /* pressed / texto de enlace sobre blanco */
  --ic-blue-wash:  #EAF4FB;   /* fondos suaves */
  --ic-blue-ring:  rgba(52, 152, 219, .40);

  /* ---- Fuego del logo: SOLO urgencia (promos, ofertas, últimas unidades) ---- */
  --ic-flame:      #FF4F1F;
  --ic-flame-deep: #DC0000;
  --ic-flame-wash: #FFF0EB;
  --ic-gold:       #FBC929;

  /* ---- Neutros con sesgo frío (elegidos, no heredados) ---- */
  --ic-ink:        #101418;   /* texto principal */
  --ic-ink-2:      #3B444D;   /* texto secundario */
  --ic-ink-3:      #6B767F;   /* terciario / metadatos */
  --ic-line:       #DDE4EA;   /* filetes: la unidad estructural del sistema */
  --ic-line-soft:  #EBF0F4;
  --ic-mist:       #EDF1F5;   /* fondo de sección alterna */
  --ic-paper:      #FFFFFF;

  /* ---- Sobre fondos oscuros / azules ---- */
  --ic-on-blue:        #FFFFFF;
  --ic-on-blue-soft:   rgba(255,255,255,.80);
  --ic-on-blue-line:   rgba(255,255,255,.26);
  --ic-on-ink:         #F2F5F8;
  --ic-on-ink-soft:    #9AA5AE;

  /* ---- Semántico ---- */
  --ic-ok:         #12874E;
  --ic-ok-wash:    #E7F4ED;
  --ic-warn:       #A9690A;
  --ic-warn-wash:  #FDF3E2;
  --ic-wa:         #25D366;

  /* ---- Tipografía ----
     Figtree: geométrica de x-height alta, la más cercana a las letras del logo.
     Mono del sistema para metadatos: 0 KB de descarga. */
  --ic-font: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --ic-mono: ui-monospace, SFMono-Regular, "SF Mono", "Roboto Mono", Menlo, Consolas, monospace;

  /* Escala fluida 375px → 1440px */
  --ic-fs-display: clamp(2.0625rem, 1.47rem + 2.53vw, 3.75rem); /* 33 → 60 */
  --ic-fs-h1:      clamp(1.875rem, 1.34rem + 2.28vw, 2.9rem);   /* 30 → 46 */
  --ic-fs-h2:      clamp(1.5rem, 1.18rem + 1.37vw, 2.25rem);    /* 24 → 36 */
  --ic-fs-h3:      clamp(1.1875rem, 1.06rem + 0.53vw, 1.5rem);  /* 19 → 24 */
  --ic-fs-h4:      1.0625rem;
  --ic-fs-lead:    clamp(1rem, 0.96rem + 0.16vw, 1.125rem);
  --ic-fs-body:    0.9375rem;
  --ic-fs-sm:      0.8125rem;
  --ic-fs-xs:      0.6875rem;

  --ic-lh-tight:   1.02;
  --ic-lh-snug:    1.16;
  --ic-lh-base:    1.6;

  --ic-ls-display: -0.035em;   /* apretado: el logo es apretado */
  --ic-ls-title:   -0.025em;
  --ic-ls-body:    -0.005em;
  --ic-ls-mono:    0.12em;     /* metadatos: separados y en mayúscula */

  --ic-fw-regular: 400;
  --ic-fw-medium:  500;
  --ic-fw-semi:    600;
  --ic-fw-bold:    700;
  --ic-fw-black:   800;        /* display: el peso del logo */

  /* ---- Espaciado (base 4) ---- */
  --ic-s1: 4px;   --ic-s2: 8px;   --ic-s3: 12px;  --ic-s4: 16px;
  --ic-s5: 20px;  --ic-s6: 24px;  --ic-s7: 32px;  --ic-s8: 40px;
  --ic-s9: 48px;  --ic-s10: 64px; --ic-s11: 80px; --ic-s12: 96px;

  --ic-section-y:    clamp(52px, 3.4vw + 38px, 100px);
  --ic-section-y-sm: clamp(32px, 2vw + 24px, 60px);

  /* ---- Layout ---- */
  --ic-container:  1320px;
  --ic-container-narrow: 720px;
  --ic-gutter:     20px;
  --ic-header-h:   56px;
  --ic-adbar-h:    34px;

  /* ---- Radios — LA FIRMA DEL SISTEMA ----
     UI recta. Las fotos llevan el radio de una funda. */
  --ic-r-ui:    2px;    /* botones, inputs, chips, badges */
  --ic-r-case:  24px;   /* SOLO contenedores de foto / producto */
  --ic-r-case-sm: 14px;
  --ic-r-pill:  999px;  /* solo el contador del carrito */

  /* ---- Elevación: casi inexistente. La estructura la hacen los filetes. ---- */
  --ic-sh-pop:  0 8px 28px rgba(16, 20, 24, .12);   /* mega menú */
  --ic-sh-over: 0 0 0 100vmax rgba(16, 20, 24, .45); /* overlay */
  --ic-sh-drawer: 12px 0 48px rgba(16, 20, 24, .18);
  --ic-sh-focus: 0 0 0 3px var(--ic-blue-ring);

  /* ---- Movimiento: cortes, no transiciones largas ---- */
  --ic-ease:     cubic-bezier(.32, .72, 0, 1);
  --ic-ease-out: cubic-bezier(.16, 1, .3, 1);
  --ic-t-fast:   120ms;
  --ic-t-base:   200ms;
  --ic-t-slow:   340ms;

  /* ---- Capas ---- */
  --ic-z-sticky: 100;  --ic-z-header: 900;  --ic-z-overlay: 990;
  --ic-z-drawer: 1000; --ic-z-modal: 1100;  --ic-z-toast: 1200;
}

@media (min-width: 768px)  { :root { --ic-gutter: 28px; --ic-header-h: 64px; } }
@media (min-width: 1200px) { :root { --ic-gutter: 40px; --ic-header-h: 68px; } }

/* --------------------------------------------------------------------------
   2. RESET  (envuelto en :where() → especificidad 0, nunca pisa componentes)
   -------------------------------------------------------------------------- */
.ic, .ic *, .ic *::before, .ic *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
}

body {
  margin: 0;                     /* el UA mete 8px y desalinea todo bloque a sangre */
  font-family: var(--ic-font);
  font-size: var(--ic-fs-body);
  line-height: var(--ic-lh-base);
  letter-spacing: var(--ic-ls-body);
  color: var(--ic-ink);
  background: var(--ic-paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:where(.ic) :where(img, video) { display: block; max-width: 100%; height: auto; }
:where(.ic) :where(svg)        { display: block; width: 1em; height: 1em; flex: none; }
:where(.ic) :where(a)          { color: inherit; text-decoration: none; }
:where(.ic) :where(button, input, select, textarea) { font: inherit; color: inherit; }

/* Rio estiliza elementos semánticos POR NOMBRE (footer, header, aside…) con
   sus variables --footer-background y compañía. Un <footer> dentro de una
   tarjeta nuestra heredaba fondo tinta y texto tinta: el nombre desaparecía.
   Esto los neutraliza cuando están ANIDADOS dentro de un bloque .ic.
   Va en :where() → especificidad 0, así .ic-header y .ic-footer siguen mandando. */
:where(.ic) :where(footer, header, article, aside, nav, main, section) {
  background: none; color: inherit; padding: 0; margin: 0;
  width: auto; min-width: 0; font-size: inherit;
}

.ic :focus-visible { outline: none; box-shadow: var(--ic-sh-focus); border-radius: var(--ic-r-ui); }

/* --------------------------------------------------------------------------
   3. TIPOGRAFÍA
   -------------------------------------------------------------------------- */
.ic-display, .ic-h1, .ic-h2, .ic-h3, .ic-h4 {
  margin: 0; color: var(--ic-ink); text-wrap: balance;
}
.ic-display { font-size: var(--ic-fs-display); line-height: var(--ic-lh-tight); letter-spacing: var(--ic-ls-display); font-weight: var(--ic-fw-black); }
.ic-h1      { font-size: var(--ic-fs-h1);      line-height: var(--ic-lh-tight); letter-spacing: var(--ic-ls-display); font-weight: var(--ic-fw-black); }
.ic-h2      { font-size: var(--ic-fs-h2);      line-height: var(--ic-lh-snug);  letter-spacing: var(--ic-ls-display); font-weight: var(--ic-fw-bold); }
.ic-h3      { font-size: var(--ic-fs-h3);      line-height: 1.22;               letter-spacing: var(--ic-ls-title);   font-weight: var(--ic-fw-bold); }
.ic-h4      { font-size: var(--ic-fs-h4);      line-height: 1.35;               letter-spacing: var(--ic-ls-title);   font-weight: var(--ic-fw-semi); }

.ic-lead  { font-size: var(--ic-fs-lead); line-height: 1.5; color: var(--ic-ink-2); margin: 0; text-wrap: pretty; }
:is(.ic-display, .ic-h1, .ic-h2, .ic-h3, .ic-h4) + .ic-lead { margin-top: var(--ic-s4); }
.ic-muted { color: var(--ic-ink-3); }
.ic-sm    { font-size: var(--ic-fs-sm); }

/* Metadato: la voz secundaria del sistema. Mono, mayúscula, separada. */
.ic-meta {
  display: inline-block;
  font-family: var(--ic-mono);
  font-size: var(--ic-fs-xs);
  font-weight: var(--ic-fw-medium);
  letter-spacing: var(--ic-ls-mono);
  text-transform: uppercase;
  color: var(--ic-ink-3);
}
.ic-meta--blue  { color: var(--ic-blue-deep); }
.ic-meta--flame { color: var(--ic-flame-deep); }
.ic-meta--on-dark { color: var(--ic-on-blue-soft); }

/* --------------------------------------------------------------------------
   4. LAYOUT
   -------------------------------------------------------------------------- */
.ic-container {
  width: 100%; max-width: var(--ic-container);
  margin-inline: auto; padding-inline: var(--ic-gutter);
}
.ic-container--narrow { max-width: var(--ic-container-narrow); }

.ic-section { padding-block: var(--ic-section-y); }
.ic-section--sm     { padding-block: var(--ic-section-y-sm); }
.ic-section--mist   { background: var(--ic-mist); }
.ic-section--ink    { background: var(--ic-ink);  color: var(--ic-on-ink); }
.ic-section--blue   { background: var(--ic-blue); color: var(--ic-on-blue); }
.ic-section--ruled  { border-top: 1px solid var(--ic-line); }

/* Encabezado de sección: filete + metadato + título. Estructura, no adorno. */
.ic-shead { margin-bottom: var(--ic-s7); }
.ic-shead__top {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--ic-s4);
  padding-bottom: var(--ic-s3);
  border-bottom: 2px solid var(--ic-ink);
  margin-bottom: var(--ic-s5);
}
.ic-shead__title { max-width: 26ch; }
.ic-shead .ic-lead { margin-top: var(--ic-s3); max-width: 56ch; }

.ic-more {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--ic-mono); font-size: var(--ic-fs-xs);
  letter-spacing: var(--ic-ls-mono); text-transform: uppercase;
  font-weight: var(--ic-fw-medium);
  color: var(--ic-blue-deep); white-space: nowrap;
}
.ic-more svg { width: 13px; height: 13px; transition: transform var(--ic-t-fast) var(--ic-ease); }
.ic-more:hover svg { transform: translateX(3px); }

.ic-grid { display: grid; gap: var(--ic-s5); }
.ic-grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 768px) {
  .ic-grid--3 { grid-template-columns: repeat(3, 1fr); }
  .ic-grid--4 { grid-template-columns: repeat(4, 1fr); }
}

/* Carrusel horizontal nativo (sin JS) */
.ic-rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: var(--ic-rail-item, 76%);
  gap: var(--ic-s4);
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding-inline: var(--ic-gutter);
  padding-inline: var(--ic-gutter); margin-inline: calc(var(--ic-gutter) * -1);
  padding-bottom: var(--ic-s2); scrollbar-width: none;
}
.ic-rail::-webkit-scrollbar { display: none; }
.ic-rail > * { scroll-snap-align: start; }
@media (min-width: 640px)  { .ic-rail { --ic-rail-item: 46%; } }
@media (min-width: 1024px) {
  .ic-rail {
    grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0,1fr));
    overflow: visible; padding-inline: 0; margin-inline: 0;
  }
}

/* --------------------------------------------------------------------------
   5. BOTONES — rectos. 2px de radio, nada más.
   -------------------------------------------------------------------------- */
.ic-btn {
  --_bg: var(--ic-blue); --_fg: #fff; --_bd: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--ic-s2);
  min-height: 48px; padding: 0 var(--ic-s6);
  border: 1.5px solid var(--_bd); border-radius: var(--ic-r-ui);
  background: var(--_bg); color: var(--_fg);
  font-size: var(--ic-fs-body); font-weight: var(--ic-fw-bold);
  letter-spacing: -0.01em; line-height: 1;
  cursor: pointer; text-align: center; user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--ic-t-fast) var(--ic-ease),
              color var(--ic-t-fast) var(--ic-ease),
              border-color var(--ic-t-fast) var(--ic-ease);
}
.ic-btn:hover  { background: var(--ic-blue-hover); }
.ic-btn:active { background: var(--ic-blue-deep); }
.ic-btn[disabled], .ic-btn.is-disabled { opacity: .4; pointer-events: none; }
.ic-btn svg { width: 18px; height: 18px; }

.ic-btn--ink     { --_bg: var(--ic-ink); }
.ic-btn--ink:hover { background: #000; }
.ic-btn--flame   { --_bg: var(--ic-flame); }
.ic-btn--flame:hover { background: var(--ic-flame-deep); }
.ic-btn--outline { --_bg: transparent; --_fg: var(--ic-ink); --_bd: var(--ic-ink); }
.ic-btn--outline:hover { background: var(--ic-ink); color: #fff; }
.ic-btn--paper   { --_bg: #fff; --_fg: var(--ic-ink); }
.ic-btn--paper:hover { background: var(--ic-mist); }
.ic-btn--ghost-light { --_bg: transparent; --_fg: #fff; --_bd: rgba(255,255,255,.5); }
.ic-btn--ghost-light:hover { background: #fff; color: var(--ic-ink); border-color: #fff; }
.ic-btn--wa      { --_bg: var(--ic-wa); --_fg: #06301A; }
.ic-btn--wa:hover { background: #1FBF5B; }

.ic-btn--lg    { min-height: 54px; padding-inline: var(--ic-s7); font-size: 1rem; }
.ic-btn--sm    { min-height: 38px; padding-inline: var(--ic-s4); font-size: var(--ic-fs-sm); }
.ic-btn--block { width: 100%; }

/* --------------------------------------------------------------------------
   6. ETIQUETAS
   -------------------------------------------------------------------------- */
.ic-tag {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px;
  border-radius: var(--ic-r-ui);
  background: var(--ic-ink); color: #fff;
  font-family: var(--ic-mono); font-size: var(--ic-fs-xs);
  font-weight: var(--ic-fw-medium); letter-spacing: .06em;
  text-transform: uppercase; line-height: 1; white-space: nowrap;
}
.ic-tag--flame { background: var(--ic-flame); }
.ic-tag--blue  { background: var(--ic-blue); }
.ic-tag--ok    { background: var(--ic-ok); }
.ic-tag--soft  { background: var(--ic-mist); color: var(--ic-ink-2); }

.ic-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border: 1px solid var(--ic-line); border-radius: var(--ic-r-ui);
  background: #fff; color: var(--ic-ink-2);
  font-size: var(--ic-fs-sm); font-weight: var(--ic-fw-medium);
  white-space: nowrap;
  transition: border-color var(--ic-t-fast) var(--ic-ease), color var(--ic-t-fast) var(--ic-ease);
}
.ic-chip:hover, .ic-chip.is-active { border-color: var(--ic-ink); color: var(--ic-ink); }

/* --------------------------------------------------------------------------
   7. MEDIA — el único lugar del sistema con esquinas blandas.
   Es la silueta de una funda: por eso solo la llevan las fotos.
   -------------------------------------------------------------------------- */
.ic-media {
  position: relative; overflow: hidden;
  background: var(--ic-mist);
  border-radius: var(--ic-r-case);
}
.ic-media--sm   { border-radius: var(--ic-r-case-sm); }
.ic-media--flat { border-radius: 0; }
.ic-media--1x1  { aspect-ratio: 1 / 1; }
.ic-media--4x5  { aspect-ratio: 4 / 5; }
.ic-media--4x3  { aspect-ratio: 4 / 3; }
.ic-media--16x9 { aspect-ratio: 16 / 9; }
.ic-media > img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform var(--ic-t-slow) var(--ic-ease-out);
}
.ic-media--contain > img { object-fit: contain; }

/* --------------------------------------------------------------------------
   8. UTILIDADES
   -------------------------------------------------------------------------- */
.ic-vh {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
@media (max-width: 1023.98px) { .ic-hide-mobile  { display: none !important; } }
@media (min-width: 1024px)    { .ic-hide-desktop { display: none !important; } }
.ic-rule { height: 1px; background: var(--ic-line); border: 0; margin: 0; }
.ic-nowrap { white-space: nowrap; }

.ic-reveal { opacity: 0; }
.ic-reveal.is-in { opacity: 1; transition: opacity var(--ic-t-slow) var(--ic-ease); }
@media (prefers-reduced-motion: reduce) { .ic-reveal { opacity: 1; } }

body.ic-no-scroll { overflow: hidden; }

/* Secciones bajo el pliegue: el navegador se saltea su render hasta que
   se acercan al viewport. Baja el trabajo del hilo principal en la carga
   (mejora INP y TBT) sin cambiar nada visualmente.
   `contain-intrinsic-size: auto` hace que recuerde el alto real → sin CLS. */
.ic-section--defer {
  content-visibility: auto;
  contain-intrinsic-size: auto 620px;
}

/* --------------------------------------------------------------------------
   9. OVERRIDES DEL TEMA RIO — alinea el resto de la tienda con el sistema
   -------------------------------------------------------------------------- */
:root {
  --accent-color:      #3498db;
  --button-background: #3498db;
  --button-foreground: #FFFFFF;
  --label-background:  #FF4F1F;
  --label-foreground:  #FFFFFF;
  --header-background: #3498db;
  --header-foreground: #FFFFFF;
  --adbar-background:  #101418;
  --adbar-foreground:  #FFFFFF;
  --footer-background: #101418;
  --footer-foreground: #F2F5F8;
  --main-foreground:   #101418;
  --success:           #12874E;
  --danger:            #DC0000;
  --heading-font:      var(--ic-font);
  --body-font:         var(--ic-font);
  --title-font-weight: 800;
}
