/* ==========================================================================
   1. STRUCTURE GÉNÉRALE
   ========================================================================== */

#cdp-main-container {
    max-width: 1200px;
    margin: 30px auto;
    font-family: inherit;
    transition: opacity 0.3s ease;
    touch-action: pan-y;
}

/* ==========================================================================
   2. NAVIGATION STICKY (TOUJOURS VISIBLE)
   ========================================================================== */

.cdp-global-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #ffffff; /* Fond blanc pour ne pas voir les jours dessous */
    border-radius: 0 0 10px 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    
    /* Propriétés pour fixer la barre en haut */
    position: -webkit-sticky; /* Pour Safari */
    position: sticky;
    top: 0; 
    z-index: 9999; /* Passe au-dessus de tout */
    margin-bottom: 40px;
}

.cdp-ajax-nav {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    background: #2c3e50;
    color: white;
    transition: all 0.2s ease;
}

.cdp-ajax-nav:hover {
    background: #34495e;
    transform: translateY(-1px);
}

.btn-today {
    background: #e67e22;
}

/* ==========================================================================
   3. CALENDRIERS ET GRILLE
   ========================================================================== */

.cdp-logement-title {
    text-align: center;
    margin: 60px 0 30px;
    font-size: 1.8em;
    color: #333;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
}

.cdp-triple-wrapper {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 50px;
}

.cdp-month-header {
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 15px;
}

.cdp-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.cdp-day-name {
    text-align: center;
    font-weight: bold;
    font-size: 0.85em;
    padding-bottom: 8px;
    color: #555;
}

.cdp-day {
    min-height: 55px;
    padding: 6px;
    border-radius: 4px;
    text-align: right;
    font-size: 0.9em;
    color: #fff;
}

/* COULEURS */
.cdp-day.available { background: #2ecc71; }
.cdp-day.reserved { background: #e74c3c; }
.cdp-day.is-past { background: #e0e0e0 !important; color: #888 !important; }
.cdp-day.is-today { outline: 3px solid #000; }
.cdp-day.empty { background: transparent; }

/* ==========================================================================
   4. RESPONSIVE
   ========================================================================== */

@media (max-width: 1024px) {
    .cdp-triple-wrapper { grid-template-columns: repeat(2, 1fr); }
    .m3 { display: none !important; }
}

@media (max-width: 767px) {
    /* Cache les flèches mais garde la barre sticky pour le bouton Aujourd'hui */
    .btn-prev, .btn-next { display: none !important; }
    
    .cdp-triple-wrapper { grid-template-columns: 1fr; }
    .m2, .m3 { display: none !important; }

    #cdp-main-container::after {
        content: "← Glissez pour changer de mois →";
        display: block;
        text-align: center;
        font-size: 0.85em;
        font-weight: bold;
        color: #e67e22;
        margin-top: 20px;
        padding: 10px;
        border: 1px dashed #e67e22;
        border-radius: 5px;
    }
}