/* ==========================================
   VARIABILI E COLORI
========================================== */
:root {
    --bg-color: #F9F6F0;           
    --text-color: #1A2A22;         
    --accent-olive: #6B7853;       
    --accent-bronze: #A2825C;      
    --white: #FFFFFF;
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Open Sans', sans-serif;
}

/* ==========================================
   IMPOSTAZIONI GENERALI
========================================== */
* { box-sizing: border-box; }

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
}

/* ==========================================
   LANDING PAGE (index.html)
========================================== */
.index-container {
    text-align: center;
    padding: 40px 20px;
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-image: url('../assets/images/sfondo-index.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.main-logo {
    max-width: 250px !important;
    width: 100%; height: auto;
    margin: 0 auto 20px auto;
    display: block; border-radius: 50%;
}

.welcome-section { margin-bottom: 25px; text-align: center; }
.welcome-small { font-family: var(--font-body); font-size: 1.1rem; color: var(--text-color); margin-bottom: 0px; font-weight: 600; }

.welcome-large {
    font-family: var(--font-heading); font-size: 3.2rem; font-weight: 700; letter-spacing: 3px; line-height: 1; margin-top: 5px; margin-bottom: 0px; color: #FFFAEE; 
    text-shadow: 0 0 5px #DDA15E, 0 0 15px #DDA15E, 0 0 30px #DDA15E, 0 0 45px rgba(221, 161, 94, 0.7), 1px 1px 3px rgba(0, 0, 0, 0.2); 
}

.welcome-medium {
    font-family: var(--font-heading); font-size: 1.6rem; font-weight: 600; letter-spacing: 6px; margin-top: 5px; margin-bottom: 15px; color: #F0F5ED; 
    text-shadow: 0 0 5px #6B7853, 0 0 15px #6B7853, 0 0 30px #4A5D23, 0 0 45px rgba(74, 93, 35, 0.7), 1px 1px 3px rgba(0, 0, 0, 0.2); 
}

.btn-enter {
    display: inline-block; background-color: var(--accent-olive); color: var(--white); padding: 12px 40px; border-radius: 30px; text-decoration: none;
    font-family: var(--font-heading); font-weight: 700; font-size: 1.1rem; transition: 0.3s; box-shadow: 0 4px 15px rgba(107, 120, 83, 0.4); margin-bottom: 25px;
}
.btn-enter:hover { background-color: var(--text-color); transform: translateY(-2px); }

.info-text { font-size: 0.95rem; color: var(--text-color); margin-bottom: 15px; font-weight: 600; }

.alert-box {
    background-color: rgba(255, 255, 255, 0.65); border-left: 4px solid var(--accent-olive); padding: 10px 12px; border-radius: 8px;
    font-size: 0.75rem; color: var(--text-color); max-width: 85%; margin: 0 auto 20px auto; box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    line-height: 1.4; font-weight: 600; text-align: left;
}
.alert-box i { color: var(--accent-olive); margin-right: 5px; font-size: 0.9rem; }

footer p { font-size: 1rem; color: var(--text-color); font-weight: 600; margin: 5px 0 10px 0; }
.social-icons { margin-bottom: 15px; }
.social-link {
    display: inline-flex; justify-content: center; align-items: center; width: 40px; height: 40px; background-color: var(--accent-olive);
    color: var(--white); border-radius: 50%; margin: 0 5px; text-decoration: none; font-size: 1.2rem; transition: 0.3s; box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.social-link:hover { background-color: var(--text-color); transform: translateY(-3px); }
.powered-by { 
    font-family: var(--font-heading) !important; /* Carattere solido e moderno */
    font-size: 0.70rem !important; 
    color: var(--text-color) !important; 
    font-weight: 700 !important; 
    text-transform: uppercase; /* Tutto maiuscolo per maggiore eleganza */
    letter-spacing: 2px; /* Spaziatura ariosa tra le lettere */
    opacity: 0.65; /* Trasparenza esatta al 65% */
    margin-top: 40px !important; 
    padding-bottom: 15px;
}
/* ==========================================
   PAGINA SCELTA CATEGORIE (categorie-menu.html)
========================================== */
.categories-body {
    background-image: url('../assets/images/sfondo-index.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.landing-menu {
    display: flex;
    flex-direction: column;
    gap: 12px; 
    width: 100%;
    max-width: 250px;
    padding-bottom: 30px;
}

.landing-btn {
    background-color: var(--bg-color); 
    color: var(--text-color);
    font-family: var(--font-heading);
    font-size: 1.05rem; 
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    padding: 12px 15px; 
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    border-left: 4px solid var(--accent-olive);
    transition: 0.3s;
}

.landing-btn:hover {
    background-color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(107, 120, 83, 0.2);
}

/* ==========================================
   HEADER DEL MENU E BARRA DI RICERCA
========================================== */
.menu-header {
    display: flex; align-items: center; padding: 15px 20px;
    height: 68px; /* Altezza bloccata per unione perfetta */
    background-color: transparent !important; 
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: none !important; 
    position: sticky; top: 0; z-index: 100;
}
.menu-back-btn { color: var(--white) !important; font-size: 1.2rem; margin-right: 15px; text-decoration: none; }
.search-container { flex-grow: 1; position: relative; }
.search-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: rgba(255, 255, 255, 0.7) !important; }
.search-input {
    width: 100%; padding: 10px 10px 10px 40px; 
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 20px; font-family: var(--font-body); font-size: 0.95rem;
    outline: none; 
    background-color: rgba(0, 0, 0, 0.3) !important; 
    color: var(--white) !important; 
    transition: 0.3s;
}
.search-input::placeholder { color: rgba(255, 255, 255, 0.5) !important; }
.search-input:focus { 
    border-color: rgba(255, 255, 255, 0.5) !important; 
    background-color: rgba(0, 0, 0, 0.5) !important; 
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.1) !important; 
}

/* ==========================================
   SEZIONE MENU E CARD PRODOTTI
========================================== */
.menu-section { padding: 0 0 20px 0; } 
.container { max-width: 800px; margin: 0 auto; padding: 0 15px; }

.menu-categories-pills { 
    display: flex; 
    overflow-x: auto; 
    gap: 10px; 
    padding-bottom: 15px; 
    margin-bottom: 10px; 
    scrollbar-width: none; 
    
    position: sticky; 
    top: 68px; /* Incastro perfetto al millimetro con l'header da 68px */
    z-index: 95;
    background-color: transparent !important; 
    backdrop-filter: blur(12px) !important; 
    -webkit-backdrop-filter: blur(12px) !important;
    padding-top: 15px; 
    margin-left: -15px; 
    margin-right: -15px;
    padding-left: 15px;
    padding-right: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.menu-categories-pills::-webkit-scrollbar { display: none; }

.cat-pill {
    background-color: var(--white); color: var(--text-color); padding: 8px 16px; border-radius: 20px; font-weight: 600;
    font-family: var(--font-heading); font-size: 0.9rem; text-decoration: none; white-space: nowrap; border: 1px solid #eee; transition: all 0.3s ease;
}
.cat-pill.active, .cat-pill:hover { background-color: var(--accent-olive); color: var(--white); border-color: var(--accent-olive); box-shadow: 0 2px 8px rgba(107, 120, 83, 0.3); }

.menu-category {
    scroll-margin-top: 140px; 
}

.category-title { font-family: var(--font-heading); color: var(--accent-bronze); font-size: 1.5rem; margin-top: 30px; margin-bottom: 15px; border-bottom: 2px solid rgba(162, 130, 92, 0.2); padding-bottom: 5px; }

.product-card {
    display: flex; 
    background-color: var(--white) !important;
    color: var(--text-color) !important;
    border-radius: 12px; 
    margin-bottom: 15px; 
    overflow: hidden;
    min-height: 125px; /* MODIFICATO: ora può allungarsi se il testo è tanto */
    height: auto; 
    box-shadow: 0 0 8px rgba(107, 120, 83, 0.25), 0 4px 10px rgba(0, 0, 0, 0.05); 
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* ... lascia intatti .product-img-wrapper e .product-img ... */
.product-img-wrapper { 
    width: 110px; 
    min-width: 110px; 
    height: 100%; 
    background-color: transparent; 
    display: flex; 
    overflow: hidden; 
}

.product-img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    object-position: center;
    transition: filter 0.3s ease;
}

.product-info { padding: 12px 15px; flex-grow: 1; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }

/* MODIFICATO: Forza il testo ad andare a capo senza mai tagliarsi coi puntini */
.product-title { 
    font-family: var(--font-heading); 
    margin: 0 0 5px 0; 
    font-size: 1.1rem; 
    color: var(--text-color) !important; 
    display: flex;
    flex-wrap: wrap; 
    align-items: center;
    gap: 6px;
    line-height: 1.3;
    /* Queste tre righe sono la magia che impedisce i puntini */
    white-space: normal !important; 
    word-break: break-word; 
    overflow: visible;
}
.product-desc { font-size: 0.85rem; color: #555 !important; margin: 0 0 10px 0; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-footer { display: flex; justify-content: space-between; align-items: center; }
.product-price { font-weight: 700; color: var(--accent-olive) !important; font-size: 1.1rem; }

/* ==========================================
   STILE PAGINA MENU (menu.html) - SFONDO IMMAGINE (FIX SMARTPHONE)
========================================== */
body.menu-body { 
    background-color: #2b3a2f !important; /* Colore di base in caso di attesa */
    color: var(--white) !important; 
    min-height: 100vh;
    position: relative; /* Serve per ospitare il livello dello sfondo fantasma */
}

/* QUESTO È IL TRUCCO INFALLIBILE: Sfondo generato su un livello dedicato che non scorre mai */
body.menu-body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../assets/images/sfondo-menu.png') !important;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    z-index: -1; /* Lo nasconde perfettamente dietro a tutti gli altri elementi */
}

/* Titoli delle categorie all'interno del menù */
.menu-body .category-title { 
    color: #FFFAEE !important; 
    border-bottom: 2px solid rgba(255, 255, 255, 0.3) !important; 
    text-shadow: 0 0 5px #DDA15E, 0 0 15px #DDA15E, 0 0 30px #DDA15E, 0 0 45px rgba(221, 161, 94, 0.7), 1px 1px 3px rgba(0, 0, 0, 0.2) !important;
    letter-spacing: 1px;
}

#loadingMsg { color: var(--white) !important; }
#loadingMsg i { color: var(--white) !important; }

/* FOOTER MENU */
.menu-footer {
    text-align: center;
    padding: 30px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 20px;
}

/* ==========================================
   STATO PRODOTTO ESAURITO E ORARI
========================================== */
.sold-out-card {
    background-color: rgba(255, 255, 255, 0.8) !important; 
    box-shadow: none;
}
.sold-out-card .product-img { filter: grayscale(100%); opacity: 0.4; }
.sold-out-card .product-title,
.sold-out-card .product-desc,
.sold-out-card .product-price { color: #999 !important; }

.badge-esaurito {
    color: #FF3B30 !important; 
    font-size: 0.7rem;
    font-weight: 700;
    border: 2px solid #FF3B30; 
    padding: 3px 8px;
    border-radius: 15px; 
    margin-left: 10px;
    vertical-align: middle;
    letter-spacing: 0.5px;
    background-color: transparent;
    display: inline-block;
}

.card-orario { background-color: #FEFBF4 !important; }
.badge-orario {
    color: var(--accent-bronze) !important; 
    font-size: 0.65rem;
    font-weight: 700;
    border: 1px solid var(--accent-bronze); 
    padding: 3px 8px;
    border-radius: 15px; 
    margin-left: 8px;
    vertical-align: middle;
    letter-spacing: 0.5px;
    background-color: transparent;
    display: inline-block;
}

/* BADGE CONSIGLIATO (SCELTA DEL COLIBRI) */
.badge-consigliato {
    background-color: #f1c40f; 
    color: #1A2A22 !important;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 15px;
    margin-left: 8px;
    vertical-align: middle;
    letter-spacing: 0.5px;
    display: inline-block;
}

/* ==========================================
   ICONE DIETETICHE E INTOLLERANZE
========================================== */
.dietary-badges {
    display: flex;
    gap: 6px;
    align-items: center;
}

.dietary-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 20px;
    height: 28px;
    padding: 0;
    width: 28px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-color);
    overflow: hidden;
}

.dietary-badge i {
    font-size: 0.85rem;
    flex-shrink: 0;
}

.dietary-badge .d-text {
    max-width: 0;
    opacity: 0;
    font-size: 0.7rem;
    font-weight: 700;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dietary-badge.expanded {
    width: auto;
    padding: 0 10px;
}

.dietary-badge.expanded .d-text {
    max-width: 100px;
    opacity: 1;
    margin-right: 6px;
}

/* ==========================================
   POP-UP CARTA FEDELTA'
========================================== */
.popup-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(5px);
    display: none; align-items: center; justify-content: center; 
    z-index: 9999; padding: 20px; box-sizing: border-box;
}
.popup-content {
    background: var(--bg-color); border-radius: 20px;
    max-width: 380px; width: 100%; padding: 25px 20px;
    text-align: center; position: relative;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
}
/* La tessera disegnata in CSS - Stile LED & Jungle */
.fidelity-mockup {
    /* Usa lo sfondo foglie scurito per far brillare i LED */
    background-image: linear-gradient(rgba(26, 42, 34, 0.85), rgba(26, 42, 34, 0.95)), url('../assets/images/sfondo-index.jpg');
    background-size: cover;
    background-position: center;
    border-radius: 14px; 
    padding: 20px; 
    color: white;
    margin-bottom: 20px; 
    position: relative; 
    overflow: hidden;
    text-align: left; 
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(221, 161, 94, 0.4);
}

/* Posizionamento del tuo Colibrì LED personalizzato */
.fidelity-logo {
    position: absolute;
    right: 5px; /* Leggermente più staccato dal bordo destro */
    top: 50%; /* Lo abbassa esattamente a metà della card */
    transform: translateY(-50%); /* Bilancia l'immagine al centro perfetto */
    width: 120px; /* Grandezza bilanciata per stare al centro */
    opacity: 1;
    z-index: 1;
    /* LA MAGIA: Effetto Luce LED (Glow Oro) attorno ai contorni del Colibrì! */
    filter: drop-shadow(0 0 5px #DDA15E) drop-shadow(0 0 15px #DDA15E) drop-shadow(0 0 25px rgba(221, 161, 94, 0.6));
}

/* Scritta VIP CARD - LED Oro */
.fidelity-mockup h3 { 
    margin: 0; 
    font-family: var(--font-heading); 
    font-size: 1.4rem; 
    letter-spacing: 2px; 
    text-transform: uppercase;
    color: #FFFAEE;
    text-shadow: 0 0 5px #DDA15E, 0 0 15px #DDA15E, 0 0 30px #DDA15E;
    position: relative;
    z-index: 2;
}

/* Chip dorato realistico */
.fidelity-mockup .chip { 
    width: 42px; 
    height: 30px; 
    background: linear-gradient(135deg, #DDA15E 0%, #8b6d4a 100%);
    border-radius: 6px; 
    margin: 18px 0; 
    box-shadow: inset 0 0 8px rgba(0,0,0,0.4), 0 2px 5px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.3);
    position: relative;
    z-index: 2;
}

/* Dettaglio riga in mezzo al chip */
.fidelity-mockup .chip::after {
    content: '';
    position: absolute;
    top: 50%; left: 0; right: 0; 
    height: 1px; 
    background: rgba(0,0,0,0.25);
}

/* Scritta COLIBRÌ BAR - LED Verde */
.fidelity-mockup p { 
    margin: 0; 
    font-size: 0.95rem; 
    font-weight: 700; 
    font-family: var(--font-heading); 
    letter-spacing: 3px;
    color: #F0F5ED;
    text-shadow: 0 0 5px #6B7853, 0 0 15px #6B7853, 0 0 30px #4A5D23;
    position: relative;
    z-index: 2;
}

.popup-text h2 { color: var(--accent-olive); margin: 0 0 15px 0; font-family: var(--font-heading); font-size: 1.4rem;}
.popup-text p { font-size: 0.95rem; margin-bottom: 15px; color: var(--text-color); font-weight: 500;}
.popup-text ul { text-align: left; padding: 0; list-style: none; margin-bottom: 15px; font-size: 0.95rem; font-weight: 600;}
.popup-text li { margin-bottom: 10px; padding-left: 28px; position: relative; }
.popup-text li::before { content: '\f058'; font-family: 'Font Awesome 6 Free'; font-weight: 900; position: absolute; left: 0; color: var(--accent-olive); font-size: 1.1rem;}
.popup-text .note { font-size: 0.75rem; color: #777; line-height: 1.4; margin-bottom: 20px; font-style: italic;}
.btn-close-popup {
    background: var(--accent-olive); color: white; font-family: var(--font-heading);
    font-weight: 700; padding: 12px 20px; border: none; border-radius: 30px;
    width: 100%; cursor: pointer; text-transform: uppercase; letter-spacing: 1px;
}