:root {
  /* Fondo */
  --bg: #f7f7f4;
  --card: #ffffff;
  /* Texto / navegación (azul tinta) */
  --navy: #132238;
  /* Confianza / estados (azul secundario) */
  --blue: #315b7d;
  /* CTA / precio especial (rojo controlado) */
  --red: #b4232f;
  --red-dark: #8f1c26;
  /* Texto secundario y bordes */
  --gray: #6b7280;
  --line: #e6e7e4;

  --sans: "Inter Tight", -apple-system, "Segoe UI", Arial, sans-serif;
  --gutter: clamp(1rem, 4vw, 3.5rem);
  --max: 78rem;
  --radius: 10px;
  --radius-sm: 6px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--navy);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button { color: inherit; font: inherit; }
::selection { background: var(--red); color: #fff; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.shell { width: min(100%, var(--max)); margin-inline: auto; padding-inline: var(--gutter); }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 1rem;
  left: 1rem;
  padding: .75rem 1rem;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  border-radius: var(--radius-sm);
  transform: translateY(-180%);
  transition: transform .2s ease;
}
.skip-link:focus { transform: none; }

/* Header: navy, marca + buscador protagonista */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--navy);
  border-bottom: 3px solid var(--red);
}
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem var(--gutter);
}
.brand { display: inline-flex; align-items: baseline; gap: .4rem; text-decoration: none; color: #fff; }
.brand strong { font-size: 1.4rem; font-weight: 900; letter-spacing: -.02em; }
.brand span { font-size: .68rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #b9c3d1; }
.header-actions a { font-size: .78rem; font-weight: 700; color: #fff; text-decoration: none; letter-spacing: .02em; }

.search-wrap { padding: 0 var(--gutter) 1.1rem; }
.search-box {
  position: relative;
  max-width: 42rem;
  margin: 0 auto;
}
.search-box input {
  width: 100%;
  padding: .95rem 1rem .95rem 2.9rem;
  border: none;
  border-radius: var(--radius);
  background: #fff;
  color: var(--navy);
  font-size: 1rem;
  font-weight: 500;
}
.search-box input::placeholder { color: var(--gray); }
.search-box input:focus-visible { outline: 3px solid var(--blue); outline-offset: 0; }
.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray);
  pointer-events: none;
  font-size: 1rem;
}

/* Barra de confianza */
.trust-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: center;
  padding: .7rem var(--gutter);
  background: #eef2f6;
  border-bottom: 1px solid var(--line);
  color: var(--blue);
  font-size: .78rem;
  font-weight: 600;
}
.trust-bar li { display: flex; align-items: center; gap: .4rem; list-style: none; }

/* Filtros: sticky, siempre accesibles */
.filter-bar {
  position: sticky;
  top: 84px;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: .9rem var(--gutter);
}
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.chip-group { display: flex; flex-wrap: wrap; gap: .5rem; }
.filter-chip {
  padding: .5rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--navy);
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.filter-chip:hover { border-color: var(--navy); }
.filter-chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }

.facet-selects { display: flex; flex-wrap: wrap; gap: .5rem; margin-left: auto; }
.facet-selects select {
  padding: .5rem .7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--navy);
  font-size: .78rem;
  font-weight: 600;
}

.result-indicator {
  padding: .6rem var(--gutter) 0;
  color: var(--gray);
  font-size: .78rem;
  font-weight: 600;
  text-align: center;
}
.result-indicator strong { color: var(--navy); }

/* Catálogo / grid */
.catalog { padding: 1.5rem var(--gutter) 5rem; max-width: var(--max); margin-inline: auto; }
.empty-state { padding: 3.5rem 0; text-align: center; color: var(--gray); }

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.product-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.product-media { position: relative; aspect-ratio: 1 / 1; background: #f1f1ee; overflow: hidden; }
.product-media img { width: 100%; height: 100%; object-fit: cover; }
.product-badge {
  position: absolute;
  top: .6rem;
  left: .6rem;
  padding: .3rem .6rem;
  border-radius: var(--radius-sm);
  background: var(--red);
  color: #fff;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .03em;
}
.availability-tag {
  position: absolute;
  top: .6rem;
  right: .6rem;
  padding: .3rem .55rem;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.94);
  color: var(--blue);
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .02em;
}
.availability-tag.out { color: var(--gray); }

.product-body { display: flex; flex-direction: column; gap: .3rem; padding: .85rem .9rem 1rem; }
.product-brand { margin: 0; color: var(--gray); font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.product-name { margin: 0; font-size: .98rem; font-weight: 700; line-height: 1.25; color: var(--navy); }
.product-spec { margin: 0; color: var(--blue); font-size: .82rem; font-weight: 700; }
.product-price {
  margin: .35rem 0 0;
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--red);
  letter-spacing: -.01em;
}
.product-delivery { margin: 0; color: var(--gray); font-size: .72rem; }

.add-btn {
  margin-top: .7rem;
  width: 100%;
  padding: .85rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--red);
  color: #fff;
  font-size: .88rem;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .15s ease;
}
.add-btn:hover { background: var(--red-dark); }
.add-btn:disabled { background: var(--line); color: var(--gray); cursor: not-allowed; }

/* Sentinel + volver arriba */
.scroll-sentinel { height: 1px; }
.load-indicator { text-align: center; padding: 1.5rem 0; color: var(--gray); font-size: .8rem; }

.back-to-top {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 40;
  width: 3rem;
  height: 3rem;
  border: none;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(19,34,56,.28);
  opacity: 0;
  transform: translateY(.6rem);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.back-to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }

/* Footer */
.site-footer {
  padding: 2rem var(--gutter);
  background: var(--navy);
  color: #cfd7e2;
  font-size: .78rem;
}
.site-footer .shell { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.site-footer a { color: #fff; text-decoration: underline; }
.site-footer .disclaimer { width: 100%; margin-top: 1rem; color: #9aa7ba; font-size: .72rem; }

@media (min-width: 640px) {
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
}
@media (min-width: 1000px) {
  .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
  .brand span { display: none; }
  .header-actions { font-size: .7rem; }
  .filter-bar { top: 76px; }
  .trust-bar { gap: .8rem; font-size: .7rem; }
}

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