/* =========================================
   ТОЧКИ ПРОДАЖ — дизайн Figma node 122:2473
   ========================================= */

.bj-stores {
    background: var(--color-bg-light, #f9f8f3);
    color: var(--color-dark, #20000a);
    padding: 80px 0 0;
}

.bj-stores__inner {
    max-width: 1920px;
    padding: 46px 58px 0;
    margin: 0 auto;
}

/* ---- Шапка: заголовок + поиск в одну строку ---- */

.bj-stores__title {
    font-family: var(--font-main);
    font-weight: 400;
    letter-spacing: -0.16px;
    color: var(--color-dark);
    margin: 0;
    font-size: 36px;
    line-height: 120%;
    vertical-align: middle;
}

.bj-stores__wrap {
    padding-top: 29px;
    display: grid;
    grid-template-columns: 472px 1fr;
    grid-template-rows: auto 1fr; /* Первая строка (поиск) - auto, вторая - 1fr */
    gap: 50px;
    margin: 0 auto;
    min-height: 600px;
    height: 100%;
}

/* ---- Поиск ---- */

.bj-stores__search {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 20px;
    height: 60px;
    min-width: 320px;
    max-width: 436px;
    padding: 0 18px;
    border-radius: 14px;
    grid-row: 1;
    grid-column: 1;
    background: #ECE8E5;
}

.bj-stores__search-icon {
    flex-shrink: 0;
    color: #20000A;
    width: 18px;
    height: 18px;
}

.bj-stores__search {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.bj-stores__search-icon {
    color: currentColor;
}

.bj-stores__search-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: none;
    font-family: var(--font-main);
    color: var(--color-dark);
    letter-spacing: -0.16px;
    font-weight: 400;
    font-size: 20px;
    line-height: 21.28px;
    vertical-align: middle;
    transition: .3s;
}

.bj-stores__search::after {
    content: '';
    position: absolute;
    right: 19px;
    top: 50%;
    transform: translateY(-50%);
    width: 25px;
    height: 11px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="25" height="11" viewBox="0 0 25 11" fill="none"><path d="M0.5 0.5L12.5 9.5L24.5 0.5" stroke="%2320000A" stroke-linecap="round"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
    transition: opacity 0.3s;
}

/* При фокусе на инпуте стрелка становится ярче */
.bj-stores__search-input:focus + .bj-stores__search::after,
.bj-stores__search:hover::after {
    opacity: 1;
}

.bj-stores__search-input::placeholder {
    color: rgba(32, 0, 10);
    transition: .3s;
}

.bj-stores__search-input:focus::placeholder {
    opacity: 0;
}

.bj-stores__search-input:focus {
    outline: none;
}

/* ---- Список магазинов с адаптивной высотой ---- */
.bj-stores__list-wrap {
    grid-row: 2;
    grid-column: 1;
    height: 100%;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #20000A #e6e0d7;
    max-height: none;
}

/* Стилизация скроллбара для WebKit браузеров */
.bj-stores__list-wrap::-webkit-scrollbar {
    width: 6px;
}

.bj-stores__list-wrap::-webkit-scrollbar-track {
    background: #e6e0d7;
    border-radius: 3px;
}

.bj-stores__list-wrap::-webkit-scrollbar-thumb {
    background: #20000A;
    border-radius: 3px;
}

.bj-stores__list-wrap::-webkit-scrollbar-thumb:hover {
    background: #4a0a1a;
}

.bj-stores__list {
    list-style: none;
    margin: 0;
    padding: 0 8px 0 0; /* Правый отступ для скроллбара */
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.bj-stores__item {
    max-width: 100%;
}

.bj-stores__item:last-child {
    border-bottom: none;
}

.bj-stores__item.is-active .bj-stores__card .bj-stores__card-address{

    color:  #000000;
}

.bj-stores__card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 0 0 20px;
    margin-bottom: 20px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.bj-stores__card:hover {
    opacity: 0.85;
}

.bj-stores__card-main {
    flex: 1;
    min-width: 0;
}

.bj-stores__wrap-title {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.bj-stores__card-title {
    font-family: var(--font-main);
    color: var(--color-dark);
    margin: 0 0 11px;
    font-weight: 400;
    font-size: 20px;
    letter-spacing: 0;
    vertical-align: middle;
    line-height: 120%;
}

.bj-stores__card-address {
    font-family: var(--font-main);
    font-size: 16px;
    font-weight: 400;
    color: #7b7b7b;
    letter-spacing: -0.16px;
    margin: 0 0 21px;
    line-height: 21.28px;
    vertical-align: middle;
}

.bj-stores__card-desc {
    font-family: var(--font-main);
    font-size: 16px;
    font-weight: 400;
    color: #7b7b7b;
    letter-spacing: -0.16px;
    margin: 0;
    line-height: 21.28px;
}

.bj-stores__card-arrow {
    flex-shrink: 0;
    color: #F9F8F3;
    width: 31px;
    height: 31px;
    background: #20000A;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 37px;
}

/* ---- Фильтр городов ---- */

.bj-stores__cities {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 16px;
    flex-shrink: 0;
}

.bj-stores__city-btn {
    font-family: var(--font-main);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -0.16px;
    padding: 9px 10px;
    border-radius: 10px;
    border: 1px solid var(--color-dark, #20000A);
    background: transparent;
    color: var(--color-dark, #20000A);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.bj-stores__city-btn.is-active,
.bj-stores__city-btn:hover {
    background: var(--color-dark, #20000A);
    color: var(--color-light, #F9F8F3);
}


/* ---- Карта с адаптивной высотой ---- */
.bj-stores__map-wrap {
    grid-column: 2;
    grid-row: 1 / 3;
    height: 100%;
    position: relative;
    min-height: 480px;
    display: flex;
    flex-direction: column;
}

.bj-stores__map {
    flex: 1;
    min-height: 400px;
    overflow: hidden;
    border-radius: 5px;
    position: relative;
}

.bj-stores__map-error {
    padding: 24px;
    font-family: var(--font-main);
    font-size: 14px;
    color: #7b7b7b;
    line-height: 1.5;
}

.bj-stores__map-error a {
    color: var(--color-dark);
}

.bj-stores__map-wrap .ymaps-2-1-79-map {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
}

/* Для разрешения 1920px и выше - фиксированная высота карты 1003px */
@media screen and (min-width: 1920px) {
    .bj-stores__map-wrap {
        height: 1003px;
        min-height: 1003px;
    }

    .bj-stores__map-wrap .bj-stores__map {
        min-height: 0;
    }

    .bj-stores__wrap {
        min-height: 1003px;
        height: 1003px;
    }
}

/* Для экранов меньше 1920px - карта адаптивная */
@media screen and (max-width: 1919px) {
    .bj-stores__map-wrap {
        height: 100%;
        min-height: 480px;
    }

    .bj-stores__wrap {
        min-height: 600px;
        height: auto;
    }
}

/* ---- Попап на карте ---- */

.bj-stores__popup {
    position: absolute;
    z-index: 100;
    display: none;
    background: var(--color-bg-light);
    border-radius: 5px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 16px;
    min-width: 280px;
}

@media (max-width: 1024px) {
    .bj-stores__popup {
        left: 0 !important;
        right: 0;
        width: calc(100% - 32px);
        margin: 0 auto;
        bottom: 10px;
        top: auto !important;
    }
}

.bj-stores__popup[aria-hidden="false"] {
    display: block;
}

.bj-stores__popup-inner {
    position: relative;
    display: flex;
    gap: 10px;
}

.bj-stores__popup-image {
    width: 73px;
    height: 73px;
    border-radius: 5px;
    overflow: hidden;
    background: #ece8e5;
}

.bj-stores__popup-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bj-stores__popup-title {
    font-family: var(--font-main);
    font-size: 16px;
    font-weight: 400;
    color: var(--color-dark);
    margin: 0 0 5px;
    line-height: 120%;
    letter-spacing: 0;
}

.bj-stores__popup-address {
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 400;
    color: #7b7b7b;
    letter-spacing: -0.16px;
    margin: 0;
    line-height: 21.28px;
}

.bj-stores__popup-content {
    padding-right: 20px;
}

.bj-stores__popup-close {
    position: absolute;
    top: 0;
    right: 0;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--color-dark);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bj-stores__popup-close:hover {
    opacity: 0.7;
}

/* ---- Пустое состояние ---- */

.bj-stores__empty {
    font-family: var(--font-main);
    font-size: 16px;
    color: #7b7b7b;
    margin: 0;
    line-height: 1.5;
}

/* ---- Скрытие при фильтрации ---- */

.bj-stores__item.bj-stores__item--hidden {
    display: none;
}

/* ---- Тёмная тема ---- */


/* ---- Адаптивность ---- */

/* Десктопы средние */
@media screen and (max-width: 1400px) {
    .bj-stores__wrap {
        grid-template-columns: 400px 1fr;
        gap: 30px;
    }
}

/* Планшеты горизонтально */
@media screen and (max-width: 1200px) {
    .bj-stores__inner {
        padding: 20px 28px 0;
    }

    .bj-stores__wrap {
        grid-template-columns: 350px 1fr;
        gap: 25px;
    }
}

/* Планшеты вертикально */
@media screen and (max-width: 1024px) {
    .bj-stores__wrap {
        grid-template-columns: 1fr; /* Меняем на одноколоночную сетку */
        grid-template-rows: auto auto auto;
        gap: 30px;
        min-height: auto;
        height: auto;
    }

    .bj-stores__search {
        grid-column: 1;
        grid-row: 1;
        max-width: 100%;
        margin-bottom: 20px;
    }

    .bj-stores__list-wrap {
        grid-row: 3;
        grid-column: 1;
        max-height: 400px; /* Фиксированная высота для списка */
        height: auto;
        margin-bottom: 20px;
        overflow-y: auto;
    }

    .bj-stores__map-wrap {
        grid-row: 2;
        grid-column: 1;
        position: relative;
        height: 450px;
        min-height: 350px;
        margin-top: 0;
    }

    .bj-stores__map {
        min-height: 350px;
    }

    .bj-stores__list {
        padding: 0;
    }

    .bj-stores__card-arrow {
        margin-right: 0;
    }
    .bj-stores {
        padding: 88px 0 0;
    }
}

/*HERO*/
.bj-stores__img-wrap {
    margin-top: 89px;
    width: 100%;
    background-image: url('/local/templates/bojeni/img/contacts-hero.jpg');
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    height: 900px;
}

@media screen and (min-width: 1920px) {
    .bj-stores__img-wrap {
        height: 709px;
    }
}

@media screen and (max-width: 1919px) {
    .bj-stores__img-wrap {
        height: 0;
        padding-bottom: 45%;
        background-size: cover;
        position: relative;
    }
}

/* Скрываем на мобильных */
@media screen and (max-width: 768px) {
    .bj-stores__img-wrap {
        display: none;
    }
}

/* Мобильные устройства */
@media screen and (max-width: 768px) {
    .bj-stores__cities {

        padding: 0 18px 16px;
    }
    .bj-stores {
        padding: 89px 0 40px;
    }

    .bj-stores__inner {
        padding: 39px 0 0;
    }

    .bj-stores__wrap {
        display: flex;
        flex-direction: column;
        gap: 20px;
        padding-top: 0;
        min-height: auto;
        height: auto;
    }

    .bj-stores__title {
        margin-bottom: 18px;
        font-size: 24px;
        letter-spacing: 0;
        padding: 0 10px;
    }

    .bj-stores__search {
        order: 1;
        margin: 0 auto;
        max-width: 95%;
    }

    .bj-stores__search-input {
        font-weight: 500;
        font-size: 16px;
        line-height: 21.28px;
        letter-spacing: -0.16px;
    }

    .bj-stores__search::after {
        display: none;
    }

    .bj-stores__list-wrap {
        max-height: 350px;
        height: auto;
        order: 3;
        padding: 7px 10px 0;
        overflow-y: auto;
    }

    .bj-stores__card {
        padding-bottom: 16px;
        margin-bottom: 16px;
    }

    .bj-stores__card-title {
        margin-bottom: 10px;
    }

    .bj-stores__card-address,
    .bj-stores__card-desc {
        margin-bottom: 12px;
    }

    .bj-stores__card-address {
        margin-bottom: 21px;
    }

    .bj-stores__card-desc {
        margin-bottom: 10px;
    }

    .bj-stores__card-arrow {
        width: 31px;
        height: 31px;
    }

    .bj-stores__card-arrow svg {
        width: 20px;
        height: 20px;
    }

    .bj-stores__map-wrap {
        height: 350px;
        min-height: 300px;
        order: 2;
    }

    .bj-stores__map {
        min-height: 300px;
    }

    .bj-stores__popup {
        min-width: 240px;
        padding: 12px;
    }

    .bj-stores__search-input::placeholder {
        opacity: 0.7;
    }

    /* Для Firefox */
    .bj-stores__search-input::-moz-placeholder {
        opacity: 0.7;
    }

    /* Для Internet Explorer */
    .bj-stores__search-input:-ms-input-placeholder {
        opacity: 0.7;
    }

    /* Для старых версий Edge */
    .bj-stores__search-input::-ms-input-placeholder {
        opacity: 0.7;
    }
}

@media screen and (max-width: 602px) {
    .bj-stores__cities {
        padding: 0 10px 16px;
    }
}
@media screen and (max-width: 402px) {
    .bj-stores__map-wrap {
        height: 300px;
        min-height: 288px;
    }

    .bj-stores__list-wrap {
        max-height: 300px;
    }

}

/* Высокие экраны */
@media screen and (min-height: 1080px) {
    .bj-stores__wrap {
        min-height: 800px;
    }

    .bj-stores__list-wrap {
        max-height: calc(100vh - 350px);
    }
}