/*
 * The booking block, in whatever theme it lands in.
 *
 * It borrows the page's font and text colour, and takes one accent, --lb-accent,
 * from the theme's primary colour. Tints are mixed from currentColor, so the
 * block reads on a light or a dark section without knowing which it is on.
 * Logical properties throughout: the same rules serve Arabic.
 *
 * The tokens sit in :where(), so any theme rule on .lumen-booking beats them
 * wherever this file loads.
 */
:where(.lumen-booking) {
    --lb-accent: currentColor;
    --lb-on-accent: #fff;
    --lb-line: color-mix(in srgb, currentColor 18%, transparent);
    --lb-soft: color-mix(in srgb, currentColor 6%, transparent);
    --lb-muted: color-mix(in srgb, currentColor 66%, transparent);
    --lb-radius: 10px;
    --lb-radius-small: 8px;
}

.lumen-booking {
    padding-block: clamp(2.5rem, 6vw, 5rem);
    padding-inline: 16px;
    font-size: 1rem;
    line-height: 1.5;
}

.lumen-booking *,
.lumen-booking *::before,
.lumen-booking *::after {
    box-sizing: border-box;
}

.lumen-booking[hidden],
.lumen-booking [hidden] {
    display: none !important;
}

.lb-inner {
    display: grid;
    gap: 1.75rem;
    max-width: 44rem;
    margin-inline: auto;
}

.lb-head h2 {
    margin: 0 0 .5rem;
    font-size: clamp(1.6rem, 3.4vw, 2.3rem);
    line-height: 1.15;
}

.lb-head p {
    margin: 0;
    color: var(--lb-muted);
}

.lb-step {
    display: grid;
    gap: .875rem;
    min-width: 0;
    margin: 0 0 1.75rem;
    padding: 0;
    border: 0;
}

.lb-step > legend {
    margin-block-end: .75rem;
    padding: 0;
    font-size: 1.05rem;
    font-weight: 600;
}

.lb-alert {
    margin: 0;
    padding: .75rem 1rem;
    border: 1px solid var(--lb-line);
    border-inline-start: 3px solid var(--lb-accent);
    border-radius: var(--lb-radius);
    background: var(--lb-soft);
}

.lb-services {
    display: grid;
    gap: .625rem;
}

.lb-service {
    position: relative;
    display: block;
    cursor: pointer;
}

.lb-service input {
    position: absolute;
    opacity: 0;
}

.lb-service__body {
    display: grid;
    gap: .125rem;
    padding: .875rem 1rem;
    border: 1px solid var(--lb-line);
    border-radius: var(--lb-radius);
    transition: border-color .15s ease, background-color .15s ease;
}

.lb-service:hover .lb-service__body {
    background: var(--lb-soft);
}

.lb-service input:checked + .lb-service__body {
    border-color: var(--lb-accent);
    box-shadow: inset 0 0 0 1px var(--lb-accent);
}

.lb-service input:focus-visible + .lb-service__body {
    outline: 2px solid var(--lb-accent);
    outline-offset: 2px;
}

.lb-service__body span,
.lb-service__body small {
    color: var(--lb-muted);
}

.lb-cal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-block-end: .625rem;
}

.lb-cal__title::first-letter {
    text-transform: uppercase;
}

.lb-cal__nav {
    width: 44px;
    height: 44px;
    border: 1px solid var(--lb-line);
    border-radius: var(--lb-radius);
    background: none;
    color: inherit;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

[dir="rtl"] .lb-cal__nav {
    transform: scaleX(-1);
}

.lb-cal__nav:disabled {
    opacity: .35;
    cursor: default;
}

.lb-cal__grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
}

.lb-cal__weekday {
    padding-block: .25rem;
    color: var(--lb-muted);
    font-size: .75rem;
    text-align: center;
    text-transform: capitalize;
}

.lb-cal__day {
    height: clamp(40px, 7vw, 52px);
    border: 1px solid var(--lb-line);
    border-radius: var(--lb-radius-small);
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    transition: background-color .15s ease;
}

.lb-cal__day:disabled {
    border-color: transparent;
    color: var(--lb-muted);
    opacity: .5;
    cursor: default;
}

.lb-cal__day:not(:disabled):hover {
    background: var(--lb-soft);
}

.lb-cal__day[aria-pressed="true"],
.lb-slot[aria-pressed="true"] {
    border-color: var(--lb-accent);
    background: var(--lb-accent);
    color: var(--lb-on-accent);
}

.lb-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(5.25rem, 1fr));
    gap: .5rem;
    margin-block-start: 1rem;
}

.lb-note {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--lb-muted);
}

.lb-slot {
    display: grid;
    gap: 0;
    min-height: 44px;
    padding: .375rem .5rem;
    border: 1px solid var(--lb-line);
    border-radius: var(--lb-radius-small);
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.lb-slot small {
    font-size: .6875rem;
    opacity: .8;
}

.lb-slot:hover {
    background: var(--lb-soft);
}

.lb-slot[aria-pressed="true"]:hover {
    background: var(--lb-accent);
}

.lumen-booking :is(.lb-cal__nav, .lb-cal__day, .lb-slot, .lb-button, input, select, textarea):focus-visible {
    outline: 2px solid var(--lb-accent);
    outline-offset: 2px;
}

.lb-zone {
    margin: 0;
    color: var(--lb-muted);
    font-size: .8125rem;
}

.lb-chosen {
    margin: 0;
    font-weight: 600;
}

.lb-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .875rem;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.lb-field {
    display: grid;
    gap: .25rem;
    min-width: 0;
    font-size: .9375rem;
}

.lb-field label {
    display: grid;
    gap: .25rem;
}

.lb-field--full {
    grid-column: 1 / -1;
}

.lumen-booking :is(input:not([type="radio"], [type="checkbox"]), select, textarea) {
    width: 100%;
    min-height: 44px;
    padding: .5rem .75rem;
    border: 1px solid var(--lb-line);
    border-radius: var(--lb-radius-small);
    background: transparent;
    color: inherit;
    font: inherit;
}

.lb-check,
.lb-privacy label {
    display: flex;
    gap: .5rem;
    align-items: flex-start;
}

.lb-privacy {
    color: var(--lb-muted);
    font-size: .875rem;
}

.lb-privacy p {
    margin: 0;
}

.lb-error {
    color: #c0392b;
}

.lb-trap {
    position: absolute;
    inset-inline-start: -9999px;
}

.lb-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    margin-block-start: .5rem;
    padding: .625rem 1.5rem;
    border: 1px solid var(--lb-accent);
    border-radius: var(--lb-radius);
    background: var(--lb-accent);
    color: var(--lb-on-accent);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.lb-button:disabled {
    opacity: .6;
    cursor: progress;
}

.lb-button--quiet {
    background: none;
    border-color: var(--lb-line);
    color: inherit;
}

.lb-button--danger {
    border-color: #c0392b;
    background: #c0392b;
    color: #fff;
}

.lb-facts {
    display: grid;
    margin: 0;
    border-block-start: 1px solid var(--lb-line);
}

.lb-facts > div {
    display: grid;
    grid-template-columns: minmax(7rem, 1fr) 3fr;
    gap: 1rem;
    padding-block: .625rem;
    border-block-end: 1px solid var(--lb-line);
}

.lb-facts dt {
    color: var(--lb-muted);
}

.lb-facts dd {
    margin: 0;
}

.lb-status {
    display: inline-block;
    padding: .0625rem .625rem;
    border: 1px solid var(--lb-line);
    border-radius: 999px;
    font-size: .875rem;
}

.lb-status--confirmed {
    border-color: var(--lb-accent);
    font-weight: 600;
}

.lb-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .625rem;
}

.lb-actions:empty {
    display: none;
}

.lb-actions form {
    margin: 0;
}

.lb-push {
    display: grid;
    gap: .5rem;
    justify-items: start;
}

.lb-push .lb-button {
    margin-block-start: 0;
}

.lb-change {
    padding-block: .75rem;
    border-block-end: 1px solid var(--lb-line);
}

.lb-change summary {
    min-height: 28px;
    font-weight: 600;
    cursor: pointer;
}

.lb-change form {
    display: grid;
    gap: .75rem;
    margin-block-start: .875rem;
}

.lb-change p {
    margin: 0;
}

@media (max-width: 34rem) {
    .lb-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .lb-facts > div {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lumen-booking * {
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
