@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
    --bg-dark: #0f0c29;
    --bg-gradient: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    --glass: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --acai-color: #7b1fa2; /* Morado más vibrante */
    --pitaya-color: #f06292; /* Rosado chicle */
    --mezcla-color: #ba68c8; /* Morado-rosado mezcla */
    --pistacho-color: #93c572; /* Verde pistacho */
    --vainilla-color: #fff8dc; /* Beige vainilla */
    --mezcla-pistacho-acai-color: #8a9a5b; /* Verde-púrpura mezcla */
    --text: #ffffff;
    --accent: #00e676;
    --danger: #ff5252;
}

* { box-sizing: border-box; user-select: none; }

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-gradient);
    color: var(--text);
    margin: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
}

/* Layout Principal */
.main-layout {
    display: grid;
    grid-template-columns: 1.8fr 1.2fr; /* Ajustado para dar más espacio al menú */
    width: 100%;
    height: 100%;
    gap: 20px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Paneles Glassmorphism */
.panel {
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    overflow-y: auto;
}

/* Scrollbar más gruesa para el panel de Nuevo Pedido */
.panel::-webkit-scrollbar {
    width: 16px;
}

.panel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    border: 2px solid rgba(0, 0, 0, 0.1);
}

.panel::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

h2 { margin-top: 0; font-weight: 700; color: #fff; text-shadow: 0 0 10px rgba(123, 31, 162, 0.5); }
h3 { margin: 15px 0 10px 0; font-size: 0.85rem; text-transform: uppercase; color: #b39ddb; letter-spacing: 1px; }

/* --- 0. TIPO (VASO/HELADO) --- */
.type-switch {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.type-btn {
    flex: 1;
    padding: 18px 12px;
    border-radius: 16px;
    background: rgba(255,255,255,0.05);
    border: 2px solid rgba(255,255,255,0.1);
    color: #ccc;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.type-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s;
}

.type-btn:hover::before {
    left: 100%;
}

.type-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(255,255,255,0.3);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.type-emoji {
    font-size: 2.5rem;
    line-height: 1;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    transition: transform 0.3s;
}

.type-btn:hover .type-emoji {
    transform: scale(1.1) rotate(5deg);
}

.type-name {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.type-btn.type-active {
    background: linear-gradient(135deg, #00e676, #00c853);
    color: #000;
    box-shadow: 0 0 25px rgba(0, 230, 118, 0.7), inset 0 0 20px rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.4);
    transform: translateY(-2px);
}

.type-btn.type-active .type-emoji {
    transform: scale(1.15);
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
}

/* --- 1. SABORES --- */
.flavor-switch { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 12px; 
    margin-bottom: 20px; 
}

.flavor-btn {
    flex: 1;
    padding: 18px 12px;
    border-radius: 16px;
    background: rgba(255,255,255,0.05);
    border: 2px solid rgba(255,255,255,0.1);
    color: #ccc;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.flavor-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s;
}

.flavor-btn:hover::before {
    left: 100%;
}

.flavor-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(255,255,255,0.3);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.flavor-emoji {
    font-size: 2.2rem;
    line-height: 1;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    transition: transform 0.3s;
}

.flavor-btn:hover .flavor-emoji {
    transform: scale(1.1) rotate(5deg);
}

.flavor-name {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Estados activos con colores vibrantes */
.flavor-btn.acai-active { 
    background: linear-gradient(135deg, #9d4edd, #7b1fa2); 
    color: white; 
    box-shadow: 0 0 25px rgba(123, 31, 162, 0.7), inset 0 0 20px rgba(255,255,255,0.1); 
    border-color: rgba(255,255,255,0.4); 
    transform: translateY(-2px);
}

.flavor-btn.pitaya-active { 
    background: linear-gradient(135deg, #f06292, #e91e63); 
    color: white; 
    box-shadow: 0 0 25px rgba(240, 98, 146, 0.7), inset 0 0 20px rgba(255,255,255,0.1); 
    border-color: rgba(255,255,255,0.4); 
    transform: translateY(-2px);
}

.flavor-btn.mezcla-active { 
    background: linear-gradient(135deg, #7b1fa2, #f06292, #ba68c8); 
    color: white; 
    box-shadow: 0 0 25px rgba(186, 104, 200, 0.7), inset 0 0 20px rgba(255,255,255,0.1); 
    border-color: rgba(255,255,255,0.4); 
    transform: translateY(-2px);
}

.flavor-btn.pistacho-active { 
    background: linear-gradient(135deg, #93c572, #6b8e23); 
    color: white; 
    box-shadow: 0 0 25px rgba(147, 197, 114, 0.7), inset 0 0 20px rgba(255,255,255,0.1); 
    border-color: rgba(255,255,255,0.4); 
    transform: translateY(-2px);
}

.flavor-btn.mango-maracuya-active {
    background: linear-gradient(135deg, #ffb74d, #f57c00);
    color: white;
    box-shadow: 0 0 25px rgba(245, 124, 0, 0.7), inset 0 0 20px rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.4);
    transform: translateY(-2px);
}

.flavor-btn.vainilla-active { 
    background: linear-gradient(135deg, #fff8dc, #f5deb3); 
    color: #8b4513; 
    box-shadow: 0 0 25px rgba(245, 222, 179, 0.7), inset 0 0 20px rgba(255,255,255,0.2); 
    border-color: rgba(255,255,255,0.4); 
    transform: translateY(-2px);
}

.flavor-btn.mezcla-pistacho-acai-active { 
    background: linear-gradient(135deg, #93c572, #ba68c8, #7b1fa2); 
    color: white; 
    box-shadow: 0 0 25px rgba(147, 197, 114, 0.7), inset 0 0 20px rgba(255,255,255,0.1); 
    border-color: rgba(255,255,255,0.4); 
    transform: translateY(-2px);
}

.flavor-btn.acai-active .flavor-emoji,
.flavor-btn.pitaya-active .flavor-emoji,
.flavor-btn.mezcla-active .flavor-emoji,
.flavor-btn.pistacho-active .flavor-emoji,
.flavor-btn.mango-maracuya-active .flavor-emoji,
.flavor-btn.vainilla-active .flavor-emoji,
.flavor-btn.mezcla-pistacho-acai-active .flavor-emoji {
    transform: scale(1.15);
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
}

/* Estado activo para sabores del día (botones dinámicos) */
.flavor-btn.sabor-dia-active {
    background: linear-gradient(135deg, #22c55e, #4ade80);
    color: #022c22;
    box-shadow: 0 0 25px rgba(34, 197, 94, 0.7), inset 0 0 20px rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.4);
    transform: translateY(-2px);
}

/* --- 2. VASOS (CORREGIDO) --- */
.sizes-container {
    display: flex;
    justify-content: space-around;
    align-items: flex-end; /* Alineados a la base */
    background: rgba(0,0,0,0.2);
    border-radius: 15px;
    padding: 20px 10px; /* Padding vertical para evitar desborde */
    margin-bottom: 20px;
    min-height: 160px; /* Altura flexible pero mínima segura */
}

.cup-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    opacity: 0.5;
    transition: 0.3s;
    position: relative;
}

.cup-wrapper:hover { opacity: 0.8; }
.cup-wrapper.selected { opacity: 1; transform: translateY(-5px) scale(1.05); }

/* Formas de los vasos */
.cup-shape {
    width: 45px;
    background: #555; /* Color apagado por defecto */
    border-radius: 0 0 15px 15px;
    margin-bottom: 10px;
    transition: background 0.4s, height 0.4s;
    box-shadow: inset -5px -5px 15px rgba(0,0,0,0.3);
    border-top: 3px solid rgba(255,255,255,0.1);
}

.cup-sm { height: 60px; width: 45px; }
.cup-md { height: 80px; width: 55px; }
.cup-lg { height: 105px; width: 65px; }

/* Colores dinámicos al activar */
/* Colores de sabor para TODOS los vasos (cuando se elige un sabor) */
.cup-shape.is-acai { background: linear-gradient(180deg, #ba68c8 0%, #7b1fa2 100%) !important; }
.cup-shape.is-pitaya { background: linear-gradient(180deg, #f48fb1 0%, #e91e63 100%) !important; }
.cup-shape.is-mezcla { background: linear-gradient(180deg, #f48fb1 0%, #ba68c8 50%, #7b1fa2 100%) !important; }
.cup-shape.is-pistacho { background: linear-gradient(180deg, #93c572 0%, #6b8e23 100%) !important; }
.cup-shape.is-mango_maracuya { background: linear-gradient(180deg, #ffb74d 0%, #f57c00 100%) !important; }
.cup-shape.is-vainilla { background: linear-gradient(180deg, #fff8dc 0%, #f5deb3 100%) !important; }
.cup-shape.is-mezcla_pistacho_acai { background: linear-gradient(180deg, #93c572 0%, #ba68c8 50%, #7b1fa2 100%) !important; }

/* Vaso seleccionado más brillante */
.cup-wrapper.selected .cup-shape.is-acai { filter: brightness(1.2); box-shadow: 0 0 20px rgba(123, 31, 162, 0.5); }
.cup-wrapper.selected .cup-shape.is-pitaya { filter: brightness(1.2); box-shadow: 0 0 20px rgba(233, 30, 99, 0.5); }
.cup-wrapper.selected .cup-shape.is-mezcla { filter: brightness(1.2); box-shadow: 0 0 20px rgba(186, 104, 200, 0.5); }
.cup-wrapper.selected .cup-shape.is-pistacho { filter: brightness(1.2); box-shadow: 0 0 20px rgba(147, 197, 114, 0.5); }
.cup-wrapper.selected .cup-shape.is-vainilla { filter: brightness(1.1); box-shadow: 0 0 20px rgba(245, 222, 179, 0.5); }
.cup-wrapper.selected .cup-shape.is-mezcla_pistacho_acai { filter: brightness(1.2); box-shadow: 0 0 20px rgba(147, 197, 114, 0.5); }

.cup-label { font-size: 0.9rem; font-weight: bold; margin-bottom: 2px; }
.cup-price { font-size: 0.8rem; color: #aaa; }

/* --- 3. TOPPINGS --- */
.toppings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
    gap: 8px;
    margin-bottom: 20px;
}

.topping-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 8px;
    text-align: center;
    cursor: pointer;
    transition: 0.2s;
}

.topping-card.active {
    background: var(--accent);
    color: #052c0e;
    font-weight: bold;
    transform: scale(0.95);
    box-shadow: 0 0 15px var(--accent);
}

/* Topping agotado (no se puede seleccionar) */
.topping-card.disabled {
    background: rgba(148,163,184,0.12);
    border-color: rgba(148,163,184,0.4);
    cursor: not-allowed;
    position: relative;
    opacity: 0.85;
}

.topping-card.disabled::after {
    content: 'AGOTADO';
    position: absolute;
    top: 6px;
    right: 8px;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(248,113,113,0.15);
    border: 1px solid rgba(248,113,113,0.7);
    color: #fecaca;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    color: #fecaca;
    text-shadow: 0 0 4px rgba(0,0,0,0.6);
    background: radial-gradient(circle, rgba(15,23,42,0.5), rgba(15,23,42,0.9));
}

.t-emoji { font-size: 1.5rem; display: block; margin-bottom: 2px; }
.t-name { font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }

/* Botones principales */
.btn-add {
    margin-top: auto;
    background: white;
    color: var(--bg-dark);
    padding: 15px;
    border-radius: 12px;
    border: none;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex; justify-content: space-between;
    transition: 0.2s;
}
.btn-add:active { transform: scale(0.98); }

.btn-checkout {
    width: 100%;
    padding: 18px 16px;
    margin-top: 12px;
    border: none;
    border-radius: 12px;
    background: var(--accent);
    color: #000;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 230, 118, 0.35);
    transition: transform 0.15s ease, filter 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}
.btn-checkout:hover { filter: brightness(1.08); }
.btn-checkout:active { transform: scale(0.98); }

/* --- CARRITO --- */
.cart-list { flex: 1; overflow-y: auto; padding-right: 5px; }
.cart-item {
    background: rgba(0,0,0,0.3);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    border-left: 4px solid var(--accent);
    position: relative;
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.btn-delete {
    position: absolute; top: 10px; right: 10px;
    background: rgba(255, 82, 82, 0.2); color: var(--danger);
    border: none; width: 30px; height: 30px; border-radius: 50%;
    cursor: pointer; font-weight: bold;
}

/* --- HISTORIAL (Sidebar arreglado) --- */
.history-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 99;
    display: none; /* Oculto por defecto */
}
.history-overlay.open { display: block; }

.history-sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100%;
    width: 400px;
    background: #1a1a2e;
    box-shadow: 10px 0 30px rgba(0,0,0,0.8);
    z-index: 100; /* Por encima de todo */
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 30px;
    display: flex; flex-direction: column;
}
.history-sidebar.open { transform: translateX(0); }

.history-item {
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 15px 0;
    display: flex; justify-content: space-between; align-items: center;
}
.status-pill { font-size: 0.7rem; padding: 4px 10px; border-radius: 20px; font-weight: bold; text-transform: uppercase; }
.pill-pending { background: #ff9800; color: black; }
.pill-done { background: var(--accent); color: black; }

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&display=swap');

:root {
    --bg-app: #0f172a; /* Azul noche profundo */
    --card-bg: #1e293b; /* Pizarra oscura */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --acai-glow: #a855f7; /* Morado Neón */
    --mezcla-glow: #c084fc; /* Morado-rosa mezcla */
    --acai-bg: rgba(168, 85, 247, 0.15);
    
    --pitaya-glow: #ec4899; /* Rosa Neón */
    --pitaya-bg: rgba(236, 72, 153, 0.15);
    
    --success: #10b981;
    --danger: #ef4444;
}

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

body {
    margin: 0; padding: 0;
    background-color: var(--bg-app);
    color: var(--text-main);
    font-family: 'Inter', system-ui, sans-serif;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* --- HEADER FLOTANTE --- */
.kds-header {
    height: 70px;
    padding: 0 25px;
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px); /* Efecto vidrio */
    border-bottom: 1px solid rgba(255,255,255,0.05);
    z-index: 100;
    position: relative;
    width: 100%;
    flex-shrink: 0;
}

.brand-logo { font-size: 1.5rem; font-weight: 800; letter-spacing: -1px; background: linear-gradient(to right, #fff, #94a3b8); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.stats-pill {
    background: #334155;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex !important;
    align-items: center;
    gap: 8px;
    visibility: visible !important;
    opacity: 1 !important;
}
.count-badge { background: var(--success); color: #000; padding: 2px 8px; border-radius: 10px; }

/* --- GRID SYSTEM INTELIGENTE --- */
.orders-grid {
    flex: 1;
    display: grid;
    /* ESTO ES MAGIA CSS: Crea columnas automáticas de mínimo 340px */
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    grid-auto-rows: max-content; /* Altura se adapta al contenido */
    gap: 20px;
    padding: 20px;
    overflow-y: auto;
    align-content: start; /* Pega las tarjetas arriba */
}

/* --- TARJETA PRO --- */
.order-card {
    background: var(--card-bg);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex; flex-direction: column;
}

/* Aura de urgencia por tiempo (cocina): borde + glow, no rompe el diseño */
.order-card.urgency-green {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3),
                0 0 0 3px rgba(34, 197, 94, 0.5),
                0 0 24px rgba(34, 197, 94, 0.25);
}
.order-card.urgency-yellow {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3),
                0 0 0 3px rgba(234, 179, 8, 0.6),
                0 0 24px rgba(234, 179, 8, 0.3);
}
.order-card.urgency-red {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3),
                0 0 0 3px rgba(239, 68, 68, 0.6),
                0 0 28px rgba(239, 68, 68, 0.35);
    animation: urgency-pulse 2s ease-in-out infinite;
}
@keyframes urgency-pulse {
    0%, 100% { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(239, 68, 68, 0.6), 0 0 28px rgba(239, 68, 68, 0.35); }
    50%  { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(239, 68, 68, 0.7), 0 0 36px rgba(239, 68, 68, 0.45); }
}

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

/* Barra de estado lateral (Color dinámico) */
.status-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 6px; }
.theme-acai .status-bar { background: var(--acai-glow); box-shadow: 2px 0 15px var(--acai-glow); }
.theme-pitaya .status-bar { background: var(--pitaya-glow); box-shadow: 2px 0 15px var(--pitaya-glow); }
.theme-mezcla .status-bar { background: linear-gradient(to bottom, var(--acai-glow), var(--pitaya-glow)); box-shadow: 2px 0 15px var(--mezcla-glow); }
.theme-mixed .status-bar { background: linear-gradient(to bottom, var(--acai-glow), var(--pitaya-glow)); }

/* Header de la Tarjeta */
.card-header {
    padding: 15px 20px;
    background: rgba(0,0,0,0.2);
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.order-id { font-size: 1.8rem; font-weight: 800; color: #fff; line-height: 1; }
.time-tag { font-family: monospace; font-size: 0.95rem; color: var(--text-muted); background: rgba(255,255,255,0.05); padding: 4px 8px; border-radius: 6px; }

/* Cuerpo */
.card-body { padding: 0; }
.item-row {
    padding: 15px 20px;
    border-bottom: 1px dashed rgba(255,255,255,0.1);
}
.item-row:last-child { border-bottom: none; }

/* Título del Ítem */
.item-title {
    font-size: 1.1rem; font-weight: 700; margin-bottom: 10px;
    display: flex; align-items: center; gap: 8px;
}
.icon-acai { color: var(--acai-glow); }
.icon-pitaya { color: var(--pitaya-glow); }
.icon-mezcla { color: var(--mezcla-glow); }

/* CHIPS DE TOPPINGS */
.toppings-container { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.1);
    color: #e2e8f0;
    transition: 0.2s;
}
/* Estilo sutil para chips */
.chip:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.3); }
.chip-emoji { font-size: 1.1rem; }

/* Botón Footer */
.card-footer { padding: 15px; background: rgba(0,0,0,0.2); margin-top: auto; }
.btn-finish {
    width: 100%;
    background: var(--success);
    color: #064e3b;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transition: transform 0.1s;
    display: flex; justify-content: center; align-items: center; gap: 8px;
}
.btn-finish:active { transform: scale(0.97); }

/* --- UTILS --- */
.sidebar-panel {
    position: fixed; top: 0; right: 0; bottom: 0; width: 350px;
    background: #1e293b; z-index: 200;
    transform: translateX(100%); transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    padding: 25px; display: flex; flex-direction: column;
}
.sidebar-panel.open { transform: translateX(0); }
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); z-index: 150; opacity: 0; pointer-events: none; transition: 0.3s; }
.backdrop.open { opacity: 1; pointer-events: auto; }

/* Scrollbar Bonito */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
/* ... MANTÉN TODO TU CSS ANTERIOR, AGREGA ESTO AL FINAL ... */

/* --- BOTÓN DE CONFIGURACIÓN --- */
.btn-settings {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #cbd5e1;
    width: 40px; height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    transition: 0.3s;
}
.btn-settings:hover { background: #fff; color: #000; transform: rotate(90deg); }

/* --- MODAL DE CONFIGURACIÓN --- */
.settings-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.95); /* Fondo casi opaco */
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: none; /* Oculto por defecto */
    justify-content: center; padding: 40px;
}
.settings-modal.open { display: flex; }

.settings-content {
    background: #1e293b;
    width: 100%; max-width: 800px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    display: flex; flex-direction: column;
    overflow: hidden;
    animation: zoomIn 0.3s ease;
}
@keyframes zoomIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.settings-header {
    background: #0f172a; padding: 20px; border-bottom: 1px solid #334155;
    display: flex; justify-content: space-between; align-items: center;
}
.settings-body { padding: 30px; overflow-y: auto; flex: 1; }

/* Formularios */
.form-section { margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px dashed #334155; }
.form-section h3 { color: var(--accent); margin-top: 0; }

.input-group { margin-bottom: 15px; }
.input-label { display: block; color: #94a3b8; margin-bottom: 5px; font-size: 0.9rem; }
.input-field {
    background: #0f172a; border: 1px solid #334155; color: #fff;
    padding: 10px; border-radius: 8px; width: 100%; font-size: 1rem;
}

/* Grid de precios base */
.prices-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 15px; }

/* Lista de Toppings en Config */
.topping-manager-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 15px; }
.topping-edit-item {
    background: #0f172a; padding: 10px; border-radius: 8px; border: 1px solid #334155;
    display: flex; justify-content: space-between; align-items: center;
}
.btn-delete-topping { background: #ef4444; color: white; border: none; padding: 5px 10px; border-radius: 5px; cursor: pointer; }

/* Botones de acción */
.btn-save { background: var(--accent); color: #000; padding: 12px 25px; border-radius: 8px; border: none; font-weight: bold; cursor: pointer; font-size: 1rem; }
.btn-cancel { background: transparent; color: #fff; padding: 12px 25px; border: 1px solid #555; border-radius: 8px; cursor: pointer; margin-right: 10px; }

/* --- Barra de acciones caja (Faltantes / Extras / Historial) --- */
.panel-header-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.caja-panel-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    background: linear-gradient(135deg, #ffffff 0%, #c4b5fd 55%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.caja-toolbar {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding: 3px;
    gap: 1px;
    border-radius: 11px;
    background: rgba(0, 0, 0, 0.38);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.caja-toolbar__divider {
    width: 1px;
    align-self: stretch;
    margin: 5px 3px;
    min-height: 22px;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(255, 255, 255, 0.14) 50%,
        transparent 100%
    );
    flex-shrink: 0;
}

.caja-tool {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 0;
    padding: 5px 9px;
    border: none;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    transition:
        background 0.25s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.25s ease;
}

.caja-tool::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.caja-tool--faltantes::before {
    background: radial-gradient(circle at 50% 0%, rgba(250, 204, 21, 0.2), transparent 70%);
}

.caja-tool--extras::before {
    background: radial-gradient(circle at 50% 0%, rgba(192, 132, 252, 0.22), transparent 70%);
}

.caja-tool--extras.is-active::before {
    background: radial-gradient(circle at 50% 0%, rgba(74, 222, 128, 0.28), transparent 70%);
}

.caja-tool--historial::before {
    background: radial-gradient(circle at 50% 0%, rgba(96, 165, 250, 0.2), transparent 70%);
}

.caja-tool:hover {
    transform: translateY(-1px);
}

.caja-tool:hover::before {
    opacity: 1;
}

.caja-tool:active {
    transform: translateY(0) scale(0.97);
}

.caja-tool__icon-wrap {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    line-height: 1;
    border-radius: 7px;
    flex-shrink: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.caja-tool:hover .caja-tool__icon-wrap {
    transform: scale(1.05);
}

.caja-tool--faltantes .caja-tool__icon-wrap {
    background: linear-gradient(145deg, rgba(250, 204, 21, 0.45), rgba(180, 83, 9, 0.35));
    border: 1px solid rgba(253, 224, 71, 0.4);
    box-shadow: 0 2px 8px rgba(234, 179, 8, 0.2);
}

.caja-tool--extras .caja-tool__icon-wrap {
    background: linear-gradient(145deg, rgba(192, 132, 252, 0.45), rgba(109, 40, 217, 0.35));
    border: 1px solid rgba(216, 180, 254, 0.4);
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.18);
}

.caja-tool--extras.is-active .caja-tool__icon-wrap {
    background: linear-gradient(145deg, rgba(74, 222, 128, 0.55), rgba(22, 163, 74, 0.45));
    border-color: rgba(134, 239, 172, 0.55);
    box-shadow: 0 2px 10px rgba(34, 197, 94, 0.35);
}

.caja-tool--historial .caja-tool__icon-wrap {
    background: linear-gradient(145deg, rgba(96, 165, 250, 0.45), rgba(37, 99, 235, 0.35));
    border: 1px solid rgba(147, 197, 253, 0.4);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.18);
}

.caja-tool__label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: rgba(248, 250, 252, 0.92);
    line-height: 1.15;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.caja-tool--faltantes .caja-tool__label {
    color: #fde68a;
}

.caja-tool--extras .caja-tool__label {
    color: #e9d5ff;
}

.caja-tool--extras.is-active .caja-tool__label {
    color: #bbf7d0;
}

.caja-tool--historial .caja-tool__label {
    color: #bfdbfe;
}

.caja-tool__badge {
    display: none;
    position: absolute;
    top: 1px;
    right: 2px;
    min-width: 15px;
    height: 15px;
    padding: 0 4px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: linear-gradient(135deg, #4ade80, #16a34a);
    color: #052e16;
    font-size: 0.58rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
    border: 1.5px solid rgba(15, 23, 42, 0.85);
    animation: cajaBadgePop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cajaBadgePop {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Compatibilidad si queda referencia antigua */
.header-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

@media (max-width: 900px) {
    .panel-header-row {
        flex-direction: column;
        align-items: stretch;
    }

    .caja-panel-title {
        text-align: center;
        font-size: 1.15rem;
    }

    .caja-toolbar {
        width: 100%;
        justify-content: center;
    }

    .caja-tool {
        flex: 1;
        min-width: 0;
        padding: 5px 6px;
    }
}

@media (max-width: 420px) {
    .caja-tool__label {
        font-size: 0.62rem;
    }

    .caja-tool__icon-wrap {
        width: 24px;
        height: 24px;
        font-size: 0.85rem;
    }

    .caja-tool {
        padding: 4px 5px;
        gap: 4px;
    }
}

.btn-settings {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    width: 42px; 
    height: 42px;
    border-radius: 10px; /* Cuadrado redondeado estilo iOS */
    cursor: pointer;
    display: flex; 
    align-items: center; 
    justify-content: center;
    font-size: 1.4rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.btn-settings:hover {
    background: #fff;
    color: #000;
    transform: rotate(90deg) scale(1.1);
}
.btn-settings:active { transform: scale(0.95); }

/* --- CORRECCIÓN CARRITO (DISEÑO FLEX) --- */
.cart-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
    /* Espacio para scroll */
}

.cart-item {
    background: rgba(0, 0, 0, 0.3);
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 12px;
    border-left: 4px solid var(--accent);
    /* CAMBIO CLAVE: Usamos Flexbox para separar texto de botón */
    display: flex;
    justify-content: space-between; 
    align-items: flex-start;
    gap: 16px;
    transition: all 0.2s ease;
}
.cart-item:hover { 
    background: rgba(0, 0, 0, 0.4); 
    transform: translateX(2px);
}

.cart-item-info {
    flex: 1; 
    min-width: 0; /* Permite que el texto se ajuste */
}

.item-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 6px;
    color: #fff;
    gap: 12px;
}

.item-toppings-row {
    font-size: 0.85rem;
    color: #cbd5e1;
    line-height: 1.4;
    margin-top: 4px;
}

.btn-delete {
    /* Ya no es absolute, ahora tiene su espacio propio */
    position: static; 
    background: rgba(239, 68, 68, 0.15); /* Rojo transparente */
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.2s;
    flex-shrink: 0; /* Evita que se aplaste */
}
.btn-delete:hover {
    background: #ef4444;
    color: white;
    transform: scale(1.1);
}

/* --- Panel Detalle (simple e intuitivo) --- */
.panel--detalle {
    background: rgba(0, 0, 0, 0.25) !important;
}

.detalle-title {
    margin: 0 0 12px;
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
}

.detalle-footer {
    border-top: 2px solid rgba(255, 255, 255, 0.12);
    padding-top: 14px;
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
}

.detalle-label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #cbd5e1;
}

.detalle-input {
    width: 100%;
    padding: 11px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
}

.detalle-input:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.12);
}

.detalle-rut-info {
    font-size: 0.78rem;
    line-height: 1.35;
    margin-top: -4px;
}

.detalle-quick-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.detalle-quick-btn {
    padding: 11px 10px;
    border-radius: 8px;
    border: 2px solid transparent;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    color: #fff;
    line-height: 1.25;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
}

.detalle-quick-btn--blue {
    background: rgba(59, 130, 246, 0.25);
    border-color: rgba(96, 165, 250, 0.5);
}

.detalle-quick-btn--gold {
    background: rgba(251, 191, 36, 0.2);
    border-color: rgba(251, 191, 36, 0.45);
}

.detalle-quick-btn--gold.is-active {
    background: rgba(34, 197, 94, 0.25);
    border-color: rgba(74, 222, 128, 0.55);
}

.detalle-promo-btn {
    width: 100%;
    padding: 11px 12px;
    border-radius: 8px;
    border: 2px dashed rgba(236, 72, 153, 0.55);
    background: rgba(236, 72, 153, 0.12);
    color: #fbcfe8;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    line-height: 1.3;
    transition: background 0.2s, border-color 0.2s, opacity 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.detalle-promo-btn:hover:not(:disabled) {
    background: rgba(236, 72, 153, 0.22);
    border-color: rgba(244, 114, 182, 0.7);
}

.detalle-promo-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-style: dashed;
    color: #94a3b8;
}

.detalle-promo-btn.is-active {
    border-style: solid;
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(74, 222, 128, 0.6);
    color: #bbf7d0;
}

.detalle-premio {
    padding: 12px;
    border-radius: 10px;
    border: 2px dashed rgba(167, 139, 250, 0.45);
    background: rgba(139, 92, 246, 0.1);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detalle-premio.is-active {
    border-style: solid;
    border-color: rgba(74, 222, 128, 0.55);
    background: rgba(34, 197, 94, 0.12);
}

.detalle-premio__row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.detalle-premio__input {
    width: 100%;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.detalle-premio__active {
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(74, 222, 128, 0.45);
}

.detalle-premio__active-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.detalle-premio__active-head strong {
    color: #86efac;
    font-size: 0.88rem;
}

.detalle-premio__clear {
    background: none;
    border: none;
    color: #f87171;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.detalle-premio__active-detail {
    color: #cbd5e1;
    font-size: 0.78rem;
    margin-top: 6px;
    line-height: 1.4;
}

.detalle-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.detalle-tags:empty {
    display: none;
}

.detalle-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(74, 222, 128, 0.4);
    font-size: 0.8rem;
    color: #bbf7d0;
}

.detalle-tag button {
    background: none;
    border: none;
    color: #fca5a5;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

/* Bloque tipo boleta */
.detalle-ticket {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 14px;
}

.detalle-ticket__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    color: #e2e8f0;
    margin-bottom: 6px;
}

.detalle-ticket__row--discount {
    color: #fbbf24;
    font-size: 0.9rem;
}

.detalle-ticket__discounts:empty {
    display: none;
}

.detalle-ticket__total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px solid rgba(255, 255, 255, 0.15);
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
}

.detalle-ticket__total #grandTotal,
.detalle-ticket__total .total-amount {
    font-size: 1.75rem;
    color: var(--accent);
}

.detalle-ticket__cash {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed rgba(255, 255, 255, 0.12);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detalle-ticket__cash-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    color: #cbd5e1;
}

.detalle-ticket__cash-row label {
    font-weight: 600;
    flex-shrink: 0;
}

.detalle-ticket__cash-row input {
    flex: 1;
    max-width: 160px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: #f1f5f9;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    text-align: right;
    -webkit-appearance: none;
    appearance: none;
}

.detalle-ticket__cash-row input::placeholder {
    color: rgba(148, 163, 184, 0.65);
}

.detalle-ticket__cash-row input:focus {
    outline: none;
    border-color: rgba(0, 230, 118, 0.45);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 2px rgba(0, 230, 118, 0.15);
}

.detalle-ticket__cash-row strong {
    font-size: 1.15rem;
    font-weight: 800;
    color: #a5b4fc;
}

/* Ítems del carrito */
.panel--detalle .cart-list {
    flex: 1;
    min-height: 80px;
}

.panel--detalle .cart-item {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    display: block;
}

.panel--detalle .cart-item.editing {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.12);
}

.cart-item__main {
    cursor: pointer;
}

.cart-item__top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 4px;
}

.cart-item__name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}

.cart-item__name em {
    font-style: normal;
    font-size: 0.8rem;
    color: #60a5fa;
    font-weight: 600;
}

.cart-item__price {
    font-size: 1rem;
    font-weight: 800;
    color: var(--accent);
    white-space: nowrap;
}

.cart-item__extras {
    margin: 0;
    font-size: 0.82rem;
    color: #94a3b8;
    line-height: 1.35;
}

.cart-item__note {
    margin: 6px 0 0;
    font-size: 0.82rem;
    color: #fbbf24;
    line-height: 1.35;
}

.cart-item__btns {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cart-item__btns button {
    flex: 1;
    padding: 7px 4px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.cart-item__btns button.danger {
    color: #fecaca;
    border-color: rgba(239, 68, 68, 0.45);
    background: rgba(239, 68, 68, 0.15);
}

.cart-empty {
    margin: 0;
    padding: 24px 12px;
    text-align: center;
    color: #94a3b8;
    font-size: 0.9rem;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 8px;
}