/* ==========================================================================
   LAURICELLA ÁRIDOS · tokens.css
   Sistema de marca "afiche de corralón": rojo rombo, azul plano técnico,
   amarillo señal, hierro. Paleta muestreada de referencias/f_01.jpg y f_02.jpg
   (ver DESIGN.md para contrastes y usos permitidos).
   Rutas de imágenes relativas a sitio/assets/css/ -> ../img/
   ========================================================================== */

/* ---- Fuentes self-hosted (11 · a11y/perf) ---------------------------------
   Antes: Google Fonts por <link> (CSS render-blocking + 2 orígenes extra).
   Solo subset latin y solo los pesos que se usan. El 900 itálica (H1 del hero)
   va con <link rel="preload"> en index.html.
   Fallbacks "* fb": misma métrica que Barlow (ancho medido con fontTools sobre el
   copy del hero) para que el swap no corra el layout (CLS). */
@font-face { font-family: "Barlow Condensed"; font-style: italic; font-weight: 900; font-display: swap; src: url("../fonts/barlow-condensed-900i.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: italic; font-weight: 800; font-display: swap; src: url("../fonts/barlow-condensed-800i.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: italic; font-weight: 700; font-display: swap; src: url("../fonts/barlow-condensed-700i.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/barlow-condensed-700.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/barlow-400.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/barlow-500.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/barlow-700.woff2") format("woff2"); }
/* Display: Arial Narrow (Windows/macOS) · Roboto (Android) · Arial (iOS) */
@font-face { font-family: "BC fb Narrow"; font-style: italic; font-weight: 700 900; src: local("Arial Narrow Bold Italic"), local("ArialNarrow-BoldItalic"); size-adjust: 90%; ascent-override: 111%; descent-override: 22%; line-gap-override: 0%; }
@font-face { font-family: "BC fb Narrow"; font-style: normal; font-weight: 700 900; src: local("Arial Narrow Bold"), local("ArialNarrow-Bold"); size-adjust: 90%; ascent-override: 111%; descent-override: 22%; line-gap-override: 0%; }
@font-face { font-family: "BC fb Roboto"; font-style: italic; font-weight: 700 900; src: local("Roboto Bold Italic"), local("Roboto-BoldItalic"); size-adjust: 82%; ascent-override: 122%; descent-override: 24%; line-gap-override: 0%; }
@font-face { font-family: "BC fb Roboto"; font-style: normal; font-weight: 700 900; src: local("Roboto Bold"), local("Roboto-Bold"); size-adjust: 82%; ascent-override: 122%; descent-override: 24%; line-gap-override: 0%; }
@font-face { font-family: "BC fb Arial"; font-style: italic; font-weight: 700 900; src: local("Arial Bold Italic"), local("Arial-BoldItalicMT"); size-adjust: 74%; ascent-override: 135%; descent-override: 27%; line-gap-override: 0%; }
@font-face { font-family: "BC fb Arial"; font-style: normal; font-weight: 700 900; src: local("Arial Bold"), local("Arial-BoldMT"); size-adjust: 74%; ascent-override: 135%; descent-override: 27%; line-gap-override: 0%; }
/* Texto: Roboto (Android) · Arial (Windows/macOS/iOS) */
@font-face { font-family: "Barlow fb Roboto"; font-weight: 400 500; src: local("Roboto"), local("Roboto-Regular"); size-adjust: 96%; ascent-override: 104%; descent-override: 21%; line-gap-override: 0%; }
@font-face { font-family: "Barlow fb Roboto"; font-weight: 600 900; src: local("Roboto Bold"), local("Roboto-Bold"); size-adjust: 96%; ascent-override: 104%; descent-override: 21%; line-gap-override: 0%; }
@font-face { font-family: "Barlow fb Arial"; font-weight: 400 500; src: local("Arial"), local("ArialMT"); size-adjust: 93%; ascent-override: 107%; descent-override: 21%; line-gap-override: 0%; }
@font-face { font-family: "Barlow fb Arial"; font-weight: 600 900; src: local("Arial Bold"), local("Arial-BoldMT"); size-adjust: 93%; ascent-override: 107%; descent-override: 21%; line-gap-override: 0%; }

:root {
  /* ---- Color: marca (muestreado) ---------------------------------------- */
  --c-brand-red:   #d7192a;  /* rombo, cinta ARIDOS, badge OFERTA */
  --c-red-deep:    #a8101f;  /* hover rojo, sombra de cinta, texto rojo chico sobre claro */
  --c-navy:        #0f1d3a;  /* contorno del wordmark, texto sobre amarillo, fondos */
  --c-navy-ink:    #0a1222;  /* sombra dura, texto máximo contraste */
  --c-blue-grid:   #0b2d4d;  /* fondo azul de la rejilla técnica */
  --c-blue-mid:    #164a73;  /* paneles sobre azul, hover */
  --c-blue-line:   #5b9ac4;  /* líneas de rejilla (decorativo, nunca texto chico) */
  --c-blue-text:   #a9cbe4;  /* texto secundario sobre navy/azul (AA) */
  --c-signal:      #ffd21f;  /* amarillo señal: SOLO CTA y destacados */
  --c-signal-shade:#e4ad14;  /* base del degradé del botón / hover */
  --c-white:       #ffffff;

  /* ---- Color: hierro / neutros (fríos, de la malla) --------------------- */
  --c-iron-50:  #f3f5f6;
  --c-iron-100: #e4e8eb;
  --c-iron-300: #b9c0c6;
  --c-iron-500: #5a6066;   /* texto secundario sobre claro (AA 6.3:1) */
  --c-iron-700: #2b2e31;
  --c-iron-900: #1a1c1e;

  /* ---- Color: roles ----------------------------------------------------- */
  --c-ink:          var(--c-navy-ink);
  --c-ink-soft:     var(--c-iron-500);
  --c-surface:      var(--c-iron-50);
  --c-surface-alt:  var(--c-white);
  --c-surface-dark: var(--c-navy);
  --c-on-dark:      var(--c-white);
  --c-on-dark-soft: var(--c-blue-text);
  --c-cta:          var(--c-signal);
  --c-on-cta:       var(--c-navy);
  --c-accent:       var(--c-brand-red);
  --c-on-accent:    var(--c-white);
  --c-wa:           #25d366;  /* verde WhatsApp: texto SIEMPRE navy-ink */
  --c-wa-shade:     #1aa851;
  --c-focus:        var(--c-signal);
  --c-border:       #cfd5da;

  /* ---- Tipografía ------------------------------------------------------- */
  --ff-display: "Barlow Condensed", "BC fb Narrow", "BC fb Roboto", "BC fb Arial", "Arial Narrow", sans-serif;
  --ff-text:    "Barlow", "Barlow fb Roboto", "Barlow fb Arial", "Segoe UI", system-ui, sans-serif;

  /* Escala fluida 360px -> 1440px (rem) */
  --fs-xs:   clamp(0.8125rem, 0.7917rem + 0.0926vw, 0.875rem);
  --fs-sm:   clamp(0.9375rem, 0.9167rem + 0.0926vw, 1rem);
  --fs-base: clamp(1rem, 0.9583rem + 0.1852vw, 1.125rem);
  --fs-lg:   clamp(1.1875rem, 1.125rem + 0.2778vw, 1.375rem);
  --fs-h4:   clamp(1.375rem, 1.25rem + 0.5556vw, 1.75rem);
  --fs-h3:   clamp(1.75rem, 1.5rem + 1.111vw, 2.5rem);
  --fs-h2:   clamp(2.25rem, 1.75rem + 2.222vw, 3.75rem);
  --fs-h1:   clamp(2.75rem, 1.833rem + 4.074vw, 5.5rem);
  --fs-mega: clamp(3.5rem, 1.833rem + 7.407vw, 8.5rem); /* solo 1 por página: hero afiche */

  --lh-tight: 0.92;  /* display itálica en caja alta */
  --lh-snug:  1.1;
  --lh-text:  1.55;
  --tr-display: -0.005em;
  --tr-label:   0.04em;

  /* ---- Espaciado (fluido en los pasos grandes) -------------------------- */
  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1rem;
  --s5: 1.5rem;
  --s6: clamp(2rem, 1.833rem + 0.7407vw, 2.5rem);
  --s7: clamp(2.5rem, 2rem + 2.222vw, 4rem);
  --s8: clamp(3.5rem, 2.667rem + 3.704vw, 6rem);
  --s9: clamp(4.5rem, 3rem + 6.667vw, 9rem);
  --gutter: clamp(1rem, 0.5rem + 2.222vw, 2.5rem);
  --container: 76rem;
  --measure: 62ch;

  /* ---- Forma ------------------------------------------------------------ */
  --r-0: 0;
  --r-1: 2px;    /* botones, chips: cantos apenas rotos, como chapa cortada */
  --r-2: 4px;    /* tarjetas */
  --r-pill: 999px; /* solo chips de filtro */
  --skew: -8deg; /* inclinación de la itálica: badges, cintas y botones la siguen */

  /* ---- Sombras: dura de afiche + una suave para elevación real ---------- */
  --sh-hard-sm: 3px 3px 0 var(--c-navy-ink);
  --sh-hard:    5px 5px 0 var(--c-navy-ink);
  --sh-hard-red: 5px 5px 0 var(--c-red-deep);
  --sh-lift:    0 10px 24px -12px rgb(10 18 34 / .45), 0 2px 4px rgb(10 18 34 / .12);

  /* ---- Motion ----------------------------------------------------------- */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --ease-press: cubic-bezier(.3, 0, .5, 1);
  --dur-1: 90ms;   /* press */
  --dur-2: 180ms;  /* hover, color */
  --dur-3: 320ms;  /* paneles, drawer lista de pedido */
  --dur-4: 600ms;  /* entrada del hero (único momento coreografiado) */

  /* ---- Texturas --------------------------------------------------------- */
  --tx-grid:  url("../img/grid.svg");
  --tx-malla: url("../img/malla.svg");
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur-1: 0ms; --dur-2: 0ms; --dur-3: 0ms; --dur-4: 0ms; }
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--ff-text);
  font-size: var(--fs-base);
  line-height: var(--lh-text);
  color: var(--c-ink);
  background: var(--c-surface);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--c-signal); color: var(--c-navy); }
:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 3px; box-shadow: 0 0 0 6px var(--c-navy); }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: .2em; }

/* ---- Heading -------------------------------------------------------------- */
.h, h1, h2, h3 {
  font-family: var(--ff-display);
  font-style: italic;
  font-weight: 900;
  text-transform: uppercase;
  line-height: var(--lh-tight);
  letter-spacing: var(--tr-display);
  margin: 0 0 .35em;
  text-wrap: balance;
}
.h--mega { font-size: var(--fs-mega); }
.h--1, h1 { font-size: var(--fs-h1); }
.h--2, h2 { font-size: var(--fs-h2); }
.h--3, h3 { font-size: var(--fs-h3); font-weight: 800; }
.h--4 { font-size: var(--fs-h4); font-weight: 800; line-height: var(--lh-snug); }

/* Afiche: blanco con contorno navy y sombra dura (como "MALLAS SIMA").
   Usar SOLO sobre fondo foto/azul/rojo, máx. un titular por vista. */
.t-afiche {
  color: var(--c-white);
  -webkit-text-stroke: .07em var(--c-navy-ink);
  paint-order: stroke fill;
  text-shadow: .05em .06em 0 var(--c-navy-ink);
}
.t-afiche--signal { color: var(--c-signal); }
.t-afiche--red    { color: var(--c-brand-red); }

.lead { font-size: var(--fs-lg); max-width: var(--measure); }
.muted { color: var(--c-ink-soft); }
.on-dark .muted { color: var(--c-on-dark-soft); }

/* ---- Container / Section ------------------------------------------------- */
.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.section { padding-block: var(--s8); position: relative; }
.section--tight { padding-block: var(--s7); }
.section--dark { background: var(--c-navy); color: var(--c-on-dark); }
.section--blue { background-color: var(--c-blue-grid); color: var(--c-on-dark); }

/* ==========================================================================
   Texturas
   ========================================================================== */
.bg-grid {
  background-color: var(--c-blue-grid);
  background-image: var(--tx-grid);
  background-size: 120px 120px;
}
.bg-malla { position: relative; isolation: isolate; }
.bg-malla::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: var(--tx-malla); background-size: 64px 64px; opacity: .14;
}
/* Franjas rojas diagonales (esquina de afiche). Decorativo, aria-hidden. */
.franjas {
  position: absolute; width: clamp(140px, 22vw, 320px); aspect-ratio: 1; pointer-events: none;
  background: repeating-linear-gradient(-55deg, transparent 0 18px, var(--c-brand-red) 18px 34px);
  -webkit-mask: linear-gradient(135deg, transparent 45%, #000 46%);
          mask: linear-gradient(135deg, transparent 45%, #000 46%);
}

/* ==========================================================================
   Button
   ========================================================================== */
.btn {
  --_bg: var(--c-cta); --_fg: var(--c-on-cta); --_sh: var(--sh-hard);
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 48px; padding: .55em 1.35em .5em;
  font: italic 800 var(--fs-lg)/1 var(--ff-display);
  text-transform: uppercase; letter-spacing: .01em; text-decoration: none;
  color: var(--_fg); background: var(--_bg);
  border: 2px solid var(--c-navy-ink); border-radius: var(--r-1);
  box-shadow: var(--_sh);
  transform: skewX(var(--skew));
  cursor: pointer;
  transition: transform var(--dur-1) var(--ease-press), box-shadow var(--dur-1) var(--ease-press), background-color var(--dur-2) var(--ease-out);
}
.btn > * { transform: skewX(calc(var(--skew) * -1)); }
.btn .ico { width: 1.15em; height: 1.15em; flex: none; }
.btn:hover { background-color: var(--_bg-hover, var(--c-signal-shade)); }
.btn:active { transform: skewX(var(--skew)) translate(3px, 3px); box-shadow: 2px 2px 0 var(--c-navy-ink); }
.btn[disabled], .btn[aria-disabled="true"] { --_bg: var(--c-iron-300); --_bg-hover: var(--c-iron-300); --_fg: var(--c-iron-700); background-image: none; cursor: not-allowed; box-shadow: none; }

.btn--primary { --_bg: var(--c-signal); --_bg-hover: #ffdc4d; background-image: linear-gradient(180deg, transparent 55%, rgb(228 173 20 / .55)); }
.btn--wa { --_bg: var(--c-wa); --_bg-hover: #3ee07c; --_fg: var(--c-navy-ink); }
.btn--red { --_bg: var(--c-brand-red); --_bg-hover: var(--c-red-deep); --_fg: var(--c-white); }
.btn--ghost { --_bg: transparent; --_bg-hover: rgb(255 255 255 / .08); --_fg: currentColor; --_sh: none; border-color: currentColor; }
.btn--sm { min-height: 44px; font-size: var(--fs-base); padding: .5em 1em .45em; --_sh: var(--sh-hard-sm); }
.btn--block { width: 100%; }

/* ==========================================================================
   Chip (filtros de categoría)
   ========================================================================== */
.chip {
  display: inline-flex; align-items: center; gap: .4em; min-height: 40px; padding: .35em 1em;
  font: 700 var(--fs-sm)/1 var(--ff-text); color: var(--c-navy);
  background: var(--c-white); border: 2px solid var(--c-navy); border-radius: var(--r-pill);
  cursor: pointer; transition: background-color var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out);
}
.chip:hover { background: var(--c-iron-100); }
.chip[aria-pressed="true"], .chip.is-active { background: var(--c-navy); color: var(--c-white); }
.chip .count { font-weight: 500; opacity: .75; }

/* ==========================================================================
   Badge OFERTA / Cinta ARIDOS
   ========================================================================== */
.badge-oferta {
  display: inline-block; padding: .3em .7em .25em;
  font: italic 900 var(--fs-sm)/1 var(--ff-display); text-transform: uppercase; letter-spacing: .04em;
  color: var(--c-white); background: var(--c-brand-red);
  border: 2px solid var(--c-navy-ink);
  transform: rotate(-4deg) skewX(var(--skew));
  box-shadow: var(--sh-hard-sm);
}
.cinta {
  position: relative; display: inline-block; padding: .3em 1.4em .25em;
  font: italic 800 var(--fs-h4)/1 var(--ff-display); text-transform: uppercase; letter-spacing: .12em;
  color: var(--c-white); background: var(--c-brand-red);
  border: 3px solid var(--c-navy-ink);
  transform: skewX(-18deg);
  box-shadow: var(--sh-hard);
}
.cinta > span { display: inline-block; transform: skewX(18deg); }

/* ==========================================================================
   Card (producto). Foto arriba, nombre, código, acción. Sin precio, nunca.
   ========================================================================== */
.card {
  display: flex; flex-direction: column;
  background: var(--c-white); color: var(--c-ink);
  border: 2px solid var(--c-navy); border-radius: var(--r-2);
  overflow: hidden; position: relative;
  transition: box-shadow var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out);
}
.card:hover { box-shadow: var(--sh-hard); transform: translate(-2px, -2px); }
.card__media { aspect-ratio: 4 / 3; background: var(--c-iron-100); position: relative; overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.9) contrast(1.05); }
.card__media .badge-oferta { position: absolute; top: .7rem; left: .7rem; }
.card__body { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s4); flex: 1; }
.card__title { font: italic 800 var(--fs-h4)/1.02 var(--ff-display); text-transform: uppercase; margin: 0; }
.card__meta { font-size: var(--fs-xs); color: var(--c-ink-soft); display: flex; gap: .75em; flex-wrap: wrap; }
.card__actions { margin-top: auto; padding-top: var(--s3); display: flex; gap: var(--s2); }

/* Popularidad (1–5 por quintil de ventas; NO son reseñas) */
.popularidad { display: inline-flex; gap: 2px; color: var(--c-brand-red); } /* rojo: 5.17:1 sobre blanco; el amarillo no llega a 3:1 */
.popularidad svg { width: 14px; height: 14px; }

/* ==========================================================================
   Sellos (Materiales de primera calidad · Envíos · Mayor y menor)
   ========================================================================== */
.sellos { display: flex; flex-wrap: wrap; gap: var(--s4) var(--s6); list-style: none; margin: 0; padding: 0; }
.sello { display: flex; align-items: center; gap: .65em; font: italic 800 var(--fs-base)/1.05 var(--ff-display); text-transform: uppercase; }
.sello small { display: block; font-weight: 700; font-size: .82em; opacity: .85; }
.sello .ico { width: 2.1em; height: 2.1em; flex: none; color: var(--c-brand-red); }
.on-dark .sello .ico { color: var(--c-signal); }
.ico { width: 1.25em; height: 1.25em; }

/* ==========================================================================
   Foto: tratamiento de marca
   ========================================================================== */
.photo { position: relative; overflow: hidden; background: var(--c-navy); }
.photo > img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(.25) contrast(1.12) brightness(.92); }
/* grade azul de plano: foto + velo navy multiplicado + rejilla encima */
.photo--grade::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, rgb(10 18 34 / .92) 0%, rgb(11 45 77 / .72) 45%, rgb(11 45 77 / .15) 100%), var(--tx-grid);
  background-size: auto, 120px 120px;
}

/* ==========================================================================
   Placeholders de fotos reales (predio, camiones, acopios)
   Por defecto: fallback discreto. Con <html class="show-ph"> aparece la etiqueta.
   ========================================================================== */
.ph { position: relative; background: var(--c-iron-100) var(--tx-malla) center / 64px; }
.ph__label { display: none; }
html.show-ph .ph { outline: 2px dashed var(--c-brand-red); outline-offset: -2px; }
html.show-ph .ph__label {
  display: block; position: absolute; left: .5rem; bottom: .5rem; z-index: 2;
  padding: .25em .5em; font: 700 var(--fs-xs)/1.2 var(--ff-text);
  color: var(--c-white); background: var(--c-red-deep);
}

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
