/* Map page layout — single source of truth (mobile sheet + desktop grid) */

#map-page:not(.hidden) {
    padding-top: var(--skibum-header-h, calc(4.5rem + env(safe-area-inset-top, 0)));
}

#map-page:not(.hidden) .map-page-shell {
    flex: 1 1 auto;
    min-height: 0;
    height: calc(100dvh - var(--skibum-header-h, calc(4.5rem + env(safe-area-inset-top, 0))));
    max-height: calc(100dvh - var(--skibum-header-h, calc(4.5rem + env(safe-area-inset-top, 0))));
    overflow: hidden;
}

#map-page .map-canvas-wrap {
    flex: 1 1 auto;
    min-height: 0;
}

#map-page .map-filters-panel {
    top: var(--skibum-header-h, calc(4.5rem + env(safe-area-inset-top, 0)));
    height: calc(100dvh - var(--skibum-header-h, calc(4.5rem + env(safe-area-inset-top, 0))));
    max-height: calc(100dvh - var(--skibum-header-h, calc(4.5rem + env(safe-area-inset-top, 0))));
    padding-top: 0;
    border-left: 1px solid rgba(229, 231, 235, 0.95);
}

#map-page .map-filters-panel.translate-x-0 {
    transform: translateX(0);
}

body.map-filters-sheet-open {
    overflow: hidden;
}

.map-layout-resort .map-canvas-wrap {
    min-height: 42vh;
}

.map-layout-resort #map-carousel-section {
    max-height: min(9.5rem, 22vh);
}

.map-layout-browse #map-carousel-section {
    max-height: min(13.5rem, 30vh);
}

#map-carousel-section {
    overflow: hidden;
}

@media (max-width: 1279px) {
    #map-page:not(.hidden) {
        display: flex;
        flex-direction: column;
    }
}

@media (min-width: 1280px) {
    #map-page:not(.hidden) {
        display: grid;
        grid-template-columns: minmax(0, 1fr) var(--app-map-filter-width, min(22rem, 28vw));
        height: calc(100dvh - var(--skibum-header-h, calc(4.5rem + env(safe-area-inset-top, 0))));
        max-height: calc(100dvh - var(--skibum-header-h, calc(4.5rem + env(safe-area-inset-top, 0))));
        overflow: hidden;
    }

    #map-page .map-page-shell {
        display: flex;
        flex-direction: column;
        grid-column: 1;
        grid-row: 1;
        min-height: 0;
        height: 100%;
        max-height: 100%;
    }

    #map-page .map-filters-panel {
        grid-column: 2;
        grid-row: 1;
        position: relative !important;
        top: auto !important;
        right: auto !important;
        transform: none !important;
        width: 100% !important;
        max-width: none !important;
        height: 100%;
        max-height: none;
        box-shadow: none;
    }

    #map-page .map-filters-panel.translate-x-full {
        transform: none !important;
    }

    #map-page .map-filters-overlay {
        display: none !important;
    }

    #map-page #map-filters-btn {
        display: none;
    }

    #map-page #map-toolbar-pass-row {
        display: none;
    }
}
