:root {
  --logo-size: 55px;      /* tamaño del logo en el mapa: cambiá solo este valor */
  --bg: #ffffff;
  --text: #3d4249;        /* gris oscuro, no negro */
  --muted: #6b7178;
  --line: #e6e8ea;
  --bar-h: 34px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: var(--bar-h); }

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.4;
  padding-top: var(--bar-h);
}

img { display: block; width: 100%; height: 100%; object-fit: cover; }
a { color: inherit; text-decoration: none; }

/* Barra superior mínima */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--bar-h);
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  z-index: 1000;
}
.logo { font-size: 15px; font-weight: 700; letter-spacing: -.2px; }

/* Botón hamburguesa */
.burger {
  width: 34px; height: 34px;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center; gap: 4px;
  background: none; border: 0; cursor: pointer;
}
.burger span {
  width: 20px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}
.burger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Menú desplegable */
.menu {
  position: fixed;
  top: var(--bar-h); left: 0; right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column;
  max-height: 0; overflow: hidden;
  transition: max-height .25s ease;
  z-index: 999;
}
.menu.open { max-height: 300px; }
.menu a {
  padding: 14px 16px;
  color: var(--text);
  font-size: 16px;
  border-top: 1px solid var(--line);
}
.menu a:active { background: #f3f4f5; }

/* Barra de zonas */
.zonas { display: flex; border-bottom: 1px solid var(--line); }
.zonas button {
  flex: 1;
  height: 36px;
  background: var(--bg);
  color: var(--text);
  border: 0;
  border-right: 1px solid var(--line);
  font-size: 15px;
  cursor: pointer;
}
.zonas button:last-child { border-right: 0; }
.zonas button.activo { background: var(--text); color: #fff; }

/* Mapa */
#map { width: 100%; height: 260px; background: #eceff1; }

/* Banners */
.banners { display: grid; gap: 8px; padding: 8px; }
.banner { aspect-ratio: 8 / 3; border-radius: 8px; overflow: hidden; background: #eee; }

/* Ofertas */
#ofertas { padding: 4px 12px 24px; }
#ofertas h2 { font-size: 18px; margin: 8px 0 12px; }

.offers { list-style: none; display: grid; grid-template-columns: 1fr; gap: 16px; }
.offer .thumb { aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: #eee; }
.offer h3 { font-size: 15px; margin-top: 8px; font-weight: 600; }
.offer p { font-size: 14px; color: var(--muted); }
.offer .price { color: var(--text); font-weight: 700; }

/* Pantallas más grandes */
@media (min-width: 600px) {
  .banners { grid-template-columns: repeat(3, 1fr); }
  .offers { grid-template-columns: repeat(2, 1fr); }
  #map { height: 340px; }
}
@media (min-width: 900px) {
  .offers { grid-template-columns: repeat(3, 1fr); }
  main { max-width: 1000px; margin: 0 auto; }
}

:focus-visible { outline: 2px solid #5b6570; outline-offset: 2px; }

/* Logo del comercio sobre el mapa */
.logo-marker {
  border-radius: 10px;
  border: 1px solid #fff;
  background: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .35);
  object-fit: cover;
}

/* Popup del comercio (el ancho se define en script.js: minWidth / maxWidth) */
.popup-comercio .leaflet-popup-content-wrapper { border-radius: 8px; }
.popup-comercio .leaflet-popup-content {
  margin: 18px 20px;
  font-size: 18px;
  line-height: 1.4;
  color: var(--text);
}
.popup-comercio .leaflet-popup-content strong { display: block; font-size: 22px; margin-bottom: 6px; }
.popup-comercio .leaflet-popup-content a { display: inline-block; margin-top: 8px; font-size: 18px; text-decoration: underline; }
.popup-comercio .leaflet-popup-close-button { font-size: 24px; padding: 8px 8px 0 0; }

.map-error { position: absolute; left: 8px; right: 8px; bottom: 24px; z-index: 500; background: #fff; color: var(--text); font-size: 13px; padding: 8px 10px; border-radius: 6px; box-shadow: 0 1px 6px rgba(0,0,0,.25); }

/* Animación de entrada de los banners: llegan desde el fondo, uno tras otro */
.banners { perspective: 900px; }
.banners.pre .banner { opacity: 0; }
.banners.animar .banner {
  animation: acercar .8s cubic-bezier(.2, .7, .2, 1) both;
  will-change: transform, opacity;
}
.banners.animar .banner:nth-child(2) { animation-delay: .25s; }
.banners.animar .banner:nth-child(3) { animation-delay: .5s; }

@keyframes acercar {
  from { opacity: 0; transform: translateZ(-500px) scale(.7); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .banners.animar .banner { animation: none; }
}

/* Brillo casi vertical: pasa por cada banner cada 5 segundos, uno después del otro (1, 2 y 3) */
.banner { position: relative; }
.banner::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* 105deg = franja casi vertical. Más cerca de 90deg = más vertical; más lejos = más inclinada */
  background: linear-gradient(105deg, transparent 46%, rgba(255, 255, 255, .6) 50%, transparent 54%);
  background-size: 300% 100%;
  background-position: 100% 0;
}
.banners:not(.pre) .banner::after {
  animation: brillo 15s linear 1.5s infinite;   /* 5s = cada cuánto pasa; 1.5s = espera inicial (banner 1) */
}
.banners:not(.pre) .banner:nth-child(2)::after { animation-delay: 6.5s; }   /* banner 2: 1 s después del 1 */
.banners:not(.pre) .banner:nth-child(3)::after { animation-delay: 11.5s; }   /* banner 3: 1 s después del 2 */

@keyframes brillo {
  0%   { background-position: 100% 0; }
  20%  { background-position: 0 0; }
  100% { background-position: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  .banners:not(.pre) .banner::after { animation: none; }
}
