/* Обертка для карты и информации о филиалах */
.location-map-wrapper {
    display: flex;
    flex-direction: row;
    gap: 30px;
    margin: 20px 0;
    align-items: flex-start;
}

/* Левая панель с информацией о филиалах */
.location-map-info {
    flex: 0 0 350px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    min-height: 600px;
    max-height: 600px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

@media (max-width: 1023px) {
    .location-map-info {
        min-height: 0 !important;
        max-height: none !important;
        height: auto !important;
        overflow-y: visible !important;
    }
}

.location-map-info-title {
    margin: 0 0 15px 0;
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

.location-map-info-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.location-map-info-loading {
    text-align: center;
    padding: 20px;
    color: #6b7280;
}

.location-map-info-empty,
.location-map-info-error {
    text-align: center;
    padding: 20px;
    color: #6b7280;
}

/* Элемент филиала */
.location-map-info-item {
    padding: 12px 15px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.3s ease;
}

.location-map-info-item:hover {
    background: #f3f4f6;
    border-color: var(--location-primary-color, #3b82f6);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.location-map-info-item.active {
    background: #eff6ff;
    border-color: var(--location-primary-color, #3b82f6);
    border-width: 2px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.location-map-info-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    gap: 8px;
    flex-wrap: wrap;
}

.location-map-info-item-name {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    flex: 1;
    line-height: 1.3;
}

.location-map-info-item-status {
    font-size: 11px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 12px;
    white-space: normal;
    word-wrap: break-word;
    flex-shrink: 0;
    max-width: 100%;
    text-align: right;
    line-height: 1.3;
}

.location-map-info-item-status.status-open {
    background: #d1fae5;
    color: #065f46;
}

.location-map-info-item-status.status-closed {
    background: #fee2e2;
    color: #991b1b;
}

.location-map-info-item-address,
.location-map-info-item-phone,
.location-map-info-item-schedule {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 13px;
    color: #4b5563;
    line-height: 1.4;
}

.location-map-info-item-address:last-child,
.location-map-info-item-phone:last-child,
.location-map-info-item-schedule:last-child {
    margin-bottom: 0;
}

.location-map-info-item-icon {
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 2px;
}

.location-map-info-item-phone a {
    color: var(--location-primary-color, #3b82f6);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.location-map-info-item-phone a:hover {
    color: var(--location-hover-color, #2563eb);
    text-decoration: underline;
}

.location-map-info-item-schedule-list {
    flex: 1;
}

.location-map-info-item-schedule-list > div {
    margin-bottom: 2px;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.3;
}

.location-map-info-item-schedule-list > div:last-child {
    margin-bottom: 0;
}

/* Общие контакты города */
.location-map-contacts {
    margin-top: auto;
    padding-top: 15px;
    border-top: 2px solid #e5e7eb;
    display: none;
    flex-shrink: 0;
}

.location-map-contacts-title {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

.location-map-contacts-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
}

.location-map-contact-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}

.location-map-contact-item:hover {
    border-color: #FF6B6B;
    background: rgba(255, 182, 193, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.location-map-contact-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.location-map-contact-icon svg,
.location-map-contact-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Стили для карты */
.location-map-container {
    flex: 1;
    min-width: 0;
    min-height: 600px;
    max-height: 600px;
    height: 600px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

.location-map-error {
    padding: 20px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    color: #856404;
    text-align: center;
}

/* Стили для балуна на карте */
.location-map-balloon {
    max-width: 400px;
    padding: 10px;
}

.location-map-balloon-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.location-map-balloon-description {
    margin: 0 0 10px 0;
    color: #4b5563;
    line-height: 1.5;
}

.location-map-balloon-address {
    margin: 0 0 10px 0;
    color: #6b7280;
    font-size: 14px;
}

.location-map-balloon-address strong {
    color: #374151;
}

.location-map-balloon-phone {
    margin: 0 0 10px 0;
    color: #6b7280;
    font-size: 14px;
}

.location-map-balloon-phone strong {
    color: #374151;
}

.location-map-balloon-phone-link {
    color: var(--location-primary-color, #3b82f6);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.location-map-balloon-phone-link:hover {
    color: var(--location-hover-color, #2563eb);
    text-decoration: underline;
}

.location-map-balloon-schedule {
    margin: 0 0 5px 0;
    color: #6b7280;
    font-size: 14px;
}

.location-map-balloon-schedule strong {
    color: #374151;
}

.location-map-balloon-schedule-list {
    margin: 0 0 10px 0;
}

.location-map-balloon-schedule-item {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.6;
    padding-left: 5px;
}

.location-map-balloon-schedule-item:not(:last-child) {
    margin-bottom: 3px;
}

.location-map-balloon-photo {
    margin-top: 10px;
}

.location-map-balloon-photo img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Адаптивность */
@media (max-width: 1023px) {
    .location-map-wrapper {
        flex-direction: column;
        gap: 20px;
    }
    
    .location-map-info {
        flex: none !important;
        max-width: 100%;
        height: auto !important;
        max-height: none !important;
        min-height: 0 !important;
        overflow-y: visible !important;
    }
    
    .location-map-container {
        height: 400px;
    }
    
    /* Горизонтальная прокрутка карточек филиалов на мобильных */
    .location-map-info-list {
        flex-direction: row !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        gap: 15px;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        flex-wrap: nowrap !important;
    }
    
    .location-map-info-item {
        flex: 0 0 calc(100% - 20px) !important;
        min-width: calc(100% - 20px) !important;
        max-width: calc(100% - 20px) !important;
        scroll-snap-align: start;
        width: calc(100% - 20px) !important;
    }
    
    /* Скрываем скроллбар, но оставляем функциональность */
    .location-map-info-list::-webkit-scrollbar {
        height: 4px;
    }
    
    .location-map-info-list::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 2px;
    }
    
    .location-map-info-list::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 2px;
    }
    
    .location-map-info-list::-webkit-scrollbar-thumb:hover {
        background: #a8a8a8;
    }
}

@media (max-width: 768px) {
    .location-map-container {
        height: 400px;
    }
    
    .location-map-info {
        padding: 10px 12px !important;
        max-height: none !important;
        height: auto !important;
        overflow-x: hidden;
        overflow-y: visible !important;
    }
    
    .location-map-info-title {
        font-size: 16px !important;
        margin-bottom: 8px !important;
        padding-bottom: 8px !important;
    }
    
    .location-map-info-list {
        flex-direction: row !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        flex-wrap: nowrap !important;
        gap: 10px !important;
        align-items: flex-start !important;
        height: auto !important;
        flex: none !important;
        min-height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .location-map-info-item {
        flex: 0 0 calc(100% - 10px) !important;
        min-width: calc(100% - 10px) !important;
        max-width: calc(100% - 10px) !important;
        width: calc(100% - 10px) !important;
        padding: 8px 10px !important;
        height: fit-content !important;
        max-height: none !important;
        align-self: flex-start !important;
        margin: 0 !important;
    }
    
    .location-map-info-item-header {
        margin-bottom: 6px !important;
    }
    
    .location-map-info-item-name {
        font-size: 14px !important;
        line-height: 1.2 !important;
    }
    
    .location-map-info-item-status {
        font-size: 10px !important;
        padding: 3px 6px !important;
    }
    
    .location-map-info-item-address,
    .location-map-info-item-phone,
    .location-map-info-item-schedule {
        margin-bottom: 4px !important;
        font-size: 11px !important;
        gap: 5px !important;
        line-height: 1.3 !important;
    }
    
    .location-map-info-item-icon {
        font-size: 11px !important;
        margin-top: 1px !important;
    }
    
    .location-map-info-item-schedule-list {
        margin-top: 2px !important;
    }
    
    .location-map-info-item-schedule-list > div {
        font-size: 10px !important;
        margin-bottom: 0 !important;
        line-height: 1.2 !important;
    }
    
    .location-map-balloon {
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .location-map-container {
        height: 300px;
    }
    
    .location-map-balloon {
        max-width: 250px;
    }
    
    .location-map-balloon-title {
        font-size: 16px;
    }
}

