/* --- 1. STILI GENERALI --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: emoji, sans-serif;
    line-height: 1.6;
    color: #333;
    position: relative;
    background-color: #fff;
}

/* --- 2. HEADER E NAVBAR --- */
header {
    position: relative;
    text-align: center;
    height: 40vh; /* 40% dell'altezza schermo su desktop */
    
}

#header {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

h1 {
    color: #fe5805ef;
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    font-size: 2.5rem;
    width: 100%;
    padding: 0 20px;
    z-index: 2;
}

#navbar {
    background-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    position: sticky;
    top: 0;
    z-index: 1000;
}
/* Nasconde la navbar quando scendi troppo */
body.scrolled #navbar {
    transform: translateY(-100%);
}

#navbar ul {
    list-style: none;
    padding: 10px;
    display: flex;
    justify-content: center;
}

#navbar li {
    margin: 0 20px;
}

#navbar a {
    text-decoration: none;
    color: #fe5805ef;
    font-weight: bold;
}

/* --- 3. MENU DROPDOWN (tendina) --- */
#dropdown {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 2000;
    display: none; /* Nascosto di default, appare con lo scroll */
}

.tendina {
    background-color: #fe5805ef;
    color: white;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.5rem;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
    border-radius: 5px;
}

.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
}

/* Logica Scroll via JS */
body.scrolled #navbar {
    transform: translateY(-100%);
}

body.show-menu #dropdown {
    display: block;
}

/* --- 4. CONTENUTI PRINCIPALI --- */
#profilo {
    border-radius: 50%;
    border: 3px solid #fe5805ef;
    margin: 40px auto 20px auto;
    display: block;
    max-width: 200px;
    width: 40%;
    height: auto;
    margin-top: 5%;
   
}

#testo, #proloquio {
    margin: 20px auto;
    padding: 15px;
    text-align: center;
    max-width: 800px;
}

#proloquio {
    max-width: 950px;
}

/* --- 5. GALLERIA 3D (DESKTOP) --- */
#gallery-container {
    position: relative;
    max-width: 1000px;
    margin: 50px auto;
    overflow: hidden;
    perspective: 1200px;
    height: 550px;
}

#gallery {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    position: relative;
}

.singolo {
    position: absolute;
    width: 45%;
    height: 400px;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    filter: brightness(0.5) blur(2px);
    transform: scale(0.8);
    opacity: 0.6;
    background-color: white;
}

.singolo.active {
    left: 50%;
    transform: translateX(-50%) scale(1.1);
    filter: brightness(1) blur(0px);
    z-index: 10;
    opacity: 1;
    width: 50%;
}

.singolo.prev {
    left: 5%;
    transform: scale(0.8) rotateY(15deg);
    z-index: 5;
}

.singolo.next {
    right: 5%;
    transform: scale(0.8) rotateY(-15deg);
    z-index: 5;
}

.gallery-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(254, 88, 5, 0.7);
    color: white;
    border: none;
    cursor: pointer;
    padding: 15px;
    font-size: 24px;
    border-radius: 50%;
    z-index: 20;
    transition: all 0.3s;
}

.gallery-btn:hover {
    background-color: #fe5805ef;
    transform: translateY(-50%) scale(1.1);
}

#prev-btn { left: 20px; }
#next-btn { right: 20px; }

/* --- 6. SEZIONI SPECIFICHE --- */
#prodotti {
    padding: 50px 30px;
    display: flex;
    flex-direction: column;
    gap: 40px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.scheda-prodotto {
    display: flex;
    align-items: center;
    max-width: 900px;
    margin: 0 auto;
    gap: 30px;
    background-color: #fdf5e6;
    padding: 20px;
    border-radius: 15px;
}

.prodotto {
    width: 250px;      
    height: 300px;      
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.4s ease;
}

.scheda-prodotto:hover .prodotto {
    transform: scale(1.05);
}

.descrizione-prodotto { flex: 1; }
.descrizione-prodotto h3 { 
    color: #fe5805ef; 
    margin-bottom: 10px; 
}

/* Sezione Impegno */
#impegno {
    padding: 60px 20px;
    text-align: center;
}

.descrizione-lavoro { 
    max-width: 800px; 
    margin: 0 auto 40px auto; 
}

.icone-impegno-container { 
    display: flex; 
    justify-content: center; 
    gap: 30px; 
    flex-wrap: wrap; 
}

.icona-item {
    position: relative;
    width: 150px;
    height: 150px;
    overflow: hidden;
    border-radius: 20%;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    cursor: pointer;
}

.icona-item img {
    width: 100%; height: 100%; object-fit: cover;
    filter: blur(3px) brightness(0.6);
    transition: all 0.4s ease-in-out;
}

.icona-item:hover img { filter: blur(0px) brightness(0.9); }

.overlay-testo {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    color: white; font-weight: bold; text-transform: uppercase;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.9); pointer-events: none;
}

/* Posizione e Contatti */
#posizione { padding: 60px 20px; text-align: center; background-color: #f9f9f9; }
.mappa-container { max-width: 1000px; margin: 0 auto; border-radius: 15px; overflow: hidden; border: 5px solid white; }

#contatti { padding: 40px 20px; max-width: 1200px; margin: 0 auto; }
.contatti-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.contatto-item { background: white; padding: 20px; border-radius: 10px; box-shadow: 0 4px 8px rgba(0,0,0,0.1); }
.contatto-item span { font-size: 2rem; color: #fe5805ef; display: block; margin-bottom: 10px; }

/* --- 7. FOOTER --- */
footer { width: 100%; margin-top: 40px; }
#footer-wave { width: 100%; display: block; }
#footer-legal-bar {
    background-color: #fe5805ef; color: white; padding: 40px 20px;
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.85rem; flex-wrap: wrap; gap: 20px;
}
.legal-links a { color: white; text-decoration: none; font-weight: bold; }

/* --- 8. MEDIA QUERIES (MOBILE) --- */
@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
        top: 60%;
        background-color: transparent;
    }

    #header { max-height: 250px; }
    #profilo { width: 60%; }

    /* Fix Galleria Mobile */
    #gallery-container {
        height: 350px !important;
        margin: 20px auto !important;
    }

    #gallery { height: 100%; }

    .singolo {
        width: 80% !important;
        height: 250px !important; 
        object-fit: contain !important; 
        background-color: #fff;
    }

    .singolo.active {
        left: 50% !important;
        transform: translateX(-50%) scale(1) !important;
        width: 90% !important;
        height: 280px !important;
    }

    .singolo.prev, .singolo.next { display: none !important; }

    .gallery-btn { bottom: 10px; top: auto; transform: none; padding: 10px 15px; }

    /* Layout Mobile */
    .scheda-prodotto { flex-direction: column; text-align: center; }
    .prodotto { width: 100%; height: auto; max-width: 250px; }
    .contatti-container { grid-template-columns: 1fr; }
    #footer-legal-bar { flex-direction: column; text-align: center; }
}