/* =====================================================
   Hotel Booking Plugin — V2 Styles
   Enqueued via hotels_add_custom_css_js (front-end only)
   ===================================================== */


/* =====================================================
   Loading state — AJAX price fetch
   ===================================================== */

@keyframes hbooking-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
}

.hbooking-loading {
    animation: hbooking-pulse 1.2s ease-in-out infinite;
    color: var(--hbooking-color-primary) !important;
}

/* =====================================================
   Price Calendar [hbooking_price_calendar]
   ===================================================== */

.hbooking-price-calendar {
    font-family: var(--hbooking-font-family);
    background-color: #fff;
    border: none;
    padding: 30px 20px;
    max-width: 1100px;
    margin: 0 auto;
}

/*
 * jQuery UI adds its classes directly ON .hbooking-calendar-container (not inside it).
 * Compound selectors (no space) target the element itself.
 */
.hbooking-calendar-container.ui-datepicker,
.hbooking-calendar-container.ui-datepicker-multi {
    width: 100% !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    font-family: var(--hbooking-font-family);
    font-size: 14px;
}

/* Colonnes égales dans le calendrier */
.hbooking-calendar-container .ui-datepicker-calendar {
    table-layout: fixed !important;
    width: 100% !important;
}

.hbooking-calendar-container .ui-datepicker-calendar th,
.hbooking-calendar-container .ui-datepicker-calendar td {
    width: 14.285% !important;
}

/* Month header */
.hbooking-calendar-container .ui-datepicker-header {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 0 16px !important;
    margin-bottom: 4px;
}

.hbooking-calendar-container .ui-datepicker-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--hbooking-color-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-family: var(--hbooking-font-family);
    line-height: 1.4;
}

.hbooking-calendar-container .ui-datepicker.ui-widget-content.ui-datepicker-inline {
    width: 100% !important;
    padding: 20px  !important;
    background-color: transparent !important;
}

.hbooking-calendar-container .ui-datepicker-prev,
.hbooking-calendar-container .ui-datepicker-next {
    top: 10% !important;
    margin-top: 0 !important;
    cursor: pointer !important;
    background: transparent !important;
    border: none !important;
    color: var(--hbooking-color-dark) !important;
}

.hbooking-calendar-container .ui-datepicker-prev .ui-icon,
.hbooking-calendar-container .ui-datepicker-next .ui-icon {
    background-image: none !important;
    text-indent: 0 !important;
    width: auto !important;
    height: auto !important;
    color: var(--hbooking-color-dark);
}

.hbooking-calendar-container .ui-datepicker-prev:hover,
.hbooking-calendar-container .ui-datepicker-next:hover {
    background: transparent !important;
    border: none !important;
}

/* Day-of-week headers */
.hbooking-calendar-container .ui-datepicker-calendar thead th {
    font-size: 12px;
    font-weight: 400;
    color: #999;
    text-transform: lowercase;
    padding: 6px 0 14px;
    text-align: center;
    font-family: var(--hbooking-font-family);
    border-bottom: 1px solid #eee;
}

/* Side-by-side months */
.hbooking-calendar-container .ui-datepicker-group {
    float: left !important;
    width: 50% !important;
    box-sizing: border-box;
    padding: 0 40px;
}

.hbooking-calendar-container .ui-datepicker-row-break {
    clear: both;
    width: 100%;
    font-size: 0;
    line-height: 0;
}

/* All cells base */
.hbooking-calendar-container td {
    padding: 0 !important;
    text-align: center;
}

/* Selectable day cells */
.hbooking-calendar-container td[data-handler="selectDay"] {
    cursor: pointer !important;
    height: 68px !important;
    vertical-align: middle !important;
    padding: 0 !important;
    position: relative;
}

/* Day link */
.hbooking-calendar-container td[data-handler="selectDay"] a.ui-state-default {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    height: 68px !important;
    width: 100% !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    color: #1c1c1c;
    font-weight: 700;
    font-size: 18px;
    font-family: var(--hbooking-font-family);
    border-radius: 0;
    text-align: center;
    transition: background-color 0.12s ease;
}

.hbooking-calendar-container td[data-handler="selectDay"]:hover a.ui-state-default {
    background: rgba(213, 172, 95, 0.08) !important;
}

/* Price label below day number */
.hbooking-day-price {
    display: block !important;
    font-size: 12px !important;
    font-weight: 400;
    color: #555;
    text-align: center;
    line-height: 1.3;
    margin-top: 3px;
    font-family: var(--hbooking-font-family);
    pointer-events: none;
}



/* =====================================================
   Booking bar — #ui-datepicker-div (dropdown global)
   Mêmes styles que .hbooking-calendar-container
   ===================================================== */
#ui-datepicker-div td.hbooking-day-unavailable {
    opacity: 0.5 !important;
    cursor: pointer !important;
}

#ui-datepicker-div td.hbooking-day-unavailable a.ui-state-default,
#ui-datepicker-div td.hbooking-day-unavailable span.ui-state-default {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    height: 68px !important;
}

#ui-datepicker-div td.ui-datepicker-unselectable.ui-state-disabled a.ui-state-default,
#ui-datepicker-div td.ui-datepicker-unselectable.ui-state-disabled span.ui-state-default {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    height: 68px !important;
}

#ui-datepicker-div td.hbooking-day-unavailable a.ui-state-default::after,
#ui-datepicker-div td.hbooking-day-unavailable span.ui-state-default::after {
    content: 'Indisponible';
    display: block;
    font-size: 10px;
    color: #000;
    margin-top: 3px;
    font-family: var(--hbooking-font-family);
}

/* Complet — booking bar */
#ui-datepicker-div td.hbooking-day-complet {
    opacity: 0.5 !important;
    cursor: default !important;
    pointer-events: none !important;
}

#ui-datepicker-div td.hbooking-day-complet a.ui-state-default,
#ui-datepicker-div td.hbooking-day-complet span.ui-state-default {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    height: 68px !important;
    background: rgba(180, 60, 60, 0.06) !important;
}

#ui-datepicker-div td.hbooking-day-complet a.ui-state-default::after,
#ui-datepicker-div td.hbooking-day-complet span.ui-state-default::after {
    content: 'Complet';
    display: block;
    font-size: 11px;
    color: #000;
    font-weight: 600;
    margin-top: 3px;
    font-family: var(--hbooking-font-family);
}

#ui-datepicker-div .ui-datepicker-calendar {
    table-layout: fixed !important;
    width: 100% !important;
}

#ui-datepicker-div .ui-datepicker-calendar th,
#ui-datepicker-div .ui-datepicker-calendar td {
    width: 14.285% !important;
}

/* Indisponible — hors fenêtre ou aucune dispo API */
/* Indisponible : cliquable comme départ (deuxième clic) ou milieu de séjour,
   mais bloqué comme arrivée par le JS. */
.hbooking-calendar-container td.hbooking-day-unavailable {
    opacity: 0.5 !important;
    cursor: pointer !important;
}

.hbooking-calendar-container td.hbooking-day-unavailable a.ui-state-default,
.hbooking-calendar-container td.hbooking-day-unavailable span.ui-state-default {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    height: 68px !important;
}

/* Dates passées — même hauteur que les autres cellules */
.hbooking-calendar-container td.ui-datepicker-unselectable.ui-state-disabled a.ui-state-default,
.hbooking-calendar-container td.ui-datepicker-unselectable.ui-state-disabled span.ui-state-default {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    height: 68px !important;
}

.hbooking-calendar-container td.hbooking-day-unavailable a.ui-state-default::after,
.hbooking-calendar-container td.hbooking-day-unavailable span.ui-state-default::after {
    content: 'Indisponible';
    display: block;
    font-size: 10px;
    color: #000;
    margin-top: 3px;
    font-family: var(--hbooking-font-family);
}

/* Complet — rooms exist but availability = 0 */
.hbooking-calendar-container td.hbooking-day-complet {
    opacity: 0.5 !important;
    cursor: default !important;
    pointer-events: none !important;
}

.hbooking-calendar-container td.hbooking-day-complet a.ui-state-default,
.hbooking-calendar-container td.hbooking-day-complet span.ui-state-default {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    height: 68px !important;
    background: rgba(180, 60, 60, 0.06) !important;
}

.hbooking-calendar-container td.hbooking-day-complet a.ui-state-default::after,
.hbooking-calendar-container td.hbooking-day-complet span.ui-state-default::after {
    content: 'Complet';
    display: block;
    font-size: 11px;
    color: #000;
    font-weight: 600;
    margin-top: 3px;
    font-family: var(--hbooking-font-family);
}

/* Hover preview */
.hbooking-calendar-container td.hbooking-range-hover {
    background-color: rgba(213, 172, 95, 0.1) !important;
}

.hbooking-calendar-container td.hbooking-range-hover a.ui-state-default {
    background: transparent !important;
    border-color: transparent !important;
}

/* Range start and end — gold */
.hbooking-calendar-container td.hbooking-range-start,
.hbooking-calendar-container td.hbooking-range-end {
    background-color: var(--hbooking-color-primary) !important;
}

.hbooking-calendar-container td.hbooking-range-start a.ui-state-default,
.hbooking-calendar-container td.hbooking-range-end a.ui-state-default {
    color: black !important;
    font-weight: 700 !important;
    background: transparent !important;
    border-color: transparent !important;
}

.hbooking-calendar-container td.hbooking-range-start .hbooking-day-price,
.hbooking-calendar-container td.hbooking-range-end .hbooking-day-price {
    color: black !important;
}

/* Arrivée / Départ label on selected cells */
.hbooking-date-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    margin-top: 2px;
    border: 1px solid currentColor;
    border-radius: 2px;
    padding: 0 3px;
    line-height: 1.5;
    font-family: var(--hbooking-font-family);
    pointer-events: none;
}

.hbooking-calendar-container td.hbooking-range-start .hbooking-date-label,
.hbooking-calendar-container td.hbooking-range-end .hbooking-date-label,
.brw-calendar-container td.hbooking-range-start .hbooking-date-label,
.hrrb-cal-container td.hbooking-range-start .hbooking-date-label,
.hrrb-cal-container td.hbooking-range-end .hbooking-date-label,
#ui-datepicker-div td.hbooking-range-start .hbooking-date-label,
#ui-datepicker-div td.hbooking-range-end .hbooking-date-label {
    color: black;
    border-color: black;
}


/* Range highlight */
.hbooking-calendar-container td.hbooking-range-highlight {
    background-color: rgba(213, 172, 95, 0.12) !important;
}

.hbooking-calendar-container td.hbooking-range-highlight a.ui-state-default {
    background: transparent !important;
    border-color: transparent !important;
}

/* Today */
.hbooking-calendar-container .ui-datepicker-today a.ui-state-highlight {
    background: transparent !important;
    border: none !important;
    color: var(--hbooking-color-primary) !important;
    font-weight: 700;
}

/* Hint shown after check-in is selected */
.hbooking-calendar-hint {
    text-align: center;
    color: #888;
    font-size: 13px;
    font-family: var(--hbooking-font-family);
    padding: 12px 0 0;
    margin: 0;
    font-style: italic;
}

/* Range total summary block */
.hbooking-range-total {
    margin-top: 24px;
    padding: 18px 24px;
    background-color: #fff;
    border: 1px solid rgba(213, 172, 95, 0.5);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    font-family: var(--hbooking-font-family);
}

.hbooking-range-summary {
    color: var(--hbooking-color-dark);
    font-size: 16px;
    font-weight: 500;
    margin: 0;
}

/* Book now button */
.hbooking-book-btn {
    display: inline-block;
    background-color: var(--hbooking-color-primary);
    color: #fff !important;
    font-family: var(--hbooking-font-family);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 12px 30px;
    border-radius: 2px;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.hbooking-book-btn:hover {
    background-color: var(--hbooking-color-primary-hover) !important;
    color: #fff !important;
}

/* =====================================================
   best_rate_widget — date trigger button
   ===================================================== */

/* Reset agressif pour contrer les CSS de thème qui ajoutent des bordures rouges */
.brw-date-trigger,
.brw-apply-btn,
.brw-close-btn {
    -webkit-appearance: none !important;
    appearance: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.brw-date-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent !important;
    border: 1px solid var(--hbooking-color-primary) !important;
    border-radius: 3px;
    padding: 8px 14px;
    cursor: pointer;
    font-family: var(--hbooking-font-family);
    font-size: 13px;
    font-weight: 600;
    color: var(--hbooking-color-primary) !important;
    letter-spacing: 0.5px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.brw-date-trigger:hover,
.brw-date-trigger:focus,
.brw-date-trigger:active {
    background-color: var(--hbooking-color-primary) !important;
    color: #fff !important;
    border-color: var(--hbooking-color-primary) !important;
    outline: none !important;
    box-shadow: none !important;
}

.brw-date-trigger .fa-calendar-alt {
    font-size: 14px;
}

.brw-trigger-text {
    pointer-events: none;
}

.brw-trigger-text::before,
.brw-trigger-text::after,
.brw-date-display::before,
.brw-date-display::after {
    display: none !important;
    content: none !important;
}

/* =====================================================
   best_rate_widget — overlay + modal centré
   ===================================================== */

.brw-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 9998;
}

.brw-calendar-popup {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    background: #fff;
    border: none !important;
    outline: none !important;
    border-radius: 4px;
    padding: 28px 24px 22px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
    width: 90%;
    max-width: 420px;
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
}

/* Single-month override — no border, full width */
.brw-calendar-popup .ui-datepicker-group {
    width: 100% !important;
    float: none !important;
    padding: 0 !important;
}

/* Suppression de toute bordure parasite sur le calendrier inline */
.brw-calendar-popup .hbooking-calendar-container,
.brw-calendar-popup .hbooking-calendar-container.ui-datepicker,
.brw-calendar-popup .hbooking-calendar-container.ui-datepicker-inline {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.brw-close-btn {
    position: absolute;
    top: 10px;
    right: 14px;
    background: transparent !important;
    border: none !important;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #999 !important;
    font-family: sans-serif;
    padding: 2px 6px;
    transition: color 0.15s;
}

.brw-close-btn:hover,
.brw-close-btn:focus,
.brw-close-btn:active {
    color: var(--hbooking-color-dark) !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.brw-calendar-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
    padding-top: 12px;
}

.brw-apply-btn {
    background-color: var(--hbooking-color-primary) !important;
    color: #fff !important;
    border: none !important;
    padding: 10px 28px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 2px;
    font-family: var(--hbooking-font-family);
    transition: background-color 0.2s ease;
}

.brw-apply-btn:hover,
.brw-apply-btn:focus,
.brw-apply-btn:active {
    background-color: var(--hbooking-color-primary-hover) !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    color: #fff !important;
}

/* =====================================================
   Room Rate Bar [hbooking_room_rate_bar]
   ===================================================== */

.hbooking-room-rate-bar {
    display: flex;
    align-items: stretch;
    border: 1px solid #e8e8e8;
    border-radius: 3px;
    overflow: hidden;
    font-family: var(--hbooking-font-family);
    background: #f7f7f7;
    flex-wrap: wrap;
}

.hrrb-field {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 14px 24px;
    border-right: 1px solid #e0e0e0;
    cursor: pointer;
    flex: 1;
    min-width: 130px;
    background: #f7f7f7;
    transition: background-color 0.15s ease;
}

/* Popup calendrier inline de hbooking_room_rate_bar
   (déplacé vers body par JS — position fixed pour s'afficher au-dessus de la barre sticky) */
.hrrb-cal-popup {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9990;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    padding: 20px 20px 16px;
    width: 90%;
    max-width: 360px;
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
}

.hrrb-cal-popup .ui-datepicker-group {
    width: 100% !important;
    float: none !important;
    padding: 0 !important;
}

.hrrb-cal-hint {
    font-size: 12px;
    color: #888;
    font-family: var(--hbooking-font-family);
    font-style: italic;
    text-align: center;
    margin: 10px 0 0;
    padding: 0;
}

.hrrb-field:hover {
    background-color: #eeeeee;
}

.hrrb-label {
    display: block;
    font-size: 10px;
    letter-spacing: 1.5px;
    color: #888;
    margin-bottom: 5px;
    font-family: var(--hbooking-font-family);
}

.hrrb-date {
    display: block;
    font-size: 15px;
    font-weight: 500;
    color: var(--hbooking-color-dark);
    font-family: var(--hbooking-font-family);
}

.hrrb-nights {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    background: #f7f7f7;
    border-right: 1px solid #e0e0e0;
    white-space: nowrap;
}

.hrrb-nights-value {
    font-size: 13px;
    color: #555;
    font-family: var(--hbooking-font-family);
}

.hrrb-price {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 10px 28px;
    background: #fff;
    border-right: 1px solid #e0e0e0;
    flex: 1;
    min-width: 130px;
}

.hrrb-price-official {
    display: flex;
    align-items: center;
    gap: 5px;
}

.hrrb-price-official-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #888;
    font-family: var(--hbooking-font-family);
    white-space: nowrap;
}

.hrrb-price-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--hbooking-color-dark);
    line-height: 1;
    font-family: var(--hbooking-font-family);
}

.hrrb-price-currency {
    font-size: 13px;
    font-weight: 500;
    color: #555;
    align-self: flex-end;
    margin-bottom: 2px;
    font-family: var(--hbooking-font-family);
}

.hrrb-price-comparison {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: var(--hbooking-font-family);
}

.hrrb-price-others-label {
    font-size: 11px;
    color: #999;
}

.hrrb-price-others-value {
    font-size: 13px;
    color: #999;
    text-decoration: line-through;
    font-weight: 600;
}

.hrrb-price-currency-others {
    font-size: 11px;
    color: #999;
    text-decoration: line-through;
}

.hrrb-reserve {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff !important;
    font-family: var(--hbooking-font-family);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 0 32px;
    text-decoration: none;
    white-space: nowrap;
    min-height: 60px;
    transition: filter 0.2s ease;
}

.hrrb-reserve:hover {
    filter: brightness(0.88);
    color: #fff !important;
}

/* Responsive */
@media only screen and (max-width: 767px) {
    .hbooking-room-rate-bar {
        flex-direction: column;
    }

    .hrrb-field {
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        flex: none;
        width: 100%;
        box-sizing: border-box;
    }

    .hrrb-nights {
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        width: 100%;
        box-sizing: border-box;
    }

    .hrrb-price {
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        flex: none;
        width: 100%;
        box-sizing: border-box;
        align-items: flex-start;
        padding: 14px 24px;
    }

    .hrrb-reserve {
        width: 100%;
        min-height: 50px;
        box-sizing: border-box;
        padding: 14px 24px;
    }

    .brw-calendar-popup {
        width: 95%;
        max-width: 95%;
        padding: 20px 14px 16px;
    }
}

/* =====================================================
   Room price [hbooking_room_price]
   ===================================================== */

.hbooking-room-price {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    font-family: var(--hbooking-font-family);
    color: var(--hbooking-color-dark);
}

.hbooking-room-price-label {
    font-size: 14px;
    color: #404040;
}

.hbooking-room-price-value {
    font-size: 28px;
    font-weight: 600;
    color: var(--hbooking-color-dark);
    line-height: 1;
}

.hbooking-room-price-unit {
    font-size: 14px;
    color: #404040;
}

.hbooking-price-unavailable {
    font-size: 16px;
    color: #999;
    font-style: italic;
}

/* =====================================================
   Booking Bar [hbooking_booking_bar]
   ===================================================== */

.hbooking-booking-bar {
    display: flex;
    align-items: stretch;
    background-color: var(--hbooking-color-dark);
    border-radius: 4px;
    overflow: hidden;
    font-family: var(--hbooking-font-family);
    flex-wrap: wrap;
}

.hbooking-bb-field {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 14px 22px;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
    flex: 1;
    min-width: 130px;
    transition: background-color 0.15s ease;
}

.hbooking-bb-field:hover {
    background-color: rgba(255, 255, 255, 0.06);
}

.hbooking-bb-label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 5px;
    font-family: var(--hbooking-font-family);
}

.hbooking-bb-checkin,
.hbooking-bb-checkout,
.hbooking-bb-promocode {
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-family: var(--hbooking-font-family);
    font-size: 15px;
    font-weight: 500;
    width: 100%;
    cursor: pointer;
    padding: 0;
    caret-color: var(--hbooking-color-primary);
}

.hbooking-bb-checkin::placeholder,
.hbooking-bb-checkout::placeholder,
.hbooking-bb-promocode::placeholder {
    color: rgba(255, 255, 255, 0.35);
    font-size: 14px;
    font-weight: 400;
}

/* Total / voir tarif section */
.hbooking-bb-total {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 14px 22px;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    min-width: 160px;
}

.hbooking-bb-nights-price {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    font-family: var(--hbooking-font-family);
    display: block;
}

.hbooking-bb-voir-tarif {
    font-size: 11px;
    color: var(--hbooking-color-primary);
    text-decoration: underline;
    font-family: var(--hbooking-font-family);
    margin-top: 3px;
    display: block;
}

.hbooking-bb-voir-tarif:hover {
    color: var(--hbooking-color-primary-hover);
}

/* Réserver button */
.hbooking-bb-reserve {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--hbooking-color-primary);
    color: #fff !important;
    font-family: var(--hbooking-font-family);
    font-size: 15px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0 30px;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s ease;
    min-height: 62px;
}

.hbooking-bb-reserve:hover {
    background-color: var(--hbooking-color-primary-hover) !important;
    color: #fff !important;
}

/* Popup datepicker price cells — shared between calendar and booking bar */
#ui-datepicker-div td[data-handler="selectDay"] {
    cursor: pointer !important;
    height: 52px !important;
    vertical-align: middle !important;
    padding: 2px 1px !important;
}

#ui-datepicker-div td[data-handler="selectDay"] a.ui-state-default {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    height: 48px !important;
    padding: 2px !important;
    line-height: 1.2 !important;
    border: none !important;
    background: transparent !important;
}

#ui-datepicker-div .hbooking-day-price {
    font-size: 11px !important;
}

/* BRW calendar — prix officiel en gold, OTA barré en gris */
.brw-calendar-container .hbooking-day-price {
    color: var(--hbooking-color-primary) !important;
    font-weight: 600 !important;
}
.brw-calendar-container .hbooking-brw-ota {
    display: block !important;
    text-align: center;
    pointer-events: none;
}

/* =====================================================
   Responsive
   ===================================================== */

@media only screen and (max-width: 767px) {
    /* Price calendar */
    .hbooking-price-calendar {
        padding: 16px 4px;
    }

    .hbooking-calendar-container .ui-datepicker-group {
        width: 100% !important;
        float: none !important;
        padding: 0 8px !important;
    }

    .hbooking-calendar-container .ui-datepicker-group:first-child {
        border-bottom: 1px solid #eee;
        padding-bottom: 20px !important;
        margin-bottom: 20px;
    }

    .hbooking-calendar-container td[data-handler="selectDay"] {
        height: 56px !important;
    }

    .hbooking-calendar-container td[data-handler="selectDay"] a.ui-state-default {
        height: 56px !important;
        font-size: 15px !important;
    }

    .hbooking-range-total {
        flex-direction: column;
        align-items: flex-start;
    }

    .hbooking-book-btn {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }

    .hbooking-room-price-value {
        font-size: 22px;
    }

    /* Booking bar */
    .hbooking-booking-bar {
        flex-direction: column;
    }

    .hbooking-bb-field {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
        flex: none;
    }

    .hbooking-bb-total {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    }

    .hbooking-bb-reserve {
        width: 100%;
        min-height: 50px;
        padding: 14px 20px;
        box-sizing: border-box;
    }
}

/* =====================================================
   Upsell — hbooking_room_rate_bar legend + best price
   ===================================================== */

/* Green corner triangle on cheapest day */
td.hrrb-best-price {
    position: relative;
    overflow: hidden;
}
td.hrrb-best-price::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 11px 11px 0;
    border-color: transparent #2e7d32 transparent transparent;
}
td.hrrb-best-price a {
    color: #2e7d32 !important;
    font-weight: 700;
}

/* Legend bar below calendar */
.hrrb-legend {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    padding: 10px 14px;
    border-top: 1px solid #e8e0d0;
    background: #fafaf8;
}
.hrrb-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #555;
    white-space: nowrap;
}
.hrrb-legend-icon {
    display: inline-block;
    flex-shrink: 0;
}
/* Green corner flag (best price) */
.hrrb-legend-best {
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 11px 11px 0;
    border-color: transparent #2e7d32 transparent transparent;
}
/* Red dot (last rooms) */
.hrrb-legend-last {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e53935;
}
/* Hatched (min stay) */
.hrrb-legend-minstay {
    width: 18px;
    height: 10px;
    background: repeating-linear-gradient(
        45deg,
        #aaa,
        #aaa 1px,
        transparent 1px,
        transparent 4px
    );
}

/* Red dot — dernière(s) chambre(s) */
td.hrrb-last-room {
    position: relative;
}
td.hrrb-last-room::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #e53935;
    z-index: 1;
}

/* Hatched background — séjour minimum */
td.hrrb-min-stay {
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 3px,
        rgba(150,150,150,0.25) 3px,
        rgba(150,150,150,0.25) 4px
    ) !important;
}

/* =====================================================
   Upsell — hbooking_price_calendar
   ===================================================== */

/* Green corner triangle on best price cell */
td.hbooking-cell-best-price {
    position: relative;
    overflow: hidden;
}
td.hbooking-cell-best-price::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 11px 11px 0;
    border-color: transparent #2e7d32 transparent transparent;
}

/* Red dot — dernière(s) chambre(s) */
td.hbooking-last-room {
    position: relative;
}
td.hbooking-last-room::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #e53935;
    z-index: 1;
}

/* Séjour minimum — fond hachuré */
td.hbooking-min-stay {
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 3px,
        rgba(150,150,150,0.25) 3px,
        rgba(150,150,150,0.25) 4px
    ) !important;
}

/* Label "X n. min" affiché sous le prix */
.hbooking-min-stay-label {
    display: block;
    font-size: 0.65em;
    color: #888;
    line-height: 1.2;
    margin-top: 1px;
    white-space: nowrap;
}

/* Non arrival — ClosedOnArrival */
/* ClosedOnArrival : cliquable (peut être départ ou milieu de séjour)
   mais visuellement atténué. Le JS bloque la sélection comme arrivée. */
.hbooking-calendar-container td.hbooking-day-closed-arrival,
#ui-datepicker-div td.hbooking-day-closed-arrival {
    opacity: 0.6 !important;
    cursor: pointer !important;
}
.hbooking-calendar-container td.hbooking-day-closed-arrival a.ui-state-default,
.hbooking-calendar-container td.hbooking-day-closed-arrival span.ui-state-default,
#ui-datepicker-div td.hbooking-day-closed-arrival a.ui-state-default,
#ui-datepicker-div td.hbooking-day-closed-arrival span.ui-state-default {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    height: 68px !important;
}
.hbooking-calendar-container td.hbooking-day-closed-arrival a.ui-state-default::after,
.hbooking-calendar-container td.hbooking-day-closed-arrival span.ui-state-default::after,
#ui-datepicker-div td.hbooking-day-closed-arrival a.ui-state-default::after,
#ui-datepicker-div td.hbooking-day-closed-arrival span.ui-state-default::after {
    content: 'Arr. impossible';
    display: block;
    font-size: 9px;
    color: #000;
    margin-top: 3px;
    font-family: var(--hbooking-font-family);
}

/* Notice "Premières disponibilités : mois année" */
.hbooking-opening-notice {
    display: inline-block;
    background: #f7f0e2;
    color: #8a6f30;
    border: 1px solid #e5d099;
    border-radius: 4px;
    font-family: var(--hbooking-font-family);
    font-size: 0.82em;
    letter-spacing: 0.04em;
    padding: 7px 14px;
    margin-bottom: 12px;
}
.hbooking-opening-notice--popup {
    display: block;
    margin: 10px 12px 4px;
    text-align: center;
}

/* Legend */
.hbooking-legend {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    padding: 10px 14px;
    border-top: 1px solid #e8e0d0;
    background: #fafaf8;
    margin-top: 4px;
}
.hbooking-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #555;
    white-space: nowrap;
}
.hbooking-legend-icon {
    display: inline-block;
    flex-shrink: 0;
}
.hbooking-legend-best {
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 11px 11px 0;
    border-color: transparent #2e7d32 transparent transparent;
}
.hbooking-legend-last {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e53935;
}
.hbooking-legend-minstay {
    width: 18px;
    height: 10px;
    background: repeating-linear-gradient(
        45deg,
        #aaa,
        #aaa 1px,
        transparent 1px,
        transparent 4px
    );
}

/* =====================================================
   MODAL [hbooking_modal]
   ===================================================== */

.hbooking-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 99999;
    display: none;
    align-items: stretch;
    justify-content: flex-end;
    transition: background 0.3s ease;
}
.hbooking-modal-overlay.hbooking-modal-active {
    display: flex;
    background: rgba(0, 0, 0, 0.45);
}

/* Panel — slide depuis la droite */
.hbooking-modal-panel {
    background: #fff;
    border-radius: 0;
    width: 550px;
    max-width: 100vw;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 30px rgba(0, 0, 0, 0.18);
    overflow-x: hidden;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}
.hbooking-modal-overlay.hbooking-modal-active .hbooking-modal-panel {
    transform: translateX(0);
}
.hbooking-modal-overlay.hbooking-modal-closing .hbooking-modal-panel {
    transform: translateX(100%);
}

@keyframes hbookingBgIn {
    from { background: rgba(0,0,0,0); }
    to   { background: rgba(0,0,0,0.45); }
}

/* Header */
.hbooking-modal-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 14px 20px;
    border-bottom: 1px solid #e8e8e8;
    flex-shrink: 0;
}

.hbooking-modal-close {
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    color: #555;
    padding: 0 4px;
    transition: color 0.2s;
}
.hbooking-modal-close:hover { color: var(--hbooking-color-dark); }

/* Body — le scroll est géré par .hbooking-modal-panel */
.hbooking-modal-body {
    flex: 1;
    padding: 20px 24px 0;
}

/* Calendrier pleine largeur dans le modal — cellules compactes pour que
   le calendrier entier soit visible sans scroller (les compteurs en-dessous
   sont accessibles en scrollant dans .hbooking-modal-body) */
.hbooking-modal-body .hbooking-price-calendar {
    padding: 0;
}

.hbooking-modal-body .hbooking-calendar-container {
    width: 100%;
    box-shadow: none;
    border: none;
    padding: 0;
    margin: 0;
}
.hbooking-modal-body .hbooking-calendar-container td[data-handler="selectDay"] {
    height: 52px !important;
}
.hbooking-modal-body .hbooking-calendar-container td[data-handler="selectDay"] a.ui-state-default {
    height: 52px !important;
}

/* Masquer le bloc total/réserver du calendrier dans le modal (le modal a son propre footer) */
.hbooking-modal-body .hbooking-range-total {
    display: none !important;
}

/* Footer sticky */
.hbooking-modal-footer {
    border-top: 1px solid #e8e8e8;
    padding: 16px 24px;
    flex-shrink: 0;
    background: #fff;
}

/* Compteurs Chambres / Adultes / Enfants */
.hbooking-modal-counter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    margin-bottom: 16px;
}
.hbooking-modal-counter-label strong {
    display: block;
    font-family: var(--hbooking-font-family);
    font-size: 1rem;
    color: var(--hbooking-color-dark);
}
.hbooking-modal-counter-label span {
    font-size: 0.8rem;
    color: #888;
}
.hbooking-modal-counter-btns {
    display: flex;
    align-items: center;
    gap: 16px;
}
.hbooking-modal-panel .hbooking-modal-counter-minus,
.hbooking-modal-panel .hbooking-modal-counter-plus {
    background: transparent !important;
    background-color: transparent !important;
    border: 1px solid #ccc !important;
    border-radius: 50% !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    font-size: 1.2rem !important;
    line-height: 1 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #333 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    outline: none;
    transition: border-color 0.2s, color 0.2s;
    flex-shrink: 0;
}
.hbooking-modal-panel .hbooking-modal-counter-minus:hover,
.hbooking-modal-panel .hbooking-modal-counter-plus:hover {
    border-color: var(--hbooking-color-primary) !important;
    color: var(--hbooking-color-primary) !important;
    background: transparent !important;
}
.hbooking-modal-counter-val {
    font-size: 1rem;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
    color: var(--hbooking-color-dark);
}

/* Barre dates + bouton Suivant */
.hbooking-modal-dates-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.hbooking-modal-date-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}
.hbooking-modal-date-label {
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    color: #888;
    text-transform: uppercase;
}
.hbooking-modal-date-value {
    font-size: 0.9rem;
    color: var(--hbooking-color-dark);
    font-weight: 500;
}
.hbooking-modal-arrow {
    color: #aaa;
    font-size: 1rem;
    flex-shrink: 0;
}
.hbooking-modal-guests {
    flex: 0 0 auto;
}

/* Bouton Suivant */
.hbooking-modal-next {
    background: var(--hbooking-color-primary);
    color: #fff;
    border: none;
    padding: 12px 28px;
    font-family: var(--hbooking-font-family);
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
    border-radius: 2px;
    transition: background 0.2s;
    flex-shrink: 0;
    display: inline-block;
}
.hbooking-modal-next:hover { background: #c49d4e; color: #fff; }
.hbooking-modal-next.disabled {
    background: #ccc;
    pointer-events: none;
    cursor: default;
}

/* Bloc résumé nuits + total */
.hbooking-modal-summary {
    border: 1px solid #e8e0cc;
    border-radius: 4px;
    padding: 14px 18px;
    margin-bottom: 16px;
    background: #fdfaf4;
}
.hbooking-modal-summary-text {
    font-size: 0.9rem;
    color: var(--hbooking-color-dark);
}
.hbooking-modal-summary-nights,
.hbooking-modal-summary-total {
    font-weight: 700;
}

/* Avertissement min stay */
.hbooking-modal-minstay-warning {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #fff8e6;
    border: 1px solid #f0c040;
    border-radius: 4px;
    padding: 10px 14px;
    margin-top: 12px;
    font-size: 0.82rem;
    color: #7a5a00;
    line-height: 1.4;
}
.hbooking-modal-minstay-icon {
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 1px;
}
.hbooking-modal-minstay-val {
    font-weight: 700;
}

/* Bloquer le scroll body */
body.hbooking-modal-open { overflow: hidden; }

/* Mobile */
@media (max-width: 640px) {
    .hbooking-modal-panel {
        width: 100vw;
    }
    .hbooking-modal-dates-bar {
        flex-wrap: wrap;
        gap: 8px;
    }
    .hbooking-modal-next {
        width: 100%;
        text-align: center;
        margin-top: 8px;
    }
}

/* jQuery UI ajoute #ui-datepicker-div au body sans style inline, et setDate()
   le remplit sans l'ouvrir : sans le thème officiel jQuery UI rien ne le cache,
   il apparaît sous le footer. jQuery UI pose display:block inline à l'ouverture. */
#ui-datepicker-div { display: none; }

/* Skeleton shimmer pendant le chargement du prix d'une cellule (AJAX) */
@keyframes hbookingPriceShimmer {
    from { background-position: 200% 0; }
    to   { background-position: -200% 0; }
}
.hbooking-day-price.hbooking-price-loading {
    color: transparent !important;
    width: 34px;
    height: 12px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 3px;
    background: linear-gradient(90deg, #e4e4e4 25%, #f6f6f6 50%, #e4e4e4 75%);
    background-size: 200% 100%;
    animation: hbookingPriceShimmer 1.2s linear infinite;
}
