/* =========================================================
   Plantilla Restaurante - Estilos del frontend
   Variables --t-* vienen inyectadas desde index.php (config.json).
   Soporta múltiples presets via [data-theme="..."]
   ========================================================= */

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--t-body-font, 'Inter', sans-serif);
    color: var(--t-text);
    background: var(--t-background);
    min-height: 100vh;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   PRESET: Modern Dark (Coxicoatl style)
   ============================================================ */
[data-theme="modern_dark"] body,
body[data-theme="modern_dark"] {
    background: var(--t-background);
}
[data-theme="modern_dark"] .site-header {
    background: var(--t-primary);
    color: white;
}
[data-theme="modern_dark"] .brand-tagline {
    color: rgba(255, 255, 255, 0.7);
}
[data-theme="modern_dark"] .menu-tabs {
    background: var(--t-primary);
    border-bottom: none;
}
[data-theme="modern_dark"] .tab-btn {
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border-color: rgba(255, 255, 255, 0.2);
}
[data-theme="modern_dark"] .tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}
[data-theme="modern_dark"] .tab-btn.active {
    background: var(--t-accent);
    color: var(--t-primary);
    border-color: var(--t-accent);
}
[data-theme="modern_dark"] .menu-status.active {
    background: var(--t-accent);
    color: var(--t-primary);
}
[data-theme="modern_dark"] .item-card {
    background: var(--t-surface);
    border-color: rgba(0, 0, 0, 0.06);
}
[data-theme="modern_dark"] .item-card.in-selection {
    border-color: var(--t-primary);
}
[data-theme="modern_dark"] .item-card.in-selection::before {
    background: var(--t-primary);
    color: var(--t-accent);
}
[data-theme="modern_dark"] .btn-add {
    background: var(--t-accent);
    color: var(--t-primary);
}
[data-theme="modern_dark"] .btn-add:hover {
    background: var(--t-primary);
    color: var(--t-accent);
}
[data-theme="modern_dark"] .qty-control {
    border-color: var(--t-primary);
}
[data-theme="modern_dark"] .qty-btn { color: var(--t-primary); }
[data-theme="modern_dark"] .qty-btn.plus { background: var(--t-primary); color: var(--t-accent); }
[data-theme="modern_dark"] .selection-fab {
    background: var(--t-primary);
    color: var(--t-accent);
}
[data-theme="modern_dark"] .selection-fab .fab-badge {
    background: var(--t-accent);
    color: var(--t-primary);
}
[data-theme="modern_dark"] .item-price { color: var(--t-text); }
[data-theme="modern_dark"] .category-title { color: var(--t-primary); border-bottom-color: var(--t-accent); }
[data-theme="modern_dark"] .category-title::before { background: var(--t-accent); }
[data-theme="modern_dark"] .menu-header h2 { color: var(--t-primary); }

/* ============================================================
   PRESET: Elegant (estilo Pelícanos - crema/teal/dorado)
   ============================================================ */
[data-theme="elegant"] body {
    background: var(--t-background);
    background-image:
        radial-gradient(circle at 20% 10%, rgba(0, 0, 0, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(0, 0, 0, 0.03) 0%, transparent 40%);
}
[data-theme="elegant"] .site-header {
    background: var(--t-surface);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
[data-theme="elegant"] .brand-logo-large {
    max-height: 90px;
}
[data-theme="elegant"] .menu-tabs {
    background: var(--t-surface);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
[data-theme="elegant"] .tab-btn.active {
    background: var(--t-primary);
    color: white;
    border-color: var(--t-primary);
}
[data-theme="elegant"] .item-card.in-selection::before {
    background: var(--t-primary);
    color: white;
}
[data-theme="elegant"] .btn-add {
    background: var(--t-primary);
    color: white;
}
[data-theme="elegant"] .btn-add:hover {
    background: var(--t-text);
}
[data-theme="elegant"] .selection-fab {
    background: var(--t-primary);
    color: white;
}
[data-theme="elegant"] .selection-fab .fab-badge {
    background: var(--t-accent);
    color: var(--t-primary);
}
[data-theme="elegant"] .item-price { color: var(--t-accent); }
[data-theme="elegant"] .category-title { color: var(--t-primary); border-bottom-color: var(--t-accent); }
[data-theme="elegant"] .category-title::before { background: var(--t-accent); }
[data-theme="elegant"] .menu-header h2 { color: var(--t-primary); }

/* ============================================================
   PRESET: Light Casual (alternativa clara y simple)
   ============================================================ */
[data-theme="light_casual"] body { background: var(--t-background); }
[data-theme="light_casual"] .site-header {
    background: var(--t-surface);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
[data-theme="light_casual"] .menu-tabs {
    background: var(--t-surface);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
[data-theme="light_casual"] .tab-btn.active {
    background: var(--t-accent);
    color: var(--t-primary);
    border-color: var(--t-accent);
}
[data-theme="light_casual"] .btn-add {
    background: var(--t-accent);
    color: var(--t-primary);
}
[data-theme="light_casual"] .selection-fab {
    background: var(--t-accent);
    color: var(--t-primary);
}
[data-theme="light_casual"] .item-price { color: var(--t-primary); }
[data-theme="light_casual"] .category-title { color: var(--t-primary); border-bottom-color: var(--t-accent); }
[data-theme="light_casual"] .category-title::before { background: var(--t-accent); }

/* ============================================================
   ESTILOS BASE COMPARTIDOS
   ============================================================ */

/* HEADER */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.header-top {
    display: flex;
    justify-content: flex-end;
    padding: 0.75rem 1rem 0;
}
.brand-hero {
    padding: 0.5rem 1rem 1.25rem;
    text-align: center;
}
.brand-logo-large {
    max-height: 130px;
    max-width: 220px;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
}
.brand-tagline {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 500;
    opacity: 0.7;
}

.lang-switch {
    display: inline-flex;
    background: rgba(255,255,255,0.12);
    border-radius: 999px;
    padding: 3px;
    border: 1px solid rgba(255,255,255,0.15);
}
[data-theme="elegant"] .lang-switch,
[data-theme="light_casual"] .lang-switch {
    background: rgba(0,0,0,0.05);
    border-color: rgba(0,0,0,0.1);
}
.lang-btn {
    border: none;
    background: transparent;
    padding: 0.3rem 0.85rem;
    font-family: var(--t-body-font);
    font-size: 0.78rem;
    font-weight: 600;
    color: inherit;
    opacity: 0.6;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.06em;
}
.lang-btn[aria-pressed="true"] {
    background: var(--t-accent);
    color: var(--t-primary);
    opacity: 1;
}

/* TABS */
.menu-tabs {
    position: sticky;
    z-index: 40;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.menu-tabs::-webkit-scrollbar { display: none; }
.tabs-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1.25rem;
    display: flex;
    gap: 0.5rem;
    min-width: max-content;
    justify-content: center;
}
.tab-btn {
    background: transparent;
    border: 1.5px solid rgba(0, 0, 0, 0.12);
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-family: var(--t-body-font);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: inherit;
}
.tab-btn .tab-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #c44;
}
.tab-btn.tab-available .tab-dot,
.tab-btn.active .tab-dot { background: var(--t-accent); }
.tab-btn.inactive { opacity: 0.5; }
.tab-btn.inactive .tab-dot { background: rgba(255,255,255,0.4); }
[data-theme="elegant"] .tab-btn.inactive .tab-dot,
[data-theme="light_casual"] .tab-btn.inactive .tab-dot { background: #c44; }

/* MAIN */
.menu-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 6rem;
}
.loading { text-align: center; padding: 4rem 1rem; color: var(--t-text-muted); }
.spinner {
    width: 40px; height: 40px;
    border: 3px solid rgba(0,0,0,0.1);
    border-top-color: var(--t-accent);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* MENU HEADER */
.menu-header { text-align: center; margin-bottom: 2rem; padding: 1rem 1rem; }
.menu-header h2 {
    font-family: var(--t-heading-font);
    font-size: clamp(1.7rem, 4vw, 2.4rem);
    margin-bottom: 0.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.menu-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    background: rgba(0,0,0,0.06);
    color: var(--t-text-muted);
}
.menu-status.active { background: var(--t-accent); color: var(--t-primary); }
.menu-status-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: currentColor;
}
.menu-status.active .menu-status-dot {
    background: var(--t-primary);
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}
.menu-hours-info { margin-top: 0.6rem; font-size: 0.82rem; color: var(--t-text-muted); }

/* SEARCH */
.search-bar { position: relative; max-width: 480px; margin: 0 auto 2rem; }
.search-bar input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.6rem;
    border: 1.5px solid rgba(0, 0, 0, 0.1);
    border-radius: 999px;
    font-family: var(--t-body-font);
    font-size: 0.95rem;
    background: var(--t-surface);
    color: var(--t-text);
    transition: all 0.2s;
}
.search-bar input:focus {
    outline: none;
    border-color: var(--t-primary);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}
.search-bar::before {
    content: '';
    position: absolute;
    left: 1rem; top: 50%;
    transform: translateY(-50%);
    width: 16px; height: 16px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23888' stroke-width='2'%3E%3Ccircle cx='9' cy='9' r='6'/%3E%3Cpath d='m14 14 4 4'/%3E%3C/svg%3E") no-repeat center / contain;
    pointer-events: none;
}

/* CATEGORIES */
.category { margin-bottom: 2.5rem; }
.category-title {
    font-family: var(--t-heading-font);
    font-size: 1.35rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.category-title::before {
    content: '';
    flex: 0 0 auto;
    width: 5px; height: 18px;
    background: rgba(0,0,0,0.2);
    border-radius: 2px;
}

/* ITEMS GRID */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.item-card {
    background: var(--t-surface);
    border: 1.5px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    padding: 1.1rem 1.2rem;
    transition: all 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}
.item-card.in-selection {
    border-color: var(--t-primary);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}
.item-card.in-selection::before {
    content: '✓ ' attr(data-selected-label);
    position: absolute;
    top: -10px; right: 14px;
    background: var(--t-primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.22rem 0.7rem;
    border-radius: 999px;
    letter-spacing: 0.03em;
}

.item-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
}
.item-name {
    font-family: var(--t-heading-font);
    font-size: 1.05rem;
    color: var(--t-text);
    font-weight: 600;
    line-height: 1.25;
    flex: 1;
}
.item-price {
    font-family: var(--t-body-font);
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
    color: var(--t-text);
}
.item-desc { color: var(--t-text-muted); font-size: 0.86rem; line-height: 1.5; }
.item-allergens { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.2rem; }
.allergen-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(0,0,0,0.05);
    padding: 0.16rem 0.55rem;
    border-radius: 999px;
    font-size: 0.7rem;
    color: var(--t-text-muted);
}
.allergen-chip .icon { font-size: 0.85rem; display: inline-flex; align-items: center; }
.allergen-icon-img { width: 14px; height: 14px; object-fit: contain; display: block; }
.allergen-legend-item .allergen-icon-img { width: 22px; height: 22px; }

/* ADD BUTTON / QUANTITY */
.item-action {
    margin-top: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-add {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: var(--t-primary);
    color: white;
    border: none;
    padding: 0.65rem 1rem;
    border-radius: 999px;
    font-family: var(--t-body-font);
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.01em;
}
.btn-add:hover { transform: translateY(-1px); }
.btn-add:active { transform: scale(0.97); }
.btn-add .plus { font-size: 1.15rem; line-height: 1; font-weight: 400; }

.qty-control {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    background: var(--t-surface);
    border: 1.5px solid var(--t-primary);
    border-radius: 999px;
    padding: 3px;
}
.qty-btn {
    width: 32px; height: 32px;
    border: none;
    background: transparent;
    color: var(--t-primary);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.qty-btn:hover { background: rgba(0,0,0,0.05); }
.qty-btn.plus { background: var(--t-primary); color: white; }
.qty-num { font-weight: 700; font-size: 0.95rem; min-width: 22px; text-align: center; color: var(--t-text); }

.btn-note {
    background: transparent;
    color: var(--t-text-muted);
    border: 1.5px dashed rgba(0,0,0,0.15);
    border-radius: 8px;
    padding: 0.45rem 0.6rem;
    font-size: 0.78rem;
    cursor: pointer;
    font-family: var(--t-body-font);
    transition: all 0.15s;
    white-space: nowrap;
}
.btn-note:hover { border-color: var(--t-primary); color: var(--t-primary); border-style: solid; }
.btn-note.has-note { border-style: solid; border-color: var(--t-accent); color: var(--t-text); background: rgba(0,0,0,0.03); }

.no-results { text-align: center; padding: 3rem 1rem; color: var(--t-text-muted); font-style: italic; }

/* ALLERGEN LEGEND */
.allergen-legend[hidden] { display: none !important; }
.allergen-legend {
    max-width: 1100px;
    margin: 0 auto 2rem;
    padding: 1.5rem 1.25rem;
    background: var(--t-surface);
    border-radius: 16px;
    border: 1px solid rgba(0,0,0,0.08);
}
.allergen-legend h3 {
    font-family: var(--t-heading-font);
    color: var(--t-text);
    font-size: 1.2rem;
    margin-bottom: 0.85rem;
    text-align: center;
    font-weight: 600;
}
.allergen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}
.allergen-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.7rem;
    background: var(--t-background);
    border-radius: 8px;
    font-size: 0.85rem;
}
.allergen-legend-item .icon { font-size: 1.1rem; display: inline-flex; align-items: center; }
.allergen-note {
    text-align: center;
    font-size: 0.78rem;
    color: var(--t-text-muted);
    font-style: italic;
    padding-top: 0.6rem;
    border-top: 1px dashed rgba(0,0,0,0.1);
}

/* FOOTER */
.site-footer {
    background: var(--t-primary);
    color: rgba(255,255,255,0.85);
    padding: 1.75rem 1.25rem 4.5rem;
    text-align: center;
}
.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-items: center;
}
.footer-brand { font-family: var(--t-heading-font); font-size: 1rem; letter-spacing: 0.02em; }
.footer-meta { font-size: 0.78rem; opacity: 0.7; }
.footer-admin a { color: var(--t-accent); text-decoration: none; font-size: 0.72rem; opacity: 0.5; letter-spacing: 0.15em; text-transform: uppercase; }
.footer-admin a:hover { opacity: 1; }

/* ============================================================
   MIS ANTOJOS - Burbuja flotante
   ============================================================ */
.selection-fab[hidden] { display: none !important; }
.selection-fab {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 60;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.8rem 1.15rem 0.8rem 0.95rem;
    background: var(--t-primary);
    color: white;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
    font-family: var(--t-body-font);
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.25s;
    animation: fabIn 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes fabIn {
    from { transform: scale(0.3); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
.selection-fab:hover { transform: translateY(-2px); }
.selection-fab.pulse { animation: fabPulse 0.45s ease; }
@keyframes fabPulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.12); }
}
.fab-icon { flex-shrink: 0; }
.fab-badge {
    background: var(--t-accent);
    color: var(--t-primary);
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    padding: 0 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* MIS ANTOJOS - Panel lateral */
.selection-overlay[hidden] { display: none !important; }
.selection-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 70;
    opacity: 0;
    transition: opacity 0.3s;
    backdrop-filter: blur(2px);
}
.selection-overlay.visible { opacity: 1; }

.selection-panel[hidden] { display: none !important; }
.selection-panel {
    position: fixed;
    top: 0; right: 0;
    height: 100dvh;
    width: min(440px, 100%);
    background: var(--t-surface);
    z-index: 80;
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.18);
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.05);
}
.selection-panel.visible { transform: translateX(0); }
.selection-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    flex-shrink: 0;
}
.selection-head h2 {
    font-family: var(--t-heading-font);
    font-size: 1.3rem;
    color: var(--t-text);
    font-weight: 700;
}
.selection-close {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.06);
    color: var(--t-text);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}
.selection-close:hover { background: var(--t-primary); color: white; }

.selection-body { flex: 1; overflow-y: auto; padding: 1rem 1.25rem; }
.selection-empty { text-align: center; padding: 3rem 1rem; color: var(--t-text-muted); }
.selection-empty svg { width: 56px; height: 56px; opacity: 0.3; margin-bottom: 1rem; }
.selection-empty h3 { font-family: var(--t-heading-font); color: var(--t-text); font-size: 1.1rem; margin-bottom: 0.4rem; font-weight: 600; }
.selection-empty p { font-size: 0.85rem; }

.selection-group { margin-bottom: 1.1rem; }
.selection-group-title {
    font-size: 0.7rem;
    color: var(--t-text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 0.5rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.selection-group-count { letter-spacing: 0; text-transform: none; opacity: 0.7; }

.selection-item {
    background: var(--t-background);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.selection-item-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; }
.selection-item-info { flex: 1; min-width: 0; }
.selection-item-name { font-weight: 700; color: var(--t-text); font-size: 0.92rem; line-height: 1.3; margin-bottom: 0.15rem; }
.selection-item-price { font-size: 0.78rem; color: var(--t-text-muted); }
.selection-item-subtotal { font-weight: 700; color: var(--t-text); font-size: 0.95rem; white-space: nowrap; }
.selection-item-note {
    font-size: 0.8rem;
    color: var(--t-text-muted);
    font-style: italic;
    padding: 0.4rem 0.6rem;
    background: var(--t-surface);
    border-radius: 6px;
    border-left: 3px solid var(--t-accent);
}
.selection-item-controls { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.selection-qty {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--t-surface);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 999px;
    padding: 2px;
}
.selection-qty button {
    width: 26px; height: 26px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--t-primary);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
}
.selection-qty button.plus { background: var(--t-primary); color: white; }
.selection-qty-num { min-width: 18px; text-align: center; font-weight: 700; color: var(--t-text); font-size: 0.85rem; }
.selection-item-actions { display: flex; gap: 0.4rem; }
.btn-link-small {
    background: transparent;
    border: none;
    color: var(--t-text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0.2rem 0.35rem;
    text-decoration: underline;
    font-family: var(--t-body-font);
}
.btn-link-small:hover { color: var(--t-text); }
.btn-link-small.danger:hover { color: #C4452C; }

.selection-foot[hidden] { display: none !important; }
.selection-foot {
    flex-shrink: 0;
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(0,0,0,0.08);
}
.selection-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.85rem;
}
.selection-total span { font-size: 0.85rem; color: var(--t-text-muted); font-weight: 600; }
.selection-total strong { font-family: var(--t-heading-font); font-size: 1.55rem; color: var(--t-text); font-weight: 700; }
.selection-actions { display: flex; gap: 0.5rem; }
.btn-ghost {
    flex-shrink: 0;
    background: transparent;
    color: var(--t-text-muted);
    border: 1.5px solid rgba(0,0,0,0.1);
    padding: 0.7rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--t-body-font);
    font-weight: 700;
    font-size: 0.82rem;
    transition: all 0.2s;
}
.btn-ghost:hover { border-color: #C4452C; color: #C4452C; }
.btn-waiter {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    background: var(--t-primary);
    color: white;
    border: none;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--t-body-font);
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.btn-waiter:hover { transform: translateY(-1px); }

/* MODO MESERO */
.waiter-view[hidden] { display: none !important; }
.waiter-view {
    position: fixed;
    inset: 0;
    background: var(--t-background);
    z-index: 100;
    display: flex;
    flex-direction: column;
    animation: waiterIn 0.3s ease;
}
@keyframes waiterIn {
    from { opacity: 0; transform: scale(0.98); }
    to   { opacity: 1; transform: scale(1); }
}
.waiter-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1.5px solid rgba(0,0,0,0.08);
    background: var(--t-surface);
    flex-shrink: 0;
}
.waiter-logo img { height: 60px; width: auto; display: block; }
[data-theme="modern_dark"] .waiter-head { background: var(--t-primary); }
[data-theme="modern_dark"] .waiter-logo img { filter: brightness(0) invert(1); }
.waiter-close {
    width: 46px; height: 46px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.08);
    color: var(--t-text);
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 700;
    transition: all 0.2s;
}
.waiter-close:hover { background: #C4452C; color: white; }
[data-theme="modern_dark"] .waiter-close { background: rgba(255,255,255,0.15); color: white; }
.waiter-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 1.5rem 3rem;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
}
.waiter-scroll h1 {
    font-family: var(--t-heading-font);
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    color: var(--t-text);
    text-align: center;
    margin-bottom: 0.4rem;
    font-weight: 700;
}
.waiter-subtitle {
    text-align: center;
    color: var(--t-text-muted);
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    margin-bottom: 2.25rem;
    font-style: italic;
}
.waiter-group { margin-bottom: 2.25rem; }
.waiter-group-title {
    font-family: var(--t-heading-font);
    font-size: clamp(1.2rem, 3vw, 1.65rem);
    color: var(--t-text);
    margin-bottom: 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--t-accent);
    font-weight: 600;
}
.waiter-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px dashed rgba(0,0,0,0.1);
    align-items: baseline;
}
.waiter-qty-circle {
    min-width: 42px; height: 42px;
    border-radius: 50%;
    background: var(--t-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    align-self: center;
    flex-shrink: 0;
    padding: 0 0.5rem;
}
[data-theme="modern_dark"] .waiter-qty-circle { color: var(--t-accent); }
.waiter-item-body { min-width: 0; }
.waiter-item-name {
    font-family: var(--t-heading-font);
    font-size: clamp(1.1rem, 2.6vw, 1.55rem);
    color: var(--t-text);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.15rem;
}
.waiter-item-note {
    font-size: clamp(0.85rem, 2vw, 1rem);
    color: #C4452C;
    font-style: italic;
    margin-top: 0.3rem;
    padding-left: 0.6rem;
    border-left: 3px solid var(--t-accent);
}
.waiter-item-price {
    font-family: var(--t-heading-font);
    font-size: clamp(1rem, 2.4vw, 1.3rem);
    font-weight: 700;
    color: var(--t-text);
    white-space: nowrap;
}
.waiter-total {
    margin-top: 1.5rem;
    padding: 1.4rem;
    background: var(--t-primary);
    border-radius: 14px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
}
[data-theme="modern_dark"] .waiter-total { color: var(--t-accent); }
.waiter-total-label { font-size: clamp(1rem, 2.5vw, 1.35rem); font-weight: 700; }
.waiter-total-amount { font-family: var(--t-heading-font); font-size: clamp(1.7rem, 5vw, 2.6rem); font-weight: 700; }

/* RESPONSIVE */
@media (max-width: 640px) {
    .header-top { padding: 0.6rem 1rem 0; }
    .brand-hero { padding: 0.4rem 1rem 1rem; }
    .brand-logo-large { max-height: 110px; max-width: 180px; }
    .brand-tagline { font-size: 0.75rem; letter-spacing: 0.15em; }
    .tabs-inner { padding: 0.6rem 1rem; gap: 0.4rem; justify-content: flex-start; }
    .tab-btn { padding: 0.45rem 0.85rem; font-size: 0.8rem; }
    .menu-main { padding: 1.25rem 1rem 6rem; }
    .menu-header { margin-bottom: 1.5rem; padding: 0.5rem 0; }
    .items-grid { grid-template-columns: 1fr; gap: 0.75rem; }
    .item-card { padding: 1rem; }
    .category-title { font-size: 1.2rem; }
    .selection-fab { bottom: 1rem; right: 1rem; padding: 0.7rem 1rem 0.7rem 0.85rem; font-size: 0.85rem; }
    .fab-label { display: none; }
    .selection-fab.has-items .fab-label { display: inline; }
    .waiter-head { padding: 0.75rem 1rem; }
    .waiter-logo img { height: 48px; }
    .waiter-close { width: 42px; height: 42px; }
    .waiter-scroll { padding: 1.5rem 1.25rem 2.5rem; }
}

/* PRINT */
@media print {
    .site-header, .menu-tabs, .search-bar, .site-footer,
    .selection-fab, .selection-panel, .selection-overlay, .item-action {
        display: none !important;
    }
    body { background: white; color: black; }
    .item-card { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
}
