/* ============================================
   VARIABLES Y CONFIGURACIÓN — LIGHT THEME
   ============================================ */
:root {
    /* Paleta de colores profesional - Teal #008C94 */
    --primary-50: #f0fdfd;
    --primary-100: #ccfbfb;
    --primary-200: #99f7f7;
    --primary-300: #5ceaea;
    --primary-400: #2dd4d4;
    --primary-500: #00d9d9;
    --primary-600: #008C94;
    --primary-700: #007a82;
    --primary-800: #00656b;
    --primary-900: #005257;

    --secondary-50: #eff6ff;
    --secondary-100: #dbeafe;
    --secondary-200: #bfdbfe;
    --secondary-300: #93c5fd;
    --secondary-400: #60a5fa;
    --secondary-500: #3b82f6;
    --secondary-600: #2563eb;
    --secondary-700: #1d4ed8;
    --secondary-800: #1e40af;
    --secondary-900: #1e3a8a;

    --danger-100: #fee2e2;
    --danger-500: #ef4444;
    --danger-600: #dc2626;
    --danger-700: #b91c1c;

    --warning-400: #fbbf24;
    --warning-500: #f59e0b;
    --warning-600: #d97706;

    --success-500: #22c55e;
    --success-600: #16a34a;

    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Surfaces */
    --bg-body: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #ffffff;
    --bg-surface-glass: rgba(255, 255, 255, 0.7);
    --bg-header: rgba(0, 140, 148, 0.95);
    --bg-input: #ffffff;
    --bg-hover: #f8fafc;
    --border-color: #e2e8f0;
    --border-color-subtle: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-on-primary: #ffffff;

    /* Gradientes */
    --gradient-primary: linear-gradient(135deg, #008C94 0%, #00b4b4 100%);
    --gradient-secondary: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    --gradient-danger: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    --gradient-dark: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    --gradient-footer: linear-gradient(135deg, #0d1b2a 0%, #1b263b 100%);
    --gradient-success: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    --gradient-glass: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.6) 100%);

    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px -1px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 20px rgba(0, 140, 148, 0.25);
    --shadow-glow-lg: 0 0 40px rgba(0, 140, 148, 0.3);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 6px 16px rgba(0,0,0,0.04);
    --shadow-card-hover: 0 4px 12px rgba(0,0,0,0.08), 0 12px 28px rgba(0,0,0,0.06);

    /* Bordes */
    --radius-sm: 8px;
    --radius: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-2xl: 32px;
    --radius-full: 9999px;

    /* Transiciones */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --transition-theme: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   DARK THEME
   ============================================ */
[data-theme="dark"] {
    --bg-body: #0c1220;
    --bg-surface: #162032;
    --bg-surface-elevated: #1c2940;
    --bg-surface-glass: rgba(22, 32, 50, 0.75);
    --bg-header: rgba(12, 18, 32, 0.92);
    --bg-input: #1c2940;
    --bg-hover: #1c2940;
    --border-color: #253550;
    --border-color-subtle: #1c2940;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-on-primary: #ffffff;

    --gray-50: #0f172a;
    --gray-100: #162032;
    --gray-200: #253550;
    --gray-300: #334766;
    --gray-400: #64748b;
    --gray-500: #94a3b8;
    --gray-600: #cbd5e1;
    --gray-700: #e2e8f0;
    --gray-800: #f1f5f9;
    --gray-900: #f8fafc;

    --gradient-glass: linear-gradient(135deg, rgba(22, 32, 50, 0.9) 0%, rgba(28, 41, 64, 0.7) 100%);
    --gradient-footer: linear-gradient(135deg, #080e1a 0%, #0f172a 100%);

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px -1px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 25px rgba(0, 180, 180, 0.2);
    --shadow-glow-lg: 0 0 50px rgba(0, 180, 180, 0.25);
    --shadow-card: 0 2px 8px rgba(0,0,0,0.2), 0 0 1px rgba(0,180,180,0.1);
    --shadow-card-hover: 0 8px 24px rgba(0,0,0,0.3), 0 0 1px rgba(0,180,180,0.2);
}

/* ============================================
   RESET Y BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background var(--transition-theme), color var(--transition-theme);
}

/* ============================================
   HEADER — Glassmorphism
   ============================================ */
header {
    background: var(--bg-header);
    color: var(--text-on-primary);
    padding: 0.875rem 1.25rem;
    box-shadow: 0 1px 0 rgba(255,255,255,0.05), var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: background var(--transition-theme);
}

[data-theme="dark"] header {
    border-bottom-color: rgba(0, 180, 180, 0.1);
}

header h1 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    text-shadow: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 50vw;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    padding: 0.5rem 0.675rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
}

.btn-icon:active {
    transform: translateY(0) scale(0.95);
}

.btn-icon.hidden {
    visibility: hidden;
    pointer-events: none;
}

#btn-theme {
    font-size: 1.1rem;
    transition: all var(--transition);
}

#btn-theme:hover {
    transform: rotate(15deg) translateY(-1px);
}

.spacer {
    width: 44px;
}

/* Sincronización */
.sync-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-full);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: syncPulse 2s infinite ease-in-out;
}

.sync-indicator.hidden {
    display: none;
}

.sync-indicator span {
    display: block;
}

@media (max-width: 480px) {
    .sync-indicator span {
        display: none; /* Solo icono en móviles muy pequeños */
    }
    .sync-indicator {
        padding: 0.5rem;
    }
}

@keyframes syncPulse {
    0% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.02); }
    100% { opacity: 0.8; transform: scale(1); }
}

/* ============================================
   CONTENEDOR PRINCIPAL
   ============================================ */
#app-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 1.25rem 1.25rem 5rem;
    flex: 1;
    transition: max-width 0.3s ease;
}

/* Responsivo perfeccionado */
@media (max-width: 960px) {
    #app-container {
        max-width: 100%;
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    #app-container {
        padding: 0.75rem 0.5rem 5rem;
    }
}

/* Wider container for table views (e.g. History) */
#app-container:has(table),
#app-container:has(.table-responsive) {
    max-width: 1200px;
}

/* Page transition wrapper */
.page-transition {
    animation: pageIn 0.35s ease-out;
}

@keyframes pageIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   PANTALLA DE CARGA INICIAL
   ============================================ */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 72px);
    text-align: center;
}

.logo-container {
    margin-bottom: 3rem;
    animation: fadeInUp 0.6s ease-out;
}

.logo-icon {
    width: 100px;
    height: 100px;
    background: var(--gradient-primary);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    animation: pulse 2s ease-in-out infinite;
}

.logo-icon i {
    font-size: 3rem;
    color: white;
}

.logo-container h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.tagline {
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 500;
}

/* ============================================
   HOME — BANNER & CLOCK
   ============================================ */
.home-banner {
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-bottom: 1.25rem;
    position: relative;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-card);
    transition: transform var(--transition), box-shadow var(--transition);
    animation: fadeInUp 0.4s ease-out;
}

.home-banner:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
}

.home-banner-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: 0;
}

.home-banner-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.home-banner-content {
    position: relative;
    z-index: 2;
    color: white;
    text-align: center;
    padding: 1.5rem 1.25rem;
    width: 100%;
}

.home-banner-content h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.home-banner-content p {
    font-size: 0.9375rem;
    opacity: 0.9;
    text-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.home-clock-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
    animation: fadeInUp 0.45s ease-out;
    transition: background var(--transition-theme), border-color var(--transition-theme);
}

.clock-greeting {
    display: flex;
    flex-direction: column;
}

.clock-greeting .greeting-text {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.clock-greeting .greeting-sub {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 500;
}

.clock-time {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.clock-time .time-display {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-600);
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.clock-time .date-display {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: capitalize;
}

/* ============================================
   HOME — MENU GRID
   ============================================ */
.home-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.875rem;
}

.home-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1rem;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.home-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    opacity: 0;
    transition: opacity var(--transition);
}

.home-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--primary-300);
}

.home-card:hover::before {
    opacity: 1;
}

.home-card:active {
    transform: translateY(-1px) scale(0.98);
}

.home-card .card-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: white;
    flex-shrink: 0;
    box-shadow: var(--shadow-md);
}

.home-card .card-label {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.home-card .card-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-top: -0.25rem;
}

.home-card.card--primary::before { background: var(--gradient-primary); }
.home-card.card--blue::before { background: var(--gradient-secondary); }
.home-card.card--amber::before { background: var(--gradient-warning); }
.home-card.card--dark::before { background: var(--gradient-dark); }
.home-card.card--disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Stagger animation for cards */
.stagger-item {
    opacity: 1;
    transform: translateY(0);
}

/* Solo aplicar animación de entrada si es un renderizado nuevo */
.stagger-item {
    animation: staggerIn 0.3s ease-out forwards;
    backface-visibility: hidden;
}

@keyframes staggerIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   BOTONES
   ============================================ */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    min-height: 52px;
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow-md);
    margin-bottom: 0.75rem;
    position: relative;
    overflow: hidden;
    letter-spacing: -0.01em;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    pointer-events: none;
}

.btn:active {
    transform: scale(0.97);
    box-shadow: var(--shadow);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-primary:hover {
    box-shadow: var(--shadow-xl), var(--shadow-glow);
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--primary-600);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--primary-300);
}

.btn-danger {
    background: var(--gradient-danger);
    color: white;
}

.btn-danger:hover {
    box-shadow: var(--shadow-xl), 0 0 20px rgba(239, 68, 68, 0.3);
}

.btn-warning {
    background: var(--gradient-warning);
    color: var(--gray-900);
}

[data-theme="dark"] .btn-warning {
    color: #1e293b;
}

.btn-warning:hover {
    box-shadow: var(--shadow-xl), 0 0 20px rgba(245, 158, 11, 0.3);
}

.btn-info {
    background: var(--gradient-secondary);
    color: white;
}

.btn-info:hover {
    box-shadow: var(--shadow-xl), 0 0 20px rgba(59, 130, 246, 0.3);
}

.btn-success {
    background: var(--gradient-success);
    color: white;
}

.btn-success:hover {
    box-shadow: var(--shadow-xl), 0 0 20px rgba(16, 185, 129, 0.3);
}

.btn-light {
    background: var(--bg-surface);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-small {
    min-height: 38px;
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
    display: inline-flex;
    width: auto;
    margin-right: 0.5rem;
    border-radius: var(--radius-md);
}

/* ============================================
   GRID DE BOTONES (Legacy fallback)
   ============================================ */
.btn-grid {
    display: grid;
    gap: 0.875rem;
    margin-top: 1rem;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
    transition: all var(--transition), background var(--transition-theme), border-color var(--transition-theme);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}

.card:hover::before {
    opacity: 1;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-subtitle {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    font-weight: 500;
}

.card-body {
    color: var(--text-secondary);
    line-height: 1.7;
}

.card-footer {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ============================================
   BADGES DE ESTADO
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.3125rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-pendiente {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}

.badge-pagado {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
}

.badge-cancelado {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
}

.badge-entregado {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    color: #3730a3;
}

.badge-mercadopago {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
}

.badge-efectivo {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
}

.badge-point {
    background: linear-gradient(135deg, #e9d5ff 0%, #d8b4fe 100%);
    color: #6b21a8;
}

[data-theme="dark"] .badge-pendiente {
    background: linear-gradient(135deg, rgba(251,191,36,0.15) 0%, rgba(251,191,36,0.25) 100%);
    color: #fbbf24;
}

[data-theme="dark"] .badge-pagado {
    background: linear-gradient(135deg, rgba(34,197,94,0.15) 0%, rgba(34,197,94,0.25) 100%);
    color: #4ade80;
}

[data-theme="dark"] .badge-cancelado {
    background: linear-gradient(135deg, rgba(239,68,68,0.15) 0%, rgba(239,68,68,0.25) 100%);
    color: #f87171;
}

[data-theme="dark"] .badge-entregado {
    background: linear-gradient(135deg, rgba(99,102,241,0.15) 0%, rgba(99,102,241,0.25) 100%);
    color: #a5b4fc;
}

[data-theme="dark"] .badge-mercadopago {
    background: linear-gradient(135deg, rgba(59,130,246,0.15) 0%, rgba(59,130,246,0.25) 100%);
    color: #60a5fa;
}

[data-theme="dark"] .badge-efectivo {
    background: linear-gradient(135deg, rgba(34,197,94,0.15) 0%, rgba(34,197,94,0.25) 100%);
    color: #4ade80;
}

[data-theme="dark"] .badge-point {
    background: linear-gradient(135deg, rgba(168,85,247,0.15) 0%, rgba(168,85,247,0.25) 100%);
    color: #c084fc;
}

/* ============================================
   FORMULARIOS
   ============================================ */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    letter-spacing: -0.01em;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    font-family: inherit;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition), background var(--transition-theme);
    background: var(--bg-input);
    color: var(--text-primary);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px rgba(0, 140, 148, 0.12);
}

[data-theme="dark"] .form-input:focus,
[data-theme="dark"] .form-select:focus,
[data-theme="dark"] .form-textarea:focus {
    box-shadow: 0 0 0 4px rgba(0, 180, 180, 0.15);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25rem;
    padding-right: 2.5rem;
}

/* ============================================
   LISTA DE PRODUCTOS
   ============================================ */
.producto-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.125rem;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    margin-bottom: 0.625rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all var(--transition), background var(--transition-theme);
    position: relative;
}

.producto-item::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--primary-500);
    border-radius: 0 3px 3px 0;
    transition: height var(--transition);
}

.producto-item:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-200);
}

.producto-item:hover::after {
    height: 60%;
}

.producto-info {
    flex: 1;
}

.producto-nombre {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
    font-size: 0.9375rem;
    letter-spacing: -0.01em;
}

.producto-categoria {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.producto-precio {
    font-size: 1.0625rem;
    font-weight: 800;
    color: var(--primary-600);
    margin-right: 0.875rem;
    letter-spacing: -0.025em;
}

[data-theme="dark"] .producto-precio {
    color: var(--primary-400);
}

.producto-actions {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.btn-cantidad {
    width: 36px;
    height: 36px;
    border: 2px solid var(--primary-300);
    background: var(--bg-surface);
    color: var(--primary-600);
    border-radius: var(--radius);
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-cantidad:hover {
    background: var(--primary-600);
    color: white;
    border-color: var(--primary-600);
    transform: scale(1.08);
}

.btn-cantidad:active {
    transform: scale(0.92);
}

.cantidad-display {
    min-width: 32px;
    text-align: center;
    font-weight: 800;
    font-size: 1.0625rem;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

/* ============================================
   RESUMEN DE PEDIDO
   ============================================ */
.resumen-pedido {
    background: var(--gradient-primary);
    color: white;
    padding: 1.5rem;
    border-radius: var(--radius-xl);
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    position: relative;
    overflow: hidden;
}

.resumen-pedido::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.resumen-pedido h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
    letter-spacing: -0.01em;
}

.resumen-items {
    margin-bottom: 1rem;
    position: relative;
}

.resumen-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    padding: 0.375rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.resumen-item:last-child {
    border-bottom: none;
}

.resumen-total {
    border-top: 2px solid rgba(255, 255, 255, 0.25);
    padding-top: 1rem;
    margin-top: 1rem;
    display: flex;
    justify-content: space-between;
    font-size: 1.375rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    position: relative;
}

/* ============================================
   TABLA
   ============================================ */
.table-responsive {
    overflow-x: auto;
    margin-bottom: 1rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

table {
    width: 100%;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-collapse: collapse;
}

th {
    background: var(--gradient-primary);
    color: white;
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: background var(--transition);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: var(--bg-hover);
}

/* Zebra striping */
tbody tr:nth-child(even) td,
table tr:nth-child(even) td {
    background: var(--bg-body);
}

tbody tr:nth-child(even):hover td,
table tr:nth-child(even):hover td {
    background: var(--bg-hover);
}

/* ============================================
   BUSCADOR Y FILTROS
   ============================================ */
.search-container {
    background: var(--bg-surface);
    transition: all var(--transition), background var(--transition-theme);
    border-bottom: 1px solid var(--border-color);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 1rem;
    margin-bottom: -1px;
}

.categorias-wrapper {
    margin-top: 0.5rem;
}

.categorias-scroll {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem 0 0.75rem;
    -ms-overflow-style: none;
    scrollbar-width: none;
    scroll-behavior: smooth;
}

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

.scroll-btn {
    width: 36px;
    height: 36px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-600);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
    transition: all var(--transition);
    margin-bottom: 0.375rem;
}

.scroll-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary-400);
    transform: translateY(-1px);
}

.scroll-btn:active {
    transform: translateY(0) scale(0.95);
}

.btn-filtro {
    white-space: nowrap;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-secondary);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: auto;
}

.btn-filtro:hover {
    background: var(--bg-hover);
    transform: translateY(-1px);
}

.btn-filtro.active {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.producto-nota input {
    border: 1px dashed var(--primary-300);
    border-radius: var(--radius-sm);
    background: var(--bg-hover);
}

.producto-nota input:focus {
    border-style: solid;
    background: var(--bg-input);
}

/* ============================================
   TOAST (NOTIFICACIONES) — Mejorado con tipos
   ============================================ */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(200%);
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-2xl);
    z-index: 2000; /* Alto z-index para que aparezca sobre el panel lateral oscuro */
    transition: transform var(--transition-slow);
    max-width: 90%;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-weight: 600;
    font-size: 0.875rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* Toast types */
.toast.toast--default,
.toast:not(.toast--success):not(.toast--error):not(.toast--info) {
    background: var(--gray-800);
    color: white;
    border: 1px solid var(--gray-700);
}

[data-theme="dark"] .toast.toast--default,
[data-theme="dark"] .toast:not(.toast--success):not(.toast--error):not(.toast--info) {
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(0, 180, 180, 0.2);
}

.toast.toast--success {
    background: linear-gradient(135deg, #065f46 0%, #047857 100%);
    color: white;
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.toast.toast--error {
    background: linear-gradient(135deg, #991b1b 0%, #b91c1c 100%);
    color: white;
    border: 1px solid rgba(252, 165, 165, 0.3);
}

.toast.toast--info {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
    color: white;
    border: 1px solid rgba(147, 197, 253, 0.3);
}

.toast i {
    font-size: 1.125rem;
}

/* ============================================
   LOADING
   ============================================ */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(12, 18, 32, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.loading.hidden {
    display: none;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary-400);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

.loading p {
    color: white;
    margin-top: 1.25rem;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: -0.01em;
}

/* ============================================
   QR CODE
   ============================================ */
.qr-container {
    text-align: center;
    padding: 1.75rem;
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    margin: 1.5rem 0;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.qr-container h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    letter-spacing: -0.01em;
}

.qr-container img {
    max-width: 220px;
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 4px solid var(--border-color);
}

/* ============================================
   FOOTER
   ============================================ */
footer {
    background: var(--gradient-footer);
    color: white;
    padding: 1.75rem 1.25rem;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    transition: background var(--transition-theme);
}

.footer-content {
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-logo img {
    height: 44px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: transform var(--transition);
}

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

.footer-logo-fallback {
    display: none;
    align-items: center;
    gap: 0.25rem;
}

.logo-s {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--primary-400);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.logo-text {
    font-size: 1.375rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.025em;
}

.footer-text {
    text-align: center;
}

.footer-text p {
    font-size: 0.875rem;
    color: var(--gray-400);
    margin-bottom: 0.25rem;
}

[data-theme="dark"] .footer-text p {
    color: #64748b;
}

.footer-text strong {
    color: var(--primary-400);
    font-weight: 700;
}

.copyright {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.footer-social {
    display: flex;
    gap: 0.75rem;
}

.social-link {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    font-size: 1.125rem;
    transition: all var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.06);
    text-decoration: none;
}

.social-link:hover {
    background: var(--primary-600);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 140, 148, 0.4);
}

/* ============================================
   UTILIDADES
   ============================================ */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.mb-1 {
    margin-bottom: 1rem;
}

.mb-2 {
    margin-bottom: 2rem;
}

.mt-1 {
    margin-top: 1rem;
}

.mt-2 {
    margin-top: 2rem;
}

/* ============================================
   TÍTULOS DE SECCIÓN
   ============================================ */
h2 {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

h2::before {
    content: '';
    width: 4px;
    height: 24px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

/* ============================================
   ANIMACIONES
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: var(--shadow-xl), var(--shadow-glow);
    }
    50% {
        transform: scale(1.05);
        box-shadow: var(--shadow-2xl), var(--shadow-glow-lg);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes glowPulse {
    0%, 100% {
        box-shadow: var(--shadow-card);
    }
    50% {
        box-shadow: var(--shadow-card), var(--shadow-glow);
    }
}

/* Card animation */
.card {
    animation: fadeInUp 0.35s ease-out;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 120px);
    padding: 1rem;
}

.login-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2.5rem 2rem;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    text-align: center;
    animation: loginIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

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

.login-icon {
    width: 72px;
    height: 72px;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    animation: pulse 3s ease-in-out infinite;
}

.login-icon i {
    font-size: 2rem;
    color: white;
}

.login-card h2 {
    justify-content: center;
    margin-bottom: 0.25rem;
    font-size: 1.5rem;
}

.login-card h2::before {
    display: none;
}

.login-card .login-subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.9375rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (min-width: 768px) {
    #app-container {
        padding: 2rem;
    }

    .btn-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .home-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    header {
        padding: 1rem 2rem;
    }

    header h1 {
        font-size: 1.25rem;
        max-width: none;
    }

    footer {
        padding: 2rem;
    }

    .footer-content {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }

    .footer-logo {
        justify-content: flex-start;
    }

    .footer-text {
        text-align: center;
    }

    .login-card {
        padding: 3rem 2.5rem;
    }
}

@media (max-width: 480px) {
    #app-container {
        padding: 0.875rem;
    }

    .btn {
        min-height: 48px;
        font-size: 0.875rem;
    }

    .card {
        padding: 1rem;
        border-radius: var(--radius-md);
    }

    .resumen-pedido {
        padding: 1.125rem;
    }

    footer {
        padding: 1.25rem 1rem;
    }

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

    .logo-s {
        font-size: 1.75rem;
    }

    .logo-text {
        font-size: 1.125rem;
    }

    .home-grid {
        gap: 0.625rem;
    }

    .home-card {
        padding: 1rem 0.75rem;
    }

    .home-card .card-icon {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }

    .home-card .card-label {
        font-size: 0.8125rem;
    }

    .home-card .card-desc {
        display: none;
    }

    .clock-time .time-display {
        font-size: 1.25rem;
    }

    .home-banner-content h3 {
        font-size: 1.1rem;
    }

    header h1 {
        font-size: 1rem;
        max-width: 42vw;
    }

    .login-card {
        padding: 2rem 1.25rem;
    }
}

/* ============================================
   EFECTOS ADICIONALES
   ============================================ */
/* Ripple en botones */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--gray-600);
}

/* Selección de texto */
::selection {
    background: rgba(0, 140, 148, 0.25);
    color: inherit;
}

/* Theme transition on all common elements */
.card, .form-input, .form-select, .form-textarea,
.producto-item, .search-container, .home-clock-bar,
.btn-filtro, .scroll-btn, table, td, th {
    transition: background var(--transition-theme),
                border-color var(--transition-theme),
                color var(--transition-theme),
                box-shadow var(--transition);
}

/* ============================================
   CARRITO LATERAL FLOTANTE
   ============================================ */
.floating-cart-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 900;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    color: white;
    font-size: 1.125rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    cursor: pointer;
    border: none;
    transition: transform var(--transition-bounce), box-shadow var(--transition);
}

.floating-cart-btn:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-2xl), var(--shadow-glow-lg);
}

.floating-cart-btn .badge-count {
    background: white;
    color: var(--primary-600);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 800;
}

/* Overlay oscuro cuando el panel está abierto */
.cart-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cart-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* El panel lateral en sí */
.cart-drawer {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    max-width: 100vw;
    height: 100vh;
    background: var(--bg-body);
    z-index: 1060;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cart-drawer.active {
    right: 0;
}

.cart-drawer-header {
    background: var(--gradient-primary);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
    z-index: 10;
}

.cart-drawer-header h3 {
    margin: 0;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-drawer-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 1.25rem;
}

.cart-drawer-close:hover {
    background: rgba(255, 255, 255, 0.4);
}

.cart-drawer-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1.5rem;
    /* Evitar que flexbox encoja los hijos (lo que causaba el corte) */
    display: block; 
    overscroll-behavior: contain;
    padding-bottom: 6rem; /* Margen extra inferior para scrolling cómodo */
}

@media (max-width: 480px) {
    .floating-cart-btn {
        bottom: 1.25rem;
        right: 1.25rem;
        font-size: 1rem;
    }
}

/* ============================================
   MODALS / POPUPS
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-surface);
    width: 90%;
    max-width: 600px;
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-2xl);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-600);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.guarniciones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    background: var(--bg-hover);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.guarnicion-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    cursor: pointer;
}