/*
 * Shared reservation date-picker — single source of truth for both reservation UIs:
 *   - the checkout reservation step (checkout/steps/reservation.html.twig), built by
 *     reservation.js: date cards + time rows are <button>s, selection is toggled with
 *     .is-selected and only the active day's .time-list is shown;
 *   - the standalone Fitzone booking page (reservation/booking.html.twig), no JS:
 *     hidden radios (.rsv-radio) drive both the visible day panel (generated
 *     :checked ~ rules) and the selected time row (.rsv-radio:checked + .time-row).
 *
 * Brooklyn charter: white cards on a light background, black + yellow (#FFCC00) for
 * the selected state. Context chrome stays elsewhere: the step widget (title / book /
 * skip / feedback) in club.css under .section.checkout; the booking page layout +
 * radio hiding in reservation_booking.css.
 */

/* ===== Date picker head ===== */
.reservation-datepicker__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.reservation-datepicker__title,
.reservation-times__title {
    margin: 0;
    font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;
    font-weight: 600;
    font-size: 16px;
    text-transform: none;
    letter-spacing: normal;
    color: #000;
}

.reservation-datepicker__nav {
    display: inline-flex;
    gap: 8px;
    flex: 0 0 auto;
}

.reservation-datepicker__arrow {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #e2e2e2;
    border-radius: 999px;
    background: #fff;
    color: #000;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}

.reservation-datepicker__arrow:hover {
    background: #f2f2f2;
    border-color: #000;
}

.reservation-datepicker__arrow[disabled] {
    opacity: .35;
    cursor: default;
    background: #fff;
    border-color: #e2e2e2;
}

/* ===== Horizontal date rail ===== */
.date-rail {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.date-rail::-webkit-scrollbar {
    display: none;
}

.date-card {
    flex: 0 0 auto;
    box-sizing: border-box;
    width: 62px;
    padding: 9px 4px;
    border: 1px solid #e6e6e6;
    border-radius: 12px;
    background: #fff;
    text-align: center;
    cursor: pointer;
    user-select: none;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.date-card:hover {
    border-color: #000;
}

.date-card__weekday {
    display: block;
    font-size: 11px;
    color: #9a9a9a;
}

.date-card__day {
    display: block;
    font-family: 'Oswald', 'Helvetica Neue', Arial, Helvetica, sans-serif;
    font-size: 17px;
    font-weight: 700;
    line-height: 1;
    margin: 5px 0 0;
    color: #000;
}

.date-card__month {
    display: block;
    font-size: 11px;
    color: #9a9a9a;
}

/* Selected day: JS toggles .is-selected on the checkout step; the booking page
   reflects the hidden date radio via a generated :checked ~ rule that adds the same
   look. */
.date-card.is-selected {
    background: #000;
    border-color: #000;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
}

.date-card.is-selected .date-card__weekday,
.date-card.is-selected .date-card__month,
.date-card.is-selected .date-card__day {
    color: #FFCC00;
}

.date-card.is-disabled {
    cursor: default;
}

.date-card.is-disabled .date-card__day {
    color: #cfcfcf;
}

.date-card.is-disabled .date-card__weekday,
.date-card.is-disabled .date-card__month {
    color: #d8d8d8;
}

/* ===== Time list ===== */
.reservation-times {
    margin-top: 22px;
}

.reservation-times__title {
    margin-bottom: 14px;
}

.time-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Booking page: one .time-list per day, hidden until its date radio is checked
   (generated :checked ~ rules re-show it). No effect on the JS step, which keeps a
   single always-visible list. */
.time-panel {
    display: none;
}

.time-row {
    display: block;
    width: 100%;
    text-align: left;
    padding: 18px 20px;
    border: 1px solid #e6e6e6;
    border-radius: 14px;
    background: #fff;
    color: #000;
    font-size: 16px;
    font-weight: 500;
    font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.time-row:hover {
    border-color: #000;
}

.time-row.is-selected,
.rsv-radio:checked + .time-row {
    background: #000;
    color: #FFCC00;
    border-color: #000;
}

.time-row.is-full {
    opacity: .4;
    cursor: not-allowed;
    text-decoration: line-through;
}


/* Empty timetable: the widgets hide the booking CTA and promote the feedback line
   to a real message block. Styled here (not in club.css) so the embed, which does
   not load the .section.checkout rules, gets the same treatment. Double class to
   win the specificity tie with `.section.checkout .reservation-feedback`. */
.reservation-feedback.reservation-feedback--empty {
    margin-top: 18px;
    padding: 16px 18px;
    color: #000;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
}

/* Blocked "Continue": the .step-next anchor is rendered by checkout_process.html.twig
   and only pre_reservation.js ever disables it (required step, nothing picked yet).
   Styled here rather than in checkout.css — which none of the three surfaces that
   render .step-next actually load — so the club page, the booking page and the embed
   behave identically. Same reasoning as the .reservation-feedback--empty rule above,
   and the same opacity + pointer-events pattern the legacy booking sheet used for
   .reservation-book.disabled: opacity avoids fighting .uk-button-primary's own
   background over specificity. The JS guard in general_checkout.js is the real gate —
   this rule only makes the refusal visible. */
.step-next.disabled,
.step-next.disabled:hover {
    opacity: .4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Companion hint, rendered at the end of the step body — i.e. directly above the
   Continue button, which is a sibling of the step (see pre_reservation.html.twig). */
.reservation-required-hint {
    margin-top: 10px;
    color: #9a9a9a;
    font-size: 13px;
    text-align: center;
}

.slot-picker-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.6);
    z-index: 10;
}

.slot-picker-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e6e6e6;
    border-top-color: #000;
    border-radius: 50%;
    animation: slotPickerSpin 0.8s linear infinite;
}

@keyframes slotPickerSpin {
    to {
        transform: rotate(360deg);
    }
}
