html {
    background: #1e2a32;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
    background: #1e2a32;
}

:root {
    /* Squircle-радиусы: чем крупнее элемент, тем плавнее скругление */
    --radius-xs: 10px;
    --radius-sm: 14px;
    --radius-md: 20px;
    --radius-lg: 28px;
    --radius-pill: 999px;
    --ease-squircle: cubic-bezier(0.22, 1, 0.36, 1);
    --shadow-xs: 0 1px 3px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 4px 14px rgba(15, 23, 42, 0.07);
    --shadow-md: 0 10px 28px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 20px 48px rgba(15, 23, 42, 0.14);
}

body {
    width: 100%;
    max-width: 100%;
    font-family: 'Inter', sans-serif;
    background: #F1F4F8;
    height: 100vh;
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
}

.app-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    min-height: 100dvh;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    background: #eef2f5;
}

.top-bar {
    background: white;
    padding: max(12px, env(safe-area-inset-top)) 24px 12px;
    box-shadow: var(--shadow-xs);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    margin-left: 50px;
    gap: 10px;
}
.logo-img {
    height: 50px;
    width: auto;
}
.logo-icon {
    height: 50px;
    width: auto;
}

.search-container {
    flex: 1;
    max-width: 500px;
    display: flex;
    margin: auto;
    gap: 12px;
}

#searchInput {
    flex: 1;
    padding: 10px 18px;
    font-size: 15px;
    border: 1px solid #d0d7de;
    border-radius: var(--radius-pill);
    outline: none;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s var(--ease-squircle), box-shadow 0.2s var(--ease-squircle);
}

#searchInput:focus {
    border-color: #2c7a4d;
    box-shadow: 0 0 0 4px rgba(44,122,77,0.1);
}

#searchBtn {
    background: #2c7a4d;
    border: none;
    padding: 0 20px;
    border-radius: var(--radius-pill);
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.25s var(--ease-squircle), transform 0.25s var(--ease-squircle), box-shadow 0.25s var(--ease-squircle);
    font-weight: bold;
}

#searchBtn:hover {
    background: #1f5a38;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.account-icon {
    font-size: 32px;
    color: #2c7a4d;
    cursor: pointer;
    transition: 0.2s;
    margin-right: 50px;
}

.account-icon:hover {
    color: #1f5a38;
}

.cup-link {
    background: #6f4e37;
    color: white;
    padding: 10px 20px;
    border-radius: var(--radius-pill);
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    transition: background-color 0.25s var(--ease-squircle), transform 0.25s var(--ease-squircle);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.cup-link:hover {
    background: #40312f;
    transform: translateY(-1px);
}

.cup-link.active {
    background: #2c7a4d;
    cursor: pointer;
    transform: none;
}

.cup-link.active:hover {
    background: #1f5a38;
    transform: translateY(-1px);
}

.main-layout {
    display: flex;
    flex: 1;
    min-height: 0;
    position: relative;
}

.sidebar-rail {
    width: 48px;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 20px;
    flex-shrink: 0;
    z-index: 20;
}

.rail-toggle {
    width: 36px;
    height: 36px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    color: #2c7a4d;
    transition: transform 0.25s var(--ease-squircle), box-shadow 0.25s var(--ease-squircle);
    border: 1px solid #e2e8f0;
}

.rail-toggle:hover {
    transform: scale(1.06);
    box-shadow: var(--shadow-md);
}

.sidebar-panel {
    width: 0;
    overflow: hidden;
    background: white;
    border-right: 1px solid #e2e8f0;
    transition: width 0.35s var(--ease-squircle);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    z-index: 15;
}

.sidebar-panel.open {
    width: 320px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #edf2f7;
}

.panel-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.filter-section {
    margin-bottom: 28px;
    font-size: 14px;
}

.filter-title {
    font-weight: 600;
    font-size: 14px;
    color: #1e2a3a;
    margin-bottom: 12px;
    display: block;
}

/* Чекбоксы – без галочек, только цвет фона */
.filter-checkbox input[type="checkbox"],
.sub-filter-group input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e1;
    border-radius: 7px;
    background: white;
    cursor: pointer;
    position: relative;
    transition: all 0.2s var(--ease-squircle);
    flex-shrink: 0;
}

.filter-checkbox input[type="checkbox"]:checked,
.sub-filter-group input[type="checkbox"]:checked {
    background-color: #2c7a4d;
    border-color: #2c7a4d;
    transform: scale(1.02);
}

.filter-checkbox input[type="checkbox"]:checked::after,
.sub-filter-group input[type="checkbox"]:checked::after {
    content: "";
    display: none;
}

.filter-checkbox input[type="checkbox"]:hover,
.sub-filter-group input[type="checkbox"]:hover {
    border-color: #2c7a4d;
    transform: scale(1.05);
}

.filter-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    cursor: pointer;
}

.sub-filter-group label {
    margin-bottom: 6px;
    font-size: 13px;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 8px;
}

.district-select {
    width: 100%;
    padding: 8px;
    border-radius: var(--radius-sm);
    border: 1px solid #cbd5e1;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s var(--ease-squircle), box-shadow 0.2s var(--ease-squircle);
}

.district-select:focus {
    outline: none;
    border-color: #2c7a4d;
    box-shadow: 0 0 0 4px rgba(44,122,77,0.1);
}

/* Вертикальное расположение кнопок режима работы */
.worktime-buttons-vertical {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.worktime-buttons-vertical .worktime-btn {
    background: #e9edf2;
    border: none;
    padding: 10px 16px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    color: #475569;
    cursor: pointer;
    transition: background-color 0.25s var(--ease-squircle), transform 0.25s var(--ease-squircle);
    text-align: center;
    width: 100%;
}

.worktime-buttons-vertical .worktime-btn:hover {
    background: #d1d9e2;
    transform: translateY(-1px);
}

.worktime-buttons-vertical .worktime-btn.active {
    background: #2c7a4d;
    color: white;
}

.worktime-buttons-vertical .worktime-btn.active:hover {
    background: #1f5a38;
}

/* Блок выбора времени (показывается при активной кнопке "all") */
.time-picker {
    background: #f8fafc;
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 8px;
    display: none;
    box-shadow: var(--shadow-xs);
}

.time-picker.visible {
    display: block;
}

.time-picker label {
    font-size: 13px;
    font-weight: 500;
    color: #1e2a3a;
    display: block;
    margin-bottom: 8px;
}

.time-selectors {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.time-selectors select {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid #cbd5e1;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    background: white;
    transition: border-color 0.2s var(--ease-squircle);
}

.time-selectors span {
    font-weight: 600;
    color: #1e2a3a;
}

.apply-time-btn {
    background: #2c7a4d;
    border: none;
    padding: 6px 16px;
    border-radius: var(--radius-pill);
    color: white;
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.25s var(--ease-squircle), transform 0.25s var(--ease-squircle);
}

.apply-time-btn:hover {
    background: #1f5a38;
    transform: translateY(-1px);
}

.map-container {
    flex: 1;
    position: relative;
    min-width: 0;
    margin: 16px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    background: #fff;
}
#map {
    position: absolute;
    inset: 0;
    width: auto;
    height: auto;
}

/* popup */
.custom-popup .leaflet-popup-content-wrapper {
    border-radius: var(--radius-md);
    padding: 0;
    background: white;
    box-shadow: var(--shadow-lg);
}
.popup-inner {
    padding: 16px 18px;
}
.popup-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 6px;
}
.popup-address, .popup-hours, .popup-desc, .popup-contacts {
    font-size: 13px;
    color: #334155;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.route-btn, .route-btn:link, .route-btn:visited {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #2c7a4d;
    color: white;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    text-decoration: none;
    font-size: 13px;
    margin-top: 10px;
    transition: background-color 0.25s var(--ease-squircle), transform 0.25s var(--ease-squircle);
}
.route-btn:hover {
    background: #1f5a38;
    transform: translateY(-1px);
}
.leaflet-popup-close-button {
    padding: 15px 22px;
}

.popup-inner {
    max-height: min(50vh, 320px);
    max-height: min(50dvh, 320px);
    overflow-y: auto;
    overflow-wrap: anywhere;
}

.popup-address,
.popup-hours,
.popup-desc,
.popup-contacts,
.popup-website {
    align-items: flex-start;
}

.popup-website {
    display: flex;
    gap: 6px;
    font-size: 13px;
    color: #334155;
    margin-bottom: 6px;
}

.popup-address i,
.popup-hours i,
.popup-desc i,
.popup-contacts i,
.popup-website i {
    flex-shrink: 0;
    margin-top: 2px;
}

.panel-close {
    display: none;
    width: 36px;
    height: 36px;
    margin-left: auto;
    border: none;
    border-radius: 50%;
    background: #f1f5f9;
    color: #475569;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: background-color 0.2s var(--ease-squircle), color 0.2s var(--ease-squircle), transform 0.2s var(--ease-squircle);
}

.panel-close:hover {
    background: #e2e8f0;
    color: #1e2a3a;
    transform: scale(1.04);
}

.panel-content {
    min-height: 0;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.sidebar-panel {
    min-height: 0;
}



/* =========================
   ФУТЕР
   ========================= */
.footer {
    position: relative;
    z-index: 2000;
    flex-shrink: 0;
    height: 56px;
    max-height: 56px;
    overflow: visible;
    width: 100%;
    background: #1e2a32;
    color: #cddfe7;
    cursor: pointer;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    box-sizing: border-box;
    transition: box-shadow 0.35s var(--ease-squircle);
}

.footer-collapsed {
    width: min(1200px, calc(100% - 64px));
    height: 56px;
    margin: 0 auto;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: center;
    font-weight: 600;
    transition: opacity 0.3s ease;
}

.footer-col-preview {
    min-width: 0;
    text-align: center;
    font-size: 14px;
    line-height: 1.2;
    color: #cddfe7;
    white-space: nowrap;
    overflow: hidden;
    padding: 0;
}

.footer-inner {
    width: min(1200px, calc(100% - 64px));
    max-width: none;
    height: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.footer-expanded {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: min(75vh, 520px);
    max-height: min(75dvh, 520px);
    overflow-y: auto;
    background: #1e2a32;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.12);
    padding: 24px 0 calc(16px + env(safe-area-inset-bottom));
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    clip-path: inset(100% 0 0 0);
    transition: clip-path 0.65s var(--ease-squircle), opacity 0.3s ease, visibility 0s linear 0.65s;
}

.footer.is-open .footer-expanded {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    clip-path: inset(-40px 0 0 0);
    transition: clip-path 0.75s var(--ease-squircle), opacity 0.4s ease, visibility 0s;
}

.footer.is-open .footer-collapsed {
    opacity: 0;
    pointer-events: none;
}

.footer-columns {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    align-items: start;
}

.footer-col {
    min-width: 0;
    flex: none;
    padding: 0 16px;
}

.footer-col:first-child { padding-left: 0; }
.footer-col:last-child { padding-right: 0; }

.footer-col h4 {
    font-weight: 700;
    margin: 0 0 14px;
    color: white;
    font-size: 18px;
    line-height: 1.25;
    letter-spacing: -0.2px;
    text-align: center;
}

/* Правило footer: в свёрнутом состоянии заголовки по центру. */
#footer .footer-col-preview {
    text-align: center;
}

/* В раскрытом состоянии содержимое колонок выравнивается по левому краю. */
#footer .footer-col h4 {
    text-align: left;
}

.footer-col p {
    margin: 0 0 10px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    line-height: 1.4;
    color: #cddfe7;
}

.foot-social {
    color: #cddfe7;
    text-decoration: none;
    text-transform: none;
}

.footer-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #2c7a4d;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    color: white;
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    margin-top: 8px;
    transition: background-color 0.25s var(--ease-squircle), transform 0.25s var(--ease-squircle), box-shadow 0.25s var(--ease-squircle);
    text-decoration: none;
}

.footer-btn:hover {
    background: #3f9e64;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
    color: white;
}

.footer-btn:visited { color: white; }

.footer-bottom {
    text-align: center;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    color: #94a3b8;
}

@media (hover: hover) and (pointer: fine) and (min-width: 769px) {
    .footer:hover {
        box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.08);
    }

    .footer:hover .footer-expanded {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        clip-path: inset(-40px 0 0 0);
        transition: clip-path 0.75s var(--ease-squircle), opacity 0.4s ease, visibility 0s;
    }

    .footer:hover .footer-collapsed {
        opacity: 0;
        pointer-events: none;
    }
}

.leaflet-control-zoom {
    position: relative;
    bottom: auto;
    right: auto;
}
.leaflet-control-attribution {
    display: none;
}

/* ========== АДАПТИВНОСТЬ ========== */

/* Для планшетов и маленьких ноутбуков */
@media (max-width: 1024px) {
    .top-bar {
        padding: 10px 16px;
        gap: 12px;
    }
    .logo {
        margin-left: 20px;
    }
    .logo-img, .logo-icon {
        height: 40px;
    }
    .account-icon {
        margin-right: 20px;
        font-size: 28px;
    }
    .sidebar-panel.open {
        width: 280px;
    }
    .search-container {
        max-width: 400px;
    }
}

/* Для планшетов вертикальной ориентации и больших телефонов */
@media (max-width: 768px) {
    .top-bar {
        padding: 8px 12px;
        gap: 8px;
    }
    .logo {
        margin-left: 0;
        gap: 6px;
    }
    .logo-img, .logo-icon {
        height: 32px;
    }
    .search-container {
        max-width: 100%;
        flex: 1 1 100%;
        order: 3; /* переносим поиск на следующую строку */
    }
    .cup-link {
        font-size: 12px;
        padding: 6px 12px;
    }
    .account-icon {
        font-size: 24px;
        margin-right: 0;
    }
    .sidebar-rail {
        width: 40px;
    }
    .rail-toggle {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    .sidebar-panel.open {
        width: 260px;
    }
    .panel-header h3 {
        font-size: 16px;
    }
    .panel-content {
        padding: 16px;
    }
    .filter-section {
        margin-bottom: 20px;
    }
    .map-container {
        margin: 12px;
        border-radius: var(--radius-md);
    }
    .footer-collapsed {
        padding: 0;
        font-size: 13px;
    }
    .footer-col h4 {
        font-size: 16px;
    }
    .footer-col p {
        font-size: 12px;
    }
    .footer-expanded {
        padding: 0 16px 12px;
    }
    .footer:hover .footer-expanded {
        padding: 16px 16px 12px;
    }
    .footer-columns {
        gap: 24px;
    }
    .footer-col {
        min-width: 0;
    }

    /* Мобильная панель фильтров — слой поверх карты */
    .sidebar-rail {
        position: absolute;
        top: 12px;
        left: 12px;
        width: auto;
        padding: 0;
        background: transparent;
        border: none;
        z-index: 1600;
    }

    .rail-toggle {
        width: 44px;
        height: 44px;
        font-size: 16px;
        box-shadow: var(--shadow-md);
    }

    .main-layout.panel-open .sidebar-rail {
        display: none;
    }

    .sidebar-panel,
    .sidebar-panel.open {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        width: min(88vw, 340px);
        max-width: none;
        z-index: 1700;
        border-right: 1px solid #e2e8f0;
        transform: translateX(-105%);
        visibility: hidden;
        box-shadow: none;
        transition: transform 0.35s var(--ease-squircle), visibility 0s linear 0.35s;
    }

    .sidebar-panel.open {
        transform: translateX(0);
        visibility: visible;
        box-shadow: var(--shadow-lg);
        transition: transform 0.35s var(--ease-squircle), visibility 0s;
    }

    .panel-close {
        display: inline-flex;
    }

    .leaflet-bottom.leaflet-right .leaflet-control-zoom {
        margin: 0 12px 12px 0;
    }

    .footer-collapsed {
        width: 100%;
        padding: 0 8px;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .footer-col-preview {
        font-size: 12px;
        white-space: normal;
        padding: 0 4px;
    }

    .footer-expanded {
        padding: 20px 16px calc(14px + env(safe-area-inset-bottom));
    }

    .footer-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px 0;
    }
}


/* Для мобильных телефонов */
@media (max-width: 480px) {
    .top-bar {
        padding: 6px 8px;
        gap: 4px;
    }
    .logo {
        margin-left: 0;
    }
    .logo-img, .logo-icon {
        height: 28px;
    }
    .search-container {
        gap: 6px;
    }
    #searchInput {
        font-size: 13px;
        padding: 6px 12px;
    }
    #searchBtn {
        padding: 6px 12px;
        font-size: 13px;
    }
    .cup-link {
        font-size: 11px;
        padding: 4px 10px;
    }
    .account-icon {
        font-size: 22px;
    }
    .sidebar-rail {
        width: 36px;
    }
    .rail-toggle {
        width: 26px;
        height: 26px;
        font-size: 12px;
    }
    .sidebar-panel.open {
        width: 100%;          /* на телефонах панель занимает почти весь экран */
        max-width: 100%;
        border-right: none;
    }
    .panel-header {
        padding: 12px 16px;
    }
    .panel-content {
        padding: 12px 16px;
    }
    .filter-section {
        margin-bottom: 16px;
        font-size: 13px;
    }
    .filter-title {
        font-size: 13px;
        margin-bottom: 8px;
    }
    .filter-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    .sub-filter-group label {
        font-size: 12px;
    }
    .district-select {
        font-size: 13px;
        padding: 6px;
    }
    .worktime-buttons-vertical .worktime-btn {
        font-size: 12px;
        padding: 8px 12px;
    }
    .time-picker {
        padding: 12px;
    }
    .time-selectors select {
        font-size: 13px;
        padding: 4px 8px;
    }
    .apply-time-btn {
        font-size: 12px;
        padding: 4px 12px;
    }
    .map-container {
        margin: 8px;
        border-radius: var(--radius-sm);
    }
    .footer-collapsed {
        padding: 8px 12px;
        font-size: 12px;
        justify-content: space-around;
    }
    .footer-col-preview {
        font-size: 12px;
    }
    .footer-expanded {
        padding: 0 12px 8px;
    }
    .footer:hover .footer-expanded {
        padding: 12px 12px 8px;
    }
    .footer-columns {
        flex-direction: column;
        gap: 16px;
    }
    .footer-col {
        min-width: 0;
    }
    .footer-col h4 {
        font-size: 15px;
        margin-bottom: 8px;
    }
    .footer-col p {
        font-size: 12px;
        margin-bottom: 6px;
    }
    .footer-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
    .footer-bottom {
        font-size: 11px;
        margin-top: 16px;
        padding-top: 12px;
    }
    .leaflet-control-zoom {
        bottom: 12px;
        right: 12px;
    }
    .popup-inner {
        padding: 12px 14px;
    }
    .popup-title {
        font-size: 14px;
    }
    .popup-address, .popup-hours, .popup-desc, .popup-contacts {
        font-size: 12px;
    }
    .route-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
    .leaflet-popup-close-button {
        padding: 12px 18px;
    }
}

/* Для очень маленьких экранов (до 360px) */
@media (max-width: 360px) {
    .top-bar {
        padding: 4px 6px;
    }
    .logo-img, .logo-icon {
        height: 24px;
    }
    #searchInput {
        font-size: 12px;
        padding: 4px 8px;
    }
    #searchBtn {
        font-size: 12px;
        padding: 4px 8px;
    }
    .cup-link {
        font-size: 10px;
        padding: 3px 8px;
    }
    .account-icon {
        font-size: 20px;
    }
    .footer-col-preview {
        font-size: 8px;
    }

}

/* Тач-устройства: увеличенные зоны нажатия */
@media (pointer: coarse) {
    .leaflet-touch .leaflet-bar a {
        width: 40px;
        height: 40px;
        line-height: 40px;
    }

    .filter-group label { min-height: 36px; }
    .sub-filter-group label { min-height: 34px; }
    .filter-checkbox { min-height: 36px; }

    .filter-checkbox input[type="checkbox"],
    .sub-filter-group input[type="checkbox"] {
        width: 22px;
        height: 22px;
    }

    .worktime-buttons-vertical .worktime-btn { min-height: 44px; }
    .apply-time-btn,
    .route-btn { min-height: 40px; }
    .footer-btn { padding: 10px 18px; }
}

/* На тач-устройствах hover не должен оставлять элементы «приподнятыми». */
@media (hover: none) {
    #searchBtn:hover,
    .route-btn:hover,
    .apply-time-btn:hover,
    .footer-btn:hover,
    .rail-toggle:hover,
    .worktime-buttons-vertical .worktime-btn:hover,
    .filter-checkbox input[type="checkbox"]:hover,
    .sub-filter-group input[type="checkbox"]:hover,
    .business-card:hover,
    .business-step:hover {
        transform: none;
    }
}

/* Безопасная высота для карты и браузеров с динамической адресной строкой. */
body:not(.business-body) {
    height: 100vh;
    height: 100dvh;
    background: #1e2a32;
}

@media (max-width: 768px) {
    #searchInput,
    .district-select,
    .time-selectors select {
        font-size: 16px;
    }

    #searchBtn { min-height: 40px; }

    .top-bar {
        padding-top: max(8px, env(safe-area-inset-top));
    }
}

@media (max-width: 600px) {
    .footer-collapsed {
        width: 100%;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        padding: 0 8px;
    }

    .footer-col-preview {
        font-size: 9px;
        line-height: 1.1;
        padding: 0;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: clip;
    }

    .footer-expanded {
        padding: 16px 12px calc(10px + env(safe-area-inset-bottom));
    }

    .footer-columns {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .footer-col {
        padding: 0;
    }

    .footer-col h4 {
        font-size: 15px;
        margin-bottom: 8px;
    }

    .footer-col p {
        font-size: 12px;
        margin-bottom: 6px;
    }
}

@media (max-height: 500px) and (orientation: landscape) {
    .top-bar {
        flex-wrap: nowrap;
        padding: 4px 12px;
        gap: 8px;
    }

    .logo { margin-left: 0; }
    .logo-img, .logo-icon { height: 28px; }
    .search-container { order: 0; flex: 1 1 auto; max-width: 420px; margin: 0 auto; }
    .map-container { margin: 6px; }
    .footer { height: 44px; max-height: 44px; }
    .footer-collapsed { height: 44px; padding: 0 12px; }
    .footer .footer-expanded { max-height: 80vh; max-height: 80dvh; }
}


/* =========================================================
   СТРАНИЦА ПАРТНЁРСТВА ДЛЯ БИЗНЕСА
   ========================================================= */

body.business-body {
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    background: #1e2a32;
}

.business-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: #F1F4F8;
}

.business-header {
    width: 100%;
    flex-shrink: 0;
    background: #FFFFFF;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: var(--shadow-xs);
}

.business-header-inner {
    width: min(1200px, calc(100% - 48px));
    min-height: 74px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.business-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    text-decoration: none;
}

.business-brand img {
    display: block;
    width: auto;
    object-fit: contain;
}

.business-brand img:first-child,
.business-brand img:last-child {
    height: 50px;
}

.business-back {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #2c7a4d;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: color 0.2s ease, transform 0.2s ease;
}

.business-back:hover {
    color: #1f5a38;
    transform: translateX(-2px);
}

.business-main {
    width: min(1100px, calc(100% - 32px));
    margin: 0 auto;
    padding: 40px 0 48px;
    flex: 1;
}

.business-hero,
.business-section {
    background: #FFFFFF;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
}

.business-hero {
    padding: 48px;
    border-radius: 24px;
    text-align: center;
}

.business-kicker {
    margin-bottom: 10px;
    color: #2c7a4d;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.business-hero h1 {
    margin: 0 0 16px;
    color: #1e2a3a;
    font-size: clamp(30px, 5vw, 46px);
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.business-hero p {
    max-width: 720px;
    margin: 0 auto;
    color: #475569;
    font-size: 17px;
    line-height: 1.6;
}

.business-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 26px;
    padding: 12px 22px;
    border-radius: 999px;
    background: #2c7a4d;
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.business-cta:hover {
    background: #1f5a38;
    color: #FFFFFF;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.07);
}

.business-section {
    margin-top: 24px;
    padding: 32px;
    border-radius: 20px;
}

.business-section h2 {
    margin: 0 0 20px;
    color: #1e2a3a;
    font-size: 24px;
    line-height: 1.25;
    font-weight: 700;
}

.business-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.business-card {
    background: #f8fafc;
    border: 1px solid #edf2f7;
    border-radius: 16px;
    padding: 20px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.business-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.07);
}

.business-card i {
    display: block;
    margin-bottom: 12px;
    color: #2c7a4d;
    font-size: 22px;
}

.business-card h3 {
    margin: 0 0 8px;
    color: #1e2a3a;
    font-size: 16px;
    line-height: 1.3;
}

.business-card p {
    margin: 0;
    color: #475569;
    font-size: 14px;
    line-height: 1.5;
}

.business-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.business-step {
    position: relative;
    padding: 20px;
    background: #FFFFFF;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.business-step:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.07);
}

.business-step-number {
    margin-bottom: 10px;
    color: #2c7a4d;
    font-size: 13px;
    line-height: 1;
    font-weight: 700;
}

.business-step h3 {
    margin: 0 0 6px;
    color: #1e2a3a;
    font-size: 16px;
    line-height: 1.3;
}

.business-step p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
}

.business-note {
    margin: 16px 0 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.6;
}

.business-contact {
    text-align: center;
}

.business-contact p {
    margin: 0;
    color: #475569;
    line-height: 1.6;
}

.business-contact-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.business-contact-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 14px;
    border-radius: 30px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #334155;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.business-contact-link:hover {
    background: #eef4f0;
    border-color: #cbded3;
    color: #334155;
    transform: translateY(-1px);
}

.business-email {
    display: inline-block;
    margin-top: 14px;
    color: #2c7a4d;
    font-weight: 700;
    text-decoration: none;
}

.business-email:hover {
    color: #1f5a38;
}

/* Бизнес-footer использует ту же геометрию, что и footer карты. */
.business-footer {
    margin-top: auto;
}

.business-footer .footer-collapsed,
.business-footer .footer-inner {
    width: min(1200px, calc(100% - 64px));
}

.business-footer .footer-columns {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (min-width: 769px) {
    .business-footer .footer-col-preview {
        text-align: center;
    }

    .business-footer .footer-col h4 {
        text-align: left;
    }
}

@media (max-width: 900px) {
    .business-grid,
    .business-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .business-hero {
        padding: 36px 28px;
    }
}

@media (max-width: 768px) {
    .business-header-inner {
        width: min(100%, calc(100% - 24px));
        min-height: 60px;
    }

    .business-brand img:first-child,
    .business-brand img:last-child {
        height: 38px;
    }

    .business-back {
        font-size: 12px;
    }

    .business-footer .footer-collapsed,
    .business-footer .footer-inner {
        width: 100%;
    }

    .business-footer .footer-collapsed {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        padding: 0 8px;
    }

    .business-footer .footer-col-preview {
        font-size: 9px;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        padding: 0;
    }

    .business-footer .footer-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px 0;
    }
}

@media (max-width: 600px) {
    .business-main {
        width: calc(100% - 16px);
        padding: 24px 0 40px;
    }

    .business-hero,
    .business-section {
        padding: 24px 18px;
        border-radius: 16px;
    }

    .business-grid,
    .business-steps {
        grid-template-columns: 1fr;
    }

    .business-hero p {
        font-size: 15px;
    }

    .business-contact-links {
        flex-direction: column;
        align-items: stretch;
    }

    .business-contact-link {
        justify-content: center;
    }

    .business-footer .footer-expanded {
        padding: 16px 12px calc(10px + env(safe-area-inset-bottom));
    }

    .business-footer .footer-columns {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .business-footer .footer-col {
        padding: 0;
    }

    .business-footer .footer-col h4 {
        font-size: 15px;
        margin-bottom: 7px;
        text-align: left;
    }

    .business-footer .footer-col p {
        font-size: 12px;
        margin-bottom: 6px;
    }
}

@media (max-width: 480px) {
    .business-header-inner {
        width: calc(100% - 16px);
    }

    .business-brand {
        gap: 6px;
    }

    .business-brand img:first-child,
    .business-brand img:last-child {
        height: 30px;
    }

    .business-back {
        font-size: 11px;
    }

    .business-footer .footer-col-preview {
        font-size: 8px;
        text-align: center;
    }
}

@media (hover: none) {
    .business-card:hover,
    .business-step:hover {
        transform: none;
    }
}
