/* =========================================
   BLOCCO SCROLL INIZIALE
   ========================================= */
body.no-scroll {
    overflow: hidden !important;
}

/* =========================================
   PRE-LOADER CINEMATOGRAFICO
   ========================================= */
#preloader {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: var(--crema-sfondo);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Sfumatura morbida di 0.6 secondi */
    transition: opacity 0.6s ease-in-out, visibility 0.6s ease-in-out; 
}
#preloader h1 {
    color: var(--verde-primario);
    font-family: 'Georgia', serif;
    font-size: 32px;
    letter-spacing: 2px;
    opacity: 0;
    /* Testo visibile per 1.5 secondi */
    animation: fadeText 1.5s ease-in-out forwards; 
}
@keyframes fadeText {
    0% { opacity: 0; transform: translateY(15px); }
    40% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-15px); }
}
.preloader-hidden {
    opacity: 0;
    visibility: hidden;
}

/* COLORI BASE E VARIABILI DINAMICHE */
:root {
    --verde-primario: #5e7153;
    --verde-chiaro: #8c9c83;
    --crema-sfondo: #faf9f6;
    --bianco-sfondo: #ffffff;
    --card-sfondo: #ffffff;
    --testo-scuro: #333333;
    --testo-chiaro: #666666;
    --footer-sfondo: #5e7153;
}

/* 🌅 TEMA TRAMONTO (Golden Hour) */
body.theme-sunset {
    --verde-primario: #c25e03; 
    --verde-chiaro: #e68e45;
    --crema-sfondo: #fff4e6; 
    --bianco-sfondo: #fffaf5;
    --card-sfondo: #fffaf5;
    --footer-sfondo: #c25e03; 
}

/* 🌙 TEMA NOTTE (Night Mode Elegante) */
body.theme-night {
    --verde-primario: #8c9c83; 
    --verde-chiaro: #5e7153;
    --crema-sfondo: #0d1117; 
    --bianco-sfondo: #161b22; 
    --testo-scuro: #f0f6fc; 
    --testo-chiaro: #8b949e; 
    --card-sfondo: #21262d; 
    --footer-sfondo: #0a0e14; 
}

/* MAGIA: Transizione morbida dei colori */
body, section, header, footer, div, h1, h2, h3, p, a, span, .servizio-card, .esperienza-card, .dintorni-card, .recensione-card {
    transition: background-color 1.5s ease, color 1.5s ease, border-color 1.5s ease;
}

body { margin: 0; font-family: 'Helvetica Neue', Arial, sans-serif; background-color: var(--crema-sfondo); color: var(--testo-scuro); overflow-x: hidden; }
h1, h2, h3 { font-family: 'Georgia', serif; font-weight: normal; margin: 0; }
a { text-decoration: none; color: inherit; }

/* LOGICA CAMBIO LINGUA */
[lang="en"] { display: none !important; }
body.lang-en [lang="it"] { display: none !important; }
body.lang-en [lang="en"] { display: inline-block !important; }
body.lang-en h1[lang="en"], body.lang-en p[lang="en"], body.lang-en h2[lang="en"], body.lang-en h3[lang="en"], body.lang-en span[lang="en"] { display: inline-block !important; }

/* BARRA DI NAVIGAZIONE */
header { background-color: var(--bianco-sfondo); padding: 20px 5%; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 1000; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.logo { font-size: 24px; font-family: 'Georgia', serif; color: var(--verde-primario); font-weight: bold; }

.menu-icon { display: none; font-size: 30px; color: var(--verde-primario); cursor: pointer; user-select: none; }

.nav-links { display: flex; gap: 20px; align-items: center; }
.nav-links a { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; transition: color 0.3s; font-weight: bold; }
.nav-links a:hover { color: var(--verde-primario); }

/* SELETTORE LINGUA */
.lang-switcher { display: flex; gap: 10px; margin-left: 10px; cursor: pointer; }
.lang-btn { opacity: 0.4; transition: 0.3s; font-size: 18px; filter: grayscale(100%); }
.lang-btn.active { opacity: 1; filter: grayscale(0%); transform: scale(1.1); }

/* STILE TASTO AIRBNB NEL MENU */
.btn-airbnb { 
    background-color: #FF5A5F !important; 
    color: white !important; 
    padding: 8px 15px; 
    border-radius: 4px; 
    font-weight: bold; 
    display: inline-flex; 
    align-items: center; 
    gap: 6px; 
    transition: transform 0.3s ease; 
}
.btn-airbnb:hover { transform: scale(1.05); }
.btn-airbnb svg { fill: white; margin-top: 4px; }

/* =========================================
   HERO: EFFETTO PARALLASSE E KEN BURNS
   ========================================= */
.hero { 
    height: 80vh; 
    position: relative;
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    text-align: center; 
    color: white !important; 
    padding: 0 20px;
    overflow: hidden;
    background-color: black;
}

.hero-slideshow {
    position: absolute;
    top: -10%; left: -10%; /* Margine per il parallasse */
    width: 120%; height: 120%; /* Più grande per evitare bordi neri nello scroll */
    z-index: 1;
    /* La transizione per il parallasse verrà gestita via Javascript */
    will-change: transform;
}

.slide {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover; 
    background-position: center;
    opacity: 0;
    animation: kenburns 18s infinite;
}

.slide::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.3));
}

.slide:nth-child(1) { animation-delay: 0s; background-image: url('assets/foto_copertina.jpg'); }
.slide:nth-child(2) { animation-delay: 6s; background-image: url('assets/foto_giardino.jpg'); }
.slide:nth-child(3) { animation-delay: 12s; background-image: url('assets/prima_camera_da_letto_n_1.jpg'); }

@keyframes kenburns {
    0% { opacity: 0; transform: scale(1); }
    10% { opacity: 1; }
    25% { opacity: 1; }
    40% { opacity: 0; transform: scale(1.08); } 
    100% { opacity: 0; transform: scale(1.08); }
}

.hero-content {
    position: relative;
    z-index: 2; 
    will-change: transform, opacity;
}

.hero h1 { font-size: 50px; margin-bottom: 15px; letter-spacing: 2px; text-shadow: 2px 2px 10px rgba(0,0,0,0.5); color: white !important; }
.hero p { font-size: 20px; margin-bottom: 30px; font-weight: 300; max-width: 600px; text-shadow: 1px 1px 5px rgba(0,0,0,0.5); color: white !important; }
.btn-prenota { background-color: white; color: var(--verde-primario) !important; padding: 15px 30px; font-size: 16px; font-weight: bold; text-transform: uppercase; border-radius: 5px; transition: 0.3s; display: inline-block; box-shadow: 0 4px 15px rgba(0,0,0,0.3); }
.btn-prenota:hover { background-color: var(--verde-primario); color: white !important; transform: translateY(-3px); }

/* SEZIONI */
.sezione { padding: 80px 5%; text-align: center; max-width: 1200px; margin: 0 auto; position: relative; z-index: 5; }
.sezione-titolo { font-size: 36px; color: var(--verde-primario); margin-bottom: 20px; }
.sezione-desc { font-size: 16px; color: var(--testo-chiaro); line-height: 1.8; max-width: 800px; margin: 0 auto 50px auto; }

/* SERVIZI */
.griglia-servizi { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; }
.servizio-card { background: var(--card-sfondo); padding: 30px; border-radius: 8px; box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
.icona-servizio {
    width: 48px;        /* Regola la grandezza dell'icona qui */
    height: 48px;
    margin-bottom: 15px; /* Spazio tra l'icona e il titolo */
    display: block;
    margin-left: auto;   /* Questi due margin centrano l'icona */
    margin-right: auto;
}

/* GALLERIA */
.griglia-foto { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 15px; }
.foto { width: 100%; height: 300px; object-fit: cover; border-radius: 5px; transition: transform 0.3s; cursor: pointer; }
.foto:hover { transform: scale(1.03); }

/* ESPERIENZE E MINI-SLIDER */
.griglia-esperienze { display: flex; flex-wrap: wrap; justify-content: center; gap: 30px; margin-top: 40px; }
.esperienza-card { background: var(--card-sfondo); border-radius: 12px; overflow: hidden; box-shadow: 0 5px 15px rgba(0,0,0,0.08); transition: transform 0.3s ease, box-shadow 0.3s ease; text-align: left; border-bottom: 4px solid var(--verde-primario); width: 100%; max-width: 450px; margin: 0 auto; }
.esperienza-card:hover { transform: translateY(-8px); box-shadow: 0 12px 20px rgba(0,0,0,0.15); }
.media-box { width: 100%; height: auto; aspect-ratio: 3 / 4; background-color: #eee; position: relative; overflow: hidden; }
.slider-container { position: relative; overflow: hidden; touch-action: pan-y; }
.slider-track { display: flex; height: 100%; transition: transform 0.5s ease-in-out; will-change: transform; } 
.slider-track img { min-width: 100%; height: 100%; object-fit: cover; }
.slider-freccia { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.5); color: white; padding: 6px 12px; cursor: pointer; border-radius: 50%; font-size: 14px; font-weight: bold; user-select: none; z-index: 5; transition: background 0.3s; }
.slider-freccia:hover { background: var(--verde-primario); }
.slider-freccia.sx { left: 10px; }
.slider-freccia.dx { right: 10px; }
.esperienza-content { padding: 25px; }
.esperienza-content h3 { margin: 0 0 10px 0; font-size: 22px; color: var(--verde-primario); font-family: 'Georgia', serif; }
.esperienza-content p { font-size: 15px; color: var(--testo-chiaro); margin: 0 0 20px 0; line-height: 1.6; }
.btn-esperienza { display: inline-block; background-color: transparent; color: var(--verde-primario); padding: 10px 20px; border-radius: 6px; font-size: 13px; font-weight: bold; text-transform: uppercase; letter-spacing: 1px; transition: 0.3s; border: 1px solid var(--verde-chiaro); }
.btn-esperienza:hover { background-color: var(--verde-primario); color: white; }

/* DISTANZE STRATEGICHE (I DINTORNI) */
.griglia-dintorni { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-top: 30px; padding: 0 5%; }
.dintorni-card { background-color: var(--crema-sfondo); padding: 20px; border-radius: 8px; text-align: center; box-shadow: 0 4px 10px rgba(0,0,0,0.03); border: 1px solid var(--verde-chiaro); opacity: 0.8; }
.dintorni-icona { font-size: 35px; margin-bottom: 10px; }
.dintorni-titolo { font-weight: bold; color: var(--testo-scuro); font-size: 16px; margin-bottom: 5px; }
.dintorni-tempo { color: var(--verde-primario); font-size: 14px; font-weight: bold; }

/* MAPPA E FOOTER */
.mappa-container { width: 100%; height: 400px; background-color: #eee; margin-top: 40px; border-radius: 8px; overflow: hidden; }
footer { background-color: var(--footer-sfondo); color: white; text-align: center; padding: 40px 20px; margin-top: 50px; border-top: 1px solid rgba(255,255,255,0.05); position: relative; z-index: 5;}
footer p { margin: 10px 0; opacity: 0.8; font-size: 14px; color: white !important; }
.social-links { display: flex; justify-content: center; gap: 20px; margin-top: 20px; }
.social-links a { color: white; display: inline-block; transition: transform 0.3s; opacity: 0.9; }
.social-links a:hover { transform: scale(1.2); opacity: 1; }
.social-links svg { width: 28px; height: 28px; fill: currentColor; }

/* LIGHTBOX E RECENSIONI */
.lightbox { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.9); justify-content: center; align-items: center; }
.lightbox-img { max-width: 85%; max-height: 85vh; border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.5); animation: zoomIn 0.3s ease; }
.chiudi-lightbox { position: absolute; top: 20px; right: 35px; color: #f1f1f1; font-size: 40px; font-weight: bold; cursor: pointer; transition: 0.2s; z-index: 2001; }
.chiudi-lightbox:hover { color: var(--verde-chiaro); }
.freccia { cursor: pointer; position: absolute; top: 50%; padding: 16px; color: white; font-weight: bold; font-size: 40px; background-color: rgba(0,0,0,0.3); border-radius: 5px; z-index: 2001; }
.freccia.sinistra { left: 20px; } .freccia.destra { right: 20px; }
@keyframes zoomIn { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.recensioni-container { max-width: 900px; margin: 50px auto; text-align: center; padding: 0 20px; position: relative; z-index: 5;}
.recensioni-titolo { font-family: 'Georgia', serif; color: var(--verde-primario); font-size: 28px; margin-bottom: 25px; }
.recensioni-scroll { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 20px; padding-bottom: 20px; scrollbar-width: thin; scrollbar-color: var(--verde-chiaro) transparent; }
.recensione-card { flex: 0 0 100%; scroll-snap-align: center; background: var(--card-sfondo); padding: 25px; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.06); border-top: 4px solid var(--verde-primario); text-align: left; box-sizing: border-box; }
@media(min-width: 768px){ .recensione-card { flex: 0 0 calc(50% - 10px); } }
.stelle { color: #f39c12; font-size: 18px; margin-bottom: 10px; letter-spacing: 2px;}
.recensione-testo { font-style: italic; color: var(--testo-chiaro); font-size: 15px; margin-bottom: 20px; line-height: 1.6; }
.recensione-autore { font-weight: bold; color: var(--testo-scuro); font-size: 15px; display: flex; align-items: center; gap: 10px; }
.recensione-autore img { border-radius: 50%; width: 30px; height: 30px; }
.recensione-data { font-size: 13px; color: var(--testo-chiaro); opacity: 0.7; margin-top: 3px; margin-left: 40px;}
.recensioni-scroll::-webkit-scrollbar { height: 8px; }
.recensioni-scroll::-webkit-scrollbar-track { background: transparent; }
.recensioni-scroll::-webkit-scrollbar-thumb { background-color: var(--verde-chiaro); border-radius: 10px; }

/* WHATSAPP FLOAT */
.whatsapp-float { position: fixed; width: 60px; height: 60px; bottom: 30px; right: 30px; background-color: #25D366; border-radius: 50px; box-shadow: 2px 2px 10px rgba(0,0,0,0.2); z-index: 1000; transition: transform 0.3s ease; }
.whatsapp-float:hover { transform: scale(1.1); }
.whatsapp-float svg { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 35px; height: 35px; fill: white; }

/* =========================================
   BARRA "PRENOTA ORA" INCOLLATA SU MOBILE
   ========================================= */
.mobile-sticky-bar { display: none; }

@media (max-width: 768px) {
    .menu-icon { display: block; }
    .nav-links { display: none; flex-direction: column; position: absolute; top: 70px; left: 0; width: 100%; background-color: var(--bianco-sfondo); padding: 20px 0; box-shadow: 0 10px 15px rgba(0,0,0,0.1); border-top: 1px solid var(--crema-sfondo); }
    .nav-links.active { display: flex; }
    .nav-links a { width: 100%; text-align: center; padding: 15px 0; border-bottom: 1px solid var(--crema-sfondo); }
    .lang-switcher { margin-left: 0; margin-top: 10px; justify-content: center; width: 100%; padding: 10px 0; }
    .hero h1 { font-size: 36px; }
    .sezione { padding: 50px 20px; }
    .freccia { font-size: 25px; }
    .btn-airbnb { width: 85% !important; margin: 15px auto !important; justify-content: center !important; box-sizing: border-box; }

    /* Attivazione Barra Mobile */
    .mobile-sticky-bar {
        display: flex; justify-content: space-between; align-items: center;
        position: fixed; bottom: 0; left: 0; width: 100%;
        background-color: var(--bianco-sfondo); padding: 12px 20px; box-shadow: 0 -2px 15px rgba(0,0,0,0.15);
        z-index: 1000; box-sizing: border-box;
    }
    .sticky-testo { font-size: 13px; color: var(--testo-chiaro); font-weight: bold; line-height: 1.2;}
    .sticky-testo strong { color: var(--testo-scuro); font-size: 15px; display: block; }
    .sticky-btn { background-color: var(--verde-primario); color: white !important; padding: 10px 20px; border-radius: 6px; font-weight: bold; font-size: 14px; text-decoration: none; }
    
    body { padding-bottom: 70px; }
    .whatsapp-float { width: 50px; height: 50px; bottom: 85px; right: 20px; }
    .whatsapp-float svg { width: 28px; height: 28px; }
}