/* ==========================================
   VARIABLES Y COLORES DE LA MARCA
   ========================================== */
:root {
  --bg-app: #121111;
  --bg-card: #1c1a1a;
  --border-card: #332f2f;
  --color-primary: #7d3636;
  --color-primary-hover: #994444;
  --color-accent: #ffc767;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-app);
  color: var(--text-main);
  line-height: 1.6;
}

main {
  max-width: 1250px;
  margin: 1.5rem auto;
  padding: 0 1rem;
}

/* ==========================================
   HEADER SUPERIOR (LOGO GRANDE + NOMBRE COMPLETO)
   ========================================== */
.appbar-custom {
  background: #121111;
  border-bottom: 3px solid var(--color-primary);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
}

.header-brand-container {
  max-width: 1250px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Logo grande con fondo blanco destacado */
.header-logo-box {
  background: #ffffff;
  padding: 6px 14px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.header-logo-img {
  height: 48px;
  width: auto;
  object-fit: contain;
  display: block;
}

.header-title-box {
  flex: 1;
  text-align: center;
}

.header-title-text {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  margin: 0;
  text-transform: uppercase;
  color: #ffffff;
  line-height: 1.1;
}

.header-subtitle {
  font-size: 0.7rem;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
  display: block;
  margin-top: 2px;
}

.header-right-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Píldora de conexión */
.pill {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.3);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
}
.pill.sin-conexion { 
  background: rgba(234, 88, 12, 0.15); 
  color: #fb923c; 
  border-color: rgba(251, 146, 60, 0.3);
}

/* Botón limpio de "Ver Carrito" en el header */
.btn-carrito-header {
  background: var(--color-primary);
  color: #ffffff;
  text-decoration: none;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: 0 2px 8px rgba(125, 54, 54, 0.4);
  transition: background 0.2s;
  white-space: nowrap;
}
.btn-carrito-header:hover {
  background: var(--color-primary-hover);
}

/* ==========================================
   BARRA DE NAVEGACIÓN Y FILTROS
   ========================================== */
.menu-navegacion {
  position: sticky;
  top: 73px;
  z-index: 999;
  background: rgba(18, 17, 17, 0.95);
  backdrop-filter: blur(10px);
  padding: 0.6rem 1rem;
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--border-card);
  justify-content: center;
  margin: 0;
}

.filtro-btn {
  background: #1c1a1a !important;
  color: var(--text-muted) !important;
  border: 1px solid var(--border-card) !important;
  border-radius: 999px !important;
  padding: 0.4rem 1rem !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease !important;
  font-family: inherit;
  width: auto !important;
}

.filtro-btn:hover {
  background: #272424 !important;
  color: #ffffff !important;
}

.filtro-btn.activo {
  background: var(--color-primary) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border-color: #994444 !important;
  box-shadow: 0 2px 8px rgba(125, 54, 54, 0.5) !important;
}

/* ==========================================
   TÍTULOS Y SECCIONES
   ========================================== */
.section-title-custom {
  font-size: 1.4rem;
  color: #fff;
  margin-top: 1rem;
  margin-bottom: 1.25rem;
  font-weight: 700;
  text-transform: uppercase;
  border-left: 4px solid var(--color-primary);
  padding-left: 0.75rem;
}

.card-section-custom {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 2rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.card-section-custom h2 {
  font-size: 1.2rem;
  color: #fff;
  margin-top: 0;
  margin-bottom: 1rem;
  font-weight: 700;
  border-left: 4px solid var(--color-primary);
  padding-left: 0.75rem;
}

.section-desc, .sucursal-info {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* ==========================================
   CATÁLOGO Y PRODUCTOS (2 COLUMNAS EN MÓVIL)
   ========================================== */
.grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.producto {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.producto:hover {
  border-color: var(--color-primary);
  transform: translateY(-3px);
}

.producto__foto {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  background: #121111;
}

.producto strong { 
  display: block; 
  margin-bottom: 0.25rem; 
  font-size: 1rem;
  color: #fff;
}

.producto .precio { 
  color: var(--color-accent); 
  font-weight: 800; 
  font-size: 1.15rem;
  margin-bottom: 0.2rem;
}

.producto p {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 0 0 1rem 0;
}

.producto button {
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.6rem;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: auto;
  width: 100%;
  transition: background 0.2s;
}
.producto button:hover {
  background: var(--color-primary-hover);
}

/* ==========================================
   CARRITO DE COMPRAS
   ========================================== */
#carrito-lista { list-style: none; padding: 0; margin: 0; }
#carrito-lista li {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid var(--border-card);
  padding: 0.75rem 0;
}

.carrito-nombre { font-weight: 600; color: #fff; }

.carrito-cantidad {
  display: flex;
  align-items: center;
  gap: .4rem;
  background: #121111;
  border: 1px solid var(--border-card);
  border-radius: 6px;
  padding: 2px;
}
.carrito-cantidad button {
  padding: .15rem .5rem;
  font-size: .85rem;
  background: var(--color-primary);
  border-radius: 4px;
  color: white;
  border: none;
  cursor: pointer;
}
.carrito-cantidad__valor {
  min-width: 1.2rem;
  text-align: center;
  font-weight: 700;
  color: #fff;
}

.carrito-precio { font-weight: 800; color: var(--color-accent); font-size: 1.1rem; }

.carrito-quitar {
  background: transparent;
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.3);
  padding: .3rem .6rem;
  font-size: .78rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

.carrito-footer-box {
  margin-top: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-card);
  padding-top: 1rem;
}
.carrito-total-label { font-size: 1.05rem; font-weight: 700; color: #fff; }

.carrito-actions-box {
  margin-top: 1rem;
}

.btn-custom-primary {
  background: var(--color-primary);
  color: white;
  padding: 0.7rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.9rem;
  width: 100%;
}
.btn-custom-primary:hover {
  background: var(--color-primary-hover);
}

.mensaje, .mensaje-alerta {
  font-size: 0.85rem;
  color: var(--color-accent);
  margin-top: 0.5rem;
  text-align: center;
}

.mapa {
  height: 260px;
  border-radius: 8px;
  margin-top: 0.75rem;
  border: 1px solid var(--border-card);
}

/* ==========================================
   FOOTER
   ========================================== */
footer {
  background: linear-gradient(180deg, #151414 0%, #0a0909 100%);
  border-top: 2px solid var(--color-primary);
  color: var(--text-main);
  margin-top: 3rem;
  padding: 2.5rem 1rem 1.5rem;
}

.footer-content {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  text-align: center;
}

.footer-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.footer-icon {
  width: 44px;
  height: 44px;
  background: var(--color-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.footer-bold { margin: 0 0 0.2rem; font-weight: 700; color: #ffffff; font-size: 0.9rem; }
.footer-accent { margin: 0; color: var(--color-accent); font-weight: 800; font-size: 0.95rem; }
.footer-muted { margin: 0; color: var(--text-muted); font-size: 0.8rem; }

.footer-bottom {
  max-width: 1100px;
  margin: 2rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border-card);
  text-align: center;
  font-size: 0.75rem;
  color: #6b7280;
}

/* ==========================================
   RESPONSIVO MÓVIL (2 COLUMNAS EN CATÁLOGO)
   ========================================== */
@media (max-width: 768px) {
  .header-brand-container {
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
  }

  .header-logo-box {
    padding: 4px 8px;
  }

  .header-logo-img {
    height: 36px;
  }

  .header-title-text {
    font-size: 1rem;
  }

  .header-subtitle {
    font-size: 0.55rem;
    letter-spacing: 1px;
  }

  .pill {
    display: none; 
  }

  .btn-carrito-header {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
  }

  .menu-navegacion {
    top: 53px;
    padding: 0.4rem 0.5rem;
    justify-content: flex-start;
  }

  .filtro-btn {
    padding: 0.3rem 0.8rem !important;
    font-size: 0.78rem !important;
  }

  /* Forzar 2 columnas en móvil */
  .grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .producto {
    padding: 8px !important;
  }

  .producto__foto {
    height: 95px !important;
    aspect-ratio: 4 / 3 !important;
    margin-bottom: 0.4rem !important;
  }

  .producto strong {
    font-size: 0.8rem !important;
    margin-bottom: 0.15rem !important;
    line-height: 1.1 !important;
  }

  .producto p {
    font-size: 0.7rem !important;
    margin-bottom: 0.4rem !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .producto .precio {
    font-size: 0.9rem !important;
    margin-bottom: 0.2rem !important;
  }

  .producto button {
    padding: 5px 2px !important;
    font-size: 0.7rem !important;
  }

  /* Carrito adaptado en móvil */
  #carrito-lista li { 
    grid-template-columns: 1fr auto; 
    grid-template-areas: 
      "nombre nombre" 
      "cantidad precio" 
      "quitar quitar";
    gap: 0.4rem;
    padding: 0.6rem 0;
  }

  .carrito-nombre { grid-area: nombre; font-size: 0.88rem; }
  .carrito-cantidad { grid-area: cantidad; justify-self: start; }
  .carrito-precio { grid-area: precio; justify-self: end; font-size: 1rem; }
  .carrito-quitar { grid-area: quitar; justify-self: start; }
}

@keyframes cardEntrance {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.producto {
  animation: cardEntrance 0.4s ease forwards;
  opacity: 0; /* Arrancan ocultas */
}

/* Retraso progresivo para cada tarjeta en cascada */
.producto:nth-child(1) { animation-delay: 0.05s; }
.producto:nth-child(2) { animation-delay: 0.10s; }
.producto:nth-child(3) { animation-delay: 0.15s; }
.producto:nth-child(4) { animation-delay: 0.20s; }
.producto:nth-child(5) { animation-delay: 0.25s; }
.producto:nth-child(6) { animation-delay: 0.30s; }

/* ==========================================
   PANTALLA DE CARGA / SPLASH SCREEN (TONOS CARBÓN Y ÁMBAR)
   ========================================== */
#splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  pointer-events: none;
}

.splash-panel {
  position: absolute;
  top: 0;
  width: 50vw;
  height: 100vh;
  background: #090808;
  transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
  z-index: 1;
}

.left-panel {
  left: 0;
  border-right: 1px solid rgba(255, 199, 103, 0.15);
}

.right-panel {
  right: 0;
}

#splash-screen.open .left-panel {
  transform: translateX(-100%);
}

#splash-screen.open .right-panel {
  transform: translateX(100%);
}

/* Gradiente radial cambiado de rojo a tonos oscuros y ámbar dorado */
#splash-screen::before {
  content: '';
  position: absolute;
  width: 150vw;
  height: 150vh;
  background: radial-gradient(circle, rgba(255, 199, 103, 0.15) 0%, rgba(30, 28, 28, 0.6) 40%, rgba(9, 8, 8, 0.98) 75%);
  animation: fireGlowFade 2s infinite alternate ease-in-out;
  z-index: 2;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

#splash-screen.open::before {
  opacity: 0;
}

.splash-content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

#splash-screen.open .splash-content {
  opacity: 0;
  transform: scale(1.08);
}

.splash-logo-box {
  background: #ffffff;
  padding: 14px 28px;
  border-radius: 16px;
  box-shadow: 0 0 35px rgba(255, 199, 103, 0.25); /* Sombra ámbar en lugar de roja */
  margin-bottom: 1.25rem;
  animation: pulseLogo 1.2s infinite alternate ease-in-out;
}

.splash-logo {
  height: 85px;
  width: auto;
  display: block;
}

.splash-title {
  color: #ffffff;
  font-size: 2.2rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin: 0;
  text-shadow: 0 2px 15px rgba(0, 0, 0, 0.9);
}

@keyframes fireGlowFade {
  0% { transform: scale(0.9); opacity: 0.5; }
  100% { transform: scale(1.15); opacity: 0.9; }
}

@keyframes pulseLogo {
  0% { transform: scale(0.95); box-shadow: 0 0 15px rgba(255, 199, 103, 0.2); }
  100% { transform: scale(1.05); box-shadow: 0 0 35px rgba(255, 199, 103, 0.45); }
}