/*
 * MWFewoManager — Frontend
 *
 * @author Küstenweb GmbH <info@mwfewomanager.de>
 * @copyright mwfewomanager.de
 *
 * Buchungsbox der Objektseite als Blatt auf dem Telefon (bis 760 px).
 *
 * Auf dem Rechner bleibt die Box, wo sie ist; bis 760 px setzt das Skript der
 * Vorlage `reader/booking_form.html.twig` die Klassen `is-sheet` und `is-open`,
 * unten steht eine feste Leiste mit dem „ab“-Preis, ein Tipp öffnet die Box als
 * Blatt. Das Kreuz im Kopf der Box, der Griff und die Leiste gehören nur dazu;
 * ohne diese Datei standen sie am Rechner offen da (gemessen: das Kreuz neben
 * „ab 171,00 € / Nacht“).
 *
 * Warum eine eigene Datei: Die gleichen Regeln stehen in `area.css` des
 * frontend-core-Bundles. Instanzen mit dem Theme aus `files/layout/css` (die
 * kopierten Dateien aus `skeleton/css`) laden `area.css` nicht, und ein Update
 * ändert diese Kopien nicht. Dieses Bundle liefert die Regeln deshalb selbst
 * aus, mit den Tokens des Skeletons und Rückfallwerten.
 */

.booking-bar,
.booking-sheet__scrim,
.booking-sheet__close,
.booking-sheet__grip {
    display: none;
}

.booking-bar__info {
    display: grid;
    min-width: 0;
    line-height: 1.25;
}

.booking-bar__summary {
    color: var(--color-muted, #6b7280);
    font-size: 0.8125rem;
    font-weight: 400;
}

.booking-bar__summary:empty {
    display: none;
}

@media (max-width: 760px) {
    body.booking-sheet-lock {
        overflow: hidden;
    }

    body:has(.booking-bar:not([hidden])) {
        padding-bottom: 88px;
    }

    .booking-bar:not([hidden]) {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 800;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: var(--space-3, 0.75rem);
        padding: var(--space-3, 0.75rem) var(--space-4, 1rem) calc(var(--space-4, 1rem) + env(safe-area-inset-bottom, 0px));
        border-top: 1px solid var(--border-color, #e3e8ee);
        background: var(--color-surface, #fff);
        box-shadow: 0 -4px 16px color-mix(in srgb, var(--shadow-color, black) 10%, transparent);
    }

    .booking-bar__price {
        min-width: 0;
        font-weight: 500;
    }

    .booking-bar__open {
        flex: none;
        min-height: 44px;
    }

    .booking-sheet__scrim:not([hidden]) {
        position: fixed;
        inset: 0;
        z-index: 850;
        display: block;
        background: color-mix(in srgb, var(--shadow-color, black) 45%, transparent);
    }

    .accommodation-detail__booking-box.is-sheet {
        display: none;
    }

    .accommodation-detail__booking-box.is-sheet.is-open {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 860;
        display: grid;
        max-height: 94%;
        margin: 0;
        overflow-y: auto;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -12px 40px color-mix(in srgb, var(--shadow-color, black) 20%, transparent);
        padding-bottom: calc(var(--space-5, 1.25rem) + env(safe-area-inset-bottom, 0px));
    }

    .accommodation-detail__booking-box.is-sheet .accommodation-detail__booking-box-header {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: var(--space-3, 0.75rem);
    }

    .accommodation-detail__booking-box.is-sheet .accommodation-detail__booking-box-header .accommodation-detail__booking-box-title {
        display: block;
        flex: 1 1 auto;
        margin: 0;
        font-weight: 500;
    }

    .accommodation-detail__booking-box.is-sheet .booking-sheet__close {
        display: inline-flex;
        flex: none;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        margin-left: auto;
        border: 1px solid var(--border-color, #e3e8ee);
        border-radius: var(--radius-pill, 999px);
        background: var(--color-surface, #fff);
        color: inherit;
        cursor: pointer;
    }

    .accommodation-detail__booking-box.is-sheet .booking-sheet__close:focus-visible,
    .booking-bar__open:focus-visible {
        outline: 2px solid var(--color-primary, #0072ce);
        outline-offset: 2px;
    }

    .accommodation-detail__booking-box.is-sheet.is-open .booking-sheet__grip {
        display: block;
        width: 40px;
        height: 4px;
        margin: 0 auto var(--space-3, 0.75rem);
        border-radius: 4px;
        background: var(--border-color, #e3e8ee);
    }
}
