/* =============================================== */
/* === NUEVO TEMA "GRIS ACERO" PARA LA APP === */
/* =============================================== */

/* 1. Definición de la paleta de colores principal */
:root {
    --app-bg-color: #dde2e7; /* <-- NUEVO GRIS "ACERO", UN TOQUE MÁS OSCURO */
    --control-bg-color: #ffffff;
    --primary-color: #0d6efd;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
}

/* 2. Aplicar el fondo a toda la aplicación */
body {
    background-color: var(--app-bg-color);
    color: var(--text-secondary);
    padding-bottom: 70px;
    /* Alternativa más suave */
    overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
}

main#content {
    background-color: var(--app-bg-color);
    min-height: calc(100vh - 70px);
}

body, html, #content {
   /* overscroll-behavior: contain;*/
    -webkit-overflow-scrolling: touch;
}
/* 3. Estilos para Header y Footer (blancos) */
#app-header,
.bottom-nav,
.pwa-header {
    background-color: var(--control-bg-color) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary);
}

.header-title { color: var(--text-primary); }
.bottom-nav__item { color: var(--text-secondary); }
.bottom-nav__item.active { color: var(--primary-color); }
.bottom-nav__icon-main { border-color: var(--control-bg-color); }

/* 4. Estilos para Tarjetas (blancas sobre fondo gris) */
.card {
    background-color: var(--control-bg-color);
    border: none; /* <-- Eliminamos el borde para un look más limpio */
    border-radius: 1rem;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.08); /* Sombra un poco más pronunciada */
    color: var(--text-secondary);
}

.card .card-title,
.card h1, .card h2, .card h3, .card h4, .card h5, .card h6,
.card .fw-bold,
.section-title {
    color: var(--text-primary);
}

.card .text-muted { color: var(--text-secondary) !important; }

/* 5. Estilos para Botones y Filtros (CORREGIDO) */
.pill-item {
   white-space: nowrap;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    border-radius: 50rem;
    text-decoration: none;
    background-color: #e9ecef;
    color: #495057;
    border: none;
    margin-right: 0.5rem;
    transition: all 0.2s ease-in-out;
}

.pill-item.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    font-weight: 600;
}

.btn-light {
    background-color: var(--control-bg-color);
    color: var(--text-primary);
    border-color: var(--border-color);
}
/*
.header-actions .icon-btn {
    background-color: #eef1f5;
    color: var(--text-secondary);
}
*/
/*
=================================================
=== FIN DEL TEMA - TUS ESTILOS ORIGINALES COMIENZAN ABAJO ===
=================================================
*/

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    width: 100%;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
    z-index: 1000;
}

.bottom-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    text-decoration: none;
    transition: color 0.2s ease-in-out, transform 0.2s ease;
}
/*
.bottom-nav__item:hover {
    color: #555;
}
*/
.bottom-nav__item.active {
    font-weight: 600;
}

.bottom-nav__icon {
    font-size: 1.4rem;
}

.bottom-nav__text {
    font-size: 0.7rem;
    margin-top: 2px;
}

.bottom-nav__item--main {
    transform: translateY(-20px);
}

.bottom-nav__icon-main {
    width: 60px;
    height: 60px;
    background-color: var(--bs-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
    transition: transform 0.2s ease;
}

.bottom-nav__item--main:hover .bottom-nav__icon-main {
    transform: scale(1.05);
}
.fade-in {
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
}
.fade-in.loaded {
  opacity: 1;
}

.bottom-nav {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bottom-nav--hidden {
    transform: translateY(100%);
}
#app-header {
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header--hidden {
    transform: translateY(-100%);
}

/* ============================================= */
/* ESTILOS FINALES PARA EL BOTÓN FLOTANTE (FAB)  */
/* ============================================= */

#cart-fab-container {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 1040;
}
 
.cart-fab {
    /* --- INICIO DE LA LÓGICA DE ANIMACIÓN --- */
    /* Define la transición para todas las propiedades que vamos a animar */
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    transform: scale(1); /* Estado inicial: visible */
    opacity: 1;
    /* --- FIN DE LA LÓGICA DE ANIMACIÓN --- */
     background-color: #0d6efd73;
    /* background-color: #0d6efd; */ /* Color sólido para mejor visibilidad */
    color: white;
    width: 60px; /* Tamaño recomendado para accesibilidad */
    height: 60px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    margin-right: -21px;
    /* `margin-right` ya no es necesario */
}
 
.cart-fab:hover {
    transform: scale(1.1); /* Mantenemos tu efecto hover */
}

/* El badge para el contador de items */
.cart-fab .badge {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 0.8rem;
    padding: 0.3em 0.6em;
    border: 2px solid white;
    /* Las clases de Bootstrap se encargan del resto */
}

/* --- CLASE PARA OCULTAR --- */
/* Cuando añadimos esta clase con JS, se aplican estos estilos */
.cart-fab.fab-hidden {
    transform: scale(0.5) translateY(50px); /* Se encoge y baja un poco */
    opacity: 0;
    pointer-events: none; /* Impide que se pueda hacer clic en el botón invisible */
}

.badge-discount-percentage { background-color: #0d6efd; }
.badge-discount-fixed { background-color: #198754; }
.badge-2x1 { background-color: #dc3545; }
.badge-combo { background-color: #6f42c1; }

.cart-offer-badge {
  font-size: 0.75em !important;
  padding: 1px 6px !important;
  border-radius: 0.5em;
  vertical-align: middle;
  color: #fff;
  margin-left: 6px;
}

.menu-card.highlighted {
    animation: pulse-border 1.2s ease-in-out 2;
}

@keyframes pulse-border {
    0% { box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(0, 123, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 123, 255, 0); }
}

.pills-nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.pills-nav::-webkit-scrollbar {
    display: none;
}

.pwa-header {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.header-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-title {
    font-weight: 700;
    font-size: 1.2rem;
    margin: 0;
}
.pwa-content {
    padding: 1rem;
}

.back-button {
    position: absolute;
    top: 15px;
    left: 10px;
    font-size: 1.5rem;
    text-decoration: none;
    z-index: 2;
}

@keyframes chatPulse {
    0% { color: #dc3545; transform: scale(1); text-shadow: 0 0 0 rgba(0,0,0,0); }
    50% { color: #dc3545; transform: scale(1.25); text-shadow: 0 0 8px rgba(220,53,69,0.7); }
    100% { color: #dc3545; transform: scale(1); text-shadow: 0 0 0 rgba(0,0,0,0); }
}
#global-chat-badge.has-unread {
    display: block !important;
    animation: chatPulse 1.5s infinite;
}

.order-card .btn-outline-primary .position-absolute {
    top: -5px;
    right: -5px;
}

.order-card .btn-outline-primary:hover .position-absolute {
    transform: scale(1.1);
}

@keyframes chatIconPulse {
    0% { color: #dc3545; transform: scale(1); text-shadow: 0 0 0 rgba(0,0,0,0); }
    50% { color: #dc3545; transform: scale(1.25); text-shadow: 0 0 8px rgba(220,53,69,0.7); }
    100% { color: #dc3545; transform: scale(1); text-shadow: 0 0 0 rgba(0,0,0,0); }
}
.chat-icon-unread {
    animation: chatIconPulse 1.5s infinite;
    color: #dc3545 !important;
}
.menu-card-price .offer-price {
    font-weight: 700;
    color: #d9534f;
    font-size: 16px;
}
.text-danger {
    --bs-text-opacity: 1;
    color: rgba(var(--bs-danger-rgb), var(--bs-text-opacity)) !important;
}
.menu-card-price .original-price {
    text-decoration: line-through;
    color: #6c757d;
    font-size: 0.85rem;
}
 #app-loader { 
            position: fixed; 
            top: 0; 
            left: 0; 
            width: 100%; 
            height: 100%; 
            display: none; 
            justify-content: center; 
            align-items: center; 
            /*background-color: #fff; */
            z-index: 9999; 
            opacity: 0;
            transition: opacity 0.3s ease; 
        }

          .toast-container {
      position: fixed;
      bottom: 1rem;
      right: 1rem;
      z-index: 1055;
    }
    .toast {
      border-radius: 1rem;
      box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    }
    .toast-header img {
      width: 30px;
      height: 30px;
      border-radius: 50%;
      margin-right: 8px;
    }
    .reward-highlight {
      font-weight: bold;
      color: #dc3545;
    }
    .toast-body {
  background-color: #28a745; /* verde Bootstrap */
  color: #fff; /* texto blanco para contraste */
  border-radius: 0 0 1rem 1rem; /* redondeado solo abajo */
}



/* Shimmer robusto para imágenes con Bootstrap */
.skeleton-shimmer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 0.5rem;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 37%, #f0f0f0 63%);
    background-size: 400% 100%;
    animation: shimmer 1.2s infinite linear;
    z-index: 1;
}

@keyframes shimmer {
    0% { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

.fade-in {
    opacity: 0;
    transition: opacity 0.6s;
}
.fade-in.loaded {
    opacity: 1;
}

/* El contenedor de la imagen debe tener min-height y position: relative */
.img-shimmer-container {
    min-height: 150px;
    position: relative;
}

.header-actions .icon-btn {
    background-color: #eef1f5;
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.1rem;
    position: relative;
}
#search-icon-btn {
background-color: #eef1f5;
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.1rem;
    }