/* Contenitore principale della pagina dettaglio */
.detail-container {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Titolo e posizione */
.property-header {
    margin-bottom: 25px;
}

.property-header h1 {
    font-size: 36px;
    color: #222;
    margin-bottom: 5px;
}

.property-header .location {
    color: #666;
    font-size: 16px;
    font-weight: 500;
}

/* ========================================= */
/* GALLERIA FOTOGRAFICA                      */
/* ========================================= */
.gallery {
    display: flex;
    gap: 15px;
    margin-bottom: 40px;
    height: 400px; 
}

.main-photo {
    width: 65%;
    border-radius: 12px 0 0 12px; 
    object-fit: cover;
}

.small-photos {
    width: 35%;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.small-photos img {
    height: calc(50% - 7.5px); 
    width: 100%;
    object-fit: cover;
}

.small-photos img:first-child {
    border-radius: 0 12px 0 0; 
}

.small-photos img:last-child {
    border-radius: 0 0 12px 0; 
}

/* ========================================= */
/* LAYOUT A DUE COLONNE (Info + Prenotazione)*/
/* ========================================= */
.content-wrapper {
    display: flex;
    gap: 50px;
    align-items: flex-start; 
}

.property-info {
    flex: 2; 
}

.property-info h2 {
    font-size: 24px;
    margin-bottom: 10px;
}

.section-title {
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 20px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.description-text {
    line-height: 1.6;
    color: #555;
    font-size: 16px;
}

.amenities-list {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 15px;
}

.amenities-list li {
    font-size: 16px;
    color: #444;
}

/* ========================================= */
/* Colonna di destra (Modulo Prenotazione)   */
/* ========================================= */
.booking-sidebar {
    flex: 1; 
    position: sticky; 
    top: 100px; 
}

.booking-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid #eee;
}

.booking-card h3 {
    font-size: 24px;
    margin-bottom: 20px;
}

.per-night {
    font-size: 16px;
    color: #666;
    font-weight: normal;
}

.price-breakdown {
    margin-top: 20px;
    margin-bottom: 20px;
}

.price-breakdown p {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    color: #555;
}

.price-breakdown hr {
    border: 0;
    border-top: 1px solid #eee;
    margin: 15px 0;
}

.price-breakdown .total {
    font-weight: bold;
    color: #222;
    font-size: 18px;
}

.btn-book-now {
    width: 100%;
    padding: 15px;
    background-color: #003d82; /* Blu Immobilmar */
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-book-now:hover {
    background-color: #002a5a;
}

.map-wrapper {
    margin-top: 15px;
    margin-bottom: 30px;
    border-radius: 12px;
    overflow: hidden; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 1px solid #ddd;
}

/* ========================================= */
/* FIX CALENDARIO - FORZA IL BLU SUI GRIGI    */
/* ========================================= */

/* Se un giorno è disabilitato MA è stato selezionato (es. il 12), il blu DEVE vincere */
.flatpickr-day.flatpickr-disabled.selected,
.flatpickr-day.flatpickr-disabled.startRange,
.flatpickr-day.flatpickr-disabled.endRange,
.flatpickr-day.flatpickr-disabled.inRange {
    background: #003d82 !important;
    color: white !important;
    border-color: #003d82 !important;
    opacity: 1 !important;
}

/* La scia azzurra deve coprire anche i giorni grigi intermedi se selezionati */
.flatpickr-day.inRange, 
.flatpickr-day.flatpickr-disabled.inRange {
    background: #e0f0ff !important;
    box-shadow: -5px 0 0 #e0f0ff, 5px 0 0 #e0f0ff !important;
}

/* Hover sul grigio: se sto cercando di chiudere il range, fammelo vedere blu */
.flatpickr-day.flatpickr-disabled:hover {
    background: #003d82 !important;
    color: white !important;
}

/* ========================================= */
/* RESPONSIVE DESIGN                         */
/* ========================================= */
@media (max-width: 768px) {
    .content-wrapper {
        flex-direction: column; 
        gap: 30px;
    }
    
    .booking-sidebar {
        width: 100%;
        position: static; 
    }
    
    .gallery {
        flex-direction: column;
        height: auto;
    }
    .main-photo {
        width: 100%;
        height: 250px;
        border-radius: 12px 12px 0 0; 
    }
    .small-photos {
        width: 100%;
        flex-direction: row; 
    }
    .small-photos img {
        height: 120px;
        border-radius: 0 0 12px 12px;
    }
    
    .amenities-list {
        grid-template-columns: 1fr; 
    }

   /* --- FIX MOBILE DEFINITIVO DETTAGLIO --- */
@media (max-width: 768px) {
    .booking-sidebar { 
        width: 100% !important; 
        box-sizing: border-box !important; 
    }
    
    /* Ridimensiona il calendario */
    .flatpickr-calendar.inline {
        width: 100% !important;
        max-width: 100% !important;
    }
    .flatpickr-innerContainer, .flatpickr-rContainer, .dayContainer, .flatpickr-days {
        width: 100% !important;
        max-width: 100% !important;
    }
    /* Rimpicciolisce leggermente i pallini per farli entrare tutti e 7 */
    .flatpickr-day {
        max-width: 13.5% !important; 
        height: 35px !important;
        line-height: 35px !important;
    }

    /* Mette Adulti e Bambini uno sotto l'altro invece che affiancati */
    .booking-form .form-group[style*="display: flex"] {
        flex-direction: column !important;
        gap: 15px !important;
    }
}
}