/* Gudok map: responsive layout based on the 360px mobile design.
   These rules do not alter the kiosk desktop interface or routing geometry. */
.map__mobileFilter,
.map__mobileSidebarHead,
.map__mobileBackdrop { display: none; }

@media (max-width: 1199px) {
    html, body { width: 100%; height: 100%; overflow: hidden; }
    .map {
        display: block;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        min-height: 0;
        overflow: hidden;
        --map-canvas-safe-left: 12px;
        --map-canvas-safe-right: 12px;
        /* The map canvas is full-screen. Safe offsets now serve only to keep
           its INITIAL fit in the same central region as the previous layout. */
        --map-canvas-safe-top: 179px;
        --map-canvas-safe-bottom: 172px;
        --map-canvas-fit-scale: .96;
        background: #f0f0f0;
    }
    .map__main { position: absolute; inset: 0; height: 100%; overflow: hidden; }
    .map_controls { position: absolute; inset: 0; height: 100%; width: 100%; }
    .map_controlsLeft, .map_controlsRight {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        z-index: 45;
        pointer-events: none;
    }
    .map_controlsRight { z-index: 44; }

    /* Search and category filter: the only controls above the map itself. */
    .map__search {
        position: absolute;
        left: 20px;
        right: 20px;
        top: max(30px, env(safe-area-inset-top));
        width: auto;
        height: 54px;
        margin: 0;
        z-index: 65;
    }
    .map__searchPanel { position: absolute; inset: 0 auto auto 0; width: 100%; max-width: 100%; }
    .map__searchInputWrap { width: 100%; max-width: none; margin: 0; overflow: visible; }
    .map__searchInputWrap input {
        width: 100%;
        height: 55px;
        padding: 0 52px 0 27px;
        font-size: 16px;
        font-weight: 500;
        border-width: 2px;
        border-radius: 30px;
        touch-action: manipulation;
    }
    .map__searchInputWrap button { right: 18px; width: 21px; height: 21px; }
    /* Search suggestions float below the input, narrower than the search bar.
       Keep a dedicated scroll area inside the white card (mobile PSD). */
    .map__searchBody {
        position: absolute;
        left: max(20px, calc((100% - 360px) / 2));
        right: auto;
        top: 60px;
        width: min(calc(100% - 40px), 360px);
        max-width: none;
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
        z-index: 75;
    }
    .map__searchSuggest {
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        width: 100%;
        height: auto;
        min-height: 0;
        /* Grow only with content. Scroll results only once this cap is reached. */
        max-height: min(395px, calc(100dvh - 150px));
        padding: 30px 24px 30px 30px;
        background: #fff;
        border: 2px solid #b9b9b9;
        border-radius: 25px;
        box-shadow: 0 5px 13px rgba(0, 0, 0, .13);
        overflow: hidden;
    }
    .map__searchSuggestList {
        box-sizing: border-box;
        width: 100%;
        min-height: 0;
        max-height: none;
        /* Natural list height for a few matches; shrink into a scroller for many. */
        flex: 0 1 auto;
        gap: 16px;
        padding: 0 7px 0 0;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        scrollbar-color: #999 #eeeeee;
        -webkit-overflow-scrolling: touch;
    }
    .map__searchSuggestItem,
    .map__searchSuggestCategory {
        flex: 0 0 auto;
        width: 100%;
        min-width: 0;
        gap: 3px;
        text-align: left;
    }
    .map__searchSuggestCategory { display: flex; flex-direction: column; }
    .map__searchSuggestItemTitle { font-size: 15px; line-height: 1.3; }
    .map__searchSuggestItemFloor { font-size: 14px; line-height: 1.3; }
    .map__searchSuggestEmpty { padding: 4px 0; font-size: 13px; }
    .map__searchSuggestList:empty::before { font-size: 12px; max-width: 100%;}
    .map__searchSuggestList::-webkit-scrollbar { width: 4px; }
    .map__searchSuggestList::-webkit-scrollbar-track { background: #eee; border-radius: 3px; }
    .map__searchSuggestList::-webkit-scrollbar-thumb { background: #999; border-radius: 3px; }
    .map__searchInputWrap .map__searchSubmit { opacity: .55; }
    .map__keyboardWrapper { display: none !important; }
    /* The mockup has no purple X inside the search field. Tapping outside
       still dismisses results through the existing document handler. */
    .map__searchCloseBtn.closeBtn { display: none !important; }

    .map__mobileFilter {
        position: absolute;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
        top: max(110px, calc(env(safe-area-inset-top) + 76px));
        left: 20px;
        right: 20px;
        height: 57px;
        width: calc(100% - 40px);
        background: #fff;
        color: #303030;
        box-shadow: 0 5px 16px rgba(0,0,0,.13);
        border-radius: 14px;
        font-size: 15px;
        font-weight: 700;
        z-index: 55;
        pointer-events: auto;
        padding: 0 24px;
    }
    .map__mobileFilterIcon {
        position: relative;
        display: block;
        flex: 0 0 34px;
        width: 34px;
        height: 34px;
        border-radius: 50%;
        background: #d93678;
    }
    .map__mobileFilterIcon::after {
        content: '';
        position: absolute;
        inset: 8px;
        background: #fff;
        -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath stroke='black' stroke-width='2' stroke-linecap='round' d='M3 6h18M3 12h18M3 18h18'/%3E%3Ccircle fill='black' cx='9' cy='6' r='3'/%3E%3Ccircle fill='black' cx='16' cy='12' r='3'/%3E%3Ccircle fill='black' cx='8' cy='18' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath stroke='black' stroke-width='2' stroke-linecap='round' d='M3 6h18M3 12h18M3 18h18'/%3E%3Ccircle fill='black' cx='9' cy='6' r='3'/%3E%3Ccircle fill='black' cx='16' cy='12' r='3'/%3E%3Ccircle fill='black' cx='8' cy='18' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
    }

    /* The 2D/3D SVG remains the real interactive map, not a bitmap. */
    .map__placeholder {
        inset: 0;
        width: 100%;
        height: 100%;
        z-index: 1;
        overflow: hidden;
        /* Only actual floating controls intercept touches; empty areas remain
           part of the interactive SVG (also under search and bottom buttons). */
    }
    .map__placeholder #floors,
    .map__placeholder #floors3d {
        width: 100%;
        height: 100%;
        pointer-events: auto;
        touch-action: none;
    }
    .map__placeholder #floors .floor > svg,
    .map__placeholder #floors3d .floor3d > svg {
        pointer-events: auto;
        touch-action: none;
    }

    .map__floors {
        position: absolute;
        top: 50%;
        left: 17px;
        right: auto;
        width: 42px;
        padding: 3px;
        gap: 0;
        transform: translateY(-51%);
        border-radius: 26px;
    }
    .map__floorBtn { min-height: 37px; height: 37px; aspect-ratio: auto; padding: 2px 0; }
    .map__floorBtnStage { font-size: 17px; }
    .map__floorBtnTitle { font-size: 8px; }
    .map__home {
        position: absolute;
        top: calc(50% - 61px);
        right: 17px;
        width: 40px;
        height: 40px;
        background-size: 18px;
        transform: none;
    }
    .map__zoom {
        position: absolute;
        top: calc(50% - 11px);
        right: 17px;
        width: 40px;
        padding: 2px;
        gap: 0;
        transform: none;
        border-radius: 22px;
    }
    .map__zoomBtn {
        position: relative;
        height: 34px;
        aspect-ratio: auto;
    }
    /* One consistent thin-line icon style for both controls. */
    .map__zoomBtn--in,
    .map__zoomBtn--in:active,
    .map__zoomBtn--out,
    .map__zoomBtn--out:active {
        background-image: none;
    }
    .map__zoomBtn::before,
    .map__zoomBtn--in::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 16px;
        height: 2px;
        border-radius: 2px;
        background: #383838;
        transform: translate(-50%, -50%);
        pointer-events: none;
    }
    .map__zoomBtn--in::after {
        transform: translate(-50%, -50%) rotate(90deg);
    }
    .map__dev { display: none; }

    .map__viewSwitch {
        position: absolute;
        bottom: calc(120px + env(safe-area-inset-bottom));
        left: 50%;
        z-index: 48;
        gap: 12px;
        transform: translateX(-50%);
    }
    .map__viewBtn--2d { order: 1; }
    .map__viewBtn--3d { order: 2; }
    .map__viewBtn {
        width: 43px;
        height: 43px;
        border-width: 4px;
        font-size: 14px;
        box-shadow: none;
    }
    .map__manage {
        position: absolute;
        left: 12px;
        right: 12px;
        bottom: calc(30px + env(safe-area-inset-bottom));
        z-index: 48;
        transform: none;
        width: auto;
        gap: 3px;
        justify-content: space-between;
        align-items: flex-start;
    }
    .map__manageBtn { width: 20%; min-width: 0; gap: 6px; }
    .map__manageBtnIcon { width: 42px; height: 42px; border-width: 1.5px; filter: none; }
    .map__manageBtnIcon::after { inset: 9px; }
    .map__manageBtnTitle { font-size: 11px; line-height: 1.12; white-space: normal; }

    /* Full-screen mobile catalogue. The original category buttons and the
       original submenu remain intact; JS only moves the submenu below the
       selected category for the expanded, inline layout. */
    .map__mobileBackdrop { display: none !important; }
    .map__sidebar {
        position: fixed;
        inset: 0;
        z-index: 120;
        display: flex;
        flex-direction: column;
        box-sizing: border-box;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        padding: max(82px, calc(env(safe-area-inset-top) + 65px)) 0 calc(20px + env(safe-area-inset-bottom));
        overflow: hidden;
        background: #ededed;
        box-shadow: none;
        opacity: 0;
        transform: translateY(14px);
        transition: opacity .22s ease, transform .22s ease, visibility .22s;
        visibility: hidden;
        pointer-events: none;
    }
    .map--mobile-categories-open .map__sidebar {
        opacity: 1;
        transform: translateY(0);
        visibility: visible;
        pointer-events: auto;
    }
    .map__mobileSidebarHead {
        position: absolute;
        top: calc(10px + env(safe-area-inset-top));
        right: max(12px, env(safe-area-inset-right));
        display: block;
        width: 52px;
        height: 52px;
        margin: 0;
        padding: 0;
        min-height: 0;
    }
    .map__mobileSidebarHead > span { display: none; }
    .map__mobileSidebarClose {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        width: 52px;
        height: 52px;
        padding: 4px 2px;
        border-radius: 11px;
        background: #818181;
        color: #ffffff;
        font-size: 0;
        line-height: 0;
        font-weight: 300;
        white-space: nowrap;
        pointer-events: auto;
    }
    .map__mobileSidebarClose::after {
        content: 'Закрыть';
        display: block;
        margin-top: 0;
        font-size: 9px;
        line-height: 11px;
        font-weight: 700;
    }
    .map__mobileSidebarClose::before {
        content: '';
        flex: none;
        width: 13px;
        height: auto;
        aspect-ratio: 1;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' fill='none' viewBox='0 0 13 13'%3E%3Cpath fill='%23fff' d='M11.52.254a.867.867 0 1 1 1.226 1.225L7.726 6.5l5.02 5.02a.867.867 0 0 1-1.225 1.226L6.5 7.726l-5.02 5.02a.867.867 0 0 1-1.226-1.225L5.274 6.5.254 1.48A.867.867 0 1 1 1.479.253L6.5 5.274z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: center;
        background-size: contain;
        margin-bottom: 5px;
    }
    .map__sidebar > .map__scroll { display: none !important; }
    .map__menu {
        flex: 1 1 auto;
        /* Keep category cards at their existing width. Give their shadows a
           gutter INSIDE the scrollport so overflow-y: auto doesn't clip them. */
        box-sizing: border-box;
        width: min(calc(79% + 28px), 398px);
        min-width: 0;
        min-height: 0;
        margin: 0 auto;
        padding: 10px 14px 22px;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        touch-action: pan-y;
        scrollbar-width: thin;
        scrollbar-color: #c9c9c9 transparent;
    }
    .map__menuShadowLayer { display: none !important; }
    .map__menuTrack {
        display: flex;
        flex-direction: column;
        width: 100%;
        height: auto;
        min-height: 0;
        margin: 0;
        gap: 8px;
        transform: none !important;
        will-change: auto;
    }
    .map__menuItem {
        display: block;
        flex: 0 0 auto;
        width: 100%;
        height: auto;
        min-height: 0;
        margin: 0;
        padding: 0;
        overflow: visible;
        background: transparent;
        border-radius: 12px;
        filter: none;
    }
    .map__menuItem.is-clone, .map__submenuItem.is-clone { display: none !important; }
    .map__menuBtn {
        display: flex;
        align-items: center;
        width: 100%;
        height: 62px;
        min-height: 62px;
        gap: 11px;
        padding: 8px 11px;
        border-radius: 12px;
        background: #fff;
        box-shadow: 0 5px 12px rgba(0,0,0,.10);
        font-size: 15px;
        line-height: 1.17;
        font-weight: 700;
        text-align: left;
    }
    .map__menuItem.active .map__menuBtn {
        background: var(--category-color);
        color: #fff;
    }
    .map__menuIcon {
        flex: 0 0 34px;
        width: 34px;
        height: 34px;
    }
    .map__menuIconImg { inset: 7px; width: 20px; height: 20px; }
    .map__menuTitle { min-width: 0; }

    /* The submenu is moved into .map__menuItem.active on narrow screens,
       so it opens directly BELOW its category instead of a separate drawer. */
    .map__submenu {
        position: relative;
        display: none;
        inset: auto;
        top: auto;
        right: auto;
        bottom: auto;
        left: auto;
        z-index: 1;
        width: calc(100% - 20px);
        height: min(320px, 43dvh);
        min-height: 185px;
        max-height: 360px;
        margin: 6px auto 5px;
        padding: 0;
        border: 2px solid #873aff;
        border-radius: 13px;
        background: #fff;
        box-shadow: none;
        transform: none !important;
        transition: none;
        overflow: hidden;
    }
    .map__menuItem.active > .map__submenu.active {
        display: flex;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    .map__submenuPanel {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        height: 100%;
        min-height: 0;
        padding: 25px 9px;
    }
    .map__submenuMenu {
        flex: 1 1 auto;
        width: 100%;
        min-height: 0;
        margin: 0;
        padding: 0 7px;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        touch-action: pan-y;
        scrollbar-color: #c5c5c5 #f2f2f2;
        scrollbar-width: thin;
    }
    .map__submenuMenu::-webkit-scrollbar { width: 4px; }
    .map__submenuMenu::-webkit-scrollbar-thumb { background: #c5c5c5; border-radius: 6px; }
    .map__submenuTrack {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        height: auto !important;
        min-height: 0;
        margin: 0;
        padding: 0;
        gap: 8px !important;
        transform: none !important;
        will-change: auto;
    }
    .map__submenuItem { flex: 0 0 auto; height: auto; min-height: 43px; }
    .map__submenuBtn { min-height: 43px; height: auto; padding: 4px 5px; font-size: 15px; line-height: 1.2; }
    .map__submenuFloor { font-size: 14px; margin-top: 3px; }
    .map__submenuScroll, .map__submenuClose.closeBtn { display: none !important; }

    /* Mobile shop card: full-width bottom sheet, matching the 360px design.
       The map stays interactive outside the card. Desktop layouts are intact. */
    .map__shopModal {
        position: fixed;
        inset: auto 0 0;
        display: flex;
        align-items: flex-end;
        justify-content: stretch;
        width: 100%;
        max-width: 100%;
        z-index: 100;
    }
    .map__shopModalInner,
    .map__shopModal.is-summary .map__shopModalInner,
    .map__shopModal.is-details .map__shopModalInner {
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 13px 13px 0 0;
        box-shadow: 0 -4px 18px rgba(0,0,0,.12);
        filter: none;
    }
    .map__shopModal.is-summary .map__shopModalInner {
        position: relative;
        max-height: none;
        padding: 32px 22px calc(40px + env(safe-area-inset-bottom));
        overflow: visible; /* allow the close control to overlap the top edge */
    }
    .map__shopModal.is-details .map__shopModalInner {
        position: relative;
        display: flex;
        flex-direction: column;
        max-height: min(87dvh, 720px);
        padding: 31px 22px calc(30px + env(safe-area-inset-bottom));
        overflow: visible;
    }
    /* Identical to the 52x52 close button in the category menu. */
    .map__shopModalClose.closeBtn {
        box-sizing: border-box;
        top: -14px;
        right: 18px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-end;
        gap: 0;
        width: 52px;
        height: 52px;
        min-width: 52px;
        min-height: 52px;
        padding: 0 2px 10px;
        aspect-ratio: 1;
        border-radius: 11px;
        background: #818181;
        color: #fff;
        font-size: 9px;
        line-height: 11px;
        font-weight: 700;
        white-space: nowrap;
    }
    .map__shopModalClose.closeBtn::before,
    .map__shopModalClose.closeBtn::after {
        content: '';
        position: absolute;
        top: 17px;
        left: 16px;
        width: 20px;
        height: 2px;
        border-radius: 2px;
        background: #fff;
    }
    .map__shopModalClose.closeBtn::before { transform: rotate(45deg); }
    .map__shopModalClose.closeBtn::after { transform: rotate(-45deg); }
    /* The close control overlaps the top of the details sheet like the mockup.
       Only the details body scrolls, so this control is never clipped. */
    .map__shopModal.is-details .map__shopModalClose.closeBtn {
        top: -14px;
        right: 12px;
        z-index: 3;
    }
    .map__shopPhotoModalClose.closeBtn {
        top: 5px;
        right: 6px;
        width: 36px;
        height: 36px;
        padding: 0;
        font-size: 0;
        border-radius: 50%;
    }
    .map__shopPhotoModalClose.closeBtn::before,
    .map__shopPhotoModalClose.closeBtn::after {
        left: 10px;
        top: 17px;
        width: 16px;
        height: 2px;
    }
    .map__shopModalTitle {
        padding-right: 38px;
        font-size: clamp(23px, 5.6vw, 30px);
        line-height: 1.2;
    }
    .map__shopModal.is-summary .map__shopModalTitle {
        margin-bottom: 27px;
    }
    .map__shopModal.is-summary .map__shopModalSummary {
        align-items: center;
        gap: 12px;
    }
    .map__shopModal.is-summary .map__shopModalRouteBtn,
    .map__shopModal.is-summary .map__shopModalDescriptionBtn,
    .map__shopModal.is-details .map__shopModalRouteBtn {
        box-sizing: border-box;
        width: min(100%, clamp(220px, 60vw, 300px));
        max-width: 100%;
        height: 45px;
        min-height: 45px;
        margin: 0 auto;
        padding: 0 10px;
        border-radius: 8px;
        gap: 9px;
        font-size: 14px;
        line-height: 1.2;
        white-space: nowrap;
    }
    .map__shopModal.is-summary .map__shopModalRouteBtn::after,
    .map__shopModal.is-details .map__shopModalRouteBtn::after {
        flex: none;
        width: 21px;
        height: 21px;
    }
    .map__shopModal.is-summary .map__shopModalDescriptionBtn::after {
        flex: none;
        width: 22px;
        height: 16px;
    }
    .map__shopModalInfo { display: block; }
    .map__shopModalInfoLeft, .map__shopModalInfoRight { font-size: 13px; }
    .map__shopModalTags { flex-wrap: wrap; }
    .map__shopModalText { font-size: 14px; line-height: 1.4; }
    .map__shopModalRouteBtn, .map__shopModalDescriptionBtn { max-width: 100%; }
    /* Expanded shop details: compact phone design, independently of the
       summary card and without changing desktop kiosk typography. */
    .map__shopModal.is-details .map__shopModalTitle {
        margin: 0 0 19px;
        padding-right: 58px;
        font-size: 23px;
        line-height: 1.2;
        overflow-wrap: anywhere;
    }
    .map__shopModal.is-details .map__shopModalDetails {
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        scrollbar-color: #cecece transparent;
    }
    .map__shopModal.is-details .map__shopModalInfo {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: start;
        gap: 8px 11px;
        margin: 0 0 17px;
    }
    .map__shopModal.is-details .map__shopModalInfo.is-left-empty,
    .map__shopModal.is-details .map__shopModalInfo.is-right-empty {
        grid-template-columns: minmax(0, 1fr);
    }
    .map__shopModal.is-details .map__shopModalInfoLeft,
    .map__shopModal.is-details .map__shopModalInfoRight {
        min-width: 0;
        gap: 7px;
        font-size: 12px;
    }
    .map__shopModal.is-details .map__shopModalInfoItem,
    .map__shopModal.is-details .map__shopModalPhone,
    .map__shopModal.is-details .map__shopModalSite {
        box-sizing: border-box;
        min-width: 0;
        padding-left: 18px;
        font-size: 14px;
        font-weight: 600;
        line-height: 1.4;
        overflow-wrap: anywhere;
        text-decoration: none;
    }
    .map__shopModal.is-details .map__shopModalSite {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow-wrap: normal;
    }
    .map__shopModal.is-details .map__shopModalInfoItem::before,
    .map__shopModal.is-details .map__shopModalPhone::before,
    .map__shopModal.is-details .map__shopModalSite::before {
        top: 2px;
        left: 0;
        width: 13px;
        height: 13px;
        background-size: contain;
    }
    .map__shopModal.is-details .map__shopModalTags {
        display: flex;
        flex-wrap: wrap;
        gap: 6px 8px;
        margin: 0 0 19px;
    }
    .map__shopModal.is-details .map__shopModalTag {
        min-height: 27px;
        padding: 5px 9px;
        border-radius: 5px;
        font-size: 12px;
        font-weight: 500;
        line-height: 1.25;
    }
    .map__shopModal.is-details .map__shopModalText {
        max-width: 100%;
        margin: 0 0 23px;
        font-size: 13px;
        font-weight: 400;
        line-height: 1.5;
        -webkit-line-clamp: 5;
        line-clamp: 5;
    }
    .map__shopModal.is-details .map__shopModalRouteBtn {
        margin: 0 auto;
        width: min(100%, clamp(215px, 60vw, 300px));
        height: 45px;
        min-height: 45px;
        font-size: 13px;
    }
    .map__shopModal.is-details .map__shopModalGallery {
        margin-bottom: 18px;
    }
    .map__shopModalGallery { max-width: 100%; }
    .map__shopModalGalleryViewport { max-width: 100%; }
    .map__shopModalGalleryArrow { width: 34px; height: 34px; }
    .map__shopModalGalleryArrow--prev { left: -8px; }
    .map__shopModalGalleryArrow--next { right: -8px; }
    .map__shopPhotoModal { inset: 12px; z-index: 121; }
    .map__shopPhotoModalInner { width: 100%; max-height: 90dvh; overflow: auto; padding: 35px 18px 25px; }
    .map__shopPhotoModalTitle { font-size: 20px; margin-bottom: 15px; }
    .map__shopPhotoModalArrow { width: 36px; height: 36px; }
    .map__shopPhotoModalArrow--prev { left: -8px; }
    .map__shopPhotoModalArrow--next { right: -8px; }

    /* Mobile route preview: a compact bottom sheet with horizontally swipable
       floor cards. Never change the shared desktop route layout. */
    .map__route {
        position: absolute;
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        box-sizing: border-box;
        width: 100%;
        height: auto;
        max-height: min(60dvh, 340px);
        z-index: 82;
        overflow: visible;
        border-radius: 16px 16px 0 0;
        background: #fff;
        box-shadow: 0 -4px 16px rgba(0, 0, 0, .07);
        transform: translateY(15px);
    }
    .map__route.active { transform: translateY(0); }
    /* Keep the view switch in its normal, unchanged position. The sheet may
       cover it while the route is open: it must not jump on top of the map. */
    .map:has(.map__route.active) .map__viewSwitch {
        bottom: calc(120px + env(safe-area-inset-bottom));
        z-index: 48;
    }
    .map:has(.map__route.active) .map__manage { display: none; }
    .map__routePanel {
        box-sizing: border-box;
        width: 100%;
        height: auto;
        max-height: inherit;
        padding: 30px 0 20px;
        overflow: visible;
    }
    .map__routeTitle {
        margin: 0 18px 7px;
        padding: 0 56px 0 0;
        font-size: 20px;
        line-height: 1.2;
    }
    .map__routeText {
        margin: 0 18px;
        padding: 0 35px 0 0;
        font-size: 13px;
        line-height: 1.35;
    }
    .map__routeClose.closeBtn {
        position: absolute;
        z-index: 6;
        top: -16px;
        right: 10px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-end;
        gap: 0;
        box-sizing: border-box;
        width: 52px;
        height: 52px;
        padding: 0 2px 11px;
        border-radius: 11px;
        background: #818181;
        color: #fff;
        font-size: 9px;
        line-height: 1;
        font-weight: 700;
        transform: none;
    }
    .map__routeClose.closeBtn::before,
    .map__routeClose.closeBtn::after {
        top: 19px;
        left: 17px;
        width: 18px;
        height: 2px;
        border-radius: 2px;
    }
    .map__routeList {
        display: flex;
        flex-flow: row nowrap;
        align-items: stretch;
        box-sizing: border-box;
        position: relative;
        gap: 14px;
        width: 100%;
        margin: 11px 0 0;
        padding: 7px 18px 17px;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-padding-inline: 18px;
        scroll-snap-type: x mandatory;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x;
        scrollbar-width: none;
    }
    .map__routeList::-webkit-scrollbar { display: none; }
    .map__routeList::before { content: none; display: none; }
    /* Transition copy is redundant in the mobile horizontal preview: each
       actionable floor is already an independently selectable route card. */
    .map__routeTransition { display: none !important; }
    .map__routeStep {
        box-sizing: border-box;
        flex: 0 0 clamp(188px, 56vw, 246px);
        width: clamp(188px, 56vw, 246px);
        min-height: 112px;
        height: auto;
        padding: 16px 17px;
        border-radius: 14px;
        filter: none;
        box-shadow: 0 6px 13px rgba(0, 0, 0, .11);
        scroll-snap-align: start;
        scroll-snap-stop: always;
    }
    .map__routeStep::before { content: none; display: none; }
    .map__routeFloor {
        min-width: 76px;
        height: 28px;
        margin-bottom: 9px;
        padding: 2px 10px;
        font-size: 12px;
        line-height: 1.1;
    }
    .map__routeStepTitle {
        font-size: 15px;
        line-height: 1.25;
    }
    .map__routeError {
        flex: 1 0 100%;
        margin: 0;
    }
    .map__routeError { font-size: 13px; padding: 12px; }
}

@media (min-width: 700px) and (max-width: 1199px) {
    .map__search { left: 6%; right: 6%; }
    .map__mobileFilter { left: 6%; width: 88%; }
    .map { --map-canvas-safe-top: 182px; --map-canvas-safe-bottom: 185px; }
    .map__manage { left: 14%; right: 14%; bottom: 30px; }
    .map__viewSwitch { bottom: 120px; }
    .map__floors { left: 25px; width: 54px; }
    .map__floorBtn { min-height: 46px; height: 46px; }
    .map__floorBtnStage { font-size: 21px; }
    .map__home, .map__zoom { right: 25px; width: 54px; }
    /* 54px home + 12px gap + 94px zoom group, centered as one unit. */
    .map__home { top: calc(50% - 80px); height: 54px; background-size: 21px; }
    .map__zoom { top: calc(50% - 14px); }
    .map__zoomBtn { height: 45px; }
    .map__viewBtn { width: 54px; height: 54px; font-size: 16px; }
    .map__manageBtnIcon { width: 54px; height: 54px; }
    .map__manageBtnTitle { font-size: 12px; }
    .map__searchInputWrap input { font-size: 18px; }
}

@media (max-width: 399px) {
    .map__manage { left: 6px; right: 6px; }
    .map__manageBtnTitle { font-size: 11px; }
    .map__manageBtnIcon { width: 40px; height: 40px; }
}

@media (max-width: 1199px) and (max-height: 620px) {
    .map__search { top: 10px; }
    .map__mobileFilter { top: 72px; height: 49px; }
    .map { --map-canvas-safe-top: 138px; --map-canvas-safe-bottom: 133px; }
    .map__viewSwitch { bottom: 110px; }
    .map__manage { bottom: 30px; }
    .map__manageBtnIcon { width: 35px; height: 35px; }
    .map__manageBtnTitle { font-size: 10px; }
    .map__viewBtn { width: 36px; height: 36px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) and (max-width: 1199px) {
    .map__sidebar, .map__submenu, .map__route { transition-duration: 0s; }
}

/* Phones in landscape: keep the map usable instead of compressing it between
   a tall search/filter header and the lower actions. */
@media (max-width: 1199px) and (max-height: 500px) and (orientation: landscape) {
    .map__search { top: 12px; left: 14px; right: auto; width: min(45%, 340px); height: 45px; }
    .map__searchInputWrap input { height: 45px; font-size: 15px; }
    .map__searchBody { top: 51px; }
    .map__mobileFilter { top: 12px; left: auto; right: 14px; width: min(45%, 340px); height: 45px; font-size: 13px; }
    .map__mobileFilterIcon { flex-basis: 29px; width: 29px; height: 29px; }
    .map { --map-canvas-safe-top: 74px; --map-canvas-safe-bottom: 85px; }
    .map__floors { top: 53%; left: 11px; }
    .map__floorBtn { height: 32px; min-height: 32px; }
    .map__floorBtnStage { font-size: 14px; }
    .map__home { top: calc(50% - 61px); right: 12px; }
    .map__zoom { top: calc(50% - 11px); right: 12px; }
    .map__viewSwitch { left: 16px; bottom: 13px; transform: none; }
    .map__manage { left: 122px; right: 9px; bottom: 20px; width: auto; }
    .map__manageBtnIcon { width: 35px; height: 35px; }
    .map__manageBtnTitle { font-size: 9px; }
    .map:has(.map__route.active) .map__viewSwitch {
        left: 16px;
        bottom: 13px;
        transform: none;
    }
}
