/* =========================================
   1. VARIABLES DE DISEÑO
   ========================================= */
:root {
    --bg-body: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    --bg-card: #ffffff;
    --text-main: #1F2937;
    --text-sec: #6b7280;
    --border-color: #e5e7eb;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --primary: #8A2BE2;
    --primary-gradient: linear-gradient(135deg, #8A2BE2, #FF69B4);
    --accent: #FF69B4;
    --input-bg: #ffffff;
    --shadow-card: 0 4px 10px rgba(0,0,0,0.03);
}

[data-theme="dark"] {
    --bg-body: linear-gradient(135deg, #0f0c29 0%, #1a1a2e 100%);
    --bg-card: #1e1e24;
    --text-main: #e0e0e0;
    --text-sec: #a0a0a0;
    --border-color: #333333;
    --glass-bg: rgba(30, 30, 36, 0.9);
    --primary: #9D4EDD;
    --primary-gradient: linear-gradient(135deg, #7b2cbf, #9d4edd);
    --accent: #ff006e;
    --input-bg: #2b2b36;
    --shadow-card: 0 4px 15px rgba(0,0,0,0.5);
}

/* =========================================
   2. ESTILOS GENERALES Y RUTAS ESTRICTAS
   ========================================= */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { font-family: 'Poppins', sans-serif; background: var(--bg-body); color: var(--text-main); margin: 0; padding-bottom: 80px; min-height: 100vh; overflow-x: hidden; transition: background 0.5s ease, color 0.5s ease; }

/* REGLA CRÍTICA: Previene superposición de vistas */
.view { display: none !important; }
.view:not(.hidden) { display: block !important; }
.hidden { display: none !important; }
.flex { display: flex; }

/* ANIMACIONES */
.page-enter { animation: slideUpFade 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.page-exit { animation: fadeOutDown 0.2s ease-in forwards; }
@keyframes slideUpFade { 0% { opacity: 0; transform: translate3d(0, 20px, 0); } 100% { opacity: 1; transform: translate3d(0, 0, 0); } }
@keyframes fadeOutDown { 0% { opacity: 1; transform: translate3d(0, 0, 0); } 100% { opacity: 0; transform: translate3d(0, 10px, 0); } }
.anim-click { transition: transform 0.1s; will-change: transform; }
.anim-click:active { transform: scale(0.96); }

/* LOADER */
#splash-screen { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: var(--bg-card); z-index: 9999; display: flex; flex-direction: column; align-items: center; justify-content: center; transition: opacity 0.5s ease-out; }
.loader { border: 4px solid #f3f3f3; border-top: 4px solid var(--primary); border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; margin-top: 20px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* LOGIN */
#view-login { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background-image: url('../assets/pantalla_inicio_guille.jpg'); background-size: cover; background-position: center; z-index: 2000; display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 20px; }
#view-login::before { content: ''; position: absolute; top:0; left:0; right:0; bottom:0; background: rgba(0,0,0,0.3); z-index: -1; }
.login-card { position: relative; background: rgba(0, 0, 0, 0.6); border: 1px solid rgba(255, 255, 255, 0.2); padding: 40px 30px 30px 30px; border-radius: 30px; width: 100%; max-width: 350px; box-shadow: 0 20px 50px rgba(0,0,0,0.4); text-align: center; color: white; backdrop-filter: blur(10px); }
.guille-login-badge { position: absolute; top: -35px; left: -10px; width: 70px; height: 70px; border-radius: 50%; border: 3px solid white; box-shadow: 0 5px 15px rgba(0,0,0,0.3); object-fit: cover; z-index: 20; background-color: #fff; }
.login-input { width: 100%; padding: 12px; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 18px; margin-bottom: 10px; outline: none; color: white; font-weight: 600; text-align: center; }
#login-error.login-ok {
    color: #bbf7d0;
    background: rgba(6, 78, 59, 0.55);
}
.btn-social { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 12px; border-radius: 18px; font-weight: 600; background: white; color: #444; margin-bottom: 10px; }

/* HEADER */
header { background: var(--primary-gradient); backdrop-filter: blur(10px); padding: 0 15px; position: sticky; top: 0; z-index: 50; height: 70px; display: grid; grid-template-columns: 45px 1fr 45px; align-items: center; justify-items: center; box-shadow: 0 4px 20px rgba(0,0,0,0.2); border-bottom-left-radius: 24px; border-bottom-right-radius: 24px; }
header img { height: 100%; max-height: 40px; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3)); }
#btn-header-back, #btn-logout { color: white; font-size: 1.2rem; background: rgba(255,255,255,0.2); width: 42px; height: 42px; border-radius: 14px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
main { padding: 24px; max-width: 800px; margin: 0 auto; position: relative; z-index: 10; }

/* IMAGEN FLOTANTE */
#img-barra-corner { position: fixed; bottom: 100px; right: 10px; width: 90px; height: 90px; z-index: 60; padding: 3px; background: var(--primary-gradient); border-radius: 50%; box-shadow: 0 8px 20px rgba(0,0,0,0.4); opacity: 0; transform: translateY(50px) scale(0.5) rotate(-10deg); transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); pointer-events: none; }
#img-barra-corner img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; border: 2px solid rgba(255,255,255,0.9); }
body.theme-barra #img-barra-corner { opacity: 1; transform: translateY(0) scale(1) rotate(0deg); }

/* BOTONES */
button { cursor: pointer; border: none; outline: none; position: relative; overflow: hidden; }
.btn-primary { background: var(--primary-gradient); color: white; padding: 16px; border-radius: 18px; font-weight: 700; width: 100%; box-shadow: 0 8px 20px rgba(0,0,0,0.2); white-space: nowrap; }
.btn-secondary { background: var(--bg-card); color: var(--text-main); padding: 10px 18px; border-radius: 14px; font-weight: 600; box-shadow: var(--shadow-card); border: 1px solid var(--border-color); white-space: nowrap; }
.btn-danger { background: linear-gradient(135deg, #ef4444, #dc2626); color: white; padding: 10px 20px; border-radius: 14px; font-weight: 600; }
.btn-whatsapp { background: linear-gradient(135deg, #25D366, #128C7E); color: white; padding: 14px; border-radius: 18px; font-weight: 700; width: 100%; }
.btn-copy { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; padding: 12px; border-radius: 14px; font-weight: 600; width: 100%; margin-top: 10px; }

/* DASHBOARD ICONOS GRANDES */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; }
.btn-area { height: 140px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: var(--glass-bg); backdrop-filter: blur(8px); border-radius: 24px; border: 1px solid var(--border-color); box-shadow: var(--shadow-card); color: var(--text-main); transition: transform 0.2s; }
.btn-area:active { transform: scale(0.96); }
.btn-area .icon { font-size: 5rem; margin-bottom: 8px; display: block; line-height: 1; }
.btn-vitrina { background: linear-gradient(135deg, #fff, #fdf2f8); border: 2px solid var(--accent); }
[data-theme="dark"] .btn-vitrina { background: linear-gradient(135deg, #2a2a35, #3b3b4f); border-color: var(--accent); }

/* ELEMENTOS COMUNES */
input, select, textarea { width: 100%; padding: 14px; border-radius: 16px; border: 1px solid var(--border-color); background: var(--input-bg); color: var(--text-main); margin-bottom: 12px; font-size: 1rem; }
.item-list li { background: var(--bg-card); padding: 16px; margin-bottom: 12px; border-radius: 18px; box-shadow: var(--shadow-card); display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--border-color); }
.item-quantity { width: 70px !important; text-align: center; margin-bottom: 0 !important; font-weight: 800; color: var(--primary); background: var(--input-bg); }
.cat-header { background: var(--bg-card); padding: 18px; border-radius: 16px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; font-weight: 700; color: var(--primary); border: 1px solid var(--border-color); cursor: pointer; }
.cat-content { display: none; padding-bottom: 10px; animation: slideDown 0.3s ease-out; }
.cat-content.open { display: block; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.unit-tag { font-size: 0.7rem; color: var(--text-sec); font-weight: 700; margin-right: 8px; background: var(--bg-body); padding: 6px 10px; border-radius: 10px; cursor: pointer; border: 1px solid var(--border-color); min-width: 40px; text-align: center; }
.unit-tag.is-kg { background: #dbeafe; color: #2563eb; border-color: #bfdbfe; }

/* VITRINA */
.vitrina-container { background: linear-gradient(180deg, #e0e7ff 0%, #c7d2fe 100%); padding: 20px; border-radius: 24px; border: 4px solid white; box-shadow: inset 0 5px 15px rgba(0,0,0,0.1); }
[data-theme="dark"] .vitrina-container { background: linear-gradient(180deg, #2a2a35 0%, #3b3b4f 100%); border-color: #444; }
.fila-atras, .fila-frente { display: grid; gap: 8px; }
.fila-atras { grid-template-columns: repeat(4, 1fr); margin-bottom: 15px; }
.fila-frente { grid-template-columns: repeat(4, 1fr); padding-top: 15px; border-top: 2px dashed rgba(255,255,255,0.5); }
@media (min-width: 600px) { .fila-atras { grid-template-columns: repeat(11, 1fr); } .fila-frente { grid-template-columns: repeat(8, 1fr); } }
.slot { background: rgba(255,255,255,0.8); border-radius: 12px; display: flex; align-items: center; justify-content: center; text-align: center; font-weight: 600; color: #94a3b8; padding: 4px; font-size: 0.6rem; min-height: 60px; transition: transform 0.1s; border: 2px solid transparent; }
.slot:active { transform: scale(0.95); }
.slot.lleno { background: var(--primary-gradient); color: white; border-bottom: 3px solid rgba(0,0,0,0.3); flex-direction: column; gap: 2px; padding-top: 8px; padding-bottom: 6px; }
.slot.estado-ok { background: linear-gradient(135deg, #22c55e, #16a34a) !important; border-bottom-color: #15803d !important; color: white; }
.slot.estado-warning { background: linear-gradient(135deg, #fbbf24, #d97706) !important; border-bottom-color: #b45309 !important; color: white; }
.slot.estado-critical { background: linear-gradient(135deg, #ef4444, #b91c1c) !important; border-bottom-color: #7f1d1d !important; color: white; }

/* CAMARAS Y STOCK */
.refri-door { background: var(--bg-card); border-radius: 12px; padding: 12px; margin-bottom: 12px; border-left: 6px solid #22c55e; box-shadow: var(--shadow-card); }
.slots-stock-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.slot-stock { aspect-ratio: 1; background: rgba(34, 197, 94, 0.1); border: 1px dashed #86efac; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 0.55rem; color: #166534; text-align: center; }
.slot-stock.lleno { background: #22c55e; color: white; border: none; font-weight: bold; }
.resumen-stock-container { background: var(--bg-card); padding: 15px; border-radius: 16px; margin-top: 20px; border: 1px solid var(--border-color); }
.resumen-item { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--border-color); font-size: 0.9rem; }
.resumen-badge { background: var(--primary); color: white; border-radius: 10px; padding: 2px 8px; font-weight: bold; font-size: 0.8rem; }

/* TOOLBAR PINTAR */
#toolbar-colores { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--bg-card); padding: 15px 25px; border-radius: 50px; display: flex; gap: 15px; box-shadow: 0 10px 40px rgba(0,0,0,0.3); z-index: 900; border: 1px solid var(--border-color); display: none; }
#toolbar-colores.visible { display: flex !important; animation: slideUpFade 0.3s; }
.pincel-btn { width: 45px; height: 45px; border-radius: 50%; border: 3px solid #eee; cursor: pointer; transition: 0.2s; }
.pincel-btn.active { transform: scale(1.2) translateY(-5px); border-color: var(--text-main); border-width: 4px; }

/* MODALES Y VARIOS */
.modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(5px); display: flex; align-items: center; justify-content: center; z-index: 5000; padding: 15px; }
#modal-config-helados { z-index: 5100; }
#modal-sabor-meta { z-index: 5200; }
.modal-content { background: var(--bg-card); color: var(--text-main); padding: 25px; border-radius: 25px; width: 100%; max-width: 400px; max-height: 85vh; overflow-y: auto; border: 1px solid var(--border-color); box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); }
.switch { position: relative; display: inline-block; width: 50px; height: 28px; } .switch input { opacity: 0; width: 0; height: 0; } .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 34px; } .slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; } input:checked + .slider { background-color: var(--primary); } input:checked + .slider:before { transform: translateX(22px); }
.tabs { background: var(--bg-card); padding: 6px; border-radius: 16px; margin-bottom: 15px; display:flex; gap:5px; border: 1px solid var(--border-color); }
.tab-btn { flex: 1; padding: 10px; background: transparent; border-radius: 12px; color: var(--text-sec); font-weight: 600; }
.tab-btn.active { background: var(--primary); color: white; }
#status-bar { background: var(--bg-card); color: var(--text-sec); font-size: 0.7rem; padding: 6px 15px; border-radius: 20px; margin-bottom: 20px; display: inline-block; border: 1px solid var(--border-color); }
.card-datos { background: var(--bg-card); padding: 20px; border-radius: 20px; border: 1px solid var(--border-color); box-shadow: var(--shadow-card); margin-bottom: 20px; }
#auth-alert { background: #ef4444; color: white; text-align: center; padding: 10px; font-weight: bold; font-size: 0.85rem; position: sticky; top: 0; z-index: 100; }
#modal-logs { z-index: 3000; }
.flavor-item { display: flex; justify-content: space-between; align-items: center; padding: 10px; border-bottom: 1px solid var(--border-color); cursor: pointer; gap: 6px; }
.flavor-item .flavor-name { flex: 1; text-align: left; }
.flavor-item.is-fav { background: #fffbeb; }
.fav-star-btn {
    border: none;
    background: transparent;
    color: #d1d5db;
    font-size: 1.15rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.fav-star-btn:hover, .flavor-item.is-fav .fav-star-btn { color: #f59e0b; }
.delete-flavor-btn { color: #ef4444; font-weight: bold; cursor: pointer; padding: 0 10px; font-size: 1.2rem; }

/* Título de pedido y administración */
#pedido-title, #admin-menu-title { font-size: 1rem !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }

/* =========================================
   3. RECETARIO: DISEÑO DE LIBRO (AJUSTADO MÓVIL)
   ========================================= */
.book-bookmarks { padding-top: 10px; overflow-x: auto; scrollbar-width: none; }
.bookmark-btn {
    padding: 8px 8px 25px !important;
    font-size: 0.75rem !important;
    border-radius: 12px 12px 0 0; margin-bottom: -15px; 
    font-weight: 700; border: none; z-index: 1; position: relative;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: inset 0 -3px 6px rgba(0,0,0,0.15); opacity: 0.8;
    white-space: nowrap; 
}
.bookmark-btn.active {
    transform: translateY(-8px); z-index: 10; padding-bottom: 30px; opacity: 1;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.15), inset 0 2px 2px rgba(255,255,255,0.3);
}
.book-page {
    background: #fdfbf7;
    background-image: linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 0), linear-gradient(rgba(0,0,0,0.03) 1px, transparent 0);
    background-size: 20px 20px;
    border-radius: 4px 20px 20px 4px;
    box-shadow: inset 18px 0 25px -10px rgba(139, 90, 43, 0.4), 8px 8px 20px rgba(0,0,0,0.15);
    padding: 24px 16px; position: relative; z-index: 5;
    border-left: 10px solid #6b4423;
    min-height: 60vh;
}
[data-theme="dark"] .book-page {
    background: var(--bg-card); 
    background-image: linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 0), linear-gradient(rgba(255,255,255,0.02) 1px, transparent 0);
    box-shadow: inset 18px 0 25px -10px rgba(0,0,0,0.8), 8px 8px 20px rgba(0,0,0,0.4);
    border-left-color: #111;
}
.recipe-card {
    background: var(--bg-card);
    border-left: 4px solid var(--accent);
    box-shadow: var(--shadow-card);
    border-radius: 14px; padding: 14px; margin-bottom: 12px;
    border: 1px solid var(--border-color);
}

/* =========================================
   4. PLANTILLAS TEMÁTICAS LIGERAS (CSS + Emojis)
   ========================================= */

.view-epic-enter {
    animation: epicEntrance 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    will-change: transform, opacity;
}

@keyframes epicEntrance {
    0% { opacity: 0; transform: scale(0.92) translateY(15px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* -----------------------------------------
   TEMA: HELADERÍA (Cono de Waffle y Emojis)
   ----------------------------------------- */
body[data-theme-template="heladeria"] {
    --bg-body: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
    --bg-card: rgba(255, 255, 255, 0.9);
    --primary-gradient: linear-gradient(135deg, #f472b6, #db2777);
    --text-main: #831843;
    --text-sec: #be185d;
    --border-color: #fbcfe8;
    --shadow-card: 0 8px 15px rgba(219, 39, 119, 0.1);
}

body[data-theme-template="heladeria"] .btn-primary,
body[data-theme-template="heladeria"] .btn-area {
    border-radius: 40px 40px 10px 10px; 
    border-bottom: 6px solid #9d174d; 
}

/* Textura de cono de waffle sutil en los botones grandes */
body[data-theme-template="heladeria"] .btn-area {
    background-image: repeating-linear-gradient(45deg, transparent 25%, rgba(219, 39, 119, 0.03) 25%, rgba(219, 39, 119, 0.03) 50%, transparent 50%, transparent 75%, rgba(219, 39, 119, 0.03) 75%, rgba(219, 39, 119, 0.03) 100%);
    background-size: 20px 20px;
}

body[data-theme-template="heladeria"]::before {
    content: '🍦 🍧 🍨 🍓 🍒';
    position: fixed;
    top: 20%;
    left: -5%;
    font-size: 80px;
    opacity: 0.15;
    z-index: 0; /* Asegura que esté por encima del fondo pero debajo del contenido */
    pointer-events: none;
    transform: rotate(-15deg);
    line-height: 2;
    white-space: pre-wrap;
    width: 120%;
}

/* -----------------------------------------
   TEMA: SANDWICHES (Hamburguesas y Pan)
   ----------------------------------------- */
body[data-theme-template="sandwiches"] {
    --bg-body: #fffbeb;
    --bg-card: #fef3c7;
    --primary-gradient: linear-gradient(135deg, #d97706, #92400e);
    --text-main: #451a03;
    --text-sec: #78350f;
    --border-color: #fcd34d;
    --shadow-card: 0 4px 6px rgba(146, 64, 14, 0.1);
    background-image: radial-gradient(#fde68a 2px, transparent 2px);
    background-size: 20px 20px;
}

/* Tarjetas base: Sándwich de miga o tabla rústica */
body[data-theme-template="sandwiches"] .btn-area {
    border-radius: 8px;
    background: #fcd34d; 
    color: #78350f;
    border-top: 3px solid #f59e0b; 
    box-shadow: 0 4px 0 #ef4444, 0 8px 0 #22c55e, 0 12px 0 #d97706; 
    margin-bottom: 15px;
    transition: transform 0.1s, box-shadow 0.1s;
}

/* Botones principales: Hamburguesa completa */
body[data-theme-template="sandwiches"] .btn-primary {
    border-radius: 40px 40px 10px 10px; /* Pan de hamburguesa redondeado arriba */
    background: #fbbf24;
    color: #451a03;
    border-top: 4px solid #f59e0b;
    /* Capas: Tomate, Lechuga, Carne gruesa, Pan inferior */
    box-shadow: 0 4px 0 #ef4444, 0 8px 0 #22c55e, 0 16px 0 #451a03, 0 22px 0 #fbbf24; 
    margin-bottom: 25px; /* Espacio para las sombras */
    transition: transform 0.1s, box-shadow 0.1s;
}

body[data-theme-template="sandwiches"] .btn-primary:active {
    transform: translateY(8px);
    box-shadow: 0 2px 0 #ef4444, 0 4px 0 #22c55e, 0 8px 0 #451a03, 0 14px 0 #fbbf24; 
}

body[data-theme-template="sandwiches"]::before {
    content: '🍔 🥪 🥓 🧀';
    position: fixed;
    top: 15%;
    left: 10%;
    font-size: 90px;
    opacity: 0.1;
    z-index: 0;
    pointer-events: none;
    transform: rotate(10deg);
}

/* -----------------------------------------
   TEMA: ¡EN LLAMAS! (Bordes carbonizados y ascuas)
   ----------------------------------------- */
body[data-theme-template="llamas"] {
    --bg-body: #111111;
    --bg-card: #1a0505;
    --primary-gradient: linear-gradient(to top, #7f1d1d, #ea580c, #facc15);
    --text-main: #fecaca;
    --text-sec: #f87171;
    --border-color: #450a0a;
    --shadow-card: 0 4px 15px rgba(220, 38, 38, 0.2);
    --input-bg: #2b0606;
}/* =========================================
   TEMA: ¡EN LLAMAS! (Versión Liquid Glass + Ascuas)
   ========================================= */

body[data-theme-template="llamas"] {
    --bg-body: #111111;
    --bg-card: #1a0505;
    --primary-gradient: linear-gradient(to top, #7f1d1d, #ea580c, #facc15);
    --text-main: #fecaca;
    --text-sec: #f87171;
    --border-color: #450a0a;
    --shadow-card: 0 4px 15px rgba(220, 38, 38, 0.2);
}

/* 1. LOS BOTONES DE SECCIONES (Efecto Liquid Glass) */
body[data-theme-template="llamas"] .btn-area {
    background: rgba(40, 10, 10, 0.4) !important; /* Semi-transparente */
    backdrop-filter: blur(12px); /* Efecto vidrio */
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(234, 88, 12, 0.3);
    border-radius: 12px 28px 12px 30px; 
    box-shadow: inset 0 0 15px rgba(0,0,0,0.5), 0 8px 20px rgba(0,0,0,0.3);
    color: #fff;
}

/* 2. BOTONES PRINCIPALES Y TARJETAS (Estilo Quemado/Sólido) */
body[data-theme-template="llamas"] .btn-primary,
body[data-theme-template="llamas"] .bg-card {
    background: #1a0505; /* Sólido para que contrasten con los botones de sección */
    border-radius: 4px 24px 8px 30px; 
    border-bottom: 2px dashed #ea580c; 
    border-right: 2px solid #7f1d1d;
    box-shadow: inset -6px -6px 15px #000000, 0 4px 10px rgba(234, 88, 12, 0.2);
}

/* 3. ASCUAS FLOTANTES (El fuego que sube) */
body[data-theme-template="llamas"]::before {
    content: '🔥 🔥 🔥 🔥 🔥 🔥 🔥 🔥 🔥 🔥 🔥 🔥';
    position: fixed;
    bottom: -20%;
    left: 0;
    width: 100%;
    font-size: 70px;
    opacity: 0.15;
    z-index: 0; /* Detrás de los botones, pero visible */
    pointer-events: none;
    letter-spacing: 20px;
    text-align: center;
    animation: fireRise 8s infinite linear;
}

@keyframes fireRise {
    0% { transform: translateY(0) scale(1); opacity: 0.15; }
    50% { opacity: 0.25; }
    100% { transform: translateY(-100vh) scale(1.5); opacity: 0; }
}

/* -----------------------------------------
   TEMA: NEÓN ÉPICO (cyber / noche / glow)
   ----------------------------------------- */
body[data-theme-template="neon_epico"] {
    --bg-body: radial-gradient(ellipse at 20% 0%, #1a0533 0%, #050510 45%, #000 100%);
    --bg-card: rgba(12, 10, 30, 0.85);
    --primary-gradient: linear-gradient(135deg, #22d3ee, #e879f9, #818cf8);
    --text-main: #e0f2fe;
    --text-sec: #a5b4fc;
    --border-color: rgba(34, 211, 238, 0.35);
    --shadow-card: 0 0 24px rgba(232, 121, 249, 0.15), 0 8px 30px rgba(0,0,0,0.5);
    --input-bg: #0f172a;
    color: var(--text-main);
}

body[data-theme-template="neon_epico"] .btn-area {
    background: rgba(15, 23, 42, 0.7) !important;
    border: 1px solid rgba(34, 211, 238, 0.45);
    border-radius: 16px;
    box-shadow: 0 0 12px rgba(34, 211, 238, 0.2), inset 0 0 20px rgba(232, 121, 249, 0.08);
    color: #f0abfc;
    text-shadow: 0 0 8px rgba(232, 121, 249, 0.5);
}

body[data-theme-template="neon_epico"] .btn-primary {
    background: linear-gradient(135deg, #22d3ee, #c026d3);
    border: none;
    border-radius: 14px;
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.45);
    color: #0f172a;
    font-weight: 800;
}

body[data-theme-template="neon_epico"] header,
body[data-theme-template="neon_epico"] .bg-card {
    background: rgba(8, 8, 24, 0.9) !important;
    border-color: rgba(34, 211, 238, 0.25);
}

body[data-theme-template="neon_epico"]::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(circle at 80% 20%, rgba(232, 121, 249, 0.18), transparent 40%),
        radial-gradient(circle at 10% 80%, rgba(34, 211, 238, 0.15), transparent 35%);
    animation: neonPulse 6s ease-in-out infinite alternate;
}

@keyframes neonPulse {
    from { opacity: 0.7; }
    to { opacity: 1; }
}

/* -----------------------------------------
   TEMA: JADE IMPERIAL (exótico / pro / oro)
   ----------------------------------------- */
body[data-theme-template="jade_imperial"] {
    --bg-body: linear-gradient(160deg, #052e1f 0%, #0c4a3a 40%, #14532d 70%, #1c1917 100%);
    --bg-card: rgba(255, 251, 235, 0.94);
    --primary-gradient: linear-gradient(135deg, #ca8a04, #a16207, #854d0e);
    --text-main: #14532d;
    --text-sec: #3f6212;
    --border-color: #ca8a04;
    --shadow-card: 0 10px 28px rgba(20, 83, 45, 0.35);
    --input-bg: #fffbeb;
}

body[data-theme-template="jade_imperial"] .btn-area {
    background: linear-gradient(180deg, #fef3c7, #fde68a) !important;
    border: 2px solid #ca8a04;
    border-radius: 4px 20px 4px 20px;
    color: #14532d;
    box-shadow: 0 4px 0 #854d0e, 0 8px 16px rgba(0,0,0,0.2);
    font-weight: 700;
}

body[data-theme-template="jade_imperial"] .btn-primary {
    background: linear-gradient(135deg, #166534, #15803d);
    border: 2px solid #ca8a04;
    border-radius: 999px;
    color: #fef9c3;
    box-shadow: 0 0 0 3px rgba(202, 138, 4, 0.25);
}

body[data-theme-template="jade_imperial"] header {
    background: rgba(5, 46, 31, 0.95) !important;
    border-bottom: 2px solid #ca8a04;
}

body[data-theme-template="jade_imperial"]::before {
    content: '🏯 🐉 🍃 ✨';
    position: fixed;
    top: 12%;
    right: -5%;
    font-size: 72px;
    opacity: 0.12;
    z-index: 0;
    pointer-events: none;
    transform: rotate(12deg);
    letter-spacing: 30px;
}

/* Modos vitrina */
.vitrina-mode-bar {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.vitrina-mode-bar .modo-btn {
    flex: 1;
    min-width: 90px;
    padding: 8px 6px;
    border-radius: 12px;
    border: 1px solid var(--border-color, #e5e7eb);
    background: #f9fafb;
    font-size: 0.72rem;
    font-weight: 700;
    color: #4b5563;
}
.vitrina-mode-bar .modo-btn.active {
    background: linear-gradient(135deg, #7c3aed, #db2777);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}
.slot.seleccionable { outline: 2px dashed transparent; }
.slot.seleccionado-toteat {
    outline: 3px solid #2563eb !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.25);
    transform: scale(1.04);
}
.slot.oculto-seleccion {
    opacity: 0.22;
    pointer-events: none;
    filter: grayscale(0.6);
}

/* Texto grande (modo Elegir) — lectura accesible */
.btn-texto-grande {
    margin-left: auto;
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 800;
    border-radius: 999px;
    border: 2px solid #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
    cursor: pointer;
    white-space: nowrap;
}
.btn-texto-grande.active {
    background: #1d4ed8;
    color: #fff;
    border-color: #1e40af;
}
#view-heladeria.texto-grande .vitrina-container .slot {
    font-size: 0.95rem;
    min-height: 88px;
    padding: 8px 6px;
    font-weight: 800;
    line-height: 1.2;
}
#view-heladeria.texto-grande .vitrina-container .slot .slot-nombre {
    font-size: 1rem;
    line-height: 1.2;
}
#view-heladeria.texto-grande .vitrina-container .slot-sabor-icos {
    font-size: 0.85rem;
}
#view-heladeria.texto-grande .fila-atras,
#view-heladeria.texto-grande .fila-frente {
    gap: 10px;
}
#view-heladeria.texto-grande .fila-atras,
#view-heladeria.texto-grande .fila-frente {
    grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 600px) {
    #view-heladeria.texto-grande .fila-atras { grid-template-columns: repeat(4, 1fr); }
    #view-heladeria.texto-grande .fila-frente { grid-template-columns: repeat(4, 1fr); }
}
#view-heladeria.texto-grande #lista-seleccion-toteat {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.45;
}
#view-heladeria.texto-grande .chip-topping-sel {
    font-size: 0.95rem;
    padding: 0.45rem 0.85rem;
}
#view-heladeria.texto-grande .label-zona {
    font-size: 0.85rem !important;
}

.slot.modo-ver {
    cursor: default;
}
#vitrina-lock-banner {
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    padding: 8px 10px;
    border-radius: 12px;
    margin-bottom: 10px;
}
#vitrina-lock-banner.ocupado {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}
#vitrina-lock-banner.libre {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}
#panel-seleccion-toteat {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 16px;
    padding: 12px;
    margin-top: 12px;
}
.seleccion-toppings-box {
    background: #fdf2f8;
    border: 1px solid #fbcfe8;
    border-radius: 12px;
    padding: 10px;
}
.chip-topping-sel {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    border: 1.5px solid #f9a8d4;
    background: #fff;
    color: #9d174d;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
}
.chip-topping-sel.active {
    background: linear-gradient(135deg, #ec4899, #db2777);
    border-color: #be185d;
    color: #fff;
    box-shadow: 0 2px 8px rgba(219, 39, 119, 0.35);
}
.chip-max {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #93c5fd;
    background: #fff;
    font-weight: 800;
    margin-right: 6px;
    cursor: pointer;
}
.chip-max.active {
    background: #2563eb;
    color: #fff;
    border-color: #1d4ed8;
}

.flavor-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.flavor-meta-btn {
    border: none;
    background: #eef2ff;
    color: #3730a3;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 0.45rem;
    font-size: 0.75rem;
    cursor: pointer;
    flex-shrink: 0;
}
.flavor-tags {
    display: flex;
    gap: 0.2rem;
    flex-wrap: wrap;
    max-width: 5.5rem;
}
.flavor-tags em {
    font-style: normal;
    font-size: 0.58rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    padding: 0.1rem 0.3rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
}
.flavor-tags em.alc {
    background: #ffedd5;
    color: #9a3412;
}
.flavor-tags em.lac {
    background: #fef9c3;
    color: #854d0e;
}
.flavor-tags em.glu {
    background: #ffedd5;
    color: #9a3412;
}
.flavor-tags em.veg {
    background: #dcfce7;
    color: #166534;
}

/* Iconos tipo/alérgenos en slots de vitrina (equipo) */
.slot {
    position: relative;
}
.slot .slot-nombre {
    display: block;
    line-height: 1.15;
}
.slot-meta-row {
    margin-top: 0.15rem;
    line-height: 1;
}
.slot-sabor-icos {
    display: inline-flex;
    gap: 1px;
    font-size: 0.62rem;
    letter-spacing: -0.5px;
    opacity: 0.95;
}
.lista-config-helados {
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fafafa;
}
.config-helado-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid #eee;
}
.config-helado-row:last-child { border-bottom: none; }
.config-helado-info { flex: 1; min-width: 0; }
.config-helado-nombre {
    font-weight: 700;
    font-size: 0.9rem;
    color: #1e293b;
    margin-bottom: 0.2rem;
}
.config-helado-desc {
    font-size: 0.72rem;
    color: #475569;
    margin-top: 0.25rem;
    line-height: 1.25;
}
.config-helado-desc.vacia {
    color: #94a3b8;
    font-style: italic;
}
[data-theme="dark"] .config-helado-desc { color: #cbd5e1; }
.config-helado-actions {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
}

/* Panel carta clientes (dentro de Vitrina) */
.btn-carta-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    max-width: 100%;
    padding: 0.4rem 0.85rem;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 999px;
    border: 1px solid #ddd6fe;
    background: #f5f3ff;
    color: #5b21b6;
    cursor: pointer;
}
.btn-carta-mini.abierto {
    background: #ede9fe;
    border-color: #c4b5fd;
}
.panel-carta-cliente {
    margin-top: 0.75rem;
    padding: 1rem;
    border-radius: 1.25rem;
    background: linear-gradient(180deg, #f8fafc, #eef2ff);
    border: 1px solid #c7d2fe;
}
.panel-carta-cliente .carta-head h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    color: #312e81;
}
.panel-carta-cliente .carta-head p {
    margin: 0.35rem 0 0.85rem;
    font-size: 0.72rem;
    color: #64748b;
    line-height: 1.35;
}
.panel-carta-cliente .carta-head code {
    font-size: 0.7rem;
    background: #e0e7ff;
    padding: 0.1rem 0.35rem;
    border-radius: 0.35rem;
}
.carta-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475569;
    margin-bottom: 0.35rem;
}
.carta-textarea,
.carta-input {
    width: 100%;
    margin: 0 0 0.5rem;
    padding: 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.85rem;
    background: #fff;
    font-size: 0.9rem;
}
.carta-grupo {
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    border-top: 1px dashed #c7d2fe;
}
.carta-grupo-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}
.carta-grupo-head h4 {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 800;
    color: #1e1b4b;
}
.carta-add {
    border: none;
    background: #312e81;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    cursor: pointer;
}
.carta-item-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
    padding: 0.35rem 0.4rem;
    background: #fff;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
}
.carta-item-row.off {
    opacity: 0.55;
}
.carta-toggle {
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0 0.15rem;
    line-height: 1;
}
.carta-toggle.on { color: #059669; }
.carta-nombre-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.85rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
    padding: 0.25rem 0;
}
.carta-del {
    border: none;
    background: #fee2e2;
    color: #b91c1c;
    width: 2rem;
    height: 2rem;
    border-radius: 0.55rem;
    cursor: pointer;
    font-size: 0.75rem;
}
