* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    color: #222;
    background: #f7f7f7;
}

/* Табы */
.tabs {
    display: flex;
    gap: 0;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.tab {
    padding: 16px 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 15px;
    color: #555;
    border-bottom: 3px solid transparent;
    transition: .15s;
}
.tab:hover { color: #000; }
.tab.active {
    color: #c8102e;
    border-bottom-color: #c8102e;
    font-weight: 600;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Раскладка «Где купить» */
.layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 16px;
    padding: 16px;
    height: calc(100vh - 60px);
}
.sidebar {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    overflow-y: auto;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow: hidden;
}
.map {
    width: 100%;
    height: 55%;
    min-height: 320px;
    border-radius: 12px;
    overflow: hidden;
    background: #e5e5e5;
}
.shops-block {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    overflow-y: auto;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

/* Поиск */
.search-wrap { position: relative; margin-bottom: 12px; }
#citySearch {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}
#citySearch:focus { border-color: #c8102e; }
.suggest {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-top: 4px;
    max-height: 260px;
    overflow-y: auto;
    display: none;
    z-index: 50;
    box-shadow: 0 6px 16px rgba(0,0,0,.1);
}
.suggest.open { display: block; }
.suggest div {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
}
.suggest div:hover,
.suggest div.active { background: #f2f2f2; }

/* Список городов */
.city-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.city-list li {
    padding: 6px 10px;
    background: #f2f2f2;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: .15s;
    user-select: none;
}
.city-list li:hover { background: #e0e0e0; }
.city-list li.selected { background: #c8102e; color: #fff; }

/* Свёрнутый список городов (мобильный режим) */
.city-list.collapsed li:not(.selected) {
    display: none;
}
.city-list.collapsed li.selected::after {
    content: ' ✕';
    opacity: .7;
    margin-left: 6px;
    font-size: 11px;
}

/* Карточки магазинов */
.shop {
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: .15s;
}
.shop:hover { border-color: #c8102e; }
.shop.active {
    border-color: #c8102e;
    box-shadow: 0 0 0 2px rgba(200,16,46,.15);
}
.shop h4 { margin: 0 0 6px; font-size: 15px; }
.shop p { margin: 2px 0; font-size: 13px; color: #555; }
.shop .addr { font-weight: 500; color: #333; }
.shop .phone a { color: #c8102e; text-decoration: none; }

/* Главный офис */
.office-wrap {
   
    margin: 24px auto;
    padding: 24px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.office-wrap h1 { margin-top: 0; }
.office-info p { margin: 8px 0; font-size: 15px; }
.office-info a { color: #c8102e; text-decoration: none; }
.office-map { height: 420px; margin: 16px 0; }
.office-addresses {
    list-style: none;
    padding: 0;
    margin: 0;
}
.office-addresses li {
    padding: 10px 12px;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
}
.office-addresses li:hover { border-color: #c8102e; }

.muted { color: #888; font-size: 13px; }

/* ============================================================
   МОБИЛЬНАЯ ВЕРСИЯ
   ============================================================ */
@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr;
        height: auto;
        padding: 12px;
        gap: 12px;
    }

    .sidebar {
        max-height: none;
        overflow: visible;
        padding: 12px;
    }

    .content {
        display: flex;
        flex-direction: column;
        gap: 12px;
        overflow: visible;
        /* Отступ сверху, чтобы при скролле карта не упиралась в табы */
        scroll-margin-top: 60px;
    }

    .map {
        height: 320px;
        min-height: 320px;
    }

    .shops-block {
        overflow: visible;
        padding: 12px;
    }

    /* Компактнее карточки магазинов */
    .shop {
        padding: 10px 12px;
    }
    .shop h4 { font-size: 14px; }
    .shop p  { font-size: 12.5px; }

    /* Табы — компактнее */
    .tab {
        padding: 12px 16px;
        font-size: 14px;
        flex: 1;
        text-align: center;
    }

    /* Карта главного офиса — ниже */
    .office-map { height: 320px; }
    .office-wrap { margin: 12px; padding: 16px; }
}