/*
 * Buoy Booking Engine — Structural Styles
 *
 * Intentionally colour-free and typography-free.
 * All colours, fonts, and brand-specific styles are inherited
 * from the active theme. This file provides only layout,
 * spacing, and structural rules.
 *
 * For third-party embeds, colours are set via CSS custom properties
 * injected by buoy-embed.js using data attributes.
 */

/* ── Wrapper + theming variables ─────────────────────────────────────────── */
/*
 * Override any of these variables on your embed container to re-brand the widget.
 * See THEMING.md for full documentation and examples.
 */
.buoy-booking {
    max-width: 680px;
    margin: 0 auto;
    padding: 0;

    /* Core accent — single most impactful variable */
    --buoy-accent:       var(--crf-accent-color, var(--primary-color, #c9a96e));

    /* Typography */
    --buoy-font:         inherit;

    /* Layout */
    --buoy-radius:       4px;

    /* Colours */
    --buoy-border-color: rgba(26, 27, 26, 0.18);
    --buoy-btn-bg:       rgb(240, 240, 240);
    --buoy-btn-border:   currentColor;
    --buoy-btn-color:    inherit;
}

/* ── Progress indicator ──────────────────────────────────────────────────── */
.buoy-booking__progress {
    display: flex;
    align-items: flex-start;
    margin-bottom: 2em;
    gap: 0;
    overflow: hidden; /* prevent blowout on very small screens */
}

.buoy-booking__progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 1 auto; /* can shrink on small screens */
    min-width: 0;
    opacity: 0.4;
    transition: opacity 0.2s;
}

.buoy-booking__progress-step.is-active,
.buoy-booking__progress-step.is-complete {
    opacity: 1;
}

.buoy-booking__progress-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2em;
    height: 2em;
    border-radius: 50%;
    border: 2px solid currentColor;
    font-size: 0.875em;
    font-weight: 600;
    margin-bottom: 0.3em;
    flex-shrink: 0;
}

.buoy-booking__progress-step.is-active .buoy-booking__progress-num {
    background: var(--buoy-accent, var(--primary-color, #c9a96e));
    border-color: var(--buoy-accent, var(--primary-color, #c9a96e));
    color: #fff;
}

.buoy-booking__progress-label {
    font-size: 0.7em;
    white-space: nowrap;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

@media (max-width: 380px) {
    .buoy-booking__progress-label {
        display: none; /* very small screens: show numbers only */
    }
    .buoy-booking__progress-num {
        font-size: 0.75em;
        width: 1.6em;
        height: 1.6em;
    }
}

/* Connector line — aligned to the vertical centre of the number circle (1em = half of 2em circle) */
.buoy-booking__progress-divider {
    flex: 1;
    height: 1px;
    background: currentColor;
    opacity: 0.25;
    margin: 0 4px;
    margin-top: 1em; /* half the circle height (2em × 0.875 font = 1.75em / 2 ≈ 1em) */
    align-self: auto;
}

/* ── Step container ──────────────────────────────────────────────────────── */
.buoy-booking__step {
    padding: 0;
}

.buoy-booking__step-title {
    margin-top: 0;
    margin-bottom: 1.25em;
}

/* ── Form fields ─────────────────────────────────────────────────────────── */
.buoy-booking__field {
    margin-bottom: 1em;
}

.buoy-booking__field-row {
    display: flex;
    gap: 1em;
}

.buoy-booking__field-row .buoy-booking__field {
    flex: 1;
}

.buoy-booking__label {
    display: block;
    margin-bottom: 0.375em;
    font-weight: 600;
    font-size: 0.875em;
}

.buoy-booking__required {
    color: inherit;
    opacity: 0.6;
}

.buoy-booking__optional {
    font-weight: 400;
    opacity: 0.6;
    font-size: 0.875em;
}

.buoy-booking__input,
.buoy-booking__select,
.buoy-booking__textarea {
    display: block;
    width: 100%;
    padding: 0.5em 0.75em;
    box-sizing: border-box;
    border: 1px solid;
    border-color: var(--buoy-border-color, rgba(26, 27, 26, 0.6));
    border-radius: var(--buoy-radius, 4px);
    font-size: 1em;
    font-family: inherit;
    line-height: 1.5;
    min-height: 44px;
}

/* Property select — match date picker height and padding */
.buoy-booking__select {
    padding-right: 2.25em;
    padding-top: 0.6em;
    padding-bottom: 0.6em;
    -webkit-appearance: auto;
    appearance: auto;
    min-height: 44px;
    cursor: pointer;
}

.buoy-booking__input--number {
    width: 100%;
}

.buoy-booking__textarea {
    resize: vertical;
    min-height: 80px;
}

/* ── Property preview ────────────────────────────────────────────────────── */
.buoy-booking__property-preview {
    display: flex;
    align-items: center;
    gap: 0.75em;
    padding: 0.75em;
    border: 1px solid;
    border-radius: var(--buoy-radius, 4px);
    margin-bottom: 1em;
    opacity: 0.8;
}

.buoy-booking__property-img {
    width: 60px;
    height: 45px;
    object-fit: cover;
    border-radius: 3px;
    flex-shrink: 0;
}

.buoy-booking__property-name {
    font-weight: 600;
    font-size: 0.9em;
}

/* ── Error messages ──────────────────────────────────────────────────────── */
.buoy-booking__error {
    padding: 0.85em 1.1em;
    border-radius: var(--buoy-radius, 4px);
    margin-bottom: 1em;
    font-size: 0.9em;
    display: none; /* shown via JS */
    background: #fff5f5;
    border: 1.5px solid #e5484d;
    color: #c0282d;
    line-height: 1.5;
}

/* Availability bounce — slightly larger and with an icon */
#buoy-step1-error:not(:empty) {
    padding-left: 2.8em;
    position: relative;
}

#buoy-step1-error:not(:empty)::before {
    content: '\26A0'; /* ⚠ */
    position: absolute;
    left: 1em;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1em;
}

/* ── Loading state ───────────────────────────────────────────────────────── */
.buoy-booking__loading {
    padding: 1em 0;
    opacity: 0.6;
    font-style: italic;
}

/* ── Stay summary (Step 2) ───────────────────────────────────────────────── */
.buoy-booking__stay-summary {
    padding: 0.75em 1em;
    border-radius: var(--buoy-radius, 4px);
    border: 1px solid;
    margin-bottom: 1.25em;
    font-size: 0.9em;
    opacity: 0.8;
}

/* ── Rate plan cards ─────────────────────────────────────────────────────── */
.buoy-booking__rates {
    display: flex;
    flex-direction: column;
    gap: 0.75em;
    margin-bottom: 1.25em;
}

/* ── Selection cards (rooms + rates) ─────────────────────────────────────── */
/* Both room and rate cards use the same base — selecting immediately advances */

.buoy-booking__rate-card {
    position: relative;
    border: 1.5px solid rgba(26, 27, 26, 0.18);
    border-radius: var(--buoy-radius, 4px);
    padding: 0;
    margin-bottom: 0.5em;
    overflow: hidden;
    cursor: default;
    transition: border-color 0.2s;
}

.buoy-booking__rate-card:hover {
    border-color: var(--primary-color, #b99d75);
    background: #faf8f5;
}

/* Selection indicator — replaces native radio, sits flush left */
.buoy-booking__rate-card::before {
    content: '';
    position: absolute;
    left: 1.1em;
    top: 1.25em;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid rgba(26, 27, 26, 0.3);
    background: #fff;
    transition: border-color 0.15s, background 0.15s;
    flex-shrink: 0;
}

.buoy-booking__rate-card.is-selected {
    border-color: var(--primary-color, #b99d75);
    background: #faf8f5;
}

/* Filled dot when selected */
.buoy-booking__rate-card.is-selected::before {
    border-color: var(--primary-color, #b99d75);
    background: radial-gradient(circle, var(--primary-color, #b99d75) 45%, #fff 46%);
    border-width: 1.5px;
}

/* Hide native radio on rate cards — we use the ::before pseudo-element */
.buoy-booking__rate-radio {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* Room cards use a real visible radio in the header row — restore it */
.buoy-booking__room-header .buoy-booking__rate-radio {
    position: static;
    opacity: 1;
    width: 18px;
    height: 18px;
    pointer-events: auto;
    accent-color: var(--buoy-accent, #c9a96e);
    flex-shrink: 0;
    margin: 0;
    cursor: pointer;
}

.buoy-booking__rate-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1em;
    flex-wrap: wrap;
}

.buoy-booking__rate-label {
    font-weight: 600;
    cursor: pointer;
    flex: 1;
    line-height: 1.3;
}

.buoy-booking__rate-price {
    text-align: right;
    flex-shrink: 0;
}

.buoy-booking__rate-per-night {
    display: block;
    font-size: 0.82em;
    opacity: 0.6;
    font-weight: 400;
}

.buoy-booking__rate-total {
    display: block;
    font-size: 0.95em;
    font-weight: 400;
}

.buoy-booking__rate-description {
    margin-top: 0.55em;
    font-size: 0.875em;
    line-height: 1.5;
    opacity: 0.75;
}

.buoy-booking__rate-cancellation {
    margin-top: 0.5em;
    font-size: 0.8em;
    display: flex;
    align-items: flex-start;
    gap: 0.35em;
    opacity: 0.6;
}

.buoy-booking__rate-cancellation svg {
    flex-shrink: 0;
    margin-top: 2px;
}

/* ── Booking summary ─────────────────────────────────────────────────────── */
.buoy-booking__booking-summary,
.buoy-booking__payment-summary {
    border: 1px solid;
    border-radius: 6px;
    padding: 1em;
    margin-bottom: 1.25em;
    font-size: 0.9em;
}

.buoy-booking__summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.375em 0;
    border-bottom: 1px solid;
    border-bottom-color: inherit;
    opacity: 0.9;
}

.buoy-booking__summary-row:last-child {
    border-bottom: none;
}

.buoy-booking__summary-row--total {
    font-weight: 700;
    font-size: 1.05em;
    opacity: 1;
    padding-top: 0.5em;
}

/* ── Action buttons ──────────────────────────────────────────────────────── */
.buoy-booking__actions {
    display: flex;
    gap: 0.75em;
    justify-content: flex-end;
    margin-top: 1.5em;
    flex-wrap: wrap;
}

.buoy-booking__btn {
    padding: 0.625em 1.5em;
    border-radius: var(--buoy-radius, 4px);
    border: 2px solid;
    cursor: pointer;
    font-size: 1em;
    font-family: inherit;
    font-weight: 600;
    transition: opacity 0.15s;
    line-height: 1.4;
}

.buoy-booking__btn:disabled,
.buoy-booking__btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed !important;
    background: inherit !important; /* prevent theme from turning bg red/grey */
    color: inherit !important;
}

.buoy-booking__btn--primary {
    /* Primary styling inherited from theme */
}

.buoy-booking__btn--secondary {
    /* Secondary styling inherited from theme */
    opacity: 0.7;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 520px) {
    .buoy-booking__field-row {
        flex-direction: column;
        gap: 0;
    }

    .buoy-booking__rate-header {
        flex-direction: column;
    }

    .buoy-booking__rate-price {
        text-align: left;
    }

    .buoy-booking__actions {
        flex-direction: column-reverse;
    }

    .buoy-booking__btn {
        width: 100%;
        text-align: center;
    }

    .buoy-booking__progress-label {
        display: none;
    }
}

/* ── Field hint text ─────────────────────────────────────────────────────── */
.buoy-booking__field-hint {
    display: block;
    margin-top: 0.3em;
    font-size: 0.8em;
    opacity: 0.65;
    line-height: 1.4;
}

/* ── Inline field errors ─────────────────────────────────────────────────── */
.buoy-booking__field-error {
    display: block;
    margin-top: 0.3em;
    font-size: 0.8em;
    line-height: 1.4;
}

.buoy-booking__input--error {
    border-color: currentColor;
    outline-color: currentColor;
    opacity: 0.85;
}

/* ── Sticky price bar ────────────────────────────────────────────────────── */
.buoy-booking__price-bar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0.75em;
    padding: 0.625em 1em;
    margin-bottom: 1.25em;
    border-radius: var(--buoy-radius, 4px);
    border: 1px solid;
    font-size: 0.875em;
    flex-wrap: wrap;
}

.buoy-booking__price-bar-property {
    font-weight: 700;
    flex-shrink: 0;
}

.buoy-booking__price-bar-dates {
    opacity: 0.7;
    flex: 1;
    min-width: 0;
}

.buoy-booking__price-bar-total {
    font-weight: 700;
    flex-shrink: 0;
    margin-left: auto;
}

/* ── Trust bar ───────────────────────────────────────────────────────────── */
.buoy-booking__trust-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
    padding: 0.75em 1em;
    border-radius: var(--buoy-radius, 4px);
    border: 1px solid;
    margin-bottom: 1.25em;
    font-size: 0.8em;
    opacity: 0.75;
}

.buoy-booking__trust-item {
    display: flex;
    align-items: center;
    gap: 0.4em;
}

/* ── Cancellation policy reminder ────────────────────────────────────────── */
.buoy-booking__cancellation-reminder {
    display: flex;
    align-items: flex-start;
    gap: 0.4em;
    padding: 0.625em 1em;
    border-radius: var(--buoy-radius, 4px);
    border: 1px solid;
    margin-bottom: 1.25em;
    font-size: 0.85em;
    line-height: 1.5;
    opacity: 0.8;
}

.buoy-booking__cancellation-reminder svg {
    flex-shrink: 0;
    margin-top: 2px;
}

/* ── Exit intent banner ──────────────────────────────────────────────────── */
.buoy-booking__exit-banner {
    position: fixed;
    bottom: 1.5em;
    right: 1.5em;
    z-index: 9999;
    max-width: 300px;
    padding: 1.25em 1em 1em;
    border-radius: 8px;
    border: 1px solid;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.25s, transform 0.25s;
    pointer-events: none;
}

.buoy-booking__exit-banner.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.buoy-booking__exit-close {
    position: absolute;
    top: 0.5em;
    right: 0.75em;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25em;
    line-height: 1;
    opacity: 0.5;
    padding: 0;
}

.buoy-booking__exit-msg {
    margin: 0 0 0.75em;
    font-size: 0.875em;
    line-height: 1.5;
}

.buoy-booking__exit-cta {
    display: inline-block;
    padding: 0.4em 1em;
    border-radius: var(--buoy-radius, 4px);
    border: 2px solid;
    font-size: 0.875em;
    font-weight: 600;
    text-decoration: none;
}

@media (max-width: 520px) {
    .buoy-booking__exit-banner {
        bottom: 0;
        right: 0;
        left: 0;
        max-width: none;
        border-radius: 8px 8px 0 0;
    }
    .buoy-booking__price-bar {
        font-size: 0.8em;
    }
}

/* ── Calendar — Litepicker theming & price labels ────────────────────────── */

/*
 * Desktop picker appends to <body> (standard Litepicker behaviour).
 * We tag the range input with a data attribute so JS can add a class
 * to the picker after init for scoping. Meanwhile we use global selectors
 * that only affect Buoy booking pickers via the .buoy-booking-picker class
 * added by JS after init.
 *
 * Mobile picker is inside .buoy-booking__date-sheet — scoped normally.
 */

/* Theming — applied globally via .buoy-booking-picker class added by JS */
.buoy-booking-picker,
.buoy-booking__date-sheet .litepicker {
    /* Use --primary-color (set by CozyStay theme) with fallback chain */
    --buoy-accent: var(--crf-accent-color, var(--primary-color, #c9a96e));
    --litepicker-is-start-color:     #fff;
    --litepicker-is-end-color:       #fff;
    --litepicker-is-start-color-bg:  var(--buoy-accent);
    --litepicker-is-end-color-bg:    var(--buoy-accent);
    --litepicker-is-in-range-color:  var(--crf-text-primary, #333);
    --litepicker-day-color-hover:    var(--buoy-accent);
    --litepicker-button-reset-color: var(--crf-text-muted, #999);
    --litepicker-button-reset-color-hover: var(--buoy-accent);
    font-family: inherit;
}

/* Greyed-out unavailable/locked dates */
.buoy-booking-picker .day-item.is-locked,
.buoy-booking__date-sheet .litepicker .day-item.is-locked {
    opacity: 0.3 !important;
    cursor: not-allowed !important;
    text-decoration: line-through !important;
    color: inherit !important; /* no red — just muted */
}
.buoy-booking-picker .day-item.is-locked:hover,
.buoy-booking__date-sheet .litepicker .day-item.is-locked:hover {
    box-shadow: none !important;
}

/* Days within min_stay range after checkin selected */
.buoy-booking-picker .day-item.is-too-close,
.buoy-booking__date-sheet .litepicker .day-item.is-too-close {
    cursor: not-allowed !important;
    opacity: 0.45 !important;
    color: inherit !important;
}

/* Days before minDate — Litepicker marks these with is-locked too,
   but also any day-item that has pointer-events:none from Litepicker internals */
.buoy-booking-picker .day-item[disabled],
.buoy-booking-picker .day-item.is-locked,
.buoy-booking-picker .day-item.is-too-close {
    cursor: not-allowed !important;
}

/* Day cells — column layout so price sits below date number */
.buoy-booking-picker .container__days > div,
.buoy-booking-picker .container__days > a {
    padding: 3px 0;
}
.buoy-booking-picker .day-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 42px;
    padding: 2px 0;
    line-height: 1.2;
    font-size: 12px;
}

/* Price label under the day number — desktop only */
.buoy-booking-picker .day-item .buoy-cal-price {
    display: block;
    font-size: 9px;
    font-weight: 500;
    opacity: 0.6;
    line-height: 1;
    margin-top: 1px;
    letter-spacing: -0.02em;
    white-space: nowrap;
    pointer-events: none;
}
.buoy-booking-picker .day-item.is-start-date .buoy-cal-price,
.buoy-booking-picker .day-item.is-end-date .buoy-cal-price {
    opacity: 0.9;
}
.buoy-booking-picker .day-item.is-locked .buoy-cal-price {
    display: none;
}

/* Mobile: no prices */
.buoy-booking__date-sheet .litepicker .day-item .buoy-cal-price {
    display: none;
}

/* ── Mobile date bottom sheet ────────────────────────────────────────────── */
/* Matches existing filter widget sheet pattern exactly */

.buoy-booking__date-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 999998;
}
.buoy-booking__date-overlay.is-open { display: block; }

.buoy-booking__date-sheet {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    box-sizing: border-box;
    max-width: 100vw;
    overflow-x: hidden;
    background: #fff;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -4px 32px rgba(0,0,0,0.18);
    padding: 0 0 env(safe-area-inset-bottom, 16px);
    max-height: 85vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.32,0.72,0,1);
}
.buoy-booking__date-sheet.is-open {
    display: block;
    transform: translateY(0);
}

/* Shared structural classes (.buoy-sheet-header/title/close/body/done) are in buoy-style.css.
   Only booking-engine-specific overrides belong here. */
.buoy-booking__date-sheet .buoy-sheet-body {
    padding: 0 14px;
    overflow-x: hidden;
    box-sizing: border-box;
}

#buoy-date-mobile-cal { overflow: hidden; max-width: 100%; }

/* ── Mobile sheet Litepicker layout ─────────────────────────────────────────
 * The sheet is portaled to <body> so the ".buoy-booking .litepicker" rules
 * in the block above don't reach it. Mirror the same constraints here.
 */
.buoy-booking__date-sheet .litepicker,
.buoy-booking__date-sheet .litepicker .container--main {
    max-width: 100% !important;
    box-sizing: border-box !important;
    width: 100% !important;
}
.buoy-booking__date-sheet .litepicker .month-item {
    min-width: 0;
    flex: 1 1 auto;
    padding: 0 !important;
}
.buoy-booking__date-sheet .litepicker .month-item-header {
    padding-left: 0 !important;
    padding-right: 0 !important;
}
.buoy-booking__date-sheet .litepicker .month-item-weekdays-row {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
}
.buoy-booking__date-sheet .litepicker .month-item-weekdays-row > div {
    text-align: center;
    box-sizing: border-box;
}
.buoy-booking__date-sheet .litepicker .container__days {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    box-sizing: border-box !important;
}
.buoy-booking__date-sheet .litepicker .container__days > div,
.buoy-booking__date-sheet .litepicker .container__days > a {
    width: auto !important;
}

/* Hide sheet on desktop */
@media (min-width: 641px) {
    .buoy-booking__date-sheet,
    .buoy-booking__date-overlay {
        display: none !important;
    }
    .buoy-booking .litepicker .day-item .buoy-cal-price {
        display: block;
    }
}

@media (max-width: 640px) {
    .buoy-booking .litepicker .day-item .buoy-cal-price {
        display: none;
    }
}

/* ── iOS zoom prevention ─────────────────────────────────────────────────── */
/* iOS Safari zooms when any focused input has font-size < 16px.             */
/* This applies to shortcode and embedded modes alike.                        */
@media (max-width: 640px) {
    .buoy-booking input:not([type="hidden"]),
    .buoy-booking select,
    .buoy-booking textarea {
        font-size: max(16px, 1em) !important;
    }
}

/* Prevent double-tap zoom on calendar day cells and navigation buttons */
.buoy-booking__date-sheet .day-item,
.buoy-booking__date-sheet .button-previous-month,
.buoy-booking__date-sheet .button-next-month,
.buoy-booking__date-sheet .button-cancel,
.buoy-booking__date-sheet .button-apply {
    touch-action: manipulation;
}

/* Keep the bottom sheet composited on GPU — prevents iOS scroll/zoom glitch in embeds */
.buoy-booking__date-sheet {
    -webkit-transform: translateZ(0);
    overscroll-behavior: contain;
}

/* Hide theme scroll-to-top buttons when sheet is open */
body.buoy-sheet-open [class*="back-to-top"],
body.buoy-sheet-open [id*="back-to-top"],
body.buoy-sheet-open [class*="scroll-top"],
body.buoy-sheet-open [id*="scroll-top"],
body.buoy-sheet-open .to-top,
body.buoy-sheet-open [class*="to-top"],
body.buoy-sheet-open [id*="to-top"] {
    display: none !important;
    z-index: -1 !important;
}

/* ── Desktop picker container ────────────────────────────────────────────── */
/* Litepicker renders into this div; position relative so dropdown anchors correctly */
.buoy-booking__desktop-cal {
    position: relative;
    max-width: 100%;
    overflow: hidden;
}

/* Prevent litepicker overflowing its container on narrow screens / embeds */
.buoy-booking .litepicker,
.buoy-booking .litepicker .container--main {
    max-width: 100% !important;
    box-sizing: border-box;
}

.buoy-booking .litepicker .month-item {
    min-width: 0;
    flex: 1 1 auto;
    padding: 0 !important;
}
.buoy-booking .litepicker .month-item-header { padding-left: 0 !important; padding-right: 0 !important; }
.buoy-booking .litepicker .container__months .month-item-weekdays-row { display: grid !important; grid-template-columns: repeat(7, 1fr) !important; }
.buoy-booking .litepicker .month-item-weekdays-row > div { text-align: center; box-sizing: border-box; }
.buoy-booking .litepicker .container__days { display: grid !important; grid-template-columns: repeat(7, 1fr) !important; box-sizing: border-box; }
.buoy-booking .litepicker .container__days > div,
.buoy-booking .litepicker .container__days > a { width: auto !important; }

/* Desktop picker is absolutely positioned inside the container */
@media (min-width: 641px) {
    .buoy-booking__desktop-cal .litepicker {
        position: absolute;
        top: 0;
        left: 0;
        z-index: 1000;
    }
}

/* ── Range input loading state ───────────────────────────────────────────── */
#buoy-date-range:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* ── Stepper buttons (adults/children) ──────────────────────────────────── */
.buoy-booking__stepper {
    display: flex;
    align-items: center;
    border: 1px solid;
    border-color: var(--buoy-border-color, rgba(26, 27, 26, 0.6));
    border-radius: var(--buoy-radius, 4px);
    overflow: hidden;
    min-height: 44px;
}

.buoy-booking__stepper-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: none !important; /* override theme disabled background */
    color: inherit !important;   /* override theme disabled colour */
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.15s;
    font-family: inherit;
    -webkit-appearance: none;
}

.buoy-booking__stepper-btn:hover { opacity: 1; }

/* Disabled stepper: keep same background/colour, just reduce opacity and show not-allowed */
.buoy-booking__stepper-btn:disabled,
.buoy-booking__stepper-btn[disabled] {
    cursor: not-allowed !important;
    background: none !important;
    color: inherit !important;
    opacity: 0.3 !important;
}

.buoy-booking__stepper-val {
    flex: 1;
    border: none;
    text-align: center;
    font-size: 1rem;
    font-family: inherit;
    background: transparent;
    -moz-appearance: textfield;
    pointer-events: none;
    padding: 0;
    min-width: 0;
}

.buoy-booking__stepper-val::-webkit-inner-spin-button,
.buoy-booking__stepper-val::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

/* ── Calendar icon on date range input ───────────────────────────────────── */
.buoy-booking__date-input-wrap {
    position: relative;
    cursor: pointer;
}

.buoy-booking__date-input-wrap .buoy-booking__input {
    padding-right: 2.5em;
    cursor: pointer;
}

.buoy-booking__date-icon {
    position: absolute;
    right: 0.75em;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    opacity: 0.45;
    display: flex;
    align-items: center;
}

/* ── Property select with home icon — matches date picker style ──────────── */
.buoy-booking__select-wrap {
    position: relative;
}

.buoy-booking__select-icon {
    position: absolute;
    left: 0.75em;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    opacity: 0.45;
    display: flex;
    align-items: center;
    z-index: 1;
}

/* Indent select text to clear the icon */
.buoy-booking__select-wrap .buoy-booking__select {
    padding-left: 2.5em;
}

/* ── Booking summary — remove borders, bold property name ────────────────── */
.buoy-booking__summary-row {
    border-bottom: none !important;
    padding: 0.25em 0;
}

.buoy-booking__summary-row:first-child span:first-child {
    font-weight: 700;
}

.buoy-booking__summary-row--total {
    border-top: 1px solid !important;
    margin-top: 0.25em;
    padding-top: 0.5em !important;
}

/* ── Rate card extra guest fee note ─────────────────────────────────────── */
.buoy-booking__rate-extra {
    display: block;
    font-size: 0.8em;
    opacity: 0.7;
    margin-top: 2px;
}

/* ── Room selection step ─────────────────────────────────────────────────── */
/* Visual-first layout: title → image → price → description → meta
   Flat vertical card — no aside, all elements stack. */

.buoy-booking__rooms-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 16px 0;
}

.buoy-booking__room-card {
    padding: 0;
    overflow: hidden;
    cursor: pointer;
}

.buoy-booking__room-card::before {
    display: none; /* replaced by radio in header row */
}

/* Row 1: radio + title */
.buoy-booking__room-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1em;
    margin: 0;
    line-height: 1.3;
}

.buoy-booking__room-header input[type=radio] {
    flex-shrink: 0;
    margin: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--buoy-accent, #c9a96e);
}

.buoy-booking__rate-label-text { flex: 1; }

/* Row 2: image full-width */
.buoy-booking__room-thumb-wrap {
    position: relative;
    width: 100%;
    display: block;
    line-height: 0;
    cursor: pointer;
}

.buoy-booking__room-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;  /* maintains ratio — no stretching ever */
    object-fit: cover !important;
    object-position: center;
    display: block;
    border-radius: 0;
    cursor: pointer;
}

/* Desktop / landscape: image 80% wide, centred */
@media (min-width: 481px), (orientation: landscape) {
    .buoy-booking__room-thumb-wrap {
        width: 80%;
        margin: 0 auto;
        border-radius: 6px;
        overflow: hidden;
    }
    .buoy-booking__room-thumb {
        /* aspect-ratio handles sizing — no fixed height needed */
        border-radius: 0;
    }
    .buoy-booking__room-gallery-btn {
        border-radius: 0 0 6px 6px;
    }
}

/* Portrait mobile: full width */
@media (max-width: 480px) and (orientation: portrait) {
    .buoy-booking__room-thumb-wrap {
        width: 100%;
        border-radius: 0;
    }
    .buoy-booking__room-thumb {
        height: 200px;
    }
}

/* Row 3: price */
.buoy-booking__room-price-row {
    padding: 10px 16px 4px;
}

.buoy-booking__room-price-row .buoy-booking__rate-price { text-align: left; }

/* Row 4: description wrapper */
.buoy-booking__room-desc-wrap {
    padding: 0 16px;
}

/* Row 3: facts (capacity + chips) — directly under photo */
.buoy-booking__room-facts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 10px 16px 4px;
    font-size: 0.8em;
    opacity: 0.75;
    row-gap: 6px;
}

/* Row 6: CTA button row */
.buoy-booking__room-meta {
    display: flex;
    align-items: center;
    padding: 8px 16px 14px;
}

.buoy-booking__room-capacity {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-right: 4px;
}

.buoy-booking__room-facts .buoy-booking__room-chip {
    font-size: 1em;
    padding: 1px 6px;
    border-radius: var(--buoy-radius, 4px);
    background: rgba(0,0,0,0.06);
    border: none;
}

.buoy-booking__room-card.is-selected .buoy-booking__room-header {
    color: var(--buoy-accent, #c9a96e);
}

/* Room Next button — visible but secondary, for users who want explicit confirmation */
#buoy-room-next {
    display: block;
    margin-top: 12px;
    opacity: 0.7;
}

/* Hide Continue button on rates step — rate selection auto-advances */
#buoy-step2-next { display: none !important; }

/* ── Select hint ─────────────────────────────────────────────────────────── */
.buoy-booking__select-hint {
    font-size: 0.8em;
    opacity: 0.5;
    margin: 0 0 10px;
    font-style: italic;
}

/* ── Price loading shimmer ───────────────────────────────────────────────── */
.buoy-shimmer {
    display: inline-block;
    background: linear-gradient(90deg, #f0ede8 25%, #e8e4de 50%, #f0ede8 75%);
    background-size: 200% 100%;
    animation: buoy-shimmer 1.2s infinite;
    border-radius: 3px;
    min-width: 60px;
}

@keyframes buoy-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Room detail chips ───────────────────────────────────────────────────── */
.buoy-booking__room-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.buoy-booking__room-chip {
    display: inline-block;
    font-size: 0.72em;
    padding: 2px 7px;
    border-radius: 20px;
    border: 1px solid rgba(26,27,26,0.18);
    opacity: 0.7;
    white-space: nowrap;
}

/* ── Processing / Confirmation / Timeout screens ────────────────────────── */
.buoy-booking__processing {
    text-align: center;
    padding: 3em 1em;
}

.buoy-booking__spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(26,27,26,0.1);
    border-top-color: var(--buoy-accent, var(--primary-color, #c9a96e));
    border-radius: 50%;
    animation: buoy-spin 0.8s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes buoy-spin {
    to { transform: rotate(360deg); }
}

.buoy-booking__processing-note {
    font-size: 0.9em;
    opacity: 0.65;
    max-width: 320px;
    margin: 0.5em auto 0;
    line-height: 1.6;
}

.buoy-booking__confirmed,
.buoy-booking__timeout {
    text-align: center;
    padding: 2.5em 1em;
}

.buoy-booking__confirmed-icon svg {
    stroke: #00a32a;
}

.buoy-booking__timeout-icon svg {
    stroke: var(--buoy-accent, var(--primary-color, #c9a96e));
}

.buoy-booking__confirmed-detail {
    max-width: 380px;
    margin: 1.5em auto;
    border: 1px solid rgba(26,27,26,0.12);
    border-radius: 6px;
    overflow: hidden;
}

.buoy-booking__confirmed-note,
.buoy-booking__timeout-note {
    font-size: 0.9em;
    opacity: 0.7;
    max-width: 360px;
    margin: 0.75em auto 0;
    line-height: 1.6;
}

.buoy-booking__timeout-ref {
    margin-top: 1em;
    font-size: 0.8em;
    opacity: 0.5;
}

/* Fake pay notice */
.buoy-booking__fake-pay-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 1em;
    background: #f0f6ff;
    border: 1px dashed #aac4e8;
    border-radius: 6px;
    font-size: 0.85em;
    color: #2271b1;
    margin-bottom: 1em;
}


/* ── Select CTA button — matches buoy-booking__btn--primary style ────────── */
.buoy-booking__select-btn {
    margin-left: auto;
    margin-top: 4px;
    flex-shrink: 0;
    background: rgb(240, 240, 240);
    border: 2px solid currentColor;
    color: inherit;
    border-radius: var(--buoy-radius, 4px);
    padding: 8px 20px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    font-family: inherit;
}

.buoy-booking__select-btn:hover {
    background: rgb(220, 220, 220);
}

.buoy-booking__rate-card.is-selected .buoy-booking__select-btn,
.buoy-booking__room-card.is-selected .buoy-booking__select-btn {
    background: rgb(0, 0, 0);
    border-color: rgb(0, 0, 0);
    color: rgb(240, 240, 240);
}

/* Rate title row — same padding as room header but no radio */
.buoy-booking__rate-title {
    font-size: 1em;
    font-weight: 600;
    padding: 14px 16px 10px;
}

/* Rate card — same flat structure as room card */
.buoy-booking__rate-card {
    overflow: hidden;
    cursor: default; /* card body not clickable — button is */
}

/* Remove old ::before radio dot from rate cards */
.buoy-booking__rate-card::before {
    display: none;
}

/* ── Room gallery button ─────────────────────────────────────────────────── */
.buoy-booking__room-gallery-btn {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.55);
    color: #fff;
    border: none;
    font-size: 10px;
    padding: 3px 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border-radius: 0 0 4px 4px;
    line-height: 1.2;
    white-space: nowrap;
}

.buoy-booking__room-gallery-btn:hover {
    background: rgba(0,0,0,0.75);
}

/* ── Lightbox ────────────────────────────────────────────────────────────── */
.buoy-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.buoy-lightbox.is-open {
    background: rgba(0,0,0,0.88);
}

.buoy-lightbox__inner {
    position: relative;
    max-width: min(90vw, 960px);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.buoy-lightbox__img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: var(--buoy-radius, 4px);
    display: block;
}

.buoy-lightbox__close {
    position: absolute;
    top: -36px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 2em;
    line-height: 1;
    cursor: pointer;
    padding: 0 6px;
    opacity: 0.8;
}

.buoy-lightbox__close:hover { opacity: 1; }

.buoy-lightbox__prev,
.buoy-lightbox__next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    font-size: 2em;
    line-height: 1;
    cursor: pointer;
    padding: 8px 14px;
    border-radius: var(--buoy-radius, 4px);
    transition: background 0.15s;
}

.buoy-lightbox__prev { left: -52px; }
.buoy-lightbox__next { right: -52px; }
.buoy-lightbox__prev:hover,
.buoy-lightbox__next:hover { background: rgba(255,255,255,0.3); }

.buoy-lightbox__title {
    color: #fff;
    font-size: 0.9em;
    opacity: 0.8;
}

.buoy-lightbox__counter {
    color: #fff;
    font-size: 0.8em;
    opacity: 0.6;
}

@media (max-width: 600px) {
    .buoy-lightbox__prev { left: -40px; font-size: 1.5em; padding: 6px 10px; }
    .buoy-lightbox__next { right: -40px; font-size: 1.5em; padding: 6px 10px; }
}

/* ── Room card — redesigned ──────────────────────────────────────────────── */

/* Description truncation */
.buoy-booking__room-desc {
    font-size: 0.875em;
    line-height: 1.55;
    color: inherit;
    opacity: 0.82;
}

.buoy-booking__room-desc.is-truncated {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.buoy-booking__room-desc-toggle {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.8em;
    font-weight: 400;
    cursor: pointer;
    display: inline;        /* truly inline with text */
    opacity: 0.5;
    text-decoration: none;
    vertical-align: baseline;
    line-height: inherit;
    margin-left: 2px;
}

.buoy-booking__room-desc-toggle:hover { opacity: 0.85; }

/* Select none / all action row */
.buoy-rule-target-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
}

/* ── Test booking notice ─────────────────────────────────────────────────── */
.buoy-booking__test-booking-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: var(--buoy-radius, 4px);
    font-size: 0.85em;
    color: #795548;
    margin-bottom: 16px;
}

/* ── Marketing opt-in checkbox ───────────────────────────────────────────── */
.buoy-booking__field--checkbox {
    margin-top: 8px;
}
.buoy-booking__checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.9em;
    color: var(--buoy-text-muted, #666);
    cursor: pointer;
    line-height: 1.4;
}
.buoy-booking__checkbox-label input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
}
