/* The booking block of the appointment module on the site (see blocks/booking/views/booking.php): the fields use
   the form classes of the site; this is what the module adds, built on the tokens of the site. */

/* The booking is a column in the middle of the page, no wider than the text of a post. */
.booking {
    max-width: 50rem;
    margin: 0 auto;
}

.booking-header {
    margin-bottom: var(--space-4);
}

.booking-step-title {
    margin-bottom: var(--space-3);
}

.booking-group {
    margin: var(--space-4) 0 var(--space-2);
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* "Back", a quiet link above the step. */
.booking-back {
    margin-bottom: var(--space-3);
    padding: 0;
    border: 0;
    background: none;
    color: var(--color-link);
    font: inherit;
    cursor: pointer;
}

.booking-back:hover {
    color: var(--color-link-hover);
}

/* A service or a member of the staff to pick: a framed row, the radio hidden from sight only. */
.booking-options {
    display: grid;
    gap: var(--space-2);
}

.booking-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-background);
    cursor: pointer;
    transition: border-color 0.15s;
}

.booking-option[hidden] {
    display: none;
}

.booking-option:hover,
.booking-option:has(input:checked) {
    border-color: var(--color-primary);
}

.booking-option:has(input:focus-visible) {
    box-shadow: 0 0 0 3px var(--color-focus);
}

.booking-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.booking-option-body {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.booking-option-name {
    font-weight: 600;
}

.booking-option-text {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

.booking-option-aside {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    white-space: nowrap;
}

.booking-option-aside strong {
    color: var(--color-text);
    font-size: var(--font-size);
}

.booking-option-photo img {
    display: block;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    object-fit: cover;
}

/* The days with a free time, in a row that scrolls sideways, and the times of the day picked under them. */
.booking-days {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-2);
    overflow-x: auto;
}

.booking-day,
.booking-time {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-background);
    color: var(--color-text);
    font: inherit;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
}

.booking-day {
    display: flex;
    flex: none;
    flex-direction: column;
    align-items: center;
    min-width: 4rem;
    padding: var(--space-2);
    font-size: var(--text-sm);
}

.booking-day strong {
    font-size: var(--text-xl);
}

.booking-times {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(5rem, 1fr));
    gap: var(--space-2);
}

.booking-time {
    padding: var(--space-2);
}

.booking-day:hover,
.booking-time:hover {
    border-color: var(--color-primary);
}

.booking-day.is-selected {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: var(--color-primary-contrast);
}

/* What was picked, above the details. */
.booking-summary {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius);
    background: var(--color-surface);
}

/* A field that has to be filled in, marked after its label. */
.booking .required .control-label::after {
    content: " *";
    color: var(--color-primary);
}

.booking .help-block:empty {
    display: none;
}

.booking button[disabled] {
    opacity: 0.6;
    cursor: wait;
}

/* What the client reads once the booking is sent, and what the editor reads while nothing can be booked. */
.booking-success,
.booking-note {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius);
    background: var(--color-surface);
}

.booking-success {
    border-left: 4px solid var(--color-primary);
}

.booking-note {
    color: var(--color-text-muted);
    text-align: center;
}
