/* =========================================
   1. RESET E REGOLE BASE
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden; /* Previene lo scorrimento orizzontale indesiderato */
}

/* =========================================
   2. NAVBAR E MENU (VERSIONE DESKTOP)
   ========================================= */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fff;
    padding: 15px 50px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo h1, .logo {
    font-size: 26px;
    font-weight: bold;
    color: #003d82;
    text-decoration: none;
    letter-spacing: 1px;
    margin: 0;
}

.navbar nav ul {
    display: flex;
    gap: 25px;
    align-items: center;
    list-style: none;
}

.navbar nav ul li a {
    text-decoration: none;
    color: #2c3e50;
    font-weight: 600;
    font-size: 15px;
    transition: color 0.3s;
}

.navbar nav ul li a:hover {
    color: #0056b3;
}

/* Pulsante evidenziato nella nav (es. Area Gestore) */
.btn-admin {
    background-color: #e74c3c;
    color: white !important;
    padding: 10px 20px;
    border-radius: 6px;
    transition: background 0.3s;
}
.btn-admin:hover {
    background-color: #c0392b;
}


/* =========================================
   3. BOTTONI GENERALI
   ========================================= */
.btn-primary, .btn-hero, .btn-search, .btn-book-now {
    background-color: #003d82;
    color: white;
    padding: 15px 30px;
    text-decoration: none;
    font-size: 18px;
    border-radius: 8px;
    font-weight: bold;
    transition: background 0.3s;
    display: inline-block;
    border: none;
    cursor: pointer;
    text-align: center;
}

.btn-primary:hover, .btn-hero:hover, .btn-search:hover, .btn-book-now:hover {
    background-color: #002855;
}


/* =========================================
   4. SCHEDE CASE (HOMEPAGE E TUTTE LE CASE)
   ========================================= */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
}

.section-title {
    text-align: center;
    font-size: 32px;
    color: #003d82;
    margin-bottom: 40px;
}

.properties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.property-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.property-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.card-image {
    position: relative;
    height: 230px;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #003d82;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-content h3 {
    font-size: 22px;
    color: #003d82;
    margin-bottom: 8px;
}

.location {
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 15px;
    font-weight: 600;
}

.description {
    font-size: 14px;
    color: #555;
    flex-grow: 1;
    margin-bottom: 20px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.price {
    font-size: 14px;
    color: #7f8c8d;
}

.price strong {
    font-size: 22px;
    color: #27ae60;
}

.btn-book {
    background-color: #003d82;
    color: white;
    text-decoration: none;
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: bold;
    transition: background 0.3s;
}

.btn-book:hover {
    background-color: #002855;
}


/* =========================================
   5. FOOTER PROFESSIONALE
   ========================================= */
.main-footer {
    background-color: #003d82;
    color: white;
    padding: 60px 20px 20px;
    margin-top: 60px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.footer-col h3 {
    font-size: 20px;
    margin-bottom: 20px;
    border-bottom: 2px solid #34495e;
    padding-bottom: 10px;
    color: #fff;
}

.footer-col p, .footer-col li {
    color: #bdc3c7;
    font-size: 14px;
    margin-bottom: 10px;
    line-height: 1.6;
}

.footer-col ul {
    list-style: none;
    padding: 0;
}

.footer-col ul li a {
    color: #bdc3c7;
    text-decoration: none;
    transition: 0.3s;
}

.footer-col ul li a:hover {
    color: white;
    padding-left: 5px;
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid #34495e;
    margin-top: 40px;
    padding-top: 20px;
    color: #7f8c8d;
    font-size: 14px;
}


/* =========================================
   6. MENU LATERALE A SCOMPARSA E RESPONSIVE
   ========================================= */

/* L'icona dell'Hamburger (Invisibile su PC) */
.menu-toggle {
    display: none;
    font-size: 32px;
    cursor: pointer;
    color: #003d82;
    user-select: none;
}

/* L'overlay scuro: Inizialmente invisibile e "trasparente" ai click */
.menu-overlay {
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Quando l'overlay è attivo, diventa visibile e cliccabile */
.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Nascondi la testata del menu su PC */
.side-menu .menu-header {
    display: none;
}

/* MEDIA QUERY: ATTIVAZIONE DESIGN PER SCHERMI PICCOLI (< 768px) */
@media (max-width: 768px) {
    
    /* Mantiene Logo a sinistra e Hamburger a destra */
    .navbar { 
        display: flex; 
        justify-content: space-between; 
        align-items: center; 
        padding: 15px 20px; 
    }
    
    .menu-toggle { 
        display: block; 
    } 

    /* STILE DELLA FINESTRA LATERALE (MENU DA DESTRA VERSO SINISTRA) */
    .navbar nav.side-menu {
        position: fixed;
        top: 0;
        right: 0;      /* Ancorato a destra */
        width: 280px;
        height: 100vh;
        background-color: #fff;
        box-shadow: -5px 0 20px rgba(0,0,0,0.3);
        z-index: 2000;
        
        /* NASCOSTO FUORI DALLO SCHERMO */
        transform: translateX(120%); 
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* Animazione super fluida */
        
        display: block; 
        padding: 0;
        margin: 0;
    }

    /* CLASSE ACTIVE: Fa scivolare il menu dentro lo schermo */
    .navbar nav.side-menu.active {
        transform: translateX(0); 
    }

    /* Intestazione Blu del menu laterale */
    .side-menu .menu-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 25px 20px;
        background: #003d82;
        color: white;
    }
    
    .side-menu .menu-header h2 { 
        font-size: 22px; 
        margin: 0; 
        color: white;
    }
    
    .close-menu { 
        font-size: 26px; 
        cursor: pointer; 
        color: white;
    }

    /* Lista dei pulsanti nel menu Mobile */
    .navbar nav.side-menu ul {
        display: flex;
        flex-direction: column;
        gap: 0;
        padding: 0;
        margin: 0;
    }
    
    .navbar nav.side-menu ul li {
        width: 100%;
        border-bottom: 1px solid #eee;
    }
    
    .navbar nav.side-menu ul li a {
        display: block;
        padding: 20px;
        font-size: 18px;
        color: #333;
        font-weight: bold;
        text-decoration: none;
    }
    
    .navbar nav.side-menu ul li a:hover {
        background: #f0f8ff;
        color: #003d82;
    }

    /* === REGOLE RESPONSIVE PER IMPAGINAZIONI VARIE === */
    
    /* Home e Titoli */
    .hero-content h1, .hero-dettaglio h1 { font-size: 32px !important; }
    .hero-content p { font-size: 16px !important; }
    
    /* Dettaglio Casa e Checkout (Mette la colonna prezzi sotto alla descrizione) */
    .dettaglio-wrapper, .checkout-container { 
        flex-direction: column; 
        margin-top: -30px; 
        padding: 0 15px;
    }
    .col-left, .col-right, .checkout-form-col, .checkout-summary-col { 
        width: 100%; 
        min-width: 100%; 
        padding: 20px; 
    }
    
    /* Pannello Admin Responsive */
    .sidebar { width: 100%; height: auto; position: relative; padding: 15px; }
    .admin-content { margin-left: 0; padding: 15px; width: 100%; }
    
    #admin-menu { display: flex; flex-wrap: wrap; gap: 10px; flex-direction: row; }
    #admin-menu li { flex: 1; min-width: 130px; text-align: center; }
    
    /* Permette di "slittare" la tabella orizzontalmente col dito nell'admin */
    .data-table { display: block; overflow-x: auto; white-space: nowrap; }
    .form-row, .form-row-multi { flex-direction: column; }

}

/* --- FIX FOOTER LUMINOSO --- */

/* 1. Colora di bianco le linee sotto i titoli (Esplora, Contatti, ecc.) */
footer h2, footer h3, footer h4 {
    border-bottom-color: rgba(255, 255, 255, 0.6) !important;
}

/* 2. Colora di bianco la linea divisoria dei diritti riservati in basso */
footer > div:last-child, 
.footer-bottom, 
.copyright-section {
    border-top-color: rgba(255, 255, 255, 0.6) !important;
}

/* (Regola di sicurezza nel caso tu abbia usato il tag <hr> per le linee) */
footer hr {
    border-top: 1px solid rgba(255, 255, 255, 0.6) !important;
}

/* 3. Rende i link dei Social (e le email) bianchi e ben leggibili */
footer a {
    color: #ffffff !important;
    text-decoration: none !important;
    transition: 0.2s;
}

/* Aggiunge un leggero effetto quando passi il mouse sui link */
footer a:hover {
    color: #3498db !important; /* Diventano azzurri al passaggio del mouse */
}