:root {
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden; /* ГЛАВНОЕ: запрет прокрутки всей страницы */
    position: fixed; /* Фиксируем body, чтобы гарантировать отсутствие скролла */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

body {
    font-family: 'Golos', sans-serif;
    background: #ffffff;
    color: #333;
    display: flex;
    flex-direction: column;
}

@font-face {
    font-family: 'Golos';
    src: url('golos/Golos\ Text_Bold.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
}

.app {
    height: 100vh; /* Фиксированная высота на весь экран */
    height: 100dvh; /* Для мобильных устройств */
    width: 100%;
    display: flex;
    flex-direction: column;
    position: fixed; /* Фиксируем приложение */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

/* ШАПКА - ВСЕГДА НА МЕСТЕ */
.app-header {
    position: relative; /* Убираем fixed, делаем частью потока */
    width: 100%;
    height: 64px;
    min-height: 64px; /* Фиксированная высота */
    background: #71c3e6dd;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    box-sizing: border-box;
    flex-shrink: 0; /* Важно: не сжимается */
    backdrop-filter: blur(10px);
}

.logo {
    padding: 2px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.burger {
    width: 26px;
    height: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
}

.burger span {
    height: 3px;
    border-radius: 3px;
    background: #ffffff;
}

/* ОСНОВНОЙ КОНТЕНТ - С ФИКСИРОВАННОЙ ВЫСОТОЙ */
.app-main {
    flex: 1; /* Занимает всё оставшееся пространство */
    display: flex;
    flex-direction: column;
    padding: 10px;
    gap: 16px;
    overflow: hidden; /* Запрещаем скролл в основном контейнере */
    min-height: 0; /* Важно для flex-потомков */
    position: relative;
}

/* КАРТА - С ФИКСИРОВАННОЙ ВЫСОТОЙ */
/* КАРТА - С ФИКСИРОВАННОЙ ВЫСОТОЙ */
/* Вариант 2: скролл в самом map-wrapper */
.map-wrapper {
    flex: 1;
    width: 100%;
    min-height: 0;
    border: 1px solid #cbd0d6;
    position: relative;
    border-radius: 12px;

    overflow: auto;                 /* скролл внутри карты */
    -webkit-overflow-scrolling: touch;

    scrollbar-width: thin;          /* Firefox: показать */
    scrollbar-color: #9ca3af #f3f4f6;
}

.map-wrapper::-webkit-scrollbar {
    width: 10px;      /* вертикальный */
    height: 10px;     /* горизонтальный */
}

.map-wrapper::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 12px;
}

.map-wrapper::-webkit-scrollbar-thumb {
    background: #9ca3af;
    border-radius: 12px;
    border: 2px solid #f3f4f6;
}

.map-wrapper::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}



.map-container {
    width: 100%;
    height: 100%;
    overflow: visible; /* Убираем overflow */
    position: relative;
}

.map-inner {
    display: inline-block;
    transform-origin: left top;
    position: relative;
}

.map-inner img {
    display: block;
    max-width: none;
    pointer-events: none;
}

/* ЗУМ КОНТРОЛЫ */
.map-zoom-controls {
    position: fixed;
    right: 0px;
    bottom: 0px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 104px;
    margin-right: 20px;
}

.zoom-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: none;
    background: #f1f1f3cf;
    box-shadow: 4px rgba(0, 0, 0, 0.12);
    font-size: 22px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

/* ШТОРКА МЕНЮ */
.menu {
    position: fixed; /* Фиксируем на весь экран */
    top: 63px; /* Под шапкой */
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    font-weight: 100;
    backdrop-filter: blur(5px);
}

.menu.active {
    opacity: 1;
    pointer-events: auto;
}

.menu-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 70%;
    height: 100%;
    background-color: #fffffff7;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    padding-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    backdrop-filter: blur(10px);
}

.menu.active .menu-panel {
    transform: translateX(0);
}

.menu-item {
    width: 100%;
    padding: 8px 5%;
    color: #000000;
}

.menu-item p {
    font-weight: normal;
    margin: 0;
}

.route-bar {
    margin-top: 0;         
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: env(safe-area-inset-bottom); 
}

.route-bar__action {
    flex: 1;
    height: 48px;
    border-radius: 12px;
    border: none;
    background: #0b83cc;
    color: #ffffff;
    font-weight: 900;
    letter-spacing: 0.02em;
    cursor: pointer;
    font-family: 'Golos', sans-serif;
}

.route-bar__action {
    background: linear-gradient(
        90deg,
        #0b83cc 0%,
        #2a9df4 25%,
        #0b83cc 50%,
        #2a9df4 75%,
        #0b83cc 100%
    );
    background-size: 200% 100%;
    animation: flow 4s infinite linear;
}

@keyframes flow {
    0% { background-position: 200% 0; }
    100% { background-position: 0 0; }
}

/* ПОИСК И ВЫБОР ЭТАЖА */
.search-box {
    background: #f1f1f3;
    border-radius: 12px;
    padding: 12px 16px;
    height: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.search-icon {
    width: 24px;
    height: 24px;
    position: relative;
    flex-shrink: 0;
}

.search-input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 16px;
    color: #4b5563;
}

.search-input::placeholder {
    color: #6b7280;
}

.floor-select {
    height: 40px;
    position: relative;
    flex-shrink: 0;
}

.select-wrapper {
    border: 2px solid #cbd0d6;
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 16px;
    color: #4b5563;
    background: #ffffff;
    height: 40px;
}

select {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.select-arrow {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid #6b7280;
}

/* НИЖНЯЯ ПАНЕЛЬ МАРШРУТА */
.route-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}



.route-bar__close {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 2px solid #d1d5db;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    position: relative;
}

.route-bar__close span {
    position: absolute;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: #9ca3af;
}

.route-bar__close span:first-child {
    transform: rotate(45deg);
}

.route-bar__close span:last-child {
    transform: rotate(-45deg);
}

/* ДОПОЛНИТЕЛЬНЫЕ ЭЛЕМЕНТЫ МАРШРУТА */
.route-build{
    display: flex;
    flex-direction: column; 
    gap: 0px;
    margin-top: auto;
}

/* Блок подсказок*/
.autocomplete-clues {
    position: fixed; /* 110px + 16px */
    left: 8px;  /* небольшие отступы по бокам */
    right: 8px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    margin: 0;
    padding: 12px;
    left: 0;
    right: 0;
    max-width: 800px;
    margin-left: 8px;
    background: rgba(255, 255, 255, 0.379);
    backdrop-filter: blur(10px);
    max-height: 300px;
    overflow-y: auto;
}

.clues-header{
    height: 16px;
}

.clue1, .clue2, .clue3, .clue4, .clue5 {
    border: 2px solid #d1d5db;
    background-color: white;
    border-radius: 8px;
    height: 32px;
    padding: 8px;
    cursor: pointer;
    margin-top: 0px;
}

.clue1:hover, .clue2:hover, .clue3:hover, .clue4:hover, .clue5:hover {
    background-color: #ffffff;
    border-color: #2f80c9;
}

/**/


.route-card {
    background: #f5f5f7;
    border-radius: 16px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
    flex-shrink: 0;
}

.route-field {
    border-radius: 12px;
    border: 2px solid #d1d5db;
    background: #ffffff;
    padding: 8px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.route-field-label {
    font-size: 13px;
    color: #9ca3af;
}

.route-field-input {
    border: none;
    outline: none;
    font-size: 16px;
    background: transparent;
    padding: 0;
    margin: 0;
}

.route-submit-btn {
    width: 100%;
    height: 48px;
    border-radius: 12px;
    border: none;
    background: #2f80c9;
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.04em;
    cursor: pointer;
}

.route-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Предотвращение bounce-эффекта на iOS */
body {
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
}

/* Предотвращение выделения текста при тапе */
* {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

input, textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}


@media (min-width:1024px) {
    .app-main{
        width: 80%;
        margin-left: 16px;
    }

    .map-zoom-controls{
        margin-right: 20%;
        margin-bottom: 20%;
    }
}