/* --- IMPOSTAZIONI GENERALI --- */
:root {
    --bg-color: #f4f4f2;
    --primary-accent-color: #E1A141; /* ORO */
    --text-color: #2c2c2c;
    --card-bg-color: #ffffff;
    --header-bg-color: #1a1a1a; /* NERO */
    --header-height: 70px;
}
*, *::before, *::after {
    box-sizing: border-box;
}
html { scroll-behavior: smooth; }
body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    padding-top: var(--header-height);
    padding-bottom: env(safe-area-inset-bottom);
}
main { padding: 1rem; }

/* --- HEADER, BANNER E NAVIGAZIONE (STICKY) --- */
#sticky-header-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: white;
}
#main-header {
    background-color: var(--header-bg-color);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: center;
}
.logo { max-height: 50px; }
#top-banner-wrapper, #lang-switcher-container, #search-container {
    background-color: #f8f8f8;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: max-height 0.4s ease-in-out, padding 0.4s ease-in-out, opacity 0.4s ease-in-out, border 0s 0.4s;
    overflow: hidden;
    max-height: 200px;
    opacity: 1;
}
body.scrolled #top-banner-wrapper,
body.scrolled #lang-switcher-container,
body.scrolled #search-container {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-bottom: none;
    transition: max-height 0.4s ease-in-out, padding 0.4s ease-in-out, opacity 0.4s ease-in-out, border 0s;
}
#contact-banner, #search-container, #lang-switcher-container {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #e0e0e0;
}
#contact-banner { text-align: center; }
#closed-banner-message p { margin: 0 0 0.5rem 0; font-weight: 500; font-size: 0.9rem; }
.whatsapp-button {
    display: inline-flex; align-items: center; gap: 8px;
    background-color: #25D366; color: white;
    padding: 8px 18px; border-radius: 20px;
    text-decoration: none; font-weight: 600;
}
.search-wrapper { position: relative; }
.search-wrapper .fa-search { position: absolute; top: 50%; left: 15px; transform: translateY(-50%); color: #aaa; }
#search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 40px;
    border: 1px solid #ddd;
    border-radius: 50px;
    font-size: 1rem;
}

/* --- SELETTORE LINGUA --- */
#lang-switcher {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.8rem;
}
.lang-btn {
    background-color: transparent;
    border: 3px solid transparent;
    border-radius: 50%;
    padding: 2px;
    cursor: pointer;
    line-height: 0;
    transition: all 0.3s ease;
    opacity: 0.7;
}
.lang-btn img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
.lang-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}
.lang-btn.active {
    border-color: var(--primary-accent-color);
    opacity: 1;
    transform: scale(1.1);
}

/* Navigazione Orizzontale */
#category-navigator-container {
    background-color: white;
    position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
#category-navigator-container::before, #category-navigator-container::after {
    content: ''; position: absolute; top: 0; width: 40px; height: 100%; z-index: 2; pointer-events: none; opacity: 0; transition: opacity 0.3s ease;
}
#category-navigator-container::before { left: 0; background: linear-gradient(to left, transparent, white); }
#category-navigator-container::after { right: 0; background: linear-gradient(to right, transparent, white); }
#category-navigator-container.is-scrolled-start::before { opacity: 1; }
#category-navigator-container.is-scrolled-end::after { opacity: 1; }
#category-navigator {
    display: flex; overflow-x: auto; padding: 0 1rem; scrollbar-width: none;
}
#category-navigator::-webkit-scrollbar { display: none; }
#category-navigator a {
    padding: 0.9rem 1rem; text-decoration: none; color: #888; font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; border-bottom: 3px solid transparent; transition: color 0.3s, border-color 0.3s;
}
#category-navigator a.active {
    color: var(--primary-accent-color);
    border-bottom-color: var(--primary-accent-color);
}

/* --- CONTENUTO MENU --- */
.section-title { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: 1.8rem; padding-top: 1.5rem; margin-bottom: 1.5rem; }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.menu-item { 
    background-color: var(--card-bg-color); 
    border-radius: 15px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); 
    overflow: hidden; 
    display: flex; 
    flex-direction: column;
    cursor: pointer;
}
.menu-item img { width: 100%; height: 220px; object-fit: cover; }
.item-content { padding: 1.2rem; display: flex; flex-direction: column; flex-grow: 1; }
.item-content h3 { margin: 0 0 0.5rem 0; font-size: 1.25rem; }
.item-content .description { font-size: 0.9rem; color: #555; flex-grow: 1; margin-bottom: 1rem;}
.item-content .price { font-size: 1.2rem; font-weight: 700; text-align: right; margin-top: auto; }

/* --- SELETTORI A OPZIONI NEI MODALI --- */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}
.options-container .price {
    margin-top: 0;
}
.size-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.size-selector input[type="radio"] {
    display: none;
}
.size-selector label {
    padding: 0.5rem 1rem;
    border: 2px solid #ddd;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
}
.size-selector input[type="radio"]:checked + label {
    background-color: var(--primary-accent-color);
    border-color: var(--primary-accent-color);
    color: white;
}
.options-list .option-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}
.options-list .option-item:last-child {
    border-bottom: none;
}
.options-list input[type="radio"] {
    margin-right: 1rem;
    width: 1.2em;
    height: 1.2em;
    accent-color: var(--primary-accent-color);
}
.options-list label {
    flex-grow: 1;
    font-size: 1rem;
    cursor: pointer;
}
.options-list .option-price {
    font-size: 1rem;
    font-weight: 700;
}
.addon-selector {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #f0f0f0;
}
.addon-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
}
.addon-item input[type="checkbox"] {
    width: 1.3em;
    height: 1.3em;
    margin-right: 1rem;
    accent-color: var(--primary-accent-color);
    cursor: pointer;
}
.addon-item label {
    flex-grow: 1;
    font-size: 1rem;
    cursor: pointer;
}

/* --- MODALI CON ANIMAZIONE --- */
.modal-wrapper { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.7); display: flex; justify-content: center; align-items: center; z-index: 2000; padding: 1rem; opacity: 0; pointer-events: none; transition: opacity 0.4s ease; }
.modal-wrapper.active { opacity: 1; pointer-events: auto; }
.modal-box { 
    background-color: var(--card-bg-color); 
    padding: 2rem; 
    border-radius: 15px; 
    width: 100%; 
    max-width: 500px; 
    max-height: 90vh; 
    overflow-y: auto; 
    position: relative; 
    transform: scale(0.9); 
    transition: transform 0.4s ease;
    color: var(--text-color);
}
.modal-wrapper.active .modal-box { transform: scale(1); }
.modal-close { position: absolute; top: 15px; right: 20px; font-size: 2rem; font-weight: bold; cursor: pointer; color: #888; }
.modal-box img { width: 100%; max-height: 30vh; object-fit: contain; border-radius: 10px; margin-bottom: 1rem; }
.modal-box h3 { font-family: 'Poppins', sans-serif; font-size: 1.8rem; margin: 0; }
.modal-box p { color: #555; }
.modal-box p.description { font-size: 1rem; margin: 0.5rem 0 1rem 0; }
.modal-box #modal-price {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: right;
    color: var(--text-color);
    margin: 1rem 0;
}
#modal-allergens { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid #ddd; }
#modal-allergens h4 { margin-top: 0; font-weight: 600; color: var(--text-color); }
#modal-allergens ul { list-style-type: none; padding: 0; margin: 0; font-size: 0.9rem; }
#modal-allergens li { padding: 0.25rem 0; color: #555;}
.modal-box .options-container .price {
    font-size: 1.5rem;
    text-align: right;
    font-weight: 700;
    color: var(--text-color);
}

/* --- SEZIONE AGGIUNGI ALLA HOME --- */
#add-to-home-section {
    padding: 2rem 1rem;
    background-color: #e9e9e2;
    text-align: center;
}
#add-to-home-section .container {
    max-width: 800px;
    margin: 0 auto;
}
#add-to-home-section p {
    font-size: 1rem;
    color: #555;
    line-height: 1.6;
}
.instructions {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}
.instruction-block {
    flex: 1;
    min-width: 250px;
    max-width: 300px;
}
.instruction-icon {
    width: 50px;
    height: 50px;
    margin-bottom: 1rem;
}

/* --- FOOTER E TORNA SU --- */
#main-footer { background-color: var(--header-bg-color); color: #ccc; padding: 3rem 1rem 1rem 1rem; text-align: center; }
.footer-logo { max-height: 60px; margin-bottom: 1.5rem; }
.footer-content p { margin: 0.5rem 0; font-size: 0.9rem; }
.footer-content a { color: #fff; text-decoration: none; }
.footer-hours { margin: 1.5rem auto; max-width: 300px; padding: 1rem 0; border-top: 1px solid #444; border-bottom: 1px solid #444; }
.footer-hours h4 { margin: 0 0 0.5rem 0; color: var(--primary-accent-color); font-size: 1rem; text-transform: uppercase; letter-spacing: 1px; }
.social-links { margin: 2rem 0; }
.social-links a { font-size: 1.8rem; margin: 0 1rem; color: white; transition: color 0.3s ease; }
.social-links a:hover { color: var(--primary-accent-color); }
.footer-bottom-info {
    padding: 2rem 0 1rem 0;
    border-top: 1px solid #444;
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}
.award-logo img {
    max-height: 85px;
    opacity: 0.8;
}
.copyright { padding-top: 1rem; }
.copyright p { font-size: 0.8rem; color: #888; margin: 0.2rem 0; }
#back-to-top { position: fixed; bottom: 20px; right: 20px; background-color: var(--primary-accent-color); color: white; border: none; width: 50px; height: 50px; border-radius: 50%; font-size: 1.2rem; cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,0.2); opacity: 0; transform: translateY(100px); transition: opacity 0.3s ease, transform 0.3s ease; pointer-events: none; }
#back-to-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }

/* Adattamenti Mobile */
@media (max-width: 768px) {
    body { padding-top: 60px; }
    #main-header { height: 60px; }
    .logo { max-height: 40px; }
    .menu-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
    .menu-item img { height: 150px; }
}