@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@600;700;800;900&family=Plus+Jakarta+Sans:wght@300;400;600;700&display=swap');

:root {
  /* MARCA Y COLORES */
  --color-principal: #f2b705;
  --color-primary-glow: rgba(242, 183, 5, 0.45);
  --color-secundario: #ffd23f;
  --color-acento: #f59e0b;
  --color-rojo: #ff3b30;
  --color-verde: #25d366;

  /* BASE GLASSMORPHISM */
  --bg-dark: #07070a;
  --color-card: linear-gradient(145deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.03) 100%), rgba(18, 18, 30, 0.36);
  --color-card-hover: linear-gradient(145deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.06) 100%), rgba(26, 26, 42, 0.5);
  --color-borde: rgba(255, 255, 255, 0.18);
  --color-borde-subtle: rgba(255, 255, 255, 0.1);
  --color-borde-glow: rgba(242, 183, 5, 0.65);

  /* TEXTO */
  --color-texto: #ffffff;
  --color-texto-secundario: #d0d0e2;

  /* SOMBRAS Y BLUR */
  --glass-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.25);
  --glass-shadow-hover: 0 18px 45px rgba(0, 0, 0, 0.5), 0 0 25px rgba(242, 183, 5, 0.3);
  --glass-blur: blur(12px) saturate(180%);
  --glass-blur-heavy: blur(18px) saturate(190%);

  /* TIPOGRAFÍAS */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
}

* { 
  margin: 0;
  padding: 0;
  box-sizing: border-box; 
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-dark);
  color: var(--color-texto);
  font-family: var(--font-body);
  padding-bottom: 100px;
  overflow-x: hidden;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: auto;
  padding: 16px;
}

/* HEADER Y CATEGORÍAS FIJAS EN PANTALLA */
.header-fijo-container {
  position: sticky;
  top: 0;
  z-index: 9999;
  background: rgba(18, 18, 18, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-borde);
}

.nav-categorias-scroll {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 15px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.nav-categorias-scroll::-webkit-scrollbar {
  display: none;
}

.btn-categoria-item {
  background: rgba(255, 255, 255, 0.08);
  color: #dddddd;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-categoria-item.activo,
.btn-categoria-item:hover {
  background: var(--color-acento);
  color: #000000;
  border-color: var(--color-acento);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

/* PORTADA Y BRANDING */

.seccion-portada {
  border-bottom: 1px solid var(--color-borde);
  position: relative;
  width: 100%;
}

.banner-principal {
  width: 100%;
  min-height: 80vh; /* Permite que la imagen se despliegue a lo alto */
  background-size: cover;
  background-position: center top; /* Alinea la imagen desde arriba para mostrar el logo completo */
  position: relative;
}

.banner-principal::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, var(--bg-dark) 100%);
}

@media (min-width: 768px) {
  .banner-principal { height: 260px; }
}

.portada-info-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 20px 20px 20px;
  gap: 15px;
  min-height: 80px;
  position: relative;
}

.logo-restaurante {
  width: 120px; 
  height: 120px;
  border-radius: 50%;
  border: 4px solid var(--color-principal); 
  background: #111;
  object-fit: cover;
  margin-top: -45px; 
  z-index: 10;
  box-shadow: 0 0 20px var(--color-primary-glow);
  transition: transform 0.3s ease;
}

.logo-restaurante:hover {
  transform: scale(1.05);
}

.portada-acciones {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 15px;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.btn-accion-portada {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  color: #fff;
  border: 1px solid var(--color-borde);    
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.btn-accion-portada:hover {
  background: var(--color-principal);
  color: #000;
  border-color: var(--color-principal);
  box-shadow: 0 0 15px var(--color-primary-glow);
}

/* TÍTULOS DE CATEGORÍA */
.titulo-categoria {
  margin: 25px 0 15px 5px;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-texto);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  scroll-margin-top: 130px; /* Offset para el scroll cuando el nav es sticky */
}

/* GRID Y TARJETAS DE PRODUCTO */
.grid-productos {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (min-width: 768px) {
  .grid-productos { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
  .grid-productos { grid-template-columns: repeat(4, 1fr); }
}

.card-producto {
  background: var(--color-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--color-borde);
  cursor: pointer;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s ease, border-color 0.28s ease;
  display: flex;
  flex-direction: column;
  box-shadow: var(--glass-shadow);
}

.card-producto:hover { 
  background: var(--color-card-hover);
  border-color: var(--color-borde-glow);
  box-shadow: var(--glass-shadow-hover);
  transform: translateY(-5px);
}

.contenedor-media {
  width: 100%;
  height: 140px;
  overflow: hidden;
  background: #000;
  position: relative;
}

.contenedor-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.card-producto:hover .contenedor-media img {
  transform: scale(1.08);
}

.card-producto .info {
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
}

.card-producto .nombre { 
  font-family: var(--font-heading);
  font-size: 1.05rem; 
  font-weight: 700; 
  color: #fff; 
  margin-bottom: 6px;
  line-height: 1.25;
}

.card-producto .precio { 
  font-family: var(--font-heading);
  color: var(--color-principal); 
  font-weight: 800; 
  font-size: 1.2rem; 
  text-shadow: 0 0 10px rgba(242, 183, 5, 0.3);
}

/* SIDEBAR GLASS */
.sidebar {
  position: fixed;
  top: 0;
  left: -320px;
  width: 290px;
  height: 100dvh;
  background: rgba(14, 14, 22, 0.95);
  backdrop-filter: var(--glass-blur-heavy);
  -webkit-backdrop-filter: var(--glass-blur-heavy);
  z-index: 10000;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 10px 0 30px rgba(0,0,0,0.8);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--color-borde);
}

.sidebar.activo {
  transform: translateX(320px);
}

/* PANEL DEL CARRITO */
.carrito-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 100%;
  max-width: 380px;
  height: 100vh;
  height: 100dvh;
  background-color: #121218 !important;
  color: #ffffff !important;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.8);
  transition: right 0.3s ease;
  border-left: 1px solid var(--color-borde);
}

.carrito-panel.activo {
  right: 0 !important;
}

/* Header Fijo */
.carrito-header {
  padding: 20px;
  border-bottom: 1px solid var(--color-borde, rgba(255,255,255,0.1));
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.carrito-header h3 {
  color: #ffffff !important;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0;
}

.carrito-header button {
  color: #aaaaaa !important;
  background: transparent;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.carrito-header button:hover {
  color: #ffffff !important;
}

/* Cuerpo con Scroll (Solo los ítems scrollean) */
.carrito-body {
  flex: 1 1 auto;
  padding: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  color: #ffffff !important;
}

/* Footer Fijo en la parte inferior */
.carrito-footer {
  padding: 20px;
  border-top: 1px solid var(--color-borde, rgba(255,255,255,0.1));
  background-color: #121218;
  flex-shrink: 0;
}

.carrito-footer .total {
  margin-bottom: 15px;
  font-weight: 800;
  font-size: 1.2rem;
  display: flex;
  justify-content: space-between;
  color: #ffffff !important;
}

/* Botón de Confirmación */
#btn-whatsapp {
  width: 100%;
  padding: 14px;
  border-radius: 25px;
  border: none;
  background: #25d366;
  color: #000000;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  transition: opacity 0.2s ease, background 0.2s ease;
}

#btn-whatsapp:disabled {
  background: #3a3a3c !important;
  color: #8e8e93 !important;
  cursor: not-allowed;
  opacity: 0.6;
}

/* PANEL DEL CARRITO */
.carrito-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 100%;
  max-width: 380px;
  height: 100vh;
  height: 100dvh;
  background-color: #121218 !important;
  color: #ffffff !important;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.8);
  transition: right 0.3s ease;
  border-left: 1px solid var(--color-borde);
}

.carrito-panel.activo {
  right: 0 !important;
}

/* OCULTAR BOTÓN FLOTANTE CUANDO EL CARRITO ESTÁ ABIERTO */
body:has(.carrito-panel.activo) .btn-carrito-flotante,
.carrito-panel.activo ~ .btn-carrito-flotante {
  display: none !important;
}

/* Header Fijo */
.carrito-header {
  padding: 20px;
  border-bottom: 1px solid var(--color-borde, rgba(255,255,255,0.1));
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.carrito-header h3 {
  color: #ffffff !important;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0;
}

.carrito-header button {
  color: #aaaaaa !important;
  background: transparent;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

/* Cuerpo con Scroll Único */
.carrito-body {
  flex: 1 1 auto;
  padding: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  color: #ffffff !important;
}

/* Footer Fijo en la parte inferior */
.carrito-footer {
  padding: 20px;
  border-top: 1px solid var(--color-borde, rgba(255,255,255,0.1));
  background-color: #121218;
  flex-shrink: 0;
}

.carrito-footer .total {
  margin-bottom: 15px;
  font-weight: 800;
  font-size: 1.2rem;
  display: flex;
  justify-content: space-between;
  color: #ffffff !important;
}

#btn-whatsapp {
  width: 100%;
  padding: 14px;
  border-radius: 25px;
  border: none;
  background: #25d366;
  color: #000000;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
}

/* BOTÓN FLOTANTE DE SEGUNDO PLANO (Z-INDEX 9998) */
.btn-carrito-flotante {
  position: fixed;
  bottom: 24px;
  right: 20px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #000000;
  border: none;
  padding: 10px 22px;
  border-radius: 50px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  z-index: 9998;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-carrito-flotante .badge-carrito {
  position: absolute;
  top: -4px;
  right: -6px;
  background: #000000;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 900;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* MODALES GLASS */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: var(--glass-blur-heavy);
  -webkit-backdrop-filter: var(--glass-blur-heavy);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 50000;
  padding: 15px;
}

.modal-overlay.activo { 
  display: flex; 
}

.modal-box {
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%), rgba(16, 16, 24, 0.98);
  backdrop-filter: var(--glass-blur-heavy);
  -webkit-backdrop-filter: var(--glass-blur-heavy);
  border: 1px solid var(--color-borde);
  color: #fff;
  width: 100%;
  max-width: 480px;
  border-radius: 20px;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9);
}

.modal-img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  display: block;
}

.modal-info {
  padding: 20px;
}

.modal-info h2 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: #ffffff;
}

/* CONTROLES DE CANTIDAD Y ACCIONES EN MODAL */
.selector-cantidad-modal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 10px;
}

.controles-cantidad {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 8px;
  border-radius: 8px;
}

.controles-cantidad button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #2a2a35;
  color: #fff;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.controles-cantidad button:hover {
  background: var(--color-acento);
  color: #000;
}

.controles-cantidad input {
  width: 40px;
  text-align: center;
  background: transparent;
  border: none;
  color: #fff;
  font-weight: bold;
  font-size: 1rem;
}

.btn-agregar-modal {
  background: linear-gradient(135deg, #ffc400 0%, #ff8c00 100%) !important;
  color: #000000 !important;
  font-family: 'Poppins', sans-serif !important;
  font-weight: 800 !important;
  font-size: 0.95rem !important;
  border: none !important;
  border-radius: 35px !important; /* Forma de píldora redondeada como en la referencia */
  padding: 12px 20px !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  box-shadow: 0 4px 20px rgba(255, 165, 0, 0.35) !important; /* Resplandor dorado/anaranjado */
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
  cursor: pointer !important;
}

.btn-agregar-modal:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(255, 165, 0, 0.5) !important;
}

.btn-agregar-modal:active {
  transform: translateY(0);
}

.btn-cerrar-modal {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--color-borde);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- CONFIGURACIÓN DE PORTADA Y CABECERA --- */

.seccion-portada {
  position: relative;
  width: 100%;
}

.banner-principal {
  width: 100%;
  height: 220px;
  background-image: url('https://distrito.menwapp.com/assets/portada/frame-050.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Logo dinámico del JSON */
#portada-logo {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ffb703;
  background-color: #000;
}

/* --- ESTRUCTURA DEL HEADER FIJO --- */

.header-fijo-container {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: #0d0d0d;
  border-bottom: 1px solid #222;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.header-fijo-contenido {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 15px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

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

.brand-subtitle {
  color: #ffb703;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 1px;
}

/* --- BOTONES DE ACCIÓN (INFOS Y CARRITO) --- */

.header-acciones {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-header-info {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-header-cart {
  background: #ffb703;
  color: #000;
  border: none;
  padding: 6px 10px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
}

.cart-badge {
  background: #000;
  color: #fff;
  font-size: 0.7rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* --- NAVEGACIÓN HORIZONTAL DE CATEGORÍAS --- */

.nav-categorias-scroll {
  display: flex;
  overflow-x: auto;
  white-space: nowrap;
  padding: 8px 15px;
  gap: 8px;
  background-color: #141414;
  scrollbar-width: none; /* Oculta scrollbar en Firefox */
}

.nav-categorias-scroll::-webkit-scrollbar {
  display: none; /* Oculta scrollbar en Chrome/Safari */
}

/* PARTE SUPERIOR DEL LOADER */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #1c1c1e; /* Fondo oscuro acorde al diseño general */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

/* CONTENEDOR DEL LOGO */
.loader-logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
    padding: 10px;
}

/* TAMAÑO Y ANIMACIÓN DEL LOGO */
.loader-logo-animado {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    margin: 0 auto;
    border: 2px solid #ffb700; /* Borde dorado tenue */
    animation: pulsoNeon 1.8s infinite ease-in-out;
}

/* EFECTO DE PULSO Y RESPLANDOR NEÓN */
@keyframes pulsoNeon {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 10px rgba(255, 183, 0, 0.3);
        filter: brightness(0.95);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 0 25px rgba(255, 183, 0, 0.8);
        filter: brightness(1.1);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 10px rgba(255, 183, 0, 0.3);
        filter: brightness(0.95);
    }
}


.btn-cerrar-modal-info {
    border-radius: 20px !important;
    color: #000 !important;
    font-weight: 700 !important;
    padding: 8px 30px !important;
}
/* Estado base: Oculto y posicionado sobre la pantalla */
.toast {
  position: fixed;
  bottom: 90px; /* Posición sobre el botón flotante */
  left: 50%;
  transform: translate(-50%, 20px);
  background-color: #222222;
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 9999;
  pointer-events: none;

  /* Oculto por defecto */
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

/* Estado activo cuando la función JS le agrega la clase .show */
.toast.show {
  visibility: visible;
  opacity: 1;
  transform: translate(-50%, 0);
}
