/* Makro Abasto Gran Via — estilos. Mobile-first. */
/* Paleta: Rojo #E4002B + Azul #003DA5 sobre fondo blanco/gris claro. Premium, no chillen. */

:root {
  --rojo: #E4002B;
  --rojo-hover: #BF0024;
  --rojo-suave: rgba(228, 0, 43, 0.08);
  --azul: #003DA5;
  --azul-hover: #002F80;
  --azul-suave: rgba(0, 61, 165, 0.08);
  --gris-fondo: #F4F6F9;
  --gris-borde: rgba(0, 0, 0, 0.1);
  --gris-linea: 1px solid rgba(0, 0, 0, 0.09);
  --blanco: #FFFFFF;
  --texto: #1A1A2E;
  --texto-suave: rgba(26, 26, 46, 0.58);
  --sombra: 0 4px 18px rgba(0, 0, 0, 0.07);
  --sombra-hover: 0 8px 28px rgba(0, 0, 0, 0.12);
  --radio: 12px;
  --sans: "Inter", "Segoe UI", system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-weight: 400;
  color: var(--texto);
  background: var(--gris-fondo);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 16px; }
h1, h2, h3, h4 { line-height: 1.2; color: var(--texto); }
h2 { font-size: 28px; font-weight: 700; }
h3 { font-size: 22px; font-weight: 700; }
a { color: inherit; text-decoration: none; }

/* ======= BARRA DEMO (cinta superior) ======= */
.barra-demo {
  background: var(--azul);
  color: rgba(255,255,255,0.85);
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 7px 16px;
  position: relative;
  z-index: 60;
}
.barra-demo strong { color: #FFD700; }

/* ======= HEADER ======= */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--blanco);
  border-bottom: var(--gris-linea);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.header-logo-icono {
  width: 40px;
  height: 40px;
  background: var(--rojo);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  color: white;
  font-weight: 900;
  line-height: 1;
}
.header-marca {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.header-marca-nombre {
  font-size: 15px;
  font-weight: 800;
  color: var(--azul);
  white-space: nowrap;
}
.header-marca-tag {
  font-size: 10px;
  font-weight: 500;
  color: var(--texto-suave);
  white-space: nowrap;
}
.header-nav {
  display: flex;
  gap: 24px;
  margin: 0 auto;
}
.header-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--texto-suave);
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color 160ms, border-color 160ms;
}
.header-nav a:hover { color: var(--azul); border-color: var(--azul); }
@media (max-width: 720px) {
  .header-nav { display: none; }
  .header-inner { gap: 12px; }
}

/* ======= HERO ======= */
.hero {
  background: linear-gradient(135deg, var(--azul) 0%, #0050D3 60%, #002a7a 100%);
  padding: 56px 20px 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 50%, rgba(255,255,255,0.04) 0%, transparent 60%),
                    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.04) 0%, transparent 50%);
  pointer-events: none;
}
.hero-badge {
  display: inline-block;
  background: var(--rojo);
  color: white;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.hero h1 {
  font-size: clamp(26px, 5vw, 46px);
  font-weight: 900;
  color: white;
  margin-bottom: 10px;
}
.hero h1 em { color: #FFD700; font-style: normal; }
.hero-sub {
  font-size: 15px;
  color: rgba(255,255,255,0.75);
  margin-bottom: 30px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

/* Buscador en hero */
.hero-buscador {
  max-width: 580px;
  margin: 0 auto 20px;
  position: relative;
}
.hero-buscador-input {
  width: 100%;
  height: 52px;
  border: none;
  border-radius: 999px;
  padding: 0 58px 0 22px;
  font-size: 15px;
  background: white;
  color: var(--texto);
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
}
.hero-buscador-input:focus { outline: 3px solid #FFD700; outline-offset: 2px; }
.hero-buscador-input::placeholder { color: var(--texto-suave); }
.hero-buscador-btn {
  position: absolute;
  right: 6px;
  top: 6px;
  height: 40px;
  width: 40px;
  background: var(--rojo);
  border: none;
  border-radius: 999px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.hero-horario {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
}
.hero-horario strong { color: rgba(255,255,255,0.88); }

/* ======= CHIPS DE CATEGORIA ======= */
.chips-wrap {
  background: var(--blanco);
  border-bottom: var(--gris-linea);
  padding: 12px 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.chips-wrap::-webkit-scrollbar { display: none; }
.chips-row {
  display: flex;
  gap: 8px;
  max-width: 1200px;
  margin: 0 auto;
  width: max-content;
}
.chip {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid var(--gris-borde);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 500;
  background: var(--blanco);
  color: var(--texto-suave);
  cursor: pointer;
  white-space: nowrap;
  transition: all 180ms ease;
}
.chip:hover { border-color: var(--azul); color: var(--azul); }
.chip.activo { background: var(--azul); border-color: var(--azul); color: white; }
.chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Resultado de busqueda */
.resultado-busqueda {
  max-width: 1200px;
  margin: 12px auto 0;
  padding: 0 20px;
  font-size: 14px;
  color: var(--texto-suave);
}
.resultado-busqueda.visible { display: block; }

/* ======= SECCION PRINCIPAL ======= */
.seccion {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 20px;
}
.seccion-cat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.seccion-cat-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: white;
  padding: 4px 12px;
  border-radius: 999px;
}
.seccion-cat-titulo {
  font-size: 20px;
  font-weight: 700;
}
.seccion-cat-linea {
  flex: 1;
  height: 1px;
  background: rgba(0,0,0,0.08);
}

/* ======= GRID DE PRODUCTOS ======= */
.grid-productos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}
@media (max-width: 500px) {
  .grid-productos { grid-template-columns: 1fr 1fr; gap: 10px; }
}

/* ======= TARJETA DE PRODUCTO ======= */
.card {
  background: var(--blanco);
  border-radius: var(--radio);
  overflow: hidden;
  border: var(--gris-linea);
  box-shadow: var(--sombra);
  cursor: pointer;
  transition: box-shadow 200ms, transform 200ms;
  position: relative;
  display: flex;
  flex-direction: column;
}
.card:hover { box-shadow: var(--sombra-hover); transform: translateY(-2px); }
.card-imagen-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--gris-fondo);
  overflow: hidden;
}
.card-imagen {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card-imagen-svg {
  width: 100%;
  height: 100%;
  display: block;
}
.card-badge-promo {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--rojo);
  color: white;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
}
.card-badge-destacado {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #FFD700;
  color: #1A1A2E;
  font-size: 9px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 999px;
}
.card-body {
  padding: 10px 12px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.card-marca {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--azul);
  margin-bottom: 2px;
}
.card-nombre {
  font-size: 13px;
  font-weight: 600;
  color: var(--texto);
  line-height: 1.35;
  margin-bottom: 2px;
}
.card-presentacion {
  font-size: 11px;
  color: var(--texto-suave);
  margin-bottom: 8px;
}
.card-precios {
  margin-top: auto;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.precio-menor {
  display: flex;
  flex-direction: column;
}
.precio-menor-label {
  font-size: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--texto-suave);
}
.precio-menor-valor {
  font-size: 18px;
  font-weight: 800;
  color: var(--texto);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.precio-menor-valor .bs {
  font-size: 11px;
  font-weight: 600;
  color: var(--texto-suave);
  vertical-align: top;
  margin-top: 3px;
}
.precio-mayor {
  display: flex;
  flex-direction: column;
  background: var(--azul-suave);
  border: 1px solid rgba(0,61,165,0.3);
  border-radius: 6px;
  padding: 3px 8px;
}
.precio-mayor-label {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--azul);
}
.precio-mayor-valor {
  font-size: 12px;
  font-weight: 700;
  color: var(--azul);
  font-variant-numeric: tabular-nums;
}

/* ======= MODAL FICHA ======= */
.modal-ficha {
  border: none;
  border-radius: 16px;
  padding: 0;
  max-width: 680px;
  width: calc(100% - 32px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.22);
}
.modal-ficha::backdrop { background: rgba(0,0,0,0.52); }

.ficha-imagen-wrap {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--gris-fondo);
  overflow: hidden;
  border-radius: 16px 16px 0 0;
}
.ficha-imagen, .ficha-imagen-svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ficha-body {
  padding: 22px 24px 24px;
}
.ficha-marca {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--azul);
  margin-bottom: 4px;
}
.ficha-nombre {
  font-size: 22px;
  font-weight: 800;
  color: var(--texto);
  margin-bottom: 3px;
  line-height: 1.25;
}
.ficha-presentacion {
  font-size: 13px;
  color: var(--texto-suave);
  margin-bottom: 6px;
}
.ficha-sku {
  font-size: 11px;
  color: var(--texto-suave);
  margin-bottom: 14px;
}
.ficha-descripcion {
  font-size: 14px;
  color: var(--texto-suave);
  line-height: 1.65;
  margin-bottom: 22px;
  padding-top: 12px;
  border-top: var(--gris-linea);
}

/* PRECIOS EN FICHA — diferenciador clave de Makro */
.ficha-precios-titulo {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--texto-suave);
  margin-bottom: 10px;
}
.ficha-precios {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 22px;
}
.ficha-precio-bloque {
  border-radius: 12px;
  padding: 16px;
  position: relative;
}
.ficha-precio-bloque.menor {
  background: var(--gris-fondo);
  border: 2px solid rgba(0,0,0,0.08);
}
.ficha-precio-bloque.mayor {
  background: var(--azul-suave);
  border: 2px solid var(--azul);
}
.ficha-precio-etiqueta {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--texto-suave);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.ficha-precio-bloque.mayor .ficha-precio-etiqueta { color: var(--azul); }
.ficha-precio-numero {
  font-size: 30px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--texto);
  line-height: 1;
}
.ficha-precio-bloque.mayor .ficha-precio-numero { color: var(--azul); }
.ficha-precio-numero .bs {
  font-size: 15px;
  font-weight: 600;
  vertical-align: top;
  margin-top: 4px;
}
.ficha-precio-sub {
  font-size: 11px;
  color: var(--texto-suave);
  margin-top: 5px;
}
.ficha-precio-bloque.mayor .ficha-precio-sub { color: rgba(0,61,165,0.7); }
.badge-ahorro {
  position: absolute;
  top: -8px;
  right: 10px;
  background: var(--rojo);
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

/* Boton WhatsApp en ficha */
.btn-wa {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 22px;
  background: #22C55E;
  color: white;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  text-decoration: none;
  transition: background 180ms;
  margin-bottom: 8px;
}
.btn-wa:hover { background: #16A34A; }
.btn-cerrar-ficha {
  width: 100%;
  padding: 12px;
  background: transparent;
  border: var(--gris-linea);
  border-radius: 10px;
  font-size: 14px;
  color: var(--texto-suave);
  transition: background 160ms;
}
.btn-cerrar-ficha:hover { background: var(--gris-fondo); }

/* ======= SUCURSALES ======= */
.sucursales-wrap {
  background: var(--azul);
  padding: 40px 20px;
}
.sucursales-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.sucursales-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  margin-bottom: 6px;
}
.sucursales-titulo { font-size: 22px; font-weight: 800; color: white; margin-bottom: 4px; }
.sucursales-sub { font-size: 13px; color: rgba(255,255,255,0.6); margin-bottom: 22px; }
.sucursales-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}
.sucursal-card {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 10px;
  padding: 14px 16px;
  transition: background 180ms;
}
.sucursal-card:hover { background: rgba(255,255,255,0.14); }
.sucursal-card.principal { border-color: rgba(255,215,0,0.6); background: rgba(255,215,0,0.08); }
.sucursal-badge-principal {
  display: inline-block;
  background: #FFD700;
  color: var(--azul);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.sucursal-nombre { font-size: 13px; font-weight: 700; color: white; margin-bottom: 3px; }
.sucursal-card.principal .sucursal-nombre { color: #FFD700; }
.sucursal-dir { font-size: 12px; color: rgba(255,255,255,0.6); line-height: 1.4; }

/* ======= FOOTER ======= */
.footer {
  background: #111827;
  color: rgba(255,255,255,0.55);
  padding: 32px 20px;
  text-align: center;
}
.footer-logo-txt {
  font-size: 18px;
  font-weight: 900;
  color: white;
  margin-bottom: 4px;
}
.footer-logo-txt span { color: var(--rojo); }
.footer-sub { font-size: 13px; margin-bottom: 14px; }
.footer-links {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 13px;
  margin-bottom: 14px;
}
.footer-links a { color: rgba(255,255,255,0.4); transition: color 160ms; }
.footer-links a:hover { color: white; }
.footer-copy { font-size: 11px; color: rgba(255,255,255,0.25); }

/* ======= TOAST ======= */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #111827;
  color: white;
  font-size: 14px;
  padding: 12px 22px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  z-index: 9999;
  white-space: nowrap;
}

/* ======= ACCESIBILIDAD ======= */
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--azul);
  outline-offset: 2px;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ======= RESPONSIVE extra ======= */
@media (max-width: 600px) {
  .hero { padding: 36px 16px 32px; }
  .hero h1 { font-size: 24px; }
  .ficha-precios { grid-template-columns: 1fr; }
  .sucursales-grid { grid-template-columns: 1fr 1fr; }
  .ficha-body { padding: 16px 18px 20px; }
}
