/*
 * 1zeh_v2 — Filials Yandex Map module
 * Isolated module styles. Temporary visual goal: repeat old 1zeh.ru modal/map behaviour.
 */

.xs_filials__modal.dn {
    display: none;
}

.xs_filials__modal.xs-filials__modal--open {
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background: rgba(0, 0, 0, .55);
    box-sizing: border-box;
}

body.xs-filials-modal-open {
    overflow: hidden;
}

.xs-filials-map-modal__dialog {
    position: relative;
    width: min(1280px, 100%);
    height: min(760px, calc(100vh - 60px));
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, .24);
    overflow: hidden;
    font-family: var(--xs-font-family-primary);
}

.xs-filials__modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: #2C3137;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
    cursor: pointer;
    font-size: 30px;
    line-height: 1;
    transition: color .2s ease, transform .2s ease;
}

.xs-filials__modal-close:hover {
    color: var(--akcent_color, #c8352f);
    transform: rotate(90deg);
}

.xs_filials_map_module {
    position: relative;
    width: 100%;
    height: 100%;
    background: #fff;
}

.xs-filials-map__title {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 6;
    width: 350px;
    height: 68px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

.xs-filials-map__title .container {
    width: auto;
    max-width: none;
    padding: 0 22px;
}

.xs-filials-map__title h2 {
    margin: 0;
    padding: 20px 0 0;
    color: #2C3137;
    font-family: var(--xs-font-family-primary);
    font-size: 24px;
    font-weight: var(--xs-font-weight-semibold);
    line-height: 1.2;
}

.xs-filials-map__container {
    display: flex;
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    max-width: none;
}

.xs-filials-map__sidebar {
    position: relative;
    z-index: 5;
    flex: 0 0 350px;
    width: 350px;
    height: 100%;
    padding-top: 68px;
    padding-bottom: 24px;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    scrollbar-gutter: stable;
    background: #fff;
    box-shadow: 4px 0 16px rgba(0, 0, 0, .08);
    transition: transform .28s ease;
}

.xs-filials-map__map {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    background: #eef2f5;
}

.xs-filials-map__sidebar-toggle {
    position: absolute;
    top: 82px;
    left: 350px;
    z-index: 8;
    display: none;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 0 6px 6px 0;
    background: #fff;
    color: #2C3137;
    box-shadow: 3px 2px 10px rgba(0,0,0,.12);
    cursor: pointer;
    transition: left .28s ease, transform .28s ease;
}

.search-container {
    display: none;
}

.filial-item {
    padding: 14px 20px;
    border-bottom: 1px solid #edf0f2;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease;
}

.filial-item:hover,
.filial-item.is-active {
    background: #f8f8f8;
}

.filial-item.all-filials {
    position: sticky;
    top: 0;
    z-index: 4;
    background: #fff;
    padding-top: 16px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, .04);
}

.filial-name {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #2C3137;
    font-size: 17px;
    font-weight: var(--xs-font-weight-semibold);
    line-height: 1.25;
}

.xs-filials-map__brand-mark,
.xs-filials-map__brand-text {
    display: inline-block;
    width: 32px;
    min-width: 32px;
    height: 20px;
    flex: 0 0 32px;
    object-fit: contain;
    vertical-align: middle;
}

.filial-address {
    margin-top: 5px;
    color: #687479;
    font-size: 14px;
    font-weight: var(--xs-font-weight-regular);
    line-height: 1.35;
}

.filials-search {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid #dfe5e8;
    border-radius: 6px;
    outline: none;
    color: #2C3137;
    font-family: var(--xs-font-family-primary);
    font-size: 14px;
    box-sizing: border-box;
}

.filials-search:focus {
    border-color: var(--akcent_color, #c8352f);
}

.filial-info-window {
    min-width: 220px;
    max-width: 310px;
    font-family: var(--xs-font-family-primary), Arial, sans-serif;
}

.xs_card_filial_name {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
    color: #2C3137;
    font-size: 18px;
    font-weight: var(--xs-font-weight-semibold);
    line-height: 1.25;
}

.filial-info-window p {
    margin: 0 0 10px;
    color: #687479;
    font-size: 14px;
    line-height: 1.4;
}

.filial-info-window a {
    color: var(--akcent_color, #c8352f);
    font-size: 14px;
    font-weight: var(--xs-font-weight-semibold);
    text-decoration: none;
}

.xs-filials-map__notice {
    position: absolute;
    right: 24px;
    bottom: 24px;
    z-index: 10;
    padding: 12px 16px;
    border-radius: 6px;
    background: #fff3cd;
    color: #664d03;
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    font-size: 14px;
}

@media (max-width: 991px) {
    .xs_filials__modal.xs-filials__modal--open {
        padding: 15px;
    }

    .xs-filials-map-modal__dialog {
        height: calc(100vh - 30px);
        border-radius: 8px;
    }

    .xs-filials-map__container {
        position: relative;
        overflow: hidden;
    }

    .xs-filials-map__title,
    .xs-filials-map__sidebar {
        position: absolute;
        left: 0;
        width: 310px;
        max-width: calc(100vw - 70px);
        flex-basis: auto;
    }

    .xs-filials-map__title {
        top: 0;
        z-index: 9;
        transform: translateX(-100%);
        transition: transform .28s ease;
    }

    .xs-filials-map__sidebar {
        top: 0;
        z-index: 8;
        transform: translateX(-100%);
    }

    .xs-filials-map__map {
        width: 100%;
        flex-basis: 100%;
        margin-left: 0;
    }

    .xs-filials-map__sidebar-toggle {
        display: flex;
        top: 50%;
        left: 0;
        transform: translateY(-50%);
    }

    .xs_filials_map_module.sidebar-open .xs-filials-map__title,
    .xs_filials_map_module.sidebar-open .xs-filials-map__sidebar {
        transform: translateX(0);
    }

    .xs_filials_map_module.sidebar-open .xs-filials-map__sidebar-toggle {
        left: min(310px, calc(100vw - 70px));
        transform: translateY(-50%) rotate(180deg);
    }
}

@media (max-width: 640px) {
    .xs_filials__modal.xs-filials__modal--open {
        padding: 0;
    }

    .xs-filials-map-modal__dialog {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }

    .xs-filials__modal-close {
        top: 10px;
        right: 10px;
        width: 34px;
        height: 34px;
        font-size: 26px;
    }

    .xs-filials-map__title,
    .xs-filials-map__sidebar {
        width: 285px;
        max-width: calc(100vw - 58px);
    }

    .xs-filials-map__title h2 {
        font-size: 21px;
    }

    .xs_filials_map_module.sidebar-open .xs-filials-map__sidebar-toggle {
        left: min(285px, calc(100vw - 58px));
    }
}
