* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body, input, button, .office-item, .mode-btn, .route-link, .detail-link, .no-results, .tag, .filter-btn, .cooperation-btn {
    font-family: 'Montserrat', sans-serif;
}
body {
    background: #f8fafc;
}
#city-search:focus, #name-search:focus {
    outline: none;
    border-color: #9aa6b5;
    box-shadow: 0 0 0 3px rgba(31,42,58,0.1);
}
.mode-btn.active {
    background: white !important;
    color: #1f2a3a !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05) !important;
}
.filter-btn.active {
    background: #1f2a3a !important;
    color: white !important;
    border-color: #1f2a3a !important;
}
.filter-btn:hover {
    background: #e5e7eb !important;
    border-color: #9aa6b5 !important;
}
/* Десктопная версия (шире 767px) */
@media (min-width: 768px) {
    .mode-map-active #office-list {
        display: block;
        width: 30% !important;
        height: 100%;
        overflow-y: auto;
        padding-right: 4px;
    }
    .mode-map-active #map {
        display: block;
        width: auto !important;
        flex: 1;
        min-width: 0;
    }
    .mode-list-active #office-list {
        width: 100% !important;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        height: 100%;
        overflow-y: auto;
        padding: 0 4px 0 0;
    }
    .mode-list-active #office-list .office-item {
        margin-bottom: 0;
    }
    .mode-list-active #map {
        display: none;
    }
}
/* Мобильная версия (≤767px) */
@media (max-width: 767px) {
    .mode-map-active #office-list {
        display: none;
    }
    .mode-map-active #map {
        display: block;
        width: 100% !important;
        height: 100%;
        flex: none;
    }
    .mode-list-active #office-list {
        display: block;
        width: 100% !important;
        height: 100%;
        overflow-y: auto;
    }
    .mode-list-active #map {
        display: none;
    }
    .filter-btn, .mode-btn, #search-btn, #reset-btn, .route-link, .detail-link {
        min-height: 44px;
        padding: 10px 16px;
        font-size: 15px;
    }
    .office-item {
        padding: 16px;
    }
    .office-item strong {
        font-size: 16px;
    }
    .office-item small {
        font-size: 14px;
    }
    .rating-stars {
        font-size: 1.1em;
    }
    .tag {
        padding: 6px 12px;
        font-size: 13px;
    }
    .filters-panel {
        padding: 12px 12px;
    }
    .filter-buttons-row {
        gap: 12px;
    }
    .group-label {
        font-size: 14px;
    }
}
/* Общие стили */
.office-item {
    padding: 20px;
    margin-bottom: 12px;
    background: white;
    border-radius: 12px;
    cursor: pointer;
    border: 1px solid #f0f2f5;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
    box-sizing: border-box;
}
.office-item:hover {
    border-color: #d0d7de;
    background-color: #fafbfc;
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.05);
}
.office-item.active {
    border-left: 4px solid #1f2a3a;
    background-color: #f9fafb;
}
.office-item strong {
    font-size: 16px;
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
    color: #1f2a3a;
}
.office-item small {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 4px;
    word-break: break-word;
}
.rating-stars {
    color: #f5b342;
    font-size: 1.2em;
    letter-spacing: 2px;
}
.rating-value {
    font-weight: 500;
    color: #1f2a3a;
}
.office-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 8px;
}
.tag {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}
.tag.product {
    background: #e0f2fe;
    color: #0369a1;
}
.tag.service {
    background: #eef2f6;
    color: #1f2a3a;
}
.tag.certified {
    background: #ffedd5;
    color: #9a3412;
}
.office-links {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.route-link, .detail-link {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s;
    border: 1px solid transparent;
}
.route-link {
    background: #e8f0fe;
    color: #1f2a3a;
    border-color: #d0d7de;
}
.route-link:hover {
    background: #dde7f5;
    border-color: #9aa6b5;
}
.detail-link {
    background: #1f2a3a;
    color: white;
    border: none;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(31,42,58,0.2);
}
.detail-link:hover {
    background: #2d3b4f;
    box-shadow: 0 4px 12px rgba(31,42,58,0.3);
}
.no-results {
    padding: 40px 20px;
    text-align: center;
    color: #6b7280;
    font-size: 15px;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px dashed #d0d7de;
}
.cooperation-btn {
    display: inline-block;
    margin-top: 15px;
    padding: 12px 28px;
    background: #1f2a3a;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s;
    cursor: pointer;
}
.cooperation-btn:hover {
    background: #2d3b4f;
}
.clear-icon {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    display: none;
    color: #9aa6b5;
    font-size: 18px;
    line-height: 1;
    user-select: none;
    transition: color 0.15s;
}
.clear-icon:hover {
    color: #1f2a3a;
}
.filters-panel {
    background: #fefefe;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 12px 20px;
    margin-bottom: 20px;
}
.filters-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.filter-icon {
    width: 24px;
    height: 24px;
}
.filters-title {
    font-weight: 600;
    font-size: 18px;
    color: #1f2a3a;
}
.active-filters-count {
    background: #1f2a3a;
    color: white;
    font-size: 14px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 30px;
    line-height: 1.4;
}
.filter-buttons-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 24px;
}
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 180px;
}
.group-label {
    font-weight: 600;
    font-size: 14px;
    color: #4b5563;
}
.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.filter-btn {
    padding: 6px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 30px;
    background: #f3f4f6;
    color: #1f2a3a;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.office-links {
    flex-wrap: nowrap;
}
.office-links a {
    white-space: nowrap;
}
#loading {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 500;
    z-index: 1000;
    font-size: 14px;
}
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .mode-map-active #office-list {
        width: 35% !important;
    }
}
@media (max-width: 639px) {
    #city-search, #name-search, #search-btn, #reset-btn {
        width: 100% !important;
    }
    .mode-btn {
        flex: 1;
        text-align: center;
    }
    .filter-btn {
        flex: 1 0 auto;
        text-align: center;
    }
}
@media (max-width: 359px) {
    .office-item { padding: 12px; }
    .office-item strong { font-size: 15px; }
    .office-item small { font-size: 12px; }
    .route-link, .detail-link { padding: 8px 12px; font-size: 12px; }
    #city-search, #name-search { font-size: 14px; padding: 10px 12px; }
    #search-btn, #reset-btn { font-size: 14px; padding: 10px 12px; }
    .mode-btn { padding: 8px 16px; font-size: 14px; }
    .map-container { height: 500px; }
}
@media (max-width: 480px) {
    .office-links {
        flex-wrap: wrap;
    }
}
