/* menu-theme.css - Centralized theme system for Digital Menu */

/* ==========================================
   CSS VARIABLES - Injected from server
   ========================================== */
:root {
  /* Client colors - dynamically overwritten */
  --client-primary: #2563eb;
  --client-text: #111827;
  --client-background: #F9FAFB;
  --client-category: #1e40af;
  --client-category-collapsed: #6b7280;
  --badge-bg: #DBEAFE;
  --badge-text: #2563EB;
  /* Card price colors */
  --card-icon: #1D4ED8;
  --card-text: #1D4ED8;
  --card-price-text: #1D4ED8;
  --card-box-bg: #EFF6FF;
  --card-box-border: #BFDBFE;
  --card-icon-display: inline;
  --card-text-display: inline;

  /* Cash price colors */
  --cash-icon: #059669;
  --cash-text: #059669;
  --cash-price-text: #059669;
  --cash-box-bg: #ECFDF5;
  --cash-box-border: #A7F3D0;
  --cash-icon-display: inline;
  --cash-text-display: inline;

  /* Bitecoin price colors */
  --bitecoin-icon: #F97316;
  --bitecoin-text: #F97316;
  --bitecoin-price-text: #F97316;
  --bitecoin-box-bg: #FFF7ED;
  --bitecoin-box-border: #FDBA74;
  --bitecoin-icon-display: inline;
  --bitecoin-text-display: inline;

  /* Availability colors */
  --availability-available: #16A34A;
  --availability-unavailable: #DC2626;

  --restaurant-title-color: #2563eb;

  /* Button text color */
  --button-text: #FFFFFF;

  /* Constant neutral colors */
  --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;

  /* Status colors */
  --success: #16a34a;
  --error: #dc2626;
  --warning: #f59e0b;
  --info: #0ea5e9;
}

/* ==========================================
   DYNAMIC CLIENT BACKGROUND
   ========================================== */
body {
  background-color: var(--client-background) !important;
  background-image: none !important;
}


/* ==========================================
   Client Titles
   ========================================== */

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

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

/* ==========================================
   BASE COMPONENTS
   ========================================== */

/* Primary buttons */
.btn-primary {
  background: var(--client-primary);
  color: var(--button-text);
  transition: all 0.3s ease;
}

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

/* Filter button */
#category-filter {
  background: var(--client-primary);
}

/* Refresh button */
#refresh-btn {
  background: var(--client-primary);
}

/* ==========================================
   BADGES AND LABELS
   ========================================== */

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

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

/* ==========================================
   CATEGORIES
   ========================================== */

/* Category title */
.category-title {
  color: var(--client-category);
}

/* Collapsed category title */
.category-title-collapsed {
  color: var(--client-category-collapsed);
}

/* Category chips - Normal state */
.category-chip {
  background-color: var(--gray-100);
  color: var(--gray-700);
  border: 2px solid transparent;
  transition: all 0.2s ease;
  cursor: pointer;
  outline: none;
}

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

.category-chip:focus {
  outline: none;
  border-color: transparent;
}

/* Category chips - Active state */
.category-chip-active {
  background-color: var(--client-primary) !important;
  color: var(--button-text) !important;
  border-color: var(--client-primary) !important;
}

.category-chip-active:focus {
  background-color: var(--client-primary) !important;
  color: var(--button-text) !important;
  border-color: var(--client-primary) !important;
}

/* ==========================================
   MENU CARDS
   ========================================== */

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

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

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

/* ==========================================
   PRICES AND PAYMENT METHODS
   ========================================== */

/* Payment icons */
.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);
}

/* NEW CLASSES FOR PAYMENT METHODS (compatibility) */
.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);
}

/* ==========================================
   MODALS
   ========================================== */

.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);  /* Auto adjust with margin */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
}

/* ==========================================
   FAVORITES
   ========================================== */

.favorites-section {
  background-color: color-mix(in srgb, var(--client-primary) 8%, white);
  border: 2px solid color-mix(in srgb, var(--client-primary) 30%, white);
}

.favorite-item {
  background: white;
  border-color: color-mix(in srgb, var(--client-primary) 30%, white);
}

/* ==========================================
   NOTIFICATIONS
   ========================================== */

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

/* ==========================================
   CONNECTION STATUS
   ========================================== */

.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(22, 163, 74, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(22, 163, 74, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0);
  }
}

/* ==========================================
   LOADING SPINNER
   ========================================== */

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

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

/* ==========================================
   CUSTOM SCROLLBAR
   Use native browser scrollbars for consistency
   ========================================== */

/* Modal specific - hide scrollbar but keep functionality */
.modal-content {
    scrollbar-width: none;  /* Firefox */
    -ms-overflow-style: none;  /* IE/Edge */
}

.modal-content::-webkit-scrollbar {
    display: none;  /* Chrome/Safari */
}

/* ==========================================
   UTILITIES
   ========================================== */

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

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

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

/* Smooth transitions for all interactive elements */
button, a, .clickable {
  transition: all 0.2s ease;
}

/* Focus visible for accessibility */
: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;
}

/* ==========================================
   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(22, 163, 74, 0.15);
}

/* Discount badges */
.text-green-600 {
    color: var(--success) !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));
    }
}

/* ==========================================
   MODAL DESCRIPTION STYLES
   Force all child elements to inherit color
   ========================================== */
.product-description,
.product-description * {
    color: inherit !important;
}

/* ==========================================
   LARGE PRICE SCALING
   Reduces font size for prices >= $100
   ========================================== */
.price-large {
    font-size: 0.75rem !important;
}

@media (min-width: 640px) {
    .price-large {
        font-size: 1rem !important;
    }
}

@media (min-width: 1024px) {
    .price-large {
        font-size: 1.125rem !important;
    }
}

/* ==========================================
   XLARGE PRICE SCALING
   Reduces font size for prices >= $1000
   ========================================== */
.price-xlarge {
    font-size: 0.625rem !important;
}

@media (min-width: 640px) {
    .price-xlarge {
        font-size: 0.875rem !important;
    }
}

@media (min-width: 1024px) {
    .price-xlarge {
        font-size: 1rem !important;
    }
}

