/* CSS исправления для корректного отображения контактов */

/* Основная структура страницы контактов */
.contacts-block {
    display: flex;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.contacts-block .left-col {
    flex: 0 0 400px;
    background: #000029;
    color: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.contacts-block .right-col {
    flex: 1;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    min-height: 500px;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .contacts-block {
        flex-direction: column;
        padding: 10px;
    }
    
    .contacts-block .left-col {
        flex: none;
        width: 100%;
    }
    
    .contacts-block .right-col {
        flex: none;
        width: 100%;
    }
}

/* Исправление отображения кнопки "Схема проезда" */
.contacts-block .left-col .button-wrap {
    margin-bottom: 20px;
    padding: 0;
    position: relative;
    z-index: 5;
    overflow: visible;
}

.contacts-block .left-col .link-to-scheme {
    display: inline-block;
    background: #e31c24 url("/bitrix/templates/main/img/map-ico.svg") no-repeat 20px 50%/33px 34px;
    padding: 18px 25px 18px 75px;
    color: #fff;
    font-size: 17px;
    text-align: center;
    border: none;
    position: relative;
    margin-bottom: 30px;
    box-sizing: border-box;
    overflow: visible;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(227, 28, 36, 0.3);
}

.contacts-block .left-col .link-to-scheme:hover {
    background-color: #c01921;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(227, 28, 36, 0.4);
    text-decoration: none;
    color: #fff;
}

/* Исправление для мобильных устройств */
@media (max-width: 550px) {
    .contacts-block .left-col .link-to-scheme {
        background: #e31c24 url("/bitrix/templates/main/img/map-ico.svg") no-repeat 10px 50%/23px 24px;
        padding: 10px 10px 10px 40px;
        font-size: 15px;
        margin-bottom: 15px;
        white-space: normal;
    }
}

/* Обеспечиваем корректное отображение контента в левой колонке */
.contacts-block .left-col .content {
    background: #000029;
    color: #fff;
    z-index: 4;
    padding: 20px;
    min-height: 0;
    box-sizing: border-box;
    overflow: visible;
}

/* Стили для контактной информации */
.contact-info {
    margin-bottom: 30px;
    text-align: center;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    width: 100% !important;
    overflow: visible !important;
}

.contact-info .phone {
    font-size: 32px;
    font-weight: bold;
    color: #000;
    margin-bottom: 20px;
    line-height: 1.2;
    text-align: center;
}

.contact-info p {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #000 !important;
    font-size: 16px !important;
    text-align: center;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    width: auto !important;
    overflow: visible !important;
}

.contact-info p:first-of-type {
    color: #007bff !important;
    text-decoration: underline !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.contact-details {
    margin-top: 20px;
}

.contact-details h3 {
    color: #fff;
    font-size: 24px;
    margin-bottom: 15px;
    font-weight: 600;
}

.contact-details p {
    margin-bottom: 10px;
    color: #DADEED;
    line-height: 1.5;
}

.contact-details .phone {
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    margin-top: 15px;
}

/* Исправление для контейнера с кнопкой */
.contacts-block .left-col .content .button-wrap {
    position: relative;
    z-index: 5;
    margin-bottom: 20px;
    padding: 0;
    overflow: visible;
}

/* Исправление отображения телефона */
.contacts-block .left-col .phone {
    color: #000;
    font-size: 32px;
    font-family: "Open Sans", sans-serif;
    font-weight: 700;
    padding-bottom: 40px;
    margin-bottom: 20px;
    line-height: 1.2;
}

/* Исправление отображения адреса */
.contacts-block .left-col p {
    line-height: 30px;
    padding-bottom: 25px;
    margin-bottom: 15px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Исправление отображения ссылок */
.contacts-block .left-col a {
    color: #DADEED;
    border: none;
    text-decoration: none;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.contacts-block .left-col a:hover {
    color: #fff;
    text-decoration: underline;
}

/* Исправление отображения заголовков */
.contacts-block .left-col h3 {
    padding-bottom: 10px;
    color: #fff;
    margin-bottom: 15px;
    line-height: 1.3;
}

/* Исправление отображения табов */
.contacts-block .left-col .tab-links {
    margin-top: 30px;
    color: #DADEED;
    margin-bottom: 20px;
}

.contacts-block .left-col .tab-links .aloneTab {
    font-size: 28px;
    padding-bottom: 40px;
    margin-bottom: 20px;
    font-weight: 600;
}

.contacts-block .left-col .tab-links a {
    border-bottom: 2px solid #535267;
    padding-bottom: 8px;
    display: inline-block;
    margin-bottom: 15px;
    color: #DADEED;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 16px;
}

.contacts-block .left-col .tab-links a:hover {
    border-color: #007bff;
    color: #007bff;
    text-decoration: none;
}

.contacts-block .left-col .tab-links p {
    margin-bottom: 15px;
    line-height: 1.6;
}

.contacts-block .left-col .tab-links br {
    margin-bottom: 10px;
}

/* Обеспечиваем корректное отображение в контейнере */
.contacts-block .left-col .header > div {
    padding: 40px 20px;
    min-height: auto !important;
    height: auto !important;
    max-height: none !important;
    position: relative;
    z-index: 3;
    background: #fff;
    box-sizing: border-box;
    overflow: visible !important;
    border-radius: 8px 8px 0 0;
    text-align: center;
}

/* Исправление для адаптивности */
@media only screen and (max-width: 1100px) {
    .contacts-block .left-col .header > div {
        padding: 30px 20px;
    }
    
    .contact-info .phone {
        font-size: 28px;
    }
}

@media only screen and (max-width: 900px) {
    .contacts-block .left-col .header > div {
        padding: 25px 15px;
    }
    
    .contact-info {
        padding: 30px 15px;
    }
    
    .contact-info .phone {
        font-size: 24px;
    }
    
    .contacts-block .left-col .tab-links .aloneTab {
        font-size: 24px;
        padding-bottom: 30px;
    }
}

@media only screen and (max-width: 550px) {
    .contact-info {
        padding: 25px 15px;
    }
    
    .contact-info .phone {
        font-size: 22px;
        margin-bottom: 15px;
    }
    
    .contact-info p {
        font-size: 14px;
        margin-bottom: 12px;
    }
    
    .contacts-block .left-col .tab-links .aloneTab {
        font-size: 20px;
        padding-bottom: 25px;
    }
    
    .contacts-block .left-col p {
        line-height: 24px;
        padding-bottom: 15px;
    }
}

/* Стили для контента правой колонки */

.contacts-content {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
    height: 100%;
}

/* Убираем модальное поведение */
.modal-contacts {
    display: none !important;
}

.close-btn {
    display: none !important;
}

.contact-heading {
    color: #333;
    font-size: 24px;
    margin-bottom: 20px;
    text-align: center;
}

/* Стили для фильтров */
.filters {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.filters-title {
    font-weight: bold;
    color: #333;
    font-size: 16px;
}

.filter-actions {
    display: flex;
    gap: 10px;
}

.btn-reset, .btn-show-all {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.btn-reset:hover, .btn-show-all:hover {
    background: #5a6268;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.filter-item label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.filter-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

/* Стили для табов */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.tab.active {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

.tab:hover:not(.active) {
    background: #e9ecef;
    border-color: #dee2e6;
}

.tab-icon {
    font-size: 18px;
}

.tab-text {
    font-weight: 500;
}

.count {
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.tab.active .count {
    background: rgba(255,255,255,0.3);
}

/* Стили для сортировки */
.sort-controls-compact {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.sort-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
    color: #555;
}

.sort-icon {
    font-size: 16px;
}

.sort-buttons {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.sort-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.sort-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.sort-btn:hover:not(.active) {
    background: #f8f9fa;
    border-color: #adb5bd;
}

/* Стили для карточек */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}

.company-info {
    flex: 1;
}

.company-name {
    font-weight: bold;
    font-size: 16px;
    color: #333;
    margin-bottom: 5px;
}

.company-type {
    font-size: 12px;
    color: #6c757d;
    background: #f8f9fa;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
}

.expand-icon {
    font-size: 14px;
    color: #6c757d;
    transition: transform 0.3s ease;
}

.card-header.expanded .expand-icon {
    transform: rotate(180deg);
}

.location-badges, .presence-badges {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.badge.country {
    background: #e3f2fd;
    color: #1976d2;
}

.badge.region {
    background: #f3e5f5;
    color: #7b1fa2;
}

.badge.city {
    background: #e8f5e8;
    color: #388e3c;
}

.badge.presence {
    background: #fff3e0;
    color: #f57c00;
}

.contact-info {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.contact-info.expanded {
    max-height: 200px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
}

.contact-item .icon {
    font-size: 16px;
}

.contact-item a {
    color: #007bff;
    text-decoration: none;
}

.contact-item a:hover {
    text-decoration: underline;
}

/* Адаптивность */
@media (max-width: 768px) {
    .filters-grid {
        grid-template-columns: 1fr;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .sort-controls-compact {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .cards {
        grid-template-columns: 1fr;
    }
    
    .tab {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .modal-contacts {
        padding: 15px;
    }
    
    .contact-heading {
        font-size: 20px;
    }
    
    .card {
        padding: 15px;
    }
    
    .company-name {
        font-size: 14px;
    }
}

