/* ---- Booking-bar widgets: range calendar + guests picker ---- */

.range-calendar,
.guest-picker {
    position: relative;
}

.rc-display,
.gp-display {
    cursor: pointer;
    user-select: none;
}

.rc-display-text,
.gp-display-text,
.op-display-text {
    display: block;
    font-weight: 700;          /* same weight in both states so glyph widths never change */
    color: #8a94a6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rc-display-text.bw-has-value,
.gp-display-text.bw-has-value,
.op-display-text.bw-has-value {
    color: var(--title-color, #071743);
}

/* Desktop bar: fixed text width so the column keeps the exact same size
   whether it shows the placeholder or a chosen value — no reflow, no shift. */
@media (min-width: 992px) {
    .rc-display-text,
    .gp-display-text,
    .op-display-text {
        width: 172px;
    }
}

/* Popover shell */
.bw-popup {
    position: absolute;
    top: calc(100% + 14px);
    left: 0;
    z-index: 1050;
    background: #fff;
    border: 1px solid #e5eef5;
    border-radius: 14px;
    box-shadow: 0 20px 45px rgba(17, 40, 72, 0.16);
    padding: 20px;
}

.bw-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: transparent;
}

body.bw-locked {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    overflow: hidden;
}

/* ---- Range calendar ---- */
.rc-popup {
    width: max-content;
}

.rc-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.rc-nav-btn {
    border: 1px solid #e5eef5;
    background: #fff;
    color: #17203a;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: all .2s ease;
}

.rc-nav-btn:hover {
    background: var(--theme-color, #2fb4e6);
    border-color: var(--theme-color, #2fb4e6);
    color: #fff;
}

.rc-months {
    display: flex;
    gap: 28px;
}

.rc-month {
    width: 260px;
}

.rc-month-header {
    text-align: center;
    font-weight: 700;
    color: #17203a;
    margin: -34px 0 12px;
    line-height: 34px;
}

.rc-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    row-gap: 4px;
}

.rc-day-name {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #8a94a6;
    padding: 4px 0;
}

.rc-day {
    position: relative;
    text-align: center;
    height: 36px;
    line-height: 36px;
    font-size: 14px;
    color: #17203a;
    cursor: pointer;
    border-radius: 50%;
    transition: background .15s ease;
}

/* Plain hover: soft circle. Never applied to a selected date, so the teal
   circle always wins while you hover to pick the check-out day. */
.rc-day:not(.rc-disabled):not(.rc-blank):not(.rc-selected):not(.rc-in-range):hover {
    background: transparent;
}
.rc-day:not(.rc-disabled):not(.rc-blank):not(.rc-selected):not(.rc-in-range):hover::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: var(--rc-cell, 36px);
    height: var(--rc-cell, 36px);
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: #d6eefb;
    z-index: -1;
}

.rc-day.rc-blank {
    cursor: default;
}

.rc-day.rc-today {
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.rc-day.rc-disabled {
    color: #cfd6e0;
    cursor: not-allowed;
    text-decoration: none;
}

/* Range band between the two dates */
.rc-day.rc-in-range {
    background: #e3f4fc;
    border-radius: 0;
}

/* Round the band's outer ends: first/last column of a week, and first/last day of a month */
.rc-day.rc-in-range:nth-child(7n+1),
.rc-blank + .rc-day.rc-in-range {
    border-top-left-radius: 999px;
    border-bottom-left-radius: 999px;
}

.rc-day.rc-in-range:nth-child(7n),
.rc-day.rc-in-range:last-child {
    border-top-right-radius: 999px;
    border-bottom-right-radius: 999px;
}

/* Selected date: a true circle (fixed size, centred) whatever the cell's
   width, so it never squashes into an oval on narrow screens. */
.rc-day.rc-selected {
    color: #fff;
    font-weight: 700;
    background: transparent;
}

.rc-day.rc-selected::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: var(--rc-cell, 36px);
    height: var(--rc-cell, 36px);
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: var(--theme-color, #2fb4e6);
    z-index: -1;
}

.rc-day.rc-selected:hover {
    background: transparent;
}

/* Check-in / check-out when a range exists: the band runs behind the circle,
   from the circle's centre outward, so circle + band read as one shape. */
.rc-day.rc-start,
.rc-day.rc-end {
    border-radius: 0;
}

.rc-day.rc-start::before,
.rc-day.rc-end::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    background: #e3f4fc;
    z-index: -2;
}

.rc-day.rc-start::before {
    left: 50%;
    right: 0;
}

.rc-day.rc-end::before {
    left: 0;
    right: 50%;
}

.rc-hint {
    margin-top: 10px;
    font-size: 13px;
    color: #8a94a6;
    text-align: center;
}

.rc-footer,
.gp-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #eef2f6;
}

.gp-footer {
    justify-content: flex-end;
    border-top: 0;      /* the last row's divider already separates it; avoids a double line */
    padding-top: 6px;
}

.rc-clear {
    background: none;
    border: none;
    color: #8a94a6;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.rc-apply,
.gp-done {
    padding: 9px 24px !important;
    font-size: 14px !important;
    min-width: 0 !important;
}

/* ---- Guests picker ---- */
.gp-popup {
    width: 320px;
    max-width: 92vw;
}

.gp-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #eef2f6;
}

.gp-row:last-of-type {
    border-bottom: none;
}

.gp-label {
    font-weight: 700;
    color: #17203a;
}

.gp-sub {
    font-size: 12px;
    color: #8a94a6;
}

.gp-stepper {
    display: flex;
    align-items: center;
    gap: 14px;
}

.gp-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid #cfd6e0;
    background: #fff;
    color: #17203a;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: all .2s ease;
}

.gp-btn:hover:not(:disabled) {
    background: var(--theme-color, #2fb4e6);
    border-color: var(--theme-color, #2fb4e6);
    color: #fff;
}

.gp-btn:disabled {
    opacity: .35;
    cursor: not-allowed;
}

.gp-count {
    min-width: 20px;
    text-align: center;
    font-weight: 700;
    color: #17203a;
}

/* ---- Tablet & phone: centered modal-style popovers ---- */
@media (max-width: 991.98px) {
    .bw-popup {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: min(92vw, 400px);
        max-height: 86vh;
        overflow-y: auto;
        z-index: 100001;   /* above the tap-catcher and every page layer */
        -webkit-overflow-scrolling: touch;
    }
    .bw-backdrop {
        z-index: 100000;
    }
    .rc-popup {
        width: min(92vw, 400px);
    }
    .rc-months {
        flex-direction: column;
    }
    .rc-month {
        width: 100%;
    }
    .rc-month-header {
        margin-top: -34px;
    }
    .rc-day {
        --rc-cell: 40px;
        height: 40px;
        line-height: 40px;
    }
}

@media (max-width: 575.98px) {
    .rc-display-text,
    .gp-display-text,
    .op-display-text {
        font-size: 14px;
    }
}

/* Focusable display fields: no browser focus ring, subtle custom one. */
.op-display:focus,
.rc-display:focus,
.gp-display:focus {
    outline: none;
}
.op-display:focus-visible {
    box-shadow: 0 0 0 2px rgba(28, 168, 203, 0.35);
    border-radius: 8px;
}

/* ---- Shared sheet look on phones/tablets: one width, padding, radius
   and a title row with a close button, for destination, dates and guests. */
.bw-head {
    display: none;
}

@media (max-width: 991px) {
    .bw-popup,
    .bw-popup.op-popup,
    .bw-popup.gp-popup,
    .bw-popup.rc-popup {
        width: min(92vw, 420px);
        padding: 16px 16px 18px;
        border-radius: 20px;
        box-shadow: 0 24px 60px rgba(7, 23, 67, 0.28);
    }
    .bw-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin: -2px 0 12px;
        padding-bottom: 12px;
        border-bottom: 1px solid #eef2f6;
    }
    .bw-head-title {
        font-size: 16px;
        font-weight: 700;
        color: #071743;
    }
    .bw-head-close {
        width: 32px;
        height: 32px;
        border: 0;
        border-radius: 50%;
        background: #f1f5f9;
        color: #071743;
        font-size: 20px;
        line-height: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        font-family: Arial, sans-serif;
    }
    .op-list {
        margin: 0 -6px;
    }
}

/* Month arrows sit in the same row as the month title; keep them on top. */
.rc-nav {
    position: relative;
    z-index: 2;
    pointer-events: none;
}
.rc-nav-btn {
    pointer-events: auto;
}
.rc-month-header {
    position: relative;
    z-index: 1;
}

/* Minimum-stay notice under the calendar. */
.rc-hint.rc-hint--warn {
    color: #c0392b;
}
.rc-hint {
    min-height: 20px;
}

/* Booked nights (from the PMS calendar). */
.rc-day.rc-booked {
    color: #cfd6e0;
    text-decoration: line-through;
}
