/* =========================================
   VARIABLES GLOBALES
========================================= */
:root {
  --red: #e60023;
  --red-soft: #ffe6ea;
  --dark: #222;
  --text: #555;
  --radius: 18px;
  --shadow: 0 12px 30px rgba(0,0,0,0.08);
}

/* =========================================
   BASE Y RESET
========================================= */
html, body { 
  margin: 0; 
  padding: 0; 
  overflow-x: hidden; 
  font-family: "Poppins", sans-serif; 
}

body { 
  color: var(--text); 
  background: #f9f9f9; 
  line-height: 1.6; 
  padding-top: 75px; /* Compensación para el header fijo */
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.bg-light { background: #f9f9f9; }

/* =========================================
   HEADER (FIJO)
========================================= */
.header { 
  background: #fff; 
  border-bottom: 1px solid #eee; 
  position: fixed; /* Header fijo al hacer scroll */
  top: 0; 
  left: 0;
  width: 100%;
  z-index: 1500; 
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.header-inner { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; }
.logo { font-weight: 700; font-size: 1.4rem; color: var(--red); display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-img { height: 40px; width: auto; }
.tabs-btn { background: var(--red); color: #fff; border: none; padding: 10px 14px; border-radius: 8px; cursor: pointer; font-size: 1.2rem; }

/* =========================================
   MENÚ LATERAL Y OVERLAY
========================================= */
.side-menu { 
  position: fixed; top: 0; right: -100%; width: 280px; height: 100vh; 
  background: #fff; z-index: 3000; padding: 30px; transition: 0.4s; 
  box-shadow: -5px 0 20px rgba(0,0,0,0.1); box-sizing: border-box; 
}
.side-menu.open { right: 0; }
.side-menu h3 { color: var(--dark); margin-top: 0; }
.side-menu a { display: block; padding: 12px 0; color: var(--dark); text-decoration: none; font-weight: 500; border-bottom: 1px solid #eee; }
.close-menu { background: none; border: none; font-size: 2rem; color: var(--red); cursor: pointer; float: right; margin-top: -10px; }

.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); visibility: hidden; opacity: 0; transition: 0.3s; z-index: 2500; }
.overlay.show { visibility: visible; opacity: 1; }

/* =========================================
   UI COMPONENTES: BOTONES
========================================= */
.btn-primary, .btn-secondary { padding: 12px 25px; border-radius: 50px; text-decoration: none; font-weight: 600; display: inline-block; transition: 0.3s; border: none; cursor: pointer; }
.btn-primary { background: var(--red); color: #fff; }
.btn-secondary { background: #fff; color: var(--red); border: 2px solid var(--red); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(230,0,35,0.3); }
.btn-small { font-size: 0.9rem; padding: 8px 20px; align-self: center; }

/* =========================================
   HOME: HERO, SECCIONES Y CARDS
========================================= */
.hero { padding: 60px 0; }
.hero-inner { display: flex; align-items: center; gap: 40px; }
.hero-text { flex: 1.2; order: 2; }
.hero-image { flex: 1; order: 1; }
.hero-image img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); }
.hero-text h1 { font-size: 2.6rem; color: var(--dark); line-height: 1.2; margin-bottom: 15px; }
.hero-actions { display: flex; gap: 15px; margin-top: 25px; }

.section { padding: 80px 0; }
.section-title { font-size: 2.2rem; text-align: center; color: var(--dark); margin: 0; }
.section-subtitle { text-align: center; color: #888; margin: 10px 0 40px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 25px; }
.card { background: #fff; padding: 30px; border-radius: var(--radius); box-shadow: var(--shadow); text-align: center; }

.info-card { display: flex; flex-direction: column; align-items: center; }
.card-img { width: 90px; height: 90px; object-fit: contain; margin-bottom: 20px; }

.store-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 30px; background: #fff; padding: 30px; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.horario-lista { list-style: none; padding: 0; }
.horario-lista li { display: flex; justify-content: space-between; border-bottom: 1px solid #eee; padding: 8px 0; }
.store-map { min-height: 350px; border-radius: 12px; overflow: hidden; }

/* =========================================
   POPUP Y COOKIES
========================================= */
.popup { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 5000; }
.popup-content { width: 90%; max-width: 400px; position: relative; border-radius: var(--radius); overflow: hidden; line-height: 0; }
.popup-img { width: 100%; height: auto; }
.popup-close { position: absolute; top: 12px; right: 12px; background: #fff; color: #000; border: none; width: 35px; height: 35px; border-radius: 50%; font-size: 1.5rem; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 10px rgba(0,0,0,0.3); z-index: 5001; }

.cookie-banner { position: fixed; bottom: 0; width: 100%; background: #fff; z-index: 9999; padding: 15px 0; box-shadow: 0 -5px 20px rgba(0,0,0,0.1); display: none; }
.cookie-content { max-width: 1100px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.cookie-content p { font-size: 0.85rem; margin: 0; }

.footer { padding: 40px 0; text-align: center; border-top: 1px solid #eee; }
.footer-links { margin-top: 15px; display: flex; justify-content: center; gap: 15px; font-size: 0.85rem; }
.footer-links a { color: #888; text-decoration: none; }

/* =========================================
   APP FIDELIZACIÓN: NAV Y TARJETA
========================================= */
.bottom-nav { position: fixed; bottom: 0; left: 0; width: 100%; background: #fff; display: flex; justify-content: space-around; padding: 12px 0; box-shadow: 0 -5px 20px rgba(0,0,0,0.08); z-index: 2000; }
.nav-item { text-decoration: none; color: #888; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 0.75rem; font-weight: 600; flex: 1; }
.nav-item.active { color: var(--red); }
.nav-svg { width: 24px; height: 24px; stroke: #888; fill: currentColor; transition: stroke 0.3s ease, fill 0.3s ease; margin-bottom: 2px; }
.nav-item.active .nav-svg { stroke: var(--red); fill: var(--red); }

.punto.sellado.nuevo { animation: efectoSello 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; box-shadow: 0 0 20px rgba(255, 0, 0, 0.3); }
.confeti { position: absolute; width: 8px; height: 8px; background: var(--red); border-radius: 50%; pointer-events: none; animation: lluvia 1s ease-out forwards; }

/* =========================================
   APP ALÉRGENOS: TARJETAS Y FILTROS
========================================= */
.alerta-cruzada { background: #fff3cd; color: #856404; padding: 15px; border-radius: 8px; margin-bottom: 20px; font-size: 0.9rem; border-left: 4px solid #ffeeba; }
.categoria-titulo { font-size: 1.3rem; color: var(--red); border-bottom: 2px solid var(--red-soft); padding-bottom: 5px; margin-top: 35px; margin-bottom: 15px; font-weight: 700; text-align: center;}

/* Leyenda fija móvil */
.leyenda-fija { position: fixed; bottom: 0; left: 0; width: 100%; background: #fff; box-shadow: 0 -5px 15px rgba(0,0,0,0.08); padding: 12px 10px; display: flex; justify-content: center; gap: 15px; z-index: 1000; border-top: 1px solid #eee; box-sizing: border-box; flex-wrap: wrap; }
.leyenda-item-fijo { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: #555; }

/* Nube de Botones Filtro */
.filtro-container { margin-bottom: 20px; text-align: center; }
.filtro-container label { font-weight: 600; font-size: 0.95rem; display: block; margin-bottom: 15px; color: #444; }
.filtro-botones { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; padding-bottom: 10px; }
.btn-filtro { background: #fff; border: 2px solid #eee; padding: 8px 16px; border-radius: 50px; font-size: 0.85rem; font-weight: 600; color: #666; cursor: pointer; transition: all 0.3s ease; box-shadow: 0 2px 5px rgba(0,0,0,0.02); }
.btn-filtro.activo { background: var(--red); color: white; border-color: var(--red); box-shadow: 0 4px 10px rgba(230, 0, 35, 0.2); }

/* Tarjetas de Producto */
.producto-card { background: white; border-radius: 15px; padding: 20px 15px; margin-bottom: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); display: flex; flex-direction: column; align-items: center; text-align: center; border: 1px solid #f9f9f9; }
.producto-card .producto-nombre { font-weight: 700; color: #333; font-size: 1.1rem; margin-bottom: 12px; }
.producto-card .producto-tags { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* Etiquetas (Tags) */
.tag { padding: 5px 12px; border-radius: 6px; font-size: 0.75rem; font-weight: 700; display: inline-block; white-space: nowrap; letter-spacing: 0.5px; border: 1px solid transparent; text-transform: uppercase; }
.tag-contiene { background: var(--red-soft); color: var(--red); }
.tag-trazas { background: #fff; color: #B8860B; border-color: #e5c100; } 
.tag-libre { background: #e6f4ea; color: #1e8e3e; }

/* =========================================
   PORTAL STAFF (EMPLEADOS)
========================================= */
.staff-overlay { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; text-align: center; z-index: 9999; animation: fadeIn 0.3s ease-out; }
.reward-bg { background-color: #FFD700; color: #000; } 
.success-bg { background-color: var(--red); color: #fff; } 
.big-text { font-size: 3.5rem; font-weight: 800; margin: 0; line-height: 1; text-transform: uppercase; }
.status-text { font-size: 2rem; font-weight: 600; margin: 20px 0; }
.sub-text { font-size: 1.2rem; margin-bottom: 40px; opacity: 0.9; }

.btn-staff-confirm { width: 100%; max-width: 350px; padding: 25px; font-size: 1.4rem; font-weight: 700; border: none; border-radius: var(--radius); background: var(--dark); color: #fff; text-transform: uppercase; cursor: pointer; box-shadow: 0 10px 20px rgba(0,0,0,0.2); transition: 0.3s; }
.btn-staff-confirm:disabled { background: rgba(0,0,0,0.3); color: rgba(255,255,255,0.5); box-shadow: none; cursor: not-allowed; }
.reward-bg .big-text { animation: pulse 1.5s infinite; }

/* =========================================
   ANIMACIONES
========================================= */
@keyframes efectoSello {
  0% { transform: scale(3); opacity: 0; filter: blur(5px); }
  70% { transform: scale(0.9); opacity: 1; filter: blur(0); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes lluvia {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(100px) scale(0); opacity: 0; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   RESPONSIVE (MÓVILES)
========================================= */
@media (max-width: 768px) {
  .hero-inner { flex-direction: column; text-align: center; }
  .hero-text { order: 1; } 
  .hero-image { order: 2; }
  .hero-actions { flex-direction: column; }
  .grid-3, .store-grid { grid-template-columns: 1fr; }
  .cookie-content { flex-direction: column; text-align: center; }
  .hero-text h1 { font-size: 2rem; }
}