/* Reservation page */
body.reservation .site-main {
    max-width: 1240px;
    padding-top: var(--space-1);
    padding-bottom: var(--space-3);
}

body.reservation .reservation-layout {
    display: grid;
    grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.2fr);
    gap: var(--space-2);
    align-items: stretch;
}

body.reservation .booking-panel {
    background: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

body.reservation .booking-panel-form {
    display: flex;
    flex-direction: column;
    padding: var(--space-2);
}

body.reservation .booking-panel-slots {
    display: flex;
    flex-direction: column;
    padding: var(--space-2);
}

body.reservation .panel-heading {
    margin-bottom: var(--space-1);
}

body.reservation .panel-heading h2 {
    margin: 0;
    color: var(--color-heading);
    font-size: var(--font-size-lg);
    line-height: var(--line-tight);
}

body.reservation .panel-heading p {
    margin: var(--space-1) 0 0;
    color: var(--color-muted);
    font-size: var(--font-size-xs);
}

body.reservation .mobile-form-hint {
    display: none;
}

body.reservation .eyebrow {
    margin: 0 0 var(--space-1) !important;
    color: var(--color-primary) !important;
    font-size: var(--font-size-xs) !important;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

body.reservation .reservation-form {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: var(--space-1);
}

body.reservation .form-section {
    padding: 0.55rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

body.reservation .form-section h3,
body.reservation .custom-request-card h3,
body.reservation .slot-day-card h3 {
    margin: 0;
    color: var(--color-heading);
    font-size: var(--font-size-md);
    line-height: var(--line-tight);
}

body.reservation .form-section h3 {
    margin-bottom: var(--space-1);
}

body.reservation .reservation-form label {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-bottom: var(--space-1);
    color: var(--color-muted);
    font-size: var(--font-size-sm);
    font-weight: 700;
}

body.reservation .label-text {
    display: inline-flex;
    align-items: baseline;
    gap: 0.18rem;
}

body.reservation .field-label {
    margin-bottom: 0.2rem;
    color: var(--color-muted);
    font-size: var(--font-size-sm);
    font-weight: 700;
}

body.reservation .reservation-form label:last-child {
    margin-bottom: 0;
}

body.reservation .reservation-form input[type="text"],
body.reservation .reservation-form input[type="date"],
body.reservation .reservation-form input[type="email"],
body.reservation .reservation-form input[type="file"],
body.reservation .reservation-form select,
body.reservation .reservation-form textarea {
    width: 100%;
    min-height: 1.85rem;
    padding: 0.25rem var(--space-2);
    color: var(--color-text);
    background: var(--color-field);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md);
}

body.reservation .reservation-form textarea {
    min-height: 3.35rem;
}

body.reservation .form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-1);
}

body.reservation .form-row label {
    margin-bottom: 0;
}

body.reservation .selected-slot-card {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    margin-bottom: var(--space-1);
    padding: 0.35rem var(--space-2);
    color: var(--color-heading);
    background: var(--color-primary-soft);
    border: 1px solid rgba(88, 101, 242, 0.42);
    border-radius: var(--radius-md);
    font-size: var(--font-size-xs);
    font-weight: 800;
}

body.reservation .selected-slot-card span {
    color: var(--color-muted);
}

body.reservation .selected-slot-card strong {
    color: var(--color-heading);
}

body.reservation .field-hint {
    color: var(--color-muted);
    font-size: var(--font-size-xs);
    font-weight: 500;
}

body.reservation .required-marker {
    color: var(--color-primary);
    font-weight: 800;
}

body.reservation .location-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-1);
}

body.reservation .choice-card {
    display: flex !important;
    min-height: 1.9rem;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    padding: 0.2rem var(--space-2);
    color: var(--color-text) !important;
    background: var(--color-field);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: var(--font-size-xs) !important;
    font-weight: 800 !important;
    text-align: center;
    transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

body.reservation .choice-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

body.reservation .choice-card:hover,
body.reservation .choice-card:focus-within,
body.reservation .choice-card.is-selected {
    color: var(--color-heading) !important;
    background: var(--color-primary-soft);
    border-color: var(--color-primary);
}

body.reservation .choice-card:focus-within {
    box-shadow: var(--focus-ring);
}

body.reservation .location-detail {
    display: none;
    margin-top: var(--space-1);
    padding: var(--space-1) var(--space-2);
    color: var(--color-muted);
    background: var(--color-field);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
}

body.reservation .location-detail label {
    margin-top: var(--space-1);
}

body.reservation .avertissement {
    margin: 0;
    color: var(--color-warning);
    font-size: var(--font-size-xs);
}

body.reservation .reservation-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: auto;
    padding-top: var(--space-1);
}

body.reservation .reservation-actions button,
body.reservation .secondary-action {
    display: inline-flex;
    min-height: 2rem;
    align-items: center;
    justify-content: center;
    padding: 0 var(--space-5);
    color: var(--color-button-text);
    background: var(--color-primary);
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    font-weight: 800;
}

body.reservation .reservation-actions button:hover,
body.reservation .secondary-action:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
}

body.reservation .slot-feedback {
    margin-bottom: var(--space-1);
    padding: 0.35rem var(--space-2);
    color: var(--color-muted);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-xs);
}

body.reservation .slot-list {
    display: block;
}

body.reservation .slot-calendar-grid {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
}

body.reservation .slot-week-header,
body.reservation .slot-week-row {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.28rem;
}

body.reservation .slot-week-header {
    padding: 0 var(--space-1);
}

body.reservation .slot-week-header span {
    color: var(--color-muted);
    font-size: 0.66rem;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
}

body.reservation .slot-week-row {
    min-height: 4.65rem;
}

body.reservation .slot-day-card {
    min-width: 0;
    padding: 0.28rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

body.reservation .slot-day-heading {
    margin-bottom: 0.22rem;
}

body.reservation .slot-day-heading h3 {
    overflow: hidden;
    color: var(--color-heading);
    font-size: 0.66rem;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.reservation .slot-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.2rem;
}

body.reservation .slot-button {
    min-height: 1.38rem;
    padding: 0 0.25rem;
    color: var(--color-text);
    background: var(--color-field);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    font-size: 0.62rem;
    font-weight: 800;
    transition: transform 140ms ease, border-color 140ms ease, background-color 140ms ease;
}

body.reservation .slot-button:hover {
    transform: translateY(-1px);
    color: var(--color-heading);
    background: var(--color-surface-muted);
    border-color: var(--color-primary);
}

body.reservation .slot-button:focus-visible,
body.reservation .reservation-actions button:focus-visible,
body.reservation .secondary-action:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

body.reservation .slot-button.is-selected {
    color: var(--color-button-text);
    background: var(--color-primary);
    border-color: var(--color-primary);
}

body.reservation .slots-loading,
body.reservation .slots-empty {
    padding: var(--space-2);
    color: var(--color-muted);
    background: var(--color-surface);
    border: 1px dashed var(--color-border-strong);
    border-radius: var(--radius-lg);
    text-align: center;
}

body.reservation .custom-request-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-1);
    margin-top: var(--space-1);
    padding: var(--space-1) var(--space-2);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

body.reservation .custom-request-card p {
    margin: 0.15rem 0 0;
    color: var(--color-muted);
    font-size: var(--font-size-xs);
}

body.reservation .secondary-action {
    min-height: 1.9rem;
    padding: 0 var(--space-2);
    background: var(--color-surface-muted);
    border-color: var(--color-border-strong);
    white-space: nowrap;
}

body.reservation .secondary-action:hover {
    background: var(--color-border);
    border-color: var(--color-primary);
}

/*
 * Desktop: keep both columns the same height (the form is the stable reference)
 * and let the calendar fill that height. With 3 weeks the rows stretch to avoid a
 * void; with 4 weeks the calendar scrolls inside its panel instead of pushing the
 * layout taller. Scoped to >900px so the mobile stacked layout is untouched.
 */
@media (min-width: 901px) {
    /* The form defines the height (JS pins the slots panel to it); top-align so the
     * form keeps its natural height as the reference rather than being stretched. */
    body.reservation .reservation-layout {
        align-items: start;
    }

    body.reservation .booking-panel-slots {
        display: grid;
        grid-template-rows: auto auto minmax(0, 1fr) auto;
        min-height: 0;
    }

    body.reservation .slot-list {
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow-y: auto;
    }

    body.reservation .slot-calendar-grid {
        flex: 1 1 auto;
    }

    body.reservation .slot-week-row {
        flex: 1 1 auto;
    }

    /* Rows stretch to fill the column height, but the slot buttons stay anchored
     * at the top of each day card (their original alignment). */
    body.reservation .slot-day-card {
        display: flex;
        flex-direction: column;
    }

    body.reservation .slot-buttons {
        flex: 1 1 auto;
        align-content: start;
    }
}

@media (max-width: 900px) {
    body.reservation .reservation-layout {
        grid-template-columns: 1fr;
    }

    body.reservation .booking-panel-slots {
        order: -1;
    }
}

@media (max-width: 768px) {
    body.reservation .site-main {
        padding-right: var(--space-2);
        padding-left: var(--space-2);
    }

    body.reservation .reservation-layout {
        align-items: start;
        gap: var(--space-3);
    }

    body.reservation.reservation-js-ready .booking-panel-form:not(.is-visible) {
        display: none;
    }

    body.reservation .booking-panel-form,
    body.reservation .booking-panel-slots {
        padding: var(--space-3);
    }

    body.reservation .booking-panel-form.is-visible .mobile-form-hint {
        display: block;
    }

    body.reservation .booking-panel-form.is-visible .mobile-form-hint::before {
        content: "Créneau choisi. ";
        color: var(--color-success);
        font-weight: 800;
    }

    body.reservation .form-section {
        padding: var(--space-2);
    }

    body.reservation .reservation-form input[type="text"],
    body.reservation .reservation-form input[type="date"],
    body.reservation .reservation-form input[type="email"],
    body.reservation .reservation-form input[type="file"],
    body.reservation .reservation-form select,
    body.reservation .reservation-form textarea {
        min-height: 2.15rem;
    }

    body.reservation .form-row,
    body.reservation .location-options {
        grid-template-columns: 1fr;
    }

    body.reservation .slot-list {
        display: block;
    }

    body.reservation .slot-week-header {
        display: none;
    }

    body.reservation .slot-week-row {
        display: flex;
        min-height: 0;
        flex-direction: column;
        gap: var(--space-2);
    }

    body.reservation .slot-day-card {
        padding: var(--space-2);
    }

    body.reservation .slot-day-heading h3 {
        font-size: var(--font-size-sm);
    }

    body.reservation .slot-buttons {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.reservation .slot-button {
        width: 100%;
        min-height: 2.65rem;
        font-size: var(--font-size-sm);
    }

    body.reservation .custom-request-card {
        align-items: stretch;
        flex-direction: column;
    }

    body.reservation .secondary-action,
    body.reservation .reservation-actions button {
        width: 100%;
    }

}

@media (max-width: 390px) {
    body.reservation .slot-buttons {
        grid-template-columns: 1fr;
    }
}
