/**
 * Lolo Booking - Frontend Styles
 */

:root {
    --lolo-primary: #ECB159;
    --lolo-primary-dark: #C87956;
    --lolo-border: #DDDDDD;
    --lolo-text: #222222;
    --lolo-text-light: #717171;
    --lolo-bg-light: #F7F7F7;
    --lolo-radius: 12px;
}

/* Widget Container */
.lolo-booking-sidebar {
    background: white;
    border: 1px solid var(--lolo-border);
    border-radius: var(--lolo-radius);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    padding: 24px;
    max-width: 100%;
}

.lolo-price-header {
    padding-bottom: 24px;
    border-bottom: 1px solid #EBEBEB;
    margin-bottom: 24px;
}

.price-display {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.price-big {
    font-size: 22px;
    font-weight: 600;
    color: var(--lolo-text);
}

.price-per {
    font-size: 16px;
    color: var(--lolo-text);
}

/* ---- Zone de sélection de dates ---- */

.calendar-placeholder {
    border: 1.5px solid var(--lolo-border);
    border-radius: var(--lolo-radius);
    overflow: visible; /* Important : ne pas clipper le popup flatpickr */
    margin-bottom: 14px;
    transition: border-color 0.2s;
}
.calendar-placeholder:focus-within {
    border-color: #999;
}

.date-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.input-box {
    padding: 11px 14px;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}
.input-box:first-child {
    border-right: 1.5px solid var(--lolo-border);
}
.input-box:hover {
    background: #fafafa;
}

.input-label {
    display: block;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 4px;
}

.fake-input {
    border: none;
    width: 100%;
    outline: none;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    color: var(--lolo-text);
    cursor: pointer;
    font-family: inherit;
    padding: 0;
}
.fake-input::placeholder { color: #ccc; font-weight: 400; }

/* Zone voyageurs */
.guest-input {
    border-top: 1.5px solid var(--lolo-border);
    padding: 14px;
    background: #fafafa;
}

/* Guests Input */
.lolo-guest-input {
    border-top: 1px solid var(--lolo-border);
    padding: 16px 14px;
}

.lolo-guest-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}

.lolo-guest-row:not(:last-child) {
    border-bottom: 1px solid #EBEBEB;
}

.guest-label {
    font-size: 16px;
    color: var(--lolo-text);
}

.guest-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.lolo-qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--lolo-border);
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    font-size: 18px;
    color: var(--lolo-text-light);
}

.lolo-qty-btn:hover {
    border-color: #B0B0B0;
    transform: scale(1.04);
}

.guest-count {
    font-size: 16px;
    font-weight: 400;
    color: var(--lolo-text);
    min-width: 20px;
    text-align: center;
}

/* Guest Info Form */
.lolo-form-group {
    margin-bottom: 16px;
}

.lolo-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--lolo-text);
    margin-bottom: 6px;
}

.lolo-form-group input,
.lolo-form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--lolo-border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.lolo-form-group input:focus,
.lolo-form-group textarea:focus {
    outline: none;
    border-color: var(--lolo-text);
    box-shadow: 0 0 0 2px rgba(34, 34, 34, 0.1);
}

/* Book Button */
.lolo-btn-book {
    width: 100%;
    background: var(--lolo-primary);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.lolo-btn-book:hover {
    background: var(--lolo-primary-dark);
    transform: translateY(-1px);
}

/* ---- Récapitulatif des prix ---- */
.charge-details {
    background: #fafafa;
    border-radius: 10px;
    padding: 14px 16px;
    border: 1px solid #f0f0f0;
}
.charge-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    font-size: 14px;
    color: #555;
    border-bottom: 1px solid #f0f0f0;
}
.charge-row:last-of-type { border-bottom: none; }

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0 2px;
    margin-top: 4px;
    border-top: 2px solid #eee;
    font-size: 16px;
    font-weight: 700;
    color: #222;
}

/* ============================================================
   CALENDRIER FLATPICKR — Popup amélioré
============================================================ */

/* Popup container */
.flatpickr-calendar {
    border-radius: 16px !important;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.08) !important;
    border: 1px solid #f0f0f0 !important;
    padding: 8px !important;
    font-family: inherit !important;
    width: 280px !important;
    box-sizing: border-box;
}
.flatpickr-calendar::before,
.flatpickr-calendar::after { display: none !important; }

/* En-tête du mois */
.flatpickr-months {
    padding: 0 4px 8px;
    border-bottom: 1px solid #f5f5f5;
    margin-bottom: 8px;
    align-items: center;
}
.flatpickr-month {
    height: 36px !important;
}
.flatpickr-current-month {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #222 !important;
    padding-top: 8px !important;
    letter-spacing: -0.01em;
}
.flatpickr-current-month .cur-month {
    font-weight: 700 !important;
    color: #222 !important;
}
.flatpickr-current-month .numInputWrapper {
    width: 56px !important;
}
.flatpickr-current-month input.cur-year {
    font-weight: 400 !important;
    color: #888 !important;
    font-size: 15px !important;
}

/* Flèches navigation */
.flatpickr-prev-month,
.flatpickr-next-month {
    padding: 8px !important;
    color: #999 !important;
    top: 6px !important;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
}
.flatpickr-prev-month:hover,
.flatpickr-next-month:hover {
    background: #f5f5f5 !important;
    color: #222 !important;
}
.flatpickr-prev-month svg,
.flatpickr-next-month svg { fill: currentColor !important; }

/* Jours de la semaine */
.flatpickr-weekdays {
    height: 30px !important;
    padding: 0 2px;
    margin-bottom: 4px;
}
.flatpickr-weekday {
    font-size: 10px !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #bbb !important;
}

/* Grille des jours — s'adapte à la largeur du popup */
.flatpickr-days,
.dayContainer {
    width: 264px !important;
    min-width: 264px !important;
    max-width: 264px !important;
}

/* Cases de jours — 264px / 7 = 37.7px par case */
.flatpickr-day {
    height: 44px !important;
    max-width: 36px !important;
    flex-basis: 36px !important;
    line-height: 26px !important;
    padding-top: 5px !important;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background-color: var(--season-color, transparent) !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 500;
    color: #333;
    border: 1px solid transparent !important;
    transition: background 0.15s, color 0.15s, transform 0.1s;
    margin: 1px 0;
}
.flatpickr-day:hover:not(.flatpickr-disabled):not(.disabled):not(.selected):not(.startRange):not(.endRange) {
    background: #f7f7f7 !important;
    border-color: #eee !important;
    transform: scale(1.05);
}

/* Aujourd'hui */
.flatpickr-day.today {
    font-weight: 700 !important;
    color: var(--lolo-primary) !important;
    border: 2px solid var(--lolo-primary) !important;
    background-color: var(--season-color, transparent) !important;
}

/* Dates sélectionnées (début & fin) */
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: var(--lolo-primary) !important;
    border-color: var(--lolo-primary) !important;
    color: #fff !important;
    font-weight: 700 !important;
    box-shadow: 0 3px 10px rgba(236, 177, 89, 0.4) !important;
    transform: scale(1.05);
}

/* Plage entre les dates */
.flatpickr-day.inRange {
    background: rgba(236, 177, 89, 0.12) !important;
    border-color: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    color: #555 !important;
}
.flatpickr-day.startRange { border-radius: 10px 0 0 10px !important; }
.flatpickr-day.endRange   { border-radius: 0 10px 10px 0 !important; }
.flatpickr-day.startRange.endRange { border-radius: 10px !important; }

/* Dates passées (avant aujourd'hui) — grisées, pas de barré */
.flatpickr-day.flatpickr-disabled {
    color: #ccc !important;
    opacity: 1 !important;
    text-decoration: none !important;
    background: none !important;
    cursor: not-allowed !important;
}
.flatpickr-day.flatpickr-disabled .lolo-day-price { display: none; }

/* Dates bloquées/réservées (dans le tableau disable[]) — barrées */
.flatpickr-day.disabled {
    color: #ccc !important;
    opacity: 1 !important;
    text-decoration: line-through !important;
    background: repeating-linear-gradient(
        -45deg, transparent, transparent 3px,
        rgba(0,0,0,0.04) 3px, rgba(0,0,0,0.04) 4px
    ) !important;
    cursor: not-allowed !important;
}
.flatpickr-day.disabled .lolo-day-price { display: none; }

/* Dates hors du mois courant */
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: #e8e8e8 !important;
    background: none !important;
}
.flatpickr-day.prevMonthDay .lolo-day-price,
.flatpickr-day.nextMonthDay .lolo-day-price { display: none; }

/* Prix sous le numéro du jour */
.lolo-day-price {
    display: block;
    font-size: 9px;
    font-weight: 700;
    color: var(--price-color, #c0c0c0);
    line-height: 1;
    letter-spacing: -0.02em;
    margin-top: 1px;
}
.flatpickr-day.selected .lolo-day-price,
.flatpickr-day.startRange .lolo-day-price,
.flatpickr-day.endRange .lolo-day-price {
    color: rgba(255, 255, 255, 0.8) !important;
}
.flatpickr-day.inRange .lolo-day-price {
    color: rgba(200, 121, 86, 0.6) !important;
}

/* Responsive */
@media (max-width: 768px) {
    .lolo-booking-sidebar {
        margin: 20px auto;
    }
    
    .lolo-date-inputs {
        grid-template-columns: 1fr;
    }
    
    .lolo-input-box:first-child {
        border-right: none;
        border-bottom: 1px solid var(--lolo-border);
    }
}
