/* =====================================================================
   Aluminios Ruta 5 · Sistema base
   Tokens, reset, tipografía, botones, nav, footer, tarjetas de producto
   ===================================================================== */

:root {
  /* Marca */
  --ink: #0b0b0d;
  --ink-2: #16171b;
  --ink-3: #24262c;
  --blue: #0a7fbe;
  --blue-600: #086a9f;
  --blue-700: #065580;
  --blue-100: #e3f1fa;
  --blue-50: #f1f8fd;

  /* Aluminio (neutros fríos) */
  --alu-50: #f7f8fa;
  --alu-100: #eef0f3;
  --alu-200: #dfe3e8;
  --alu-300: #c5cbd3;
  --alu-400: #a6aeb8;
  --alu-500: #8a93a0;
  --alu-700: #4b535e;
  --white: #ffffff;

  --wa: #25d366;

  /* Tipografía */
  --font-display: "Archivo", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Escala fluida */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: clamp(0.95rem, 0.9rem + 0.25vw, 1.05rem);
  --text-lg: clamp(1.05rem, 1rem + 0.35vw, 1.2rem);
  --text-xl: clamp(1.25rem, 1.1rem + 0.7vw, 1.6rem);
  --text-2xl: clamp(1.6rem, 1.3rem + 1.4vw, 2.4rem);
  --text-3xl: clamp(2rem, 1.5rem + 2.6vw, 3.6rem);
  --text-hero: clamp(2.5rem, 1.6rem + 5vw, 5.6rem);

  /* Layout */
  --container: 1240px;
  --gutter: clamp(1.1rem, 4vw, 2.5rem);
  --section: clamp(4rem, 8vw, 8rem);
  --radius: 14px;
  --radius-lg: 22px;
  --nav-h: 72px;

  --shadow-sm: 0 1px 2px rgba(11, 11, 13, .06), 0 2px 8px rgba(11, 11, 13, .05);
  --shadow-md: 0 8px 24px -8px rgba(11, 11, 13, .18), 0 2px 6px rgba(11, 11, 13, .06);
  --shadow-lg: 0 30px 60px -20px rgba(11, 11, 13, .3);

  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.3, .64, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
::selection { background: var(--blue); color: #fff; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---------- Utilidades ---------- */
.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.section { padding-block: var(--section); }
.section--tight { padding-block: calc(var(--section) * .6); }

.eyebrow {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--blue);
}
.eyebrow::before { content: ""; width: 22px; height: 2px; background: currentColor; border-radius: 2px; }
.eyebrow--plain::before { display: none; }

.section-head { max-width: 760px; margin-bottom: clamp(2rem, 4vw, 3.5rem); }
.section-head .eyebrow { margin-bottom: 1rem; }
.section-head h2 { font-size: var(--text-3xl); }
.section-head p { margin-top: 1rem; font-size: var(--text-lg); color: var(--alu-700); max-width: 60ch; }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center .eyebrow::before { display: none; }
.section-head--center p { margin-inline: auto; }

.title-accent { color: var(--blue); }
.title-wide { font-stretch: 112%; }

/* ---------- Botones ---------- */
.btn {
  --btn-bg: var(--ink);
  --btn-fg: #fff;
  --btn-bd: transparent;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: 52px;
  padding: .85rem 1.5rem;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1.5px solid var(--btn-bd);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .95rem;
  letter-spacing: .01em;
  line-height: 1;
  white-space: nowrap;
  transition: transform .35s var(--ease-out), background .25s, color .25s, border-color .25s, box-shadow .35s;
  overflow: hidden;
  isolation: isolate;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn--primary { --btn-bg: var(--blue); }
.btn--primary:hover { --btn-bg: var(--blue-600); }
.btn--dark { --btn-bg: var(--ink); }
.btn--dark:hover { --btn-bg: var(--ink-3); }
.btn--light { --btn-bg: #fff; --btn-fg: var(--ink); }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--ink); --btn-bd: var(--alu-300); }
.btn--ghost:hover { --btn-bd: var(--ink); box-shadow: none; }
.btn--ghost-light { --btn-bg: transparent; --btn-fg: #fff; --btn-bd: rgba(255, 255, 255, .35); }
.btn--ghost-light:hover { --btn-bd: #fff; box-shadow: none; }
.btn--wa { --btn-bg: var(--wa); --btn-fg: #06301a; }
.btn--wa:hover { --btn-bg: #1fc15a; }
.btn--sm { min-height: 42px; padding: .6rem 1.1rem; font-size: .85rem; }
.btn--block { width: 100%; }
.btn__arrow { transition: transform .35s var(--ease-out); }
.btn:hover .btn__arrow { transform: translateX(4px); }

.link-arrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-display); font-weight: 600; font-size: .95rem;
  color: var(--ink);
}
.link-arrow svg { width: 18px; height: 18px; transition: transform .3s var(--ease-out); }
.link-arrow:hover svg { transform: translateX(4px); }
.link-arrow:hover { color: var(--blue); }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center;
  transition: background .35s, box-shadow .35s, backdrop-filter .35s, transform .4s var(--ease-out);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.nav__logo { display: inline-flex; align-items: center; gap: .75rem; }
.nav__logo img { height: 34px; width: auto; }
.nav__logo-word {
  font-family: var(--font-display); font-weight: 700; font-size: .95rem;
  letter-spacing: .06em; text-transform: uppercase; line-height: 1;
  white-space: nowrap;
}
.nav__logo-word b { color: var(--blue); }
.nav__links { display: flex; align-items: center; gap: .25rem; }
.nav__links a {
  position: relative;
  padding: .55rem .85rem;
  font-family: var(--font-display); font-weight: 500; font-size: .9rem;
  color: var(--ink);
  border-radius: 999px;
  transition: background .25s, color .25s;
}
.nav__links a:hover, .nav__links a[aria-current="page"] { background: var(--alu-100); }
.nav__actions { display: flex; align-items: center; gap: .5rem; }
.nav__toggle {
  display: none; width: 46px; height: 46px; border-radius: 50%;
  flex-direction: column; align-items: center; justify-content: center;
  flex: none;
  background: var(--alu-100);
}
.nav__toggle span { display: block; width: 20px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .35s var(--ease-out), opacity .2s; }
.nav__toggle span + span { margin-top: 5px; }
.nav--scrolled { background: rgba(255, 255, 255, .82); backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%); box-shadow: 0 1px 0 rgba(11, 11, 13, .06); }
.nav--hidden { transform: translateY(-100%); }

/* Nav sobre fondo oscuro (hero) */
.nav--dark:not(.nav--scrolled) .nav__links a,
.nav--dark:not(.nav--scrolled) .nav__logo-word { color: #fff; }
.nav--dark:not(.nav--scrolled) .nav__links a:hover { background: rgba(255, 255, 255, .12); }
.nav--dark:not(.nav--scrolled) .nav__toggle { background: rgba(255, 255, 255, .12); }
.nav--dark:not(.nav--scrolled) .nav__toggle span { background: #fff; }
.nav__logo-img--light { display: none; }
.nav--dark:not(.nav--scrolled) .nav__logo-img--dark { display: none; }
.nav--dark:not(.nav--scrolled) .nav__logo-img--light { display: block; }

/* Menú mobile */
.menu {
  position: fixed; inset: 0; z-index: 99;
  background: var(--ink);
  color: #fff;
  padding: calc(var(--nav-h) + 1.5rem) var(--gutter) 2rem;
  display: flex; flex-direction: column;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .4s var(--ease-out), visibility 0s .4s;
}
.menu--open { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .4s var(--ease-out), visibility 0s; }
.menu__links { display: flex; flex-direction: column; gap: .25rem; margin-top: auto; }
.menu__links a {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: .9rem 0;
  font-family: var(--font-display); font-weight: 700; font-size: clamp(1.9rem, 8vw, 2.6rem); letter-spacing: -.02em; line-height: 1;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  transform: translateY(24px); opacity: 0;
  transition: transform .6s var(--ease-out), opacity .6s;
}
.menu__links a small { font-family: var(--font-body); font-weight: 400; font-size: .8rem; color: var(--alu-400); letter-spacing: .1em; }
.menu--open .menu__links a { transform: none; opacity: 1; }
.menu--open .menu__links a:nth-child(1) { transition-delay: .08s; }
.menu--open .menu__links a:nth-child(2) { transition-delay: .14s; }
.menu--open .menu__links a:nth-child(3) { transition-delay: .2s; }
.menu--open .menu__links a:nth-child(4) { transition-delay: .26s; }
.menu--open .menu__links a:nth-child(5) { transition-delay: .32s; }
.menu--open .menu__links a:nth-child(6) { transition-delay: .38s; }
.menu__footer { margin-top: 2rem; display: grid; gap: 1rem; }
.menu__meta { font-size: .85rem; color: var(--alu-400); line-height: 1.7; }
.menu__meta a { color: #fff; }
.menu__bg { position: absolute; right: -10%; bottom: -8%; width: 70vw; max-width: 460px; opacity: .06; pointer-events: none; }
body.menu-open { overflow: hidden; }
body.menu-open .nav { background: transparent; box-shadow: none; backdrop-filter: none; }
body.menu-open .nav__links a, body.menu-open .nav__logo-word { color: #fff; }
body.menu-open .nav__toggle { background: rgba(255, 255, 255, .12); }
body.menu-open .nav__toggle span { background: #fff; }
body.menu-open .nav__toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.menu-open .nav__toggle span:nth-child(2) { opacity: 0; }
body.menu-open .nav__toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
body.menu-open .nav__logo-img--dark { display: none; }
body.menu-open .nav__logo-img--light { display: block; }

@media (max-width: 900px) {
  .nav__links, .nav__cta { display: none; }
  .nav__toggle { display: inline-flex; }
  .nav__logo img { height: 30px; }
  .nav__logo-word { font-size: .82rem; letter-spacing: .05em; }
}
@media (max-width: 360px) {
  .nav__logo-word { display: none; }
}

/* ---------- Barra fija mobile ---------- */
.mobile-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  display: none;
  gap: .5rem;
  padding: .6rem var(--gutter) calc(.6rem + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 -1px 0 rgba(11, 11, 13, .06);
  transform: translateY(110%);
  transition: transform .45s var(--ease-out);
}
.mobile-bar--visible { transform: none; }
.mobile-bar .btn { flex: 1; min-height: 48px; }
@media (max-width: 720px) {
  .mobile-bar { display: flex; }
  body { padding-bottom: 0; }
}

/* ---------- Tarjeta de producto ---------- */
.pcard {
  position: relative;
  display: flex; flex-direction: column;
  background: #fff;
  border: 1px solid var(--alu-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform .5s var(--ease-out), box-shadow .5s var(--ease-out), border-color .3s;
}
.pcard:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--alu-300); }
.pcard__media {
  position: relative; aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--alu-100), var(--alu-50));
  overflow: hidden;
}
.pcard__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease-out); }
.pcard:hover .pcard__media img { transform: scale(1.04); }
.pcard__media--placeholder img { object-fit: contain; padding: 12%; }
.pcard:hover .pcard__media--placeholder img { transform: scale(1.02); }
.pcard__badges { position: absolute; top: .75rem; left: .75rem; display: flex; flex-wrap: wrap; gap: .35rem; }
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .3rem .6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(6px);
  font-family: var(--font-display); font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink);
}
.badge--blue { background: var(--blue); color: #fff; }
.badge--ok::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #22b573; }
.badge--warn::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #f5a623; }
.badge--off::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--alu-400); }
.pcard__body { display: flex; flex-direction: column; gap: .35rem; padding: 1.1rem 1.2rem 1.2rem; flex: 1; }
.pcard__cat { font-family: var(--font-display); font-size: .7rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--blue); }
.pcard__title { font-size: 1.1rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.pcard__title a::after { content: ""; position: absolute; inset: 0; }
.pcard__meta { font-size: .85rem; color: var(--alu-700); }
.pcard__foot { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: auto; padding-top: .8rem; }
.pcard__price { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.pcard__price small { font-weight: 500; font-size: .75rem; color: var(--alu-500); }
.pcard__price--ask small { white-space: nowrap; }
.pcard__cta { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: .4rem; font-family: var(--font-display); font-weight: 600; font-size: .85rem; color: var(--ink); }
.pcard__cta svg { width: 16px; height: 16px; transition: transform .3s var(--ease-out); }
.pcard:hover .pcard__cta svg { transform: translateX(3px); }

/* Esqueleto de carga */
.skeleton { background: linear-gradient(90deg, var(--alu-100) 25%, var(--alu-50) 50%, var(--alu-100) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius-lg); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: #fff; padding: clamp(3rem, 6vw, 5rem) 0 calc(2rem + 70px); position: relative; overflow: hidden; }
@media (min-width: 721px) { .footer { padding-bottom: 2rem; } }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2.5rem; }
.footer__brand img { height: 44px; width: auto; margin-bottom: 1.2rem; }
.footer__brand p { color: var(--alu-400); font-size: .92rem; max-width: 34ch; }
.footer h4 { font-size: .75rem; letter-spacing: .16em; text-transform: uppercase; color: var(--alu-400); margin-bottom: 1.1rem; font-weight: 600; }
.footer ul { display: grid; gap: .55rem; }
.footer li a { color: #fff; font-size: .95rem; opacity: .85; transition: opacity .2s, color .2s; }
.footer li a:hover { opacity: 1; color: var(--blue); }
.footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .8rem; color: var(--alu-500); }
.footer__bottom a { color: var(--alu-400); }
.footer__bottom a:hover { color: #fff; }
.footer__word {
  position: absolute; left: 50%; bottom: -1.5vw; transform: translateX(-50%);
  font-family: var(--font-display); font-weight: 800; font-stretch: 125%;
  font-size: clamp(5rem, 18vw, 17rem); line-height: 1; letter-spacing: -.04em;
  color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, .08);
  white-space: nowrap; pointer-events: none; user-select: none;
}
@media (max-width: 900px) { .footer__grid { grid-template-columns: 1fr 1fr; } .footer__brand { grid-column: 1 / -1; } }
@media (max-width: 520px) { .footer__grid { grid-template-columns: 1fr; } }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); }
.reveal.is-in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .1s; }
.reveal[data-delay="2"] { transition-delay: .2s; }
.reveal[data-delay="3"] { transition-delay: .3s; }
.reveal[data-delay="4"] { transition-delay: .4s; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(1.5rem + 70px); transform: translateX(-50%);
  z-index: 200; padding: .8rem 1.2rem; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: .9rem; box-shadow: var(--shadow-lg);
}
@media (min-width: 721px) { .toast { bottom: 1.5rem; } }
