/* map-styles.css */

/* Высота карты */
#library-branches-map {
    width: 100%;
    height: 800px;
}

/* Курсор для элементов аккордеона */
.library-map-accordion .elementor-tab-title,
.library-map-accordion .elementor-tab-title:hover {
    cursor: pointer !important;
}

/* Стили для контактов в аккордеоне */
.branch-contacts p {
    margin: 10px 0;
    line-height: 1.4;
}

.branch-contacts strong {
    color: #333;
    display: inline-block;
    margin-bottom: 2px;
}

.branch-contacts a {
    color: #1e73be;
    text-decoration: none;
}

.branch-contacts a:hover {
    text-decoration: underline;
}

.branch-additional-info {
    margin-top: 15px;
    padding-top: 15px;
}

.branch-additional-info hr {
    border: none;
    border-top: 1px solid #ddd;
    margin: 15px 0;
}

/* Стили для балунов */
.ymaps-balloon {
    z-index: 10000 !important;
}

.ymaps-balloon__content {
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1.3;
    z-index: 10001 !important;
    position: relative;
}

.ymaps-balloon__layout {
    z-index: 10000 !important;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.balloon-header {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eee;
}

.balloon-content {
    max-width: 280px;
}

.balloon-content strong {
    color: #333;
    display: inline;
    margin-bottom: 0;
    font-size: 13px;
    margin-right: 5px;
}

.balloon-content p {
    margin: 4px 0 !important;
    padding: 0;
    line-height: 1.3;
}

.balloon-content a {
    color: #1e73be;
    text-decoration: none;
    font-size: 13px;
}

.balloon-content a:hover {
    text-decoration: underline;
}

/* Мобильный выпадающий список */
.mobile-branch-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 15px;
    background-color: white;
    color: #333;
    display: none;
    cursor: pointer;
}

.mobile-branch-select:focus {
    outline: none;
    border-color: #1e73be;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    #library-branches-map {
        height: 500px !important;
    }
    
    .mobile-branch-select {
        display: block !important;
    }
    
    .library-map-accordion .elementor-accordion-item {
        display: none;
    }
    
    .balloon-content {
        max-width: 260px;
    }
    
    .balloon-content p {
        margin: 5px 0 !important;
    }
}

@media (min-width: 769px) {
    .mobile-branch-select {
        display: none !important;
    }
    
    .library-map-accordion .elementor-accordion-item {
        display: block;
    }
}

/* Убираем надпись "Создать свою карту" если она мешает */
.ymaps-2-1-79-copyrights-promo {
    display: none !important;
}

/* Фикс для статичных меток */
.ymaps-2-1-79-placemark-overlay,
.ymaps-2-1-79-placemark__layout,
.ymaps-2-1-79-placemark {
    transition: none !important;
    animation: none !important;
}

/* Отключаем все трансформации для меток */
.ymaps-2-1-79-placemark-overlay,
.ymaps-2-1-79-placemark__layout,
.ymaps-2-1-79-placemark__content {
    transform: none !important;
    will-change: auto !important;
}

/* Принудительно закрываем все вкладки в редакторе Elementor */
.elementor-editor-active .library-map-accordion .elementor-tab-content {
    display: none !important;
}

.elementor-editor-active .library-map-accordion .elementor-accordion-item {
    margin-bottom: 5px;
}

/* Отображаем только активную вкладку */
.elementor-editor-active .library-map-accordion .accordion-active .elementor-tab-content {
    display: block !important;
}

/* Стили для номерных иконок в балунах */

.branch-number-icon {
    position: relative;
    display: inline-block;
    width: 54px;
    height: 54px;
    margin-right: 10px;
    vertical-align: middle;
    flex-shrink: 0;
}

.branch-number-svg {
    width: 100%;
    height: 100%;
    fill: #1B413C;
}

.branch-number {
    font-family: 'Mulish' !important;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #1B413C;
    font-size: 22px;
    font-weight: bolder;
    line-height: 1;
    white-space: nowrap;
}

.balloon-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eee;
    min-height: 32px;
}

.branch-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    flex: 1;
    line-height: 1.2;
}

.balloon-header-wrapper {
    padding: 0;
    margin: 0;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .branch-number-icon {
        width: 28px;
        height: 28px;
    }
    
    .branch-number {
        font-size: 12px;
    }
    
    .branch-title {
        font-size: 14px;
    }
}

/* Стили для номерных иконок в аккордеоне */
.accordion-branch-number-icon {
    position: absolute;
    right: 15px;
    width: 65px;
    height: 65px;
    z-index: 10;
}

.accordion-branch-number-svg {
    width: 100%;
    height: 100%;
    fill: #1B413C;
}

.accordion-branch-number {
    font-family: 'Mulish' !important;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #1B413C;
    font-size: 30px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

/* Позиционирование для контента аккордеона */
.library-map-accordion .elementor-tab-content {
    position: relative;
    padding-top: 20px;
}

.branch-contacts {
    position: relative;
    z-index: 5;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .accordion-branch-number-icon {
        width: 45px;
        height: 45px;
        top: 10px;
        right: 10px;
    }
    
    .accordion-branch-number {
        font-size: 20px;
    }
    
    .library-map-accordion .elementor-tab-content {
        padding-top: 15px;
    }
    
    .novisible-mob {
    display: none;
    }
}

/* Стили для аккордеона с состояниями */
.library-map-accordion .elementor-accordion-item {
    border: 1px solid #ddd;
    margin-bottom: 10px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.library-map-accordion .elementor-tab-title {
    padding: 15px 20px;
    background-color: #f9f9f9;
    border: none;
    transition: all 0.3s ease;
    position: relative;
}

.library-map-accordion .elementor-tab-title:hover {
    background-color: #f0f0f0;
}

.library-map-accordion .elementor-tab-title.accordion-active {
    background-color: #e9e9e9;
    border-bottom: 1px solid #ddd;
}

.library-map-accordion .elementor-accordion-icon {
    margin-right: 10px;
    transition: all 0.3s ease;
}

.library-map-accordion .elementor-tab-content {
    background-color: white;
    border-radius: 0 0 5px 5px;
    transition: all 0.3s ease;
}

/* Стили для ссылок в контенте */
.library-map-accordion .elementor-tab-content a {
    color: #1e73be;
    text-decoration: none;
    transition: color 0.3s ease;
}

.library-map-accordion .elementor-tab-content a:hover {
    color: #155792;
    text-decoration: underline;
}

.sticky-map {
    position: sticky !important;
    top: 100px;
}

/* Добавьте в конец файла map-styles.css */

/* Стили для мобильного балуна */
@media (max-width: 768px) {
    .ymaps-balloon__content {
        max-height: 50vh;
        overflow-y: auto;
        padding: 15px;
    }
    
    .ymaps-balloon__layout {
        border-radius: 16px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    }
    
    .balloon-content {
        max-width: 100%;
        font-size: 14px;
        line-height: 1.4;
    }
    
    .balloon-content p {
        margin: 8px 0 !important;
    }
    
    .balloon-header {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 12px;
        padding-bottom: 10px;
    }
    
    .branch-number-icon {
        margin-bottom: 8px;
        width: 40px;
        height: 40px;
    }
    
    .branch-number {
        font-size: 16px;
    }
    
    .branch-title {
        font-size: 16px;
        line-height: 1.3;
    }
    
    /* Увеличиваем область клика для закрытия балуна */
    .ymaps-balloon__close {
        width: 35px;
        height: 35px;
        background: rgba(0, 0, 0, 0.1);
        border-radius: 50%;
    }
    
    .ymaps-balloon__close-button {
        width: 35px;
        height: 35px;
        background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>') no-repeat center;
        background-size: 20px;
    }
}

/* Улучшаем скролл внутри балуна */
.ymaps-balloon__content::-webkit-scrollbar {
    width: 6px;
}

.ymaps-balloon__content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.ymaps-balloon__content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.ymaps-balloon__content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}