/*
 * Booking section of the v2 room page — No Zebra's design, Figma 398:9010 (desktop) / 398:9272
 * (mobile). Loaded INSTEAD of rhb-style.css on v2 rooms, so nothing here has to fight the old page's
 * rules; everything is scoped to .rhb-v2. Markup: class/front/booking-v2.php.
 *
 * Fonts (Instrument Serif, Inter) are loaded by the room template in the child theme.
 */

.rhb-v2 {
    --rh-obsidian: #0f1318;
    --rh-pergament: #ece5d6;
    --rh-pergament-tint: #ded3bc;
    --rh-evergreen: #243a30;
    --rh-paprika: #d6552b;
    --rh-paprika-light: #ebaa95;
    --rh-brass: #c89b51;
    --rh-muted: rgba(15, 19, 24, .6);
    --rh-serif: "Instrument Serif", Georgia, serif;
    --rh-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 80px;
    align-items: start;
    font-family: var(--rh-sans);
    color: var(--rh-obsidian);
}

.rhb-v2 *,
.rhb-v2 *::before,
.rhb-v2 *::after {
    box-sizing: border-box;
}

.rhb-v2-col {
    display: flex;
    flex-direction: column;
    gap: 40px;
    min-width: 0;
}

.rhb-v2 [hidden] {
    display: none !important;
}

/* ---- Cards: dark band on top, pergament body overlapping it by 8px ---------------------------- */

.rhb-v2-card-head {
    background: var(--rh-evergreen);
    color: var(--rh-pergament);
    padding: 32px 32px 40px;
    margin-bottom: -8px;
    border-radius: 8px 8px 0 0;
}

.rhb-v2-card-head--nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.rhb-v2-times .rhb-v2-card-head {
    padding: 24px 32px 32px;
}

.rhb-v2-title {
    margin: 0;
    font-family: var(--rh-serif);
    font-weight: 400;
    font-size: 40px;
    line-height: 40px;
    color: var(--rh-pergament);
}

.rhb-v2-sub {
    margin: 4px 0 0;
    font-size: 16px;
    color: rgba(236, 229, 214, .6);
}

.rhb-v2-times .rhb-v2-sub {
    margin-top: 16px;
    color: var(--rh-pergament);
}

.rhb-v2-card-body {
    position: relative;
    background: var(--rh-pergament);
    border-radius: 8px;
    padding: 24px 32px;
}

.rhb-v2-calendar .rhb-v2-card-body {
    padding: 32px;
}

.rhb-v2-card-body--flush {
    padding: 0;
    background: transparent;
}

.rhb-v2-small {
    margin: 0;
    font-size: 12px;
    color: var(--rh-muted);
}

/* ---- Players ---------------------------------------------------------------------------------- */

#RHBBookingPersion .rhb-v2-card-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rhb-v2 .rhb-person-options {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.rhb-v2 .rhb-person-option {
    flex: 1 1 0;
    min-width: 64px;
    padding: 12px 8px;
    border: 1px solid var(--rh-obsidian);
    border-radius: 4px;
    background: transparent;
    font: 700 16px/1.2 var(--rh-sans);
    color: var(--rh-obsidian);
    cursor: pointer;
    transition: background-color .15s;
}

.rhb-v2 .rhb-person-option:hover {
    background: var(--rh-pergament-tint);
}

.rhb-v2 .rhb-person-option.rhb-person-selected {
    background: var(--rh-paprika-light);
    border-color: var(--rh-paprika-light);
}

.rhb-v2 .rhb-person-price {
    margin: 0;
    font-size: 16px;
}

.rhb-v2 .rhb-person-price strong {
    font-size: 20px;
}

.rhb-v2 .rhb-v2-small + .rhb-v2-small,
#RHBBookingPersion .rhb-v2-small {
    max-width: 401px;
    margin-top: 8px;
}

.rhb-v2 .rhb-notice {
    padding: 12px 16px;
    border-left: 3px solid var(--rh-paprika);
    background: var(--rh-pergament-tint);
    font-size: 14px;
    line-height: 1.4;
}

.rhb-v2 .rhb-notice-action {
    margin-left: 4px;
    padding: 0;
    border: 0;
    background: none;
    font: 600 14px var(--rh-sans);
    color: var(--rh-paprika);
    text-decoration: underline;
    cursor: pointer;
}

/* ---- Calendar --------------------------------------------------------------------------------- */

.rhb-v2-month-nav {
    display: flex;
    gap: 12px;
}

.rhb-v2-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 8px;
    background: var(--rh-pergament-tint);
    cursor: pointer;
}

.rhb-v2-arrow[data-dir="prev"] img {
    transform: scaleX(-1);
}

.rhb-v2-arrow:disabled {
    opacity: .4;
    cursor: default;
}

.rhb-v2 .rhb-block-note:empty {
    display: none;
}

.rhb-v2 .rhb-block-note {
    margin: 0 0 16px;
    font-size: 14px;
    color: var(--rh-muted);
}

/* The datepicker's own header is replaced by the card's; its buttons stay in the DOM for the arrows. */
.rhb-v2 .ui-datepicker-header {
    display: none;
}

.rhb-v2 .ui-datepicker-inline {
    width: 100%;
}

.rhb-v2 .ui-datepicker-calendar {
    width: calc(100% + 16px);
    margin: -12px -8px 0;
    border-collapse: separate;
    border-spacing: 8px 12px;
    table-layout: fixed;
}

.rhb-v2 .ui-datepicker-calendar th {
    padding: 0 0 4px;
    font: 700 20px var(--rh-sans);
    text-transform: capitalize;
    text-align: center;
    color: var(--rh-obsidian);
}

.rhb-v2 .ui-datepicker-calendar td {
    padding: 0;
    border: 0;
}

.rhb-v2 .ui-datepicker-calendar td a,
.rhb-v2 .ui-datepicker-calendar td span {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
    border: 0 solid transparent;
    border-radius: 8px;
    background: var(--rh-pergament-tint);
    font: 400 16px var(--rh-sans);
    color: var(--rh-obsidian);
    text-decoration: none;
}

.rhb-v2 .ui-datepicker-calendar td a:hover {
    outline: 2px solid var(--rh-evergreen);
    outline-offset: -2px;
}

/* Past days (including the previous month's tail): as in the design, an outline at half strength. */
.rhb-v2 .ui-datepicker-calendar td.rhb_past span {
    background: var(--rh-pergament);
    border: 1px solid var(--rh-obsidian);
    opacity: .5;
}

/* The next month's first days: drawn, faded, not clickable. */
.rhb-v2 .ui-datepicker-calendar td.ui-datepicker-other-month:not(.rhb_past) span {
    border: 0;
    background: var(--rh-pergament-tint);
    opacity: .3;
}

/* WooCommerce's quantity field: a booking is always one, and the field is only there to be posted. */
.rhb-v2 .quantity {
    display: none;
}

/* Nothing to book: sold out, closed, or not sold to this group size. One look for all three. */
.rhb-v2 .ui-datepicker-calendar td.rhb-v2-none a,
.rhb-v2 .ui-datepicker-calendar td.rhb-v2-none span {
    opacity: .3;
}

.rhb-v2 .ui-datepicker-calendar td.rhb-v2-best a {
    border: 3px dashed var(--rh-brass);
}

/* "Få tider tilbage": a bar under the day, inside the cell so it never moves the grid. */
.rhb-v2 .ui-datepicker-calendar td.rhb-v2-few a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    border-radius: 0 0 8px 8px;
    background: var(--rh-paprika);
}

.rhb-v2 .ui-datepicker-calendar td.ui-datepicker-current-day a {
    background: var(--rh-paprika-light);
    font-weight: 700;
}

.rhb-v2-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin: 24px 0 0;
    padding: 0;
    list-style: none;
    font-size: 14px;
}

.rhb-v2-legend li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rhb-v2-swatch {
    position: relative;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    background: var(--rh-pergament-tint);
}

.rhb-v2-swatch--best {
    border: 1.5px dashed var(--rh-brass);
}

.rhb-v2-swatch--few {
    border-bottom: 3px solid var(--rh-paprika);
}

.rhb-v2-swatch--none {
    opacity: .3;
    border: 1px solid var(--rh-obsidian);
}

.rhb-v2 .RHBRemark:empty,
.rhb-v2 .RHBRemark:has(span:empty) {
    display: none;
}

/* ---- Times of the chosen day ------------------------------------------------------------------ */

.rhb-v2-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    padding: 0 10px;
    border-radius: 24px;
    background: var(--rh-paprika);
    font: 700 20px/32px var(--rh-sans);
    color: var(--rh-pergament);
}

.rhb-v2 .loading-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 240px;
    background: var(--rh-pergament);
    border-radius: 8px;
}

.rhb-v2 .loading-wrapper svg {
    width: 64px;
    animation: rhb-v2-rotate 2s linear infinite;
}

.rhb-v2 .loading-wrapper circle {
    fill: none;
    stroke: var(--rh-evergreen);
    stroke-width: 3;
    stroke-dasharray: 1, 200;
    stroke-linecap: round;
    animation: rhb-v2-dash 1.5s ease-in-out infinite;
}

.rhb-v2 .loading-wrapper.stop-animation {
    display: none;
}

@keyframes rhb-v2-rotate {
    100% { transform: rotate(360deg); }
}

@keyframes rhb-v2-dash {
    0% { stroke-dasharray: 1, 200; stroke-dashoffset: 0; }
    50% { stroke-dasharray: 90, 200; stroke-dashoffset: -35px; }
    100% { stroke-dashoffset: -125px; }
}

.rhb-v2 .RHBDateTimeBlock {
    display: flex;
    flex-direction: column;
    gap: 1px;
    border-radius: 8px;
    overflow: hidden;
}

.rhb-v2 .rhb-slot-error {
    margin: 0;
    padding: 24px 32px;
    background: var(--rh-pergament);
    border-radius: 8px;
}

.rhb-v2 .RHBDateTime {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: var(--rh-pergament);
    font: 600 12px/19.2px var(--rh-sans);
    cursor: pointer;
    transition: background-color .15s;
}

.rhb-v2 .RHBDateTime:hover {
    background: #e5dcc8;
}

.rhb-v2 .RHBDateTime.RHBActiveTime {
    background: var(--rh-paprika-light);
}

.rhb-v2 .rhb-v2-icon {
    flex: 0 0 20px;
}

.rhb-v2 .rhb-v2-icon--check,
.rhb-v2 .RHBActiveTime .rhb-v2-icon--clock {
    display: none;
}

.rhb-v2 .RHBActiveTime .rhb-v2-icon--check {
    display: block;
}

.rhb-v2 .rhb-slot-time {
    flex: 1 1 auto;
}

.rhb-v2-badge {
    padding: 0 8px;
    border-radius: 24px;
    background: var(--rh-brass);
    font: 600 12px/19.2px var(--rh-sans);
    color: var(--rh-obsidian);
    white-space: nowrap;
}

.rhb-v2 .rhb-slot-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-left: 8px;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

.rhb-v2 .rhb-slot-min,
.rhb-v2 .rhb-slot-note {
    font-size: 11px;
    font-weight: 400;
    color: var(--rh-muted);
}

/* No hover on a time this group cannot have: lighting up looked like choosing it. A click still gives
   the reason and the way in (rhb.js). */
.rhb-v2 .RHBTimeNotForGroup,
.rhb-v2 .RHBTimeNotForGroup:hover {
    background: var(--rh-pergament);
    color: var(--rh-muted);
    cursor: default;
}

.rhb-v2 .RHBTimeNotForGroup .rhb-v2-icon {
    opacity: .4;
}

/* ---- The hint --------------------------------------------------------------------------------- */

.rhb-v2-hint-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: -24px 0 0;   /* 16px under the list, as in the design, inside the column's 40px rhythm */
}

.rhb-v2-hint-row:has(.rhb-v2-hint[hidden]) {
    display: none;
}

.rhb-v2-hint {
    font: 600 12px/21px var(--rh-sans);
    color: var(--rh-paprika);
}

.rhb-v2-hint.is-action {
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.rhb-v2-hint.is-good {
    color: var(--rh-evergreen);
}

/* ---- Other rooms the same day ----------------------------------------------------------------- */

.rhb-v2 #RHBAlternativeButtonWrapper:has(#RHBAlternativeButton[style*="none"]) {
    display: none;
}

.rhb-v2-alt {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding: 24px 32px;
    border-radius: 8px;
    background: var(--rh-pergament);
    cursor: pointer;
}

.rhb-v2-alt-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 16px;
}

.rhb-v2-alt-text strong {
    font-size: 20px;
}

/* ---- Buttons ---------------------------------------------------------------------------------- */

.rhb-v2-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 164px;
    padding: 12px 24px;
    border: 1px solid var(--rh-paprika);
    border-radius: 8px;
    background: var(--rh-paprika);
    font: 600 16px var(--rh-sans);
    color: var(--rh-pergament);
    white-space: nowrap;
    cursor: pointer;
    transition: filter .15s;
}

.rhb-v2-btn:hover:not(:disabled) {
    filter: brightness(1.08);
}

.rhb-v2-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.rhb-v2-btn--outline {
    min-width: 188px;
    background: transparent;
    color: var(--rh-obsidian);
}

/* ---- Summary ---------------------------------------------------------------------------------- */

.rhb-v2-summary-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 24px;
    font: 600 14px/19.2px var(--rh-sans);
    color: var(--rh-muted);
}

.rhb-v2-summary-line #RHBSummaryWhen {
    display: contents;
}

/* The separators between the three facts are paprika bars, as in the design. */
.rhb-v2-summary-line #RHBSummaryWhen span::before {
    content: "";
    display: inline-block;
    width: 2px;
    height: 16px;
    margin-right: 8px;
    vertical-align: -3px;
    background: var(--rh-paprika);
}

.rhb-v2-summary-foot {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.rhb-v2-summary-total p {
    margin: 0;
}

.rhb-v2-summary-total p + p {
    margin-top: 8px;
}

.rhb-v2-total-label {
    font-weight: 700;
    font-size: 16px;
}

.rhb-v2-total-amount {
    margin-left: 4px;
    font-weight: 700;
    font-size: 20px;
}

.rhb-v2 .rhb-summary-before:empty {
    display: none;
}

.rhb-v2 .rhb-summary-before .line-through {
    text-decoration: line-through;
    color: var(--rh-muted);
}

.rhb-v2 #RHBSummaryVat:not(:empty)::after {
    content: ". ";
}

.rhb-v2-summary-action {
    text-align: right;
}

.rhb-v2 .rhb-summary-hint {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--rh-muted);
}

.rhb-v2 .rhb-summary-hint:empty {
    display: none;
}

/* ---- Alternatives modal (unchanged behaviour, v2 colours) ------------------------------------- */

.rhb-v2 .modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15, 19, 24, .6);
}

.rhb-v2 .modal-guts {
    max-height: 100vh;
    overflow-y: auto;
    padding: 40px 16px;
}

.rhb-v2 .modal-content-box {
    max-width: 880px;
    margin: 0 auto;
    padding: 32px;
    border-radius: 8px;
    background: var(--rh-pergament);
}

.rhb-v2 .modal-close {
    float: right;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
}

.rhb-v2 #alternativesList {
    margin: 0;
    padding: 0;
    list-style: none;
}

.rhb-v2 .modal-grid {
    display: grid;
    grid-template-columns: 160px 1fr;
    grid-template-areas: "image headline" "image description" "image slots";
    gap: 8px 24px;
    padding: 24px 0;
    border-bottom: 1px solid var(--rh-pergament-tint);
}

.rhb-v2 .modal-image { grid-area: image; }
.rhb-v2 .modal-image img { width: 100%; height: auto; border-radius: 8px; }
.rhb-v2 .modal-title { grid-area: headline; color: inherit; text-decoration: none; }
.rhb-v2 .modal-title h2 { margin: 0; font: 400 32px/1.1 var(--rh-serif); }
.rhb-v2 .modal-content { grid-area: description; color: inherit; text-decoration: none; font-size: 14px; }
.rhb-v2 .modal-slots { grid-area: slots; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rhb-v2 .modal-slots .headline { width: 100%; font-weight: 700; }

.rhb-v2 .modal-slots a {
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--rh-pergament-tint);
    font-weight: 600;
    color: var(--rh-obsidian);
    text-decoration: none;
}

/* ---- Mobile bar ------------------------------------------------------------------------------- */

.rhb-v2-bar {
    display: none;
}

/* ---- Narrower screens ------------------------------------------------------------------------- */

@media (max-width: 1099px) {
    .rhb-v2 {
        grid-template-columns: minmax(0, 1fr);
        gap: 40px;
    }
}

@media (max-width: 767px) {
    .rhb-v2-card-head {
        padding: 24px 16px 32px;
    }

    .rhb-v2-times .rhb-v2-card-head {
        padding: 24px 16px 32px;
    }

    .rhb-v2-card-body,
    .rhb-v2-calendar .rhb-v2-card-body {
        padding: 24px 16px;
    }

    .rhb-v2 .rhb-person-option {
        flex: 0 0 calc((100% - 32px) / 3);
    }

    .rhb-v2 .ui-datepicker-calendar {
        width: calc(100% + 8px);
        margin: -8px -4px 0;
        border-spacing: 4px 8px;
    }

    .rhb-v2 .ui-datepicker-calendar th {
        font-size: 14px;
    }

    .rhb-v2 .ui-datepicker-calendar td a,
    .rhb-v2 .ui-datepicker-calendar td span {
        height: 38px;
        font-size: 12px;
    }

    .rhb-v2 .ui-datepicker-calendar td.rhb-v2-best a {
        border-width: 2px;
    }

    .rhb-v2 .RHBDateTime {
        padding: 20px 16px;
        font-size: 16px;
    }

    .rhb-v2-badge {
        font-size: 14px;
    }

    .rhb-v2-hint {
        font-size: 14px;
    }

    .rhb-v2-alt {
        flex-direction: column;
        align-items: stretch;
        padding: 24px 16px;
    }

    .rhb-v2-summary-foot {
        flex-direction: column;
        align-items: stretch;
    }

    .rhb-v2-summary-action,
    .rhb-v2-summary-action .rhb-v2-btn {
        width: 100%;
        text-align: center;
    }

    .rhb-v2 .modal-grid {
        grid-template-columns: 1fr;
        grid-template-areas: "headline" "description" "slots";
    }

    .rhb-v2 .modal-image {
        display: none;
    }

    .rhb-v2-bar:not([hidden]) {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 900;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        background: var(--rh-evergreen);
        color: var(--rh-pergament);
        box-shadow: 0 -4px 16px rgba(15, 19, 24, .25);
    }

    .rhb-v2-bar-text {
        display: flex;
        flex-direction: column;
        min-width: 0;
        font-size: 12px;
    }

    .rhb-v2-bar-text strong {
        font-size: 18px;
    }

    .rhb-v2-bar-text span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        opacity: .8;
    }

    .rhb-v2-bar .rhb-v2-btn {
        min-width: 0;
    }
}
