/* ============================================================
   VARIABLES
============================================================ */
:root {
    --header-blue: #0e7490;
    --header-turquoise: #14b8a6;
    --calendar-selected: #0e7490;
    --calendar-range: #99f6e4;
    --calendar-normal: #f0fdfa;
    --calendar-summer: #e0f2fe;
    --calendar-blocked: #9ca3af;
    --primary: #0ea5e9;
    --range: #a5f3fc;
    --radius: 14px;
    --muted: #64748b;
}

/* ============================================================
   CONTENEUR PRINCIPAL
============================================================ */
.airbnb-calendar {
    max-width: 900px;
    margin: 20px auto;
    font-family: Arial, sans-serif;
    touch-action: pan-y;
}

.calendar-wrapper {
    display: flex;
    gap: 40px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================================
   MOIS
============================================================ */
.month {
    width: 350px;
    background: #ffffff;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
}

.month h3 {
    color: #0e7490 !important;
    font-size: 20px !important;
    font-weight: 700;
    text-align: center;
    margin-bottom: 10px;
    text-transform: capitalize;
}

/* ============================================================
   BARRE JOURS DE LA SEMAINE (L M M J V S D)
============================================================ */
.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
    background: linear-gradient(135deg, #0e7490, #14b8a6);
    color: white !important;
    border-radius: 8px;
    padding: 8px 0;
}

/* ============================================================
   GRILLE DES JOURS
============================================================ */
.days {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 9px;
    min-height: 270px;
}

.empty {
    visibility: hidden;
}

/* ============================================================
   CASE JOUR — BASE
============================================================ */
.day {
    background: linear-gradient(135deg, #f0fdfa, #e6fdf8);
    border-radius: 8px;
    padding: 8px;
    text-align: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid rgba(0,0,0,0.05);
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    transition: background .18s ease, transform .12s ease, box-shadow .18s ease;
}

.day:hover {
    background: #ccfbf1;
    transform: scale(1.03);
    z-index: 2;
}

.day .num {
    font-weight: 700;
    font-size: 15px;
    line-height: 1;
}

/* ============================================================
   ÉTATS DES JOURS
============================================================ */
.day.past,
.day.disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.day.winter {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}

.day.normal {
    background: linear-gradient(135deg, #f0fdfa, #e6fdf8);
}

.day.summer-week {
    background: linear-gradient(135deg, #e0f2fe, #bae6fd);
}

.day.saturday {
    border-top: 2px solid rgba(14, 116, 144, 0.4);
}

.day.saturday:not(.past):not(.disabled):not(.winter):not(.reserved) {
    background: linear-gradient(135deg, #e8faf6, #d4f5ee);
}

.day.saturday:not(.past):not(.disabled):not(.winter):not(.reserved) .num {
    color: #0a5268 !important;
    font-weight: 600 !important;
}

.day.saturday.promo {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0) !important;
    border: 2px solid #0e7490 !important;
    font-weight: 900 !important;
}

.day.no-checkin {
    cursor: not-allowed;
    opacity: 0.7;
}

/* ============================================================
   RÉSERVATIONS / BLOQUÉS
============================================================ */
.day.reserved,
.day.blocked,
.day.pending {
    background: repeating-linear-gradient(
        45deg,
        #e5e7eb,
        #e5e7eb 5px,
        #f3f4f6 5px,
        #f3f4f6 10px
    ) !important;
    color: #9ca3af !important;
    cursor: not-allowed !important;
    border-radius: 6px;
}

/* ============================================================
   SEMAINE ÉTÉ SAMEDI → SAMEDI
============================================================ */
.day.summer-start {
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
    font-weight: 700;
}

.day.summer-end {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
}

/* ============================================================
   PRIX SEMAINE ÉTÉ (affiché le samedi)
============================================================ */
.week-price {
    display: block;
    font-size: 10px;
    font-weight: 600;
    color: #0e7490;
    margin-top: 2px;
}

/* ============================================================
   JOURS PROMOTIONNELS (vert doux)
============================================================ */
.day.promo {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0) !important;
    color: #065f46 !important;
    border-radius: 6px;
    border: 1px solid #6ee7b7 !important;
    font-weight: 600;
}

.day.promo::after {
    content: "🏷️";
    font-size: 8px;
    position: absolute;
    top: 2px;
    right: 2px;
    line-height: 1;
}

/* ============================================================
   SÉLECTION — PRIORITÉ MAXIMALE
============================================================ */
.day.in-range {
    background: var(--calendar-range) !important;
    color: #083344 !important;
    border-radius: 0 !important;
}

.day.start {
    background: var(--calendar-selected) !important;
    color: #fff !important;
    border-top-left-radius: 14px !important;
    border-bottom-left-radius: 14px !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.day.end {
    background: var(--calendar-selected) !important;
    color: #fff !important;
    border-top-right-radius: 14px !important;
    border-bottom-right-radius: 14px !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

.day.selected {
    background: var(--calendar-selected) !important;
    color: #fff !important;
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    z-index: 3;
}

.day.active {
    box-shadow: 0 0 0 2px #fff inset;
}

.day.promo.start,
.day.promo.end,
.day.promo.selected {
    background: var(--calendar-selected) !important;
    color: #fff !important;
}

.day.promo.in-range {
    background: var(--calendar-range) !important;
    color: #083344 !important;
}

/* ============================================================
   PRIX À LA NUIT DANS LES CASES
============================================================ */
.day-price {
    display: block;
    font-size: 9px;
    font-weight: 500;
    color: #0e7490;
    line-height: 1;
    margin-top: 1px;
    opacity: 0.85;
}

.price-old {
    color: #9ca3af;
    text-decoration: line-through;
    font-weight: 400;
}

.day.selected .num,
.day.start .num,
.day.end .num {
    color: #fff !important;
}

.day.selected .day-price,
.day.start .day-price,
.day.end .day-price {
    color: rgba(255,255,255,0.85) !important;
    opacity: 1;
}

.day.selected .price-old,
.day.start .price-old,
.day.end .price-old {
    color: rgba(255,255,255,0.5) !important;
}

/* ============================================================
   NAVIGATION
============================================================ */
.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.calendar-nav button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #0e7490, #14b8a6);
    color: white;
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.2s ease;
}

.calendar-nav button:hover {
    background: linear-gradient(135deg, #14b8a6, #0e7490);
    transform: scale(1.1);
}

.calendar-nav button:active {
    transform: scale(0.95);
}

#cal-label {
    flex: 1;
    font-size: 18px !important;
    font-weight: 800;
    color: #0e7490 !important;
    text-align: center;
    letter-spacing: 0.3px;
}

/* ============================================================
   MESSAGE ERREUR
============================================================ */
#calendar-message {
    margin-top: 15px;
    padding: 10px;
    text-align: center;
    color: #b91c1c;
    font-size: 14px;
    font-weight: 600;
    background: #fee2e2;
    border-radius: 8px;
    display: none;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================================
   LÉGENDE
============================================================ */
.calendar-legend {
    margin-top: 18px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    justify-content: center;
    gap: 25px;
}

.legend {
    display: inline-block;
    width: 15px;
    height: 15px;
    border-radius: 4px;
    border: 2px solid #000;
    margin-right: 8px;
    vertical-align: middle;
}

.legend.free     { background: #e6fffb; }
.legend.pending  { background: #67e8f9; }
.legend.reserved { background: #bfbfc4; }
.legend.promo {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    border: 2px solid #6ee7b7;
}

/* ============================================================
   INFOS SOUS LÉGENDE
============================================================ */
.calendar-info {
    font-size: 13px;
    margin-top: 8px;
    opacity: 0.75;
    text-align: center;
    line-height: 1.4;
}

/* ============================================================
   RÉSUMÉ DU SÉJOUR
============================================================ */
.summary-card {
    transition: box-shadow 0.3s ease;
    padding-bottom: 10px;
}

.summary-card.highlight {
    box-shadow: 0 0 0 3px #0ea5e9, 0 10px 30px rgba(14,165,233,0.25);
}

.summary-card .cta-info,
.cta-info {
    font-size: 12.5px;
    font-weight: 500;
    margin: 8px 0;
    text-align: center;
    color: #555;
    opacity: 0.8;
}

/* ============================================================
   GRID OPTIONS + RÉSUMÉ (PC)
============================================================ */
.premium-grid {
    display: grid !important;
    grid-template-columns: 1.2fr 1fr !important;
    gap: 30px;
    align-items: stretch;
}

.options-card {
    grid-column: 1;
    padding-bottom: 10px;
    height: 100%;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
}

.summary-card {
    grid-column: 2;
    height: fit-content;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
}

.booking-box {
    display: flex;
    align-items: stretch;
}

.options-card .opt-control span,
.options-card .price {
    color: #1E3A5F !important;
}

.options-card li {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.opt-label {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.opt-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.opt-desc {
    white-space: nowrap;
    font-size: 0.9em;
    color: #64748b;
}

.opt-control {
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    flex-shrink: 0;
}

.price {
    margin-left: auto;
    white-space: nowrap;
    font-weight: 700;
}

.opt-label span {
    font-weight: 600;
}

/* ============================================================
   CALENDRIER PLUS GRAND SUR PC
============================================================ */
@media (min-width: 901px) {
    .airbnb-calendar {
        max-width: 1060px;
    }

    .calendar-wrapper {
        gap: 50px;
    }

    .month {
        width: 460px;
        padding: 16px;
    }

    .month h3 {
        font-size: 23px !important;
        margin-bottom: 14px;
    }

    .weekdays {
        font-size: 14px;
        padding: 10px 0;
    }

    .days {
        gap: 8px;
    }

    .day {
        font-size: 15px;
        padding: 10px;
    }

    .day .num {
        font-size: 17px;
    }

    .calendar-info {
        font-size: 10px;
        opacity: 0.65;
    }

    .calendar-legend {
        font-size: 11px;
    }
}

/* ============================================================
   RESPONSIVE MOBILE
============================================================ */
@media (max-width: 900px) {
    .premium-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }

    .options-card {
        grid-column: auto;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .summary-card {
        grid-column: auto;
        width: 100% !important;
        min-width: 280px !important;
        max-width: 480px !important;
        margin: 0 auto !important;
        box-sizing: border-box !important;
    }
}

@media (max-width: 768px) {
    .day {
        min-height: 40px;
        font-size: 13px;
    }

    .days {
        gap: 4px;
    }

    .month {
        padding: 10px;
        width: 100%;
    }

    .calendar-wrapper {
        gap: 20px;
        width: 100%;
    }
}

@media (max-width: 520px) {
    .calendar-wrapper {
        width: 100%;
    }

    .day {
        aspect-ratio: 1 / 1;
        min-height: 36px;
    }
}

/* ============================================================
   BOUTONS MAP
============================================================ */
.map-actions {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.map-btn {
    display: inline-block;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 12px 18px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    margin: 6px 0;
    transition: 0.25s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

.map-btn:hover {
    background: linear-gradient(135deg, #253544, #2c3e50);
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.18);
}