/* menu-theme.css - Sistema de temas centralizado para Digital Menu */

/* ==========================================
   VARIABLES CSS - Inyectadas desde el servidor
   ========================================== */
:root {
  /* Colores del cliente - se sobrescriben dinámicamente */
  --client-primary: #2563eb;
  --client-text: #111827;
  --client-background: #F9FAFB;
  --client-category: #1e40af;
  --client-category-collapsed: #6b7280;
  --badge-bg: #DBEAFE;
  --badge-text: #2563EB;
  --card-icon: #2563EB;
  --card-text: #2563EB;
  --card-price: #2563EB;
  --cash-icon: #16A34A;
  --cash-text: #16A34A;
  --cash-price: #16A34A;
  --restaurant-title-color: #2563eb;

  /* Colores neutros constantes */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Colores de estado */
  --success: #16a34a;
  --error: #dc2626;
  --warning: #f59e0b;
  --info: #0ea5e9;
}

/* ==========================================
   FONDO DINÁMICO POR CLIENTE
   ========================================== */
body {
  background-color: var(--client-background) !important;
  background-image: none !important;
}


/* ==========================================
   Titulos Cliente
   ========================================== */

#restaurant-title {
  color: var(--restaurant-title-color) !important;
}

#app-title {
  color: var(--client-text) !important;
}

/* ==========================================
   COMPONENTES BASE
   ========================================== */

/* Botones principales */
.btn-primary {
  background: var(--client-primary);
  color: white;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* Botón de filtro */
#category-filter {
  background: var(--client-primary);
}

/* Botón de refresh */
#refresh-btn {
  background: var(--client-primary);
}

/* ==========================================
   BADGES Y ETIQUETAS
   ========================================== */

.badge {
  background-color: var(--badge-bg);
  color: var(--badge-text);
  transition: all 0.2s ease;
}

.badge:hover {
  filter: brightness(0.95);
}

/* ==========================================
   CATEGORÍAS
   ========================================== */

/* Título de categoría */
.category-title {
  color: var(--client-category);
}

/* Título de categoría colapsada */
.category-title-collapsed {
  color: var(--client-category-collapsed);
}

/* Chips de categoría - Estado normal */
.category-chip {
  background-color: var(--gray-100);
  color: var(--gray-700);
  border: 2px solid transparent;
  transition: all 0.2s ease;
  cursor: pointer;
}

.category-chip:hover {
  background-color: var(--gray-200);
}

/* Chips de categoría - Estado activo */
.category-chip-active {
  background-color: var(--client-primary);
  color: white;
  border-color: var(--client-primary);
}

/* ==========================================
   TARJETAS DE MENÚ
   ========================================== */

/* Item de menú hover/active (touch devices) */
.menu-item-list:hover,
.menu-item-list:active {
  border-left: 3px solid var(--client-primary);
  padding-left: calc(0.5rem - 3px);
}

/* Item visible en pantalla (mobile/tablet) */
@media (max-width: 1366px) {
  .menu-item-list.is-visible {
    border-left: 3px solid var(--client-primary);
    padding-left: calc(0.5rem - 3px);
  }
}

/* SKU badge */
.product-sku {
  background-color: var(--gray-100);
  color: var(--gray-600);
}

/* ==========================================
   PRECIOS Y MÉTODOS DE PAGO
   ========================================== */

/* Iconos de pago */
.payment-icon-card {
  color: var(--card-icon);
}

.payment-icon-cash {
  color: var(--cash-icon);
}

/* Texto de pago */
.payment-text-card {
  color: var(--card-text);
}

.payment-text-cash {
  color: var(--cash-text);
}

/* Precios */
.price-card {
  color: var(--card-price);
}

.price-cash {
  color: var(--cash-price);
}

/* NUEVAS CLASES PARA MÉTODOS DE PAGO (compatibilidad) */
.payment-card {
  color: var(--card-text);
}

.payment-card .price {
  color: var(--card-price);
}

.payment-cash {
  color: var(--cash-text);
}

.payment-cash .price {
  color: var(--cash-price);
}

/* ==========================================
   MODALES
   ========================================== */

.modal-content {
    background: white;
    border-radius: 1rem;
    min-height: auto;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; 
    scroll-behavior: smooth;           
}

.modal-overlay {
  background: rgba(0, 0, 0, 0.6);
}

/* ==========================================
   MODAL ANIMATIONS
   ========================================== */

@keyframes modal-in {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.animate-modal-in {
    animation: modal-in 0.3s ease-out;
}

@media (max-width: 640px) {
    .modal-content {
        margin: 0;
        border-radius: 1rem;
        min-height: auto;
        max-height: calc(100vh - 2rem);  /* Se ajusta automático con margen */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
}

/* ==========================================
   FAVORITOS
   ========================================== */

.favorites-btn {
  background: linear-gradient(135deg, #ef4444, #ec4899);
}

.favorites-section {
  background-color: #fef2f2;
  border: 2px solid #fecaca;
}

.favorite-item {
  background: white;
  border-color: #fecaca;
}

/* ==========================================
   NOTIFICACIONES
   ========================================== */

.notification {
  background: linear-gradient(135deg, var(--success), #15803d);
}

.notification-error {
  background: linear-gradient(135deg, var(--error), #b91c1c);
}

/* ==========================================
   ESTADO DE CONEXIÓN
   ========================================== */

.status-online {
  background-color: var(--success);
  animation: pulse-dot 2s infinite;
}

.status-offline {
  background-color: var(--error);
}

@keyframes pulse-dot {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

/* ==========================================
   SPINNER DE CARGA
   ========================================== */

.loading-spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================
   SCROLLBAR PERSONALIZADA
   ========================================== */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
  background: var(--client-primary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--client-category);
}

/* Scrollbar específica para modales - Sin espacio reservado */
.modal-content::-webkit-scrollbar {
    width: 0px;  /* ← Cambiar de 6px a 0px */
    background: transparent;
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.modal-content::-webkit-scrollbar-thumb {
    background: transparent;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: transparent;
}

/* ==========================================
   UTILIDADES
   ========================================== */

.text-primary {
  color: var(--client-primary);
}

.bg-primary {
  background-color: var(--client-primary);
}

.border-primary {
  border-color: var(--client-primary);
}

/* Transiciones suaves para todos los elementos interactivos */
button, a, .clickable {
  transition: all 0.2s ease;
}

/* Focus visible para accesibilidad */
:focus-visible {
  outline: 2px solid var(--client-primary);
  outline-offset: 2px;
}

/* ==========================================
   LOADING INDICATOR ANIMATION
   ========================================== */

@keyframes pulse-glow {
    0%, 100% { 
        box-shadow: 0 0 0 0 rgba(229, 38, 36, 0.7); 
    }
    70% { 
        box-shadow: 0 0 0 20px rgba(229, 38, 36, 0); 
    }
}

.logo-glow {
    animation: pulse-glow 3s infinite;
}

/* Loading indicator */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 60;
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loading-icon {
    background: linear-gradient(to right, #e52624, #ab0202);
    border-radius: 1rem;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    animation: pulse-glow 3s infinite;
}

.loading-icon i {
    color: white;
    font-size: 1.5rem;
}

.loading-text {
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
}

.loading-logo-static {
    height: 32px;
    margin-bottom: 8px;
}

/* ==========================================
   FOOTER
   ========================================== */

.footer-custom-bg {
    background: #000000;
}

.footer-custom-bg .bg-gradient-to-r.from-red-600.to-red-800 {
    background: linear-gradient(to right, #e52624, #ab0202) !important;
}

/* ==========================================
   DYNAMIC PRICING STYLES
   ========================================== */

/* Promotion banners */
.promotion-banner {
    animation: promotion-pulse 2s infinite;
}

@keyframes promotion-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* Items with discounts */
.menu-item-list.bg-gradient-to-br.from-green-50 {
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.15);
}

/* Discount badges */
.text-green-600 {
    color: #16a34a !important;
}

.line-through {
    text-decoration: line-through;
}

/* Enhanced promotion styling */
.promotion-banner:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* ==========================================
   MARQUEE EFFECT FOR LONG TITLES
   ========================================== */

/* The actual product name with marquee */
.product-name {
    display: inline-block;
    white-space: nowrap;
    max-width: none;
}

/* Only apply animation to items with overflow */
.product-name.has-overflow {
    animation: marquee-scroll var(--marquee-duration, 4s) linear infinite;
    animation-play-state: paused;
}

/* Activate marquee animation on hover/touch for all devices */
.menu-item-list:hover .product-name.has-overflow,
.menu-item-list:active .product-name.has-overflow {
    animation-play-state: running;
}

/* Activate marquee when item is visible in viewport (mobile/tablet) */
@media (max-width: 1366px) {
    .menu-item-list.is-visible .product-name.has-overflow {
        animation-play-state: running;
    }
}

/* Keyframe for marquee animation */
@keyframes marquee-scroll {
    0% {
        transform: translateX(0);
    }
    20% {
        transform: translateX(0);
    }
    80% {
        transform: translateX(var(--marquee-distance));
    }
    100% {
        transform: translateX(var(--marquee-distance));
    }
}

