/* SD Booking – Styles Frontend (interface style Airbnb) */

/* -------------------------------------------------------
   Conteneur principal
------------------------------------------------------- */
.sd-booking-form-wrapper {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.sd-booking-widget {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.12);
    padding: 24px;
}

.sd-booking-title {
    font-size: 20px;
    font-weight: 700;
    color: #222222;
    margin: 0 0 20px 0;
    text-align: center;
}

/* -------------------------------------------------------
   Formulaire
------------------------------------------------------- */
.sd-booking-form {
    width: 100%;
}

/* -------------------------------------------------------
   Champs génériques (label + corps)
------------------------------------------------------- */
.sd-field {
    background: #ffffff;
    cursor: pointer;
}

.sd-field-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #222222;
    text-transform: uppercase;
    margin-bottom: 4px;
    line-height: 1;
}

.sd-field-body {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sd-field-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #555555;
}

/* -------------------------------------------------------
   Ligne des dates (Du / Au) — deux colonnes dans un cadre
------------------------------------------------------- */
.sd-dates-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1.5px solid #b0b0b0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
}

.sd-field-checkin {
    padding: 14px 16px;
    border-right: 1.5px solid #b0b0b0;
    transition: background 0.15s ease;
}

.sd-field-checkout {
    padding: 14px 16px;
    transition: background 0.15s ease;
}

.sd-field-checkin:hover,
.sd-field-checkout:hover {
    background: #f7f7f7;
}

.sd-field-checkin input,
.sd-field-checkout input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 15px;
    font-weight: 500;
    color: #222222;
    cursor: pointer;
    width: 100%;
    padding: 0;
    line-height: 1.4;
}

.sd-field-checkin input::placeholder,
.sd-field-checkout input::placeholder {
    color: #717171;
    font-weight: 400;
}

/* -------------------------------------------------------
   Récapitulatif du prix
------------------------------------------------------- */
.sd-price-summary {
    margin-bottom: 16px;
}

.sd-price-main {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.sd-price-main strong {
    font-size: 22px;
    font-weight: 700;
    color: #222222;
}

.sd-price-au-total {
    font-size: 15px;
    color: #222222;
}

.sd-price-detail {
    font-size: 13px;
    color: #222222;
    margin-bottom: 6px;
    line-height: 1.5;
}

.sd-price-deposit {
    font-size: 13px;
    color: #555555;
    margin-bottom: 6px;
    line-height: 1.5;
    padding: 8px 12px;
    background: #f7f7f7;
    border-radius: 8px;
}

.sd-price-details-link {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    color: #222222;
    text-decoration: underline;
    cursor: pointer;
    margin-bottom: 8px;
}

.sd-price-details-link:hover {
    color: #555555;
}

/* Tooltip détails */
.sd-price-details-tooltip {
    background: #f7f7f7;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 8px;
}

.sd-tooltip-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #222222;
    padding: 4px 0;
}

.sd-tooltip-divider {
    height: 1px;
    background: #dddddd;
    margin: 8px 0;
}

.sd-tooltip-total {
    font-weight: 700;
}

/* -------------------------------------------------------
   Bouton Réserver
------------------------------------------------------- */
.button-reserve {
    display: block;
    width: 100%;
    padding: 16px;
    background: #222222;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    text-align: center;
    letter-spacing: 0.01em;
    margin-bottom: 12px;
}

.button-reserve:hover:not(:disabled) {
    background: #111111;
    transform: translateY(-1px);
}

.button-reserve:active:not(:disabled) {
    transform: translateY(0);
}

.button-reserve:disabled {
    background: #717171;
    cursor: not-allowed;
    opacity: 0.7;
}

/* -------------------------------------------------------
   Mention légale sous le bouton
------------------------------------------------------- */
.sd-no-charge {
    text-align: center;
    font-size: 12px;
    color: #717171;
    margin: 0;
    line-height: 1.5;
}

/* -------------------------------------------------------
   Légende du calendrier
------------------------------------------------------- */
.sd-calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    padding: 10px 14px;
    background: #f9f9f9;
    border-radius: 10px;
    margin-bottom: 12px;
    font-size: 12px;
    color: #444444;
}

.sd-legend-item {
    display: flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.sd-legend-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
    box-sizing: border-box;
}

.sd-legend-available     { background: #e8f5e9; border: 2px solid #a5d6a7; }
.sd-legend-saturday-only { background: #2e7d32; }
.sd-legend-booked        { background: #ffcdd2; border: 2px solid #ef9a9a; }
.sd-legend-unavailable   { background: #eeeeee; border: 2px solid #e0e0e0; }

/* -------------------------------------------------------
   Message d'avertissement samedi → samedi
------------------------------------------------------- */
.sd-saturday-msg {
    display: none;
    margin: 8px 0 12px;
    padding: 10px 14px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 10px;
    font-size: 13px;
    color: #7a5800;
    text-align: center;
    line-height: 1.5;
}

/* -------------------------------------------------------
   Flatpickr — personnalisations
------------------------------------------------------- */
.flatpickr-calendar {
    border-radius: 12px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    border: none !important;
    font-family: inherit !important;
}

.flatpickr-day {
    border-radius: 4px !important;
    font-size: 13px !important;
    transition: all 0.15s ease !important;
    max-width: none !important;
    height: 40px !important;
    line-height: 40px !important;
}

/* ---- Dates passées / sans données : aucun arrière-plan ---- */
.flatpickr-day.flatpickr-disabled {
    background: transparent !important;
    color: #cccccc !important;
    border-color: transparent !important;
    cursor: default !important;
}

/* ---- Vert clair : disponible, arrivée libre ---- */
.flatpickr-day.sd-day-available {
    background: #e8f5e9 !important;
    color: #1b5e20 !important;
    border-color: #a5d6a7 !important;
    font-weight: 600 !important;
    cursor: pointer !important;
}

.flatpickr-day.sd-day-available:hover {
    background: #66bb6a !important;
    color: #ffffff !important;
    border-color: #66bb6a !important;
}

/* ---- Vert foncé : disponible, samedi → samedi ---- */
.flatpickr-day.sd-day-saturday-only {
    background: #2e7d32 !important;
    color: #ffffff !important;
    border-color: #1b5e20 !important;
    font-weight: 600 !important;
    cursor: pointer !important;
}

.flatpickr-day.sd-day-saturday-only:hover {
    background: #1b5e20 !important;
    color: #ffffff !important;
    border-color: #1b5e20 !important;
}

/* ---- Rouge : réservé ---- */
.flatpickr-day.sd-day-booked,
.flatpickr-day.sd-day-booked.flatpickr-disabled,
.flatpickr-day.sd-day-booked:hover {
    background: #ffcdd2 !important;
    color: #b71c1c !important;
    border-color: #ef9a9a !important;
    cursor: not-allowed !important;
    text-decoration: line-through !important;
}

/* ---- Gris : non disponible ---- */
.flatpickr-day.sd-day-unavailable,
.flatpickr-day.sd-day-unavailable.flatpickr-disabled,
.flatpickr-day.sd-day-unavailable:hover {
    background: #eeeeee !important;
    color: #9e9e9e !important;
    border-color: #e0e0e0 !important;
    cursor: not-allowed !important;
}

/* ---- Jour sélectionné (arrivée / départ) : toujours au-dessus ---- */
.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.selected.sd-day-available,
.flatpickr-day.selected.sd-day-saturday-only {
    background: #222222 !important;
    border-color: #222222 !important;
    color: #ffffff !important;
}

/* -------------------------------------------------------
   Responsive mobile
------------------------------------------------------- */
@media (max-width: 520px) {
    .sd-booking-form-wrapper {
        padding: 8px;
    }

    .sd-booking-widget {
        padding: 16px;
    }

    .sd-field-checkin input,
    .sd-field-checkout input {
        font-size: 14px;
    }

    .sd-price-main strong {
        font-size: 20px;
    }

    .button-reserve {
        padding: 14px;
        font-size: 15px;
    }
}

/* Animation d'entrée du récapitulatif */
@keyframes sdSlideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sd-price-summary {
    animation: sdSlideIn 0.3s ease-out;
}
