:root {
    --brand-blue: #0b2361;
    --brand-cream: #f4f2ea;
    --text-blue: #0b2361;
    --text-cream: #f4f2ea;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--brand-blue);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: background-color 0.5s ease;
}

body.theme-alimentos { background-color: var(--brand-cream); }
body.theme-bebidas { background-color: var(--brand-blue); }

/* Navbar */
#navbar-menu {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 4vw; position: fixed; width: 100%; top: 0; z-index: 100;
}
.back-btn {
    display: flex; align-items: center; gap: 8px; font-weight: 700;
    text-transform: uppercase; font-size: 0.9rem; text-decoration: none;
    transition: opacity 0.3s ease;
}
.theme-alimentos .back-btn { color: var(--brand-blue); }
.theme-bebidas .back-btn { color: var(--brand-cream); }
.back-btn:hover { opacity: 0.6; }

.logo-text { font-weight: 900; font-size: 1.5rem; letter-spacing: -1px; }
.theme-alimentos .logo-text { color: var(--brand-blue); }
.theme-bebidas .logo-text { color: var(--brand-cream); }

/* Toggle Controles */
.menu-wrapper {
    margin-top: 90px; flex-grow: 1; display: flex; flex-direction: column; align-items: center;
}

.toggle-container {
    position: relative; display: flex; background: rgba(0,0,0,0.1);
    border-radius: 50px; padding: 5px; margin-bottom: 30px; z-index: 10;
    width: 100%; max-width: 360px; /* Nuevo: previene que crezca de más */
}

.toggle-btn {
    position: relative; z-index: 2; border: none; background: transparent;
    padding: 12px 0; /* Quitamos el padding horizontal fijo */
    flex: 1; /* Nuevo: obliga a dividirse el espacio en partes iguales */
    font-weight: 800; 
    font-size: clamp(0.85rem, 3vw, 1rem); /* Nuevo: Texto fluido */
    text-transform: uppercase; cursor: pointer; 
    transition: color 0.4s ease; border-radius: 50px;
}
.theme-alimentos .toggle-container { background: rgba(11, 35, 97, 0.1); }
.theme-bebidas .toggle-container { background: rgba(244, 242, 234, 0.1); }
.theme-alimentos .toggle-btn { color: var(--brand-blue); opacity: 0.5; }
.theme-alimentos .toggle-btn.active { color: var(--brand-cream); opacity: 1; }
.theme-bebidas .toggle-btn { color: var(--brand-cream); opacity: 0.5; }
.theme-bebidas .toggle-btn.active { color: var(--brand-blue); opacity: 1; }

.toggle-bg {
    position: absolute; top: 5px; left: 5px; height: calc(100% - 10px); width: calc(50% - 5px);
    border-radius: 50px; transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), background 0.4s ease; z-index: 1;
}
.theme-alimentos .toggle-bg { background: var(--brand-blue); transform: translateX(0); }
.theme-bebidas .toggle-bg { background: var(--brand-cream); transform: translateX(100%); }


/* Estructura de Carta */
.carta-container {
    position: relative; width: 100%; max-width: 700px; padding: 0 4vw 60px 4vw;
}

.carta-page {
    width: 100%; position: absolute; top: 0; left: 0; right: 0; margin: auto; padding: 0 4vw;
    opacity: 0; visibility: hidden; transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.carta-page.active {
    position: relative; opacity: 1; visibility: visible; transform: translateY(0);
}

.page-alimentos { color: var(--text-blue); }
.page-bebidas { color: var(--text-cream); }

/* Tipografía de la Carta */
.category-title { font-size: clamp(2.5rem, 6vw, 3.5rem); text-transform: uppercase; font-weight: 900; letter-spacing: -2px; margin-bottom: 40px; }
.subcategory-title { font-size: 1.1rem; text-transform: uppercase; font-weight: 600; letter-spacing: 2px; margin-bottom: 20px; margin-top: 30px; opacity: 0.8; }

.menu-item { margin-bottom: 25px; }
.menu-item.simple { margin-bottom: 15px; }

.item-header { display: flex; align-items: baseline; width: 100%; }
.item-header h3 { 
    font-size: clamp(1rem, 4vw, 1.2rem);
    font-weight: 800; margin: 0; 
    max-width: 75%; 
    line-height: 1.2;
}
.dots { flex-grow: 1; border-bottom: 2px dotted currentColor; opacity: 0.3; margin: 0 10px; }
.price { 
    font-size: clamp(1rem, 4vw, 1.2rem); 
    font-weight: 800; 
    white-space: nowrap;
}

.desc { font-size: 0.95rem; font-weight: 500; line-height: 1.4; margin-top: 5px; opacity: 0.9; }

.sub-options { display: flex; gap: 40px; margin-top: 15px; font-size: 0.85rem; font-weight: 600; }
.sub-options .column { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.sub-options strong { margin-bottom: 5px; text-transform: uppercase; letter-spacing: 1px; font-size: 0.75rem; opacity: 0.7; }
.sub-item { display: flex; align-items: baseline; }
.sub-dots { flex-grow: 1; border-bottom: 1px dotted currentColor; opacity: 0.3; margin: 0 5px; }

.logo-footer { text-align: center; font-weight: 900; font-size: 2rem; letter-spacing: -1px; margin-top: 60px; opacity: 0.9; }

@media (max-width: 600px) {
    .sub-options { flex-direction: column; gap: 15px; }
    .item-header { align-items: flex-end; } 
    .dots { margin: 0 5px; }
    .logo-footer { font-size: 1.5rem; margin-top: 40px; }
}