body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    background-color: #071739;
}

/* Stili per la schermata di caricamento */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #071739;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

#loading-screen.fade-out {
    opacity: 0;
}

#loading-screen .loader {
    width: 146px;
    height: 77px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#loading-screen .loader svg {
    width: 100%;
    height: 100%;
    fill: #EDB012;
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1); opacity: 0.8; }
}

.rl-button {
    border: 1px solid var(--chicca-white);
    border-radius: var(--small-radius);
    background-color: var(--chicca-white);
    font-family: var(--della-respira);
    color: var(--chicca-blue);
    text-align: center;
    padding: .75rem 1.5rem;
    font-size: 1rem;
  }
  
  .rl-button:hover {
    border: 1px solid var(--chicca-white);
    -webkit-backdrop-filter: blur(7px);
    backdrop-filter: blur(7px);
    color: var(--chicca-white);
    background-color: #0000;
  }

.flag-toggle {
    position: absolute;
    left: 2.5%;
    top: 2.5%;
    cursor: pointer;
    z-index: 999;
    background-color: #ffffff;
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    transition: all 0.3s ease;
    border: 1px solid rgba(7, 23, 57, 0.1);
    display: inline-block;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    max-width: 7.5rem; /* circa 120px ma responsive */
    width: auto;
    border-radius: var(--small-radius);
    
}

.flag-toggle:hover {
    background-color: #f8f8f8;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

.language-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.flag-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: #071739;
    font-family: var(--della-respira);
    font-size: 0.875rem;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.galleria-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    z-index: 10;
}

.logo-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    width: 150px;
    text-align: center;
}

.logo-container svg {
    fill: #EDB012;
}

/* Stile specifico per il selettore lingua nella galleria piatti */
.language-selector {
    position: fixed;
    top: 20px;  /* Stessa altezza del logo */
    left: 20px;  /* Fisso a 20px dal bordo sinistro */
    z-index: 100;
}

.intro-text {
    position: fixed;
    top: 50%;
    left: 50px;
    transform: translateY(-50%);
    max-width: 320px;
    z-index: 90;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    font-family: var(--della-respira);
}

.intro-text h2 {
    font-size: 32px;
    margin-bottom: 15px;
    font-weight: 400;
    letter-spacing: 0.5px;
    color: var(--chicca-giallo);
}

.intro-text p {
    font-size: 17px;
    line-height: 1.7;
    font-weight: 400;
    opacity: 0.9;
    letter-spacing: 0.2px;
}

/* Stili per l'animazione del testo */
.word-wrap {
    display: inline-block;
    overflow: hidden;
}

.word {
    display: inline-block;
    will-change: transform, opacity;
}

.galleria-piatti {
    position: absolute;
    width: 6000px;
    height: 4000px;
    transform-origin: center center;
    cursor: grab;
}

.galleria-piatti:active {
    cursor: grabbing;
}

.piatto {
    position: absolute;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    transform-origin: center center;
}

.piatto:hover {
    transform: scale(1.05) rotate(0deg) !important;
    z-index: 50 !important;
}

.istruzioni {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 16px;
    text-align: center;
    padding: 10px 15px;
    border-radius: 5px;
    z-index: 100;
    background-color: rgba(0, 0, 0, 0.7);
    font-family: var(--della-respira), sans-serif;
}

.piatto-fallback {
    position: absolute;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
    transform-origin: center center;
    background-color: #1c3160;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #EDB012;
    font-family: sans-serif;
    font-weight: bold;
    text-align: center;
}

.piatto-fallback:hover {
    transform: scale(1.05) rotate(0deg) !important;
    z-index: 50 !important;
}

/* Media queries */
@media (max-width: 768px) {
    .galleria-container {
        overflow-y: auto;
        overflow-x: hidden;
        position: relative;
        width: 100%;
        height: 100vh;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }

    .galleria-piatti {
        display: none !important;
    }

    .galleria-piatti-mobile {
        display: block !important;
        position: relative;
        width: 100%;
        height: auto;
        margin-top: 20px;
        overflow: visible;
    }

    .galleria-piatti-mobile-container {
        position: relative;
        width: 100%;
        padding: 20px;
        display: flex;
        flex-wrap: wrap;
        gap: 20px;
        justify-content: center;
    }

    .intro-text {
        display: none; /* Nascondiamo il testo desktop su mobile */
    }
    
    .intro-text-mobile {
        position: relative;
        text-align: center;
        max-width: 100%;
        padding: 15px 20px;
        margin: 5rem auto 0rem; /* Aumentato il margin-top a 170px per lasciare spazio al logo */
        z-index: 10;
        transition: opacity 0.4s ease-out;
        font-family: var(--della-respira);
    }
    
    .intro-text-mobile h2 {
        font-size: 2rem;
        margin-bottom: 15px;
        color: #e6b54a;
        font-family: var(--della-respira);
        text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    }
    
    .intro-text-mobile p {
        font-size: 1rem;
        line-height: 1.5;
        color: #fff;
        text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    }

    .intro-text.hidden {
        opacity: 0;
        transform: translateY(-20px);
        pointer-events: none;
    }

    .intro-text.visible {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    /* Animazione per le parole quando il testo diventa visibile */
    .intro-text.visible .word {
        animation: slideInUp 0.6s forwards;
    }

    @keyframes slideInUp {
        from {
            transform: translateY(20px);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    /* Personalizzazione della scrollbar 
    .galleria-container::-webkit-scrollbar {
        width: 6px;
    }

    .galleria-container::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 3px;
    }

    .galleria-container::-webkit-scrollbar-thumb {
        background: rgba(237, 176, 18, 0.5);
        border-radius: 3px;
    }

    .galleria-container::-webkit-scrollbar-thumb:hover {
        background: rgba(237, 176, 18, 0.7);
    }*/

    .logo-container {
        position: fixed;
        top: 20px;
        left: 50%;
        transform: translateX(-50%);
        width: 120px;
        z-index: 100;
    }

    .istruzioni {
       /* position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        width: auto;
        white-space: nowrap;
        font-size: 14px;
        background-color: rgba(0, 0, 0, 0.8);
        padding: 8px 15px;
        border-radius: 20px;*/
        display: none;
    }

    .piatto-mobile {
        position: relative;
        width: 42vw;
        aspect-ratio: 1/1;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 10px;
        box-sizing: border-box;
        transform: none !important;
    }

    .piatto-mobile img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 8px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    }

    /* Aggiungo stile per l'indicatore di scroll */
    /*.scroll-indicator {
        text-align: center;
        color: #e6b54a;
        font-size: 14px;
        margin: 20px 0;
        padding: 10px;
        animation: pulse 2s infinite ease-in-out;
        font-family: 'Cinzel', serif;
    }*/

    .flag-toggle {
        left: auto;
        right: 2rem;
        top: auto;
        bottom: 1.5rem;
        position: fixed;
        background-color: #ffffff;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
}

@media (min-width: 769px) {
    .galleria-piatti-mobile {
        display: none !important;
    }
    
    .intro-text-mobile {
        display: none; /* Nascondiamo il testo mobile su desktop */
    }
}

/* Disabilita tutti gli effetti hover su mobile */
@media (hover: none) {
    .piatto:hover {
        transform: none !important;
    }
    
    .piatto-fallback:hover {
        transform: none !important;
    }
}

@media (max-width: 480px) {
    .piatto-modal {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
    
    .piatto-nome {
        font-size: 22px;
    }
    
    .piatto-descrizione {
        font-size: 15px;
    }
    
    .nav-button {
        min-width: 100px;
        padding: 8px 12px;
    }
    
    .piatto-image-container {
        height: 35%;
    }
    
    .piatto-content {
        height: 65%;
        padding: 20px 15px;
    }
}

/* Stili specifici per migliorare il tocco su mobile */
@media (hover: none) and (pointer: coarse) {
    .piatto, .piatto-fallback {
        /* Interrompi l'hover su dispositivi touch per prevenire effetti indesiderati */
        -webkit-tap-highlight-color: transparent;
    }
    
    .nav-button {
        /* Pulsanti più grandi su touch */
        padding: 12px 20px;
        margin: 0 5px;
    }
    
    /* Aumenta l'area cliccabile per il pulsante di chiusura */
    .close-modal {
        padding: 10px;
    }
    
    /* Fix per migliorare la risposta al tocco */
    .piatto, .piatto-fallback {
        cursor: pointer;
        /* Aggiunge un ritardo minimo alla transizione per migliorare la risposta al tocco */
        transition-delay: 50ms;
    }
    
    /* Adatta l'overflow per il modal su mobile */
    .piatto-content {
        -webkit-overflow-scrolling: touch;
    }
}

/* Stili per il modal dei piatti */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.piatto-modal {
    display: flex;
    width: 90%;
    max-width: 1200px;
    height: 80%;
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    opacity: 0;
}

.piatto-image-container {
    width: 50%;
    background-color: #f8f8f8;
    position: relative;
    overflow: hidden;
}

.piatto-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s ease;
}

.piatto-content {
    width: 50%;
    padding: 40px;
    position: relative;
    overflow-y: auto;
}

.piatto-nome {
    font-size: 32px;
    margin-bottom: 24px;
    color: var(--chicca-blue);
    font-weight: bold;
    font-family: var(--della-respira), serif;
}

.piatto-descrizione {
    font-size: 18px;
    line-height: 1.6;
    color: var(--chicca-blue);
    margin-bottom: 40px;
    font-family: var(--della-respira), serif;
}

.piatto-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    position: absolute;
    bottom: 40px;
    width: calc(100% - 80px);
}

.nav-button {
    background: var(--chicca-blue);
    color: white;
    border: 1px solid var(--chicca-blue);
    padding: 12px 25px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    animation: none;
    font-family: var(--della-respira), serif;
}

.nav-button:hover {
    background: white;
    color: var(--chicca-blue);
    transform: translateY(-2px);
    animation: none;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    color: #555;
    cursor: pointer;
    z-index: 9100;
    transition: all 0.3s ease;
    background-color: rgba(255, 255, 255, 0.8);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    color: #000;
    transform: rotate(90deg);
    background-color: rgba(255, 255, 255, 1);
}

.piatto-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--chicca-blue);
    font-size: 14px;
    font-family: var(--della-respira), serif;
}

/* Stili per il pannello dettagli */
#detail-panel-styles {
    position: fixed;
    right: -400px; 
    top: 50%;
    transform: translateY(-50%);
    width: 350px;
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 25px;
    font-family: Arial, sans-serif;
    z-index: 1000;
    overflow-y: auto;
    max-height: 80vh;
    transition: all 0.3s ease;
}

#prev-piatto, #next-piatto {
    transition: all 0.3s ease;
}

#prev-piatto:hover, #next-piatto:hover {
    
    transform: scale(1.1);
}

#close-detail:hover {

    transform: scale(1.2);
}

/* Classi per i pulsanti di navigazione attivi/inattivi */
.button-active {
    opacity: 1 !important;
    cursor: pointer !important;
}

.button-inactive {
    opacity: 0.5 !important;
    cursor: default !important;
}

/* Media query per il modal su schermi piccoli */
@media (max-width: 768px) {
    .piatto-modal {
        flex-direction: column;
        height: 90%;
        width: 95%;
        max-height: 90%;
    }
    
    .piatto-image-container,
    .piatto-content {
        width: 100%;
    }
    
    .piatto-image-container {
        height: 40%;
    }
    
    .piatto-content {
        height: 60%;
        padding: 25px 20px;
        -webkit-overflow-scrolling: touch;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    
    .piatto-nome {
        font-size: 24px;
        margin-bottom: 15px;
        margin-top: 10px;
        text-align: center;
    }
    
    .piatto-descrizione {
        font-size: 16px;
        line-height: 1.5;
        margin-bottom: 20px;
        text-align: center;
    }
    
    .piatto-navigation {
        position: relative;
        bottom: 0;
        margin-top: auto;
        width: 100%;
        justify-content: space-around;
        gap: 12px;
        padding-bottom: 20px;
    }
    
    .nav-button {
        padding: 10px 15px;
        font-size: 14px;
        flex: 0 0 auto;
        min-width: 110px;
        justify-content: center;
    }
    
    .close-modal {
        top: 10px;
        right: 10px;
        font-size: 24px;
        padding: 10px;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: rgba(255, 255, 255, 0.8);
        border-radius: 50%;
        color: var(--chicca-blue);
        z-index: 9500;
    }
    
    .piatto-counter {
        position: relative;
        bottom: auto;
        left: auto;
        transform: none;
        text-align: center;
        margin-top: 15px;
    }
}

@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
} 