/* =========================================
   1. VARIABILI E RESET
   ========================================= */
:root {
    --primary: #004F59;  /* Petrolio Profondo */
    --secondary: #83C5BE; 
    --accent: #C05621;   /* Mattone Vivo */
    --accent-hover: #9C4215; 
    --strip-bg: #EDF6F9; 
    --text: #1D1F20;
    --light: #FDFDFC;   
    --white: #ffffff;
    --font-main: 'Verdana', sans-serif; 
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body { 
    font-family: var(--font-main); 
    line-height: 1.6; 
    color: var(--text); 
    background-color: var(--light); 
    display: flex; flex-direction: column; min-height: 100vh;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
img { max-width: 100%; display: block; }

/* HEADER */
header { 
    background-color: var(--primary); 
    position: sticky; top: 0; z-index: 1000; 
    border-bottom: 3px solid rgba(0,0,0,0.1); 
}
.navbar { 
    max-width: 1200px; margin: 0 auto; padding: 0 20px;
    height: 70px; display: flex; justify-content: space-between; align-items: center; 
}
/* --- INIZIO MODIFICA LOGO --- */

/* Contenitore che allinea Immagine e Testo */
.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;       /* Spazio tra il logo e la scritta */
    text-decoration: none; /* Rimuove sottolineature se usato come link */
    cursor: pointer;
}

/* Immagine del Logo */
.navbar-logo-img {
    height: 50px;    /* Altezza fissa desktop */
    width: auto;     /* Larghezza automatica per non deformare */
    display: block;
}

/* Stile del Testo (ex classe .logo) */
.logo-text {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--white);
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1;  /* Migliora l'allineamento verticale con l'immagine */
}

/* --- FINE MODIFICA LOGO --- */

/* BURGER MENU */
.hamburger { display: none; font-size: 1.8rem; color: white; cursor: pointer; }

.nav-links { display: flex; align-items: center; gap: 20px; }
.nav-links a { font-weight: 600; color: #e0fbfc; font-size: 0.9rem; text-transform: uppercase; }
.nav-links a:hover, .nav-links a.active { color: var(--white); text-decoration: underline; }
.cta-header { background: var(--accent); color: white !important; padding: 8px 20px; border-radius: 4px; text-decoration: none !important;}
.cta-header:hover { background: var(--accent-hover); }

/* =========================================
   HERO SECTION
   ========================================= */
.hero {
    position: relative;
    width: 100%;
    height: 60vh;
    min-height: 450px;    
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #000;
    margin: 0; padding: 0;
}

.hero-small {
    height: 30vh; min-height: 200px;
    background: linear-gradient(rgba(0, 109, 119, 0.6), rgba(0, 109, 119, 0.6)), url('../image/mare.jpg'); 
    background-size: cover; background-position: center;
    display: flex; align-items: center; justify-content: center; 
    text-align: center; color: white;
}

.video-bg {
    position: absolute; top: 0; left: 0;
    width: 100% !important; height: 100% !important;
    object-fit: cover; z-index: 0;
}

.overlay {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.35); z-index: 1;
}

.hero-content {
    position: relative; z-index: 2;
    text-align: center; color: white;
    padding: 20px; width: 100%; max-width: 900px;
}

.hero-content h1, .hero-small h1 { 
    font-size: 3rem; text-shadow: 2px 2px 5px rgba(0,0,0,0.7); 
    margin-bottom: 15px; font-weight: 700; line-height: 1.2;
}

.hero-content p { 
    font-size: 1.3rem; font-weight: 500; 
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8); 
    background: transparent; padding: 0; display: block;
}

/* =========================================
   RESTO DEL SITO
   ========================================= */
.booking-strip { background-color: var(--strip-bg); padding: 30px 20px; display: flex; justify-content: center; border-bottom: 1px solid #dce7eb; }
.calculator-box { width: 100%; max-width: 1000px; display: flex; align-items: flex-end; gap: 15px; }
.form-grid { display: flex; flex-grow: 1; gap: 15px;}
.form-group { flex: 1; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 700; color: var(--primary); font-size: 0.85rem; text-transform: uppercase;}
.input-field { width: 100%; padding: 10px 15px; background-color: #fff; border: 1px solid #ccc; border-radius: 4px; font-size: 1rem; color: #333;}
.btn-hero { 
    background: var(--accent); color: white; padding: 11px 30px; border-radius: 4px; 
    font-size: 1rem; border: none; cursor: pointer; height: auto;
    font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}
.btn-hero:hover { background: var(--accent-hover); transform: translateY(-1px);}

.container { max-width: 1200px; margin: 0 auto; padding: 3rem 1rem; flex-grow: 1; }
.section-title { text-align: center; color: var(--primary); font-size: 2rem; margin-bottom: 2rem; font-weight: 700;}

/* GALLERIA HOME */
.preview-section { padding: 40px 20px; background-color: #fff; text-align: center; border-bottom: 1px solid #eee;}
.preview-section h2 { font-size: 1.8rem; color: var(--primary); margin-bottom: 25px;}
.preview-gallery { display: flex; justify-content: center; gap: 10px; max-width: 1000px; margin: 0 auto;}
.preview-gallery img { width: 33%; height: 220px; object-fit: cover; border: 1px solid #ccc; }

/* CASETTE */
.grid-casette { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; width: 100%; }
.card { 
    background: white; border: 1px solid #ccc; box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    display: flex; flex-direction: column; border-radius: 6px; overflow: hidden; transition: transform 0.2s;
}
.card:hover { transform: translateY(-3px); }
.card-img-slider { height: 200px; background: #eee; }
.card-img-slider img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 20px; flex-grow: 1; display: flex; flex-direction: column; }
.card-title { color: var(--primary); font-size: 1.4rem; margin-bottom: 5px; font-weight: 700; }
.card-price { color: var(--accent); font-weight: 700; font-size: 1.2rem; margin-bottom: 10px; }
.card-desc { font-size: 0.95rem; margin-bottom: 15px; color: #555; border-top: 1px solid #eee; padding-top: 10px; line-height: 1.5;}

.btn-card { margin-top: auto; background-color: var(--primary); color: white; padding: 12px; border: none; border-radius: 4px; cursor: pointer; font-weight: 600; width: 100%; transition: background-color 0.3s;}
.btn-card:hover { background-color: #004e57; }

/* FAQ & MAPPA */
.faq-container { max-width: 800px; margin: 0 auto; width: 100%; }
.faq-item { background: white; border: 1px solid #ddd; margin-bottom: 10px; border-radius: 4px; overflow: hidden; width: 100%; }
.faq-question { padding: 15px 20px; background: #fff; cursor: pointer; font-weight: 700; color: var(--primary); display: flex; justify-content: space-between; align-items: center; width: 100%; }
.faq-question:hover { background: var(--strip-bg); }
.faq-answer { display: none; padding: 15px 20px; border-top: 1px solid #eee; color: #555; background: #f9f9f9; }
.faq-item.active .faq-answer { display: block; }
.faq-icon { transition: transform 0.3s; }
.faq-item.active .faq-icon { transform: rotate(180deg); }

.map-responsive { overflow:hidden; padding-bottom:56.25%; position:relative; height:0; border: 1px solid #ccc; }
.map-responsive iframe { left:0; top:0; height:100%; width:100%; position:absolute; }
.info-box { background: white; padding: 20px; margin-top: 20px; border: 1px solid #ddd; border-radius: 4px; text-align: center;}

/* CONTATTI */
.contact-container { display: flex; gap: 40px; flex-wrap: wrap; }
.contact-info, .contact-form { flex: 1; min-width: 300px; background: white; padding: 30px; border: 1px solid #ddd; border-radius: 4px;}
.contact-info h3, .contact-form h3 { color: var(--primary); margin-bottom: 15px; border-bottom: 2px solid var(--accent); display: inline-block; padding-bottom: 5px;}
.contact-list li { margin-bottom: 15px; display: flex; gap: 10px; align-items: center; }
.contact-list i { color: var(--accent); width: 20px;}
textarea.input-field { resize: vertical; height: 120px; }

/* MODALE & FOOTER */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); z-index: 2000; justify-content: center; align-items: center; padding: 20px;}
.modal-overlay.active { display: flex; }
.modal-content { background: white; width: 100%; max-width: 600px; border: 1px solid #000; max-height: 90vh; overflow-y: auto;}
.modal-header { position: relative; height: 300px; background: #000; }
.modal-header img { width: 100%; height: 100%; object-fit: cover; }
.slider-counter { position: absolute; bottom: 15px; left: 15px; background: rgba(0,0,0,0.6); color: white; padding: 5px 12px; border-radius: 20px; font-size: 0.9rem; font-weight: bold; pointer-events: none; z-index: 15;}
.close-modal { position: absolute; top: 10px; right: 10px; background: #000; color: white; width: 30px; height: 30px; text-align: center; line-height: 30px; cursor: pointer; font-weight:bold; z-index: 10;}
.slider-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.5); color: #fff; border: none; padding: 10px; font-size: 1.5rem; cursor: pointer; z-index: 5;}
.prev-btn { left: 0; } .next-btn { right: 0; }
.modal-body { padding: 20px; }
.btn-whatsapp-modal { display: block; width: 100%; padding: 12px; text-align: center; background: #25D366; color: white; font-weight: bold; border-radius: 4px; margin-top: 15px; text-decoration: none;}
.btn-whatsapp-modal:hover { opacity: 0.9; }

footer { background: var(--primary); color: #fff; padding: 30px 20px; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 30px; max-width: 1200px; margin: 0 auto; }
.footer-col h3 { border-bottom: 1px solid rgba(255,255,255,0.3); padding-bottom: 5px; margin-bottom: 15px; font-size: 1.1rem; }

/* ANIMAZIONE ERRORE CALENDARIO */
@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

.attention-pulse {
    border: 2px solid #d62828 !important; 
    box-shadow: 0 0 15px rgba(214, 40, 40, 0.5);
    background-color: #fff0f0 !important; 
    animation: shake 0.4s ease-in-out;
    color: #d62828 !important; 
    font-weight: 800 !important; 
    font-size: 1.1rem !important; 
    text-align: center;
}

.attention-pulse::placeholder {
    color: #d62828 !important;
    opacity: 1;
    font-weight: 800;
}

/* MEDIA QUERIES (MOBILE) */
@media (max-width: 768px) {
    .navbar { padding: 0 15px; height: 60px; }

    /* --- INIZIO NUOVE REGOLE LOGO MOBILE --- */
    .navbar-logo-img { height: 40px; }  /* Riduce il logo a 40px */
    .logo-text { font-size: 1.1rem; }   /* Riduce leggermente il testo */
    /* --- FINE NUOVE REGOLE LOGO MOBILE --- */

    .hamburger { display: block; }
    .nav-links {
        position: absolute; top: 60px; left: 0; width: 100%;
        background-color: var(--primary); flex-direction: column; align-items: center;
        padding: 20px 0; gap: 20px; transform: translateY(-150%);
        transition: transform 0.3s ease-in-out; z-index: 999; box-shadow: 0 5px 10px rgba(0,0,0,0.2);
    }
    .nav-links.active { transform: translateY(0); }
    
    .grid-casette { grid-template-columns: 1fr; }
    .hero { height: 50vh; min-height: 350px; }
    .hero-content h1 { font-size: 2rem; }
    .hero-content p { font-size: 1rem; }
    .hero-small { height: 20vh; min-height: 150px; } 
    .hero-small h1 { font-size: 2rem; }
    
    .calculator-box { flex-direction: column; gap: 10px; align-items: stretch; }
    .form-grid { flex-direction: column; }
    .preview-gallery { flex-direction: column; }
    .preview-gallery img { width: 100%; height: 200px; margin-bottom: 10px; }
    .btn-hero { width: 100%; margin-top: 5px; }
    .contact-container { flex-direction: column; }
}

/* =========================================
   INFINITE MARQUEE (CORRETTO con FLEXBOX)
   ========================================= */
.marquee-container {
    width: 100%;
    overflow: hidden; /* Nasconde le foto che escono a destra */
    background-color: var(--primary); 
    padding: 20px 0;
    border-top: 5px solid var(--accent);
    position: relative;
}

.marquee-track {
    display: flex;        /* <--- QUESTO È FONDAMENTALE: Forza la riga orizzontale */
    gap: 20px;            /* Spazio tra le foto */
    width: max-content;   /* <--- La striscia si allarga quanto serve per contenere tutto */
    animation: scroll 40s linear infinite;
}

.marquee-track img {
    height: 250px; 
    width: auto;   
    display: block;       /* Rende l'immagine un blocco solido */
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    flex-shrink: 0;       /* <--- IMPEDISCE alle foto di schiacciarsi */
}

/* Animazione */
@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); } /* Si sposta di metà esatta */
}

/* SU MOBILE: Riduciamo l'altezza */
@media (max-width: 768px) {
    .marquee-track img {
        height: 180px;
    }
}

