/* where-to-buy */

.intro {
    font-size: 16px;
    line-height: 1.45;
    max-width: 1473px;
    margin: 0 0 18px;
}

/* ---- tabs / switch ---- */

.wtb-switch {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 24px;
}

.wtb-tabs {
    display: flex;
    flex-direction: column;
    gap: 9px;
    width: 247px;
    flex: none;
}

.wtb-views {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: none;
}

.wtb-view {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    letter-spacing: -0.025em;
    color: var(--ink);
    cursor: pointer;
    width: max-content;
    background: none;
    border: none;
    padding: 0;
    font-family: var(--font);
    transition: color 0.15s;

    &:hover {
        color: var(--blue);
    }

    &.is-active {
        color: var(--blue);
    }

}

.wtb-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    letter-spacing: -0.025em;
    color: var(--ink);
    cursor: pointer;
    width: max-content;
    transition: color 0.15s;
    text-decoration: none;

    &:hover {
        color: var(--blue);
    }

    &.is-active {
        color: var(--blue);
    }

    & .arrow {
        width: 13px;
        height: 8px;
        flex: none;
        color: var(--blue);
        visibility: hidden;
    }

    &.is-active .arrow {
        visibility: visible;
    }
}

/* ---- map (retail view) ---- */

.map-wrap {
    position: relative;
    isolation: isolate;
    width: 100%;
    height: clamp(400px, 50vw, 750px);
    overflow: hidden;
    margin-bottom: 30px;
    background: var(--map-water);

    & > img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

/* ---- online search ---- */

.shop-search {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 30px;
}

.shop-search__field {
    width: min(745px, 100%);
}

.shop-search__label {
    font-size: 12px;
    letter-spacing: -0.025em;
    margin: 0 0 7px;
}

.shop-search__bar {
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--ink);
    padding-bottom: 7px;

    & input {
        flex: 1;
        border: 0;
        outline: 0;
        background: transparent;
        font-family: var(--font);
        font-size: 15px;
        color: var(--ink);

        &::placeholder {
            color: var(--placeholder);
        }
    }

    & .ico {
        width: 18px;
        height: 18px;
        flex: none;
        color: var(--ink);
    }
}

/* ---- shop cards grid ---- */

.shop-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border: 1px solid var(--ink);
    border-right: 0;
    border-bottom: 0;
}

.shop-card {
    border-right: 1px solid var(--ink);
    border-bottom: 1px solid var(--ink);
    padding: 24px 47px 28px;
    min-width: 0;
    min-height: 286px;
    overflow-wrap: break-word;
}

.shop-grid--internet .shop-card {
    min-height: 198px;
}

.shop-card__title {
    text-align: center;
    font-size: 20px;
    line-height: 1;
    padding-bottom: 18px;
    border-bottom: var(--divider);
    margin-bottom: 22px;
}

.shop-field {
    font-size: 16px;
    line-height: 22px;

    & a {
        color: inherit;
        transition: color 0.15s;
        text-decoration: none;

        &:hover {
            color: var(--blue);
        }

        &[target="_blank"] {
            text-decoration: underline;
        }
    }
}

/* Межстрочные распорки карточки: у каждой строки, кроме последней.
   Инвариант: .shop-field — последние element-дети .shop-card (первым идёт
   .shop-card__title), поэтому последняя выведенная строка = :last-child и её
   распорка гасится сама. После строк-полей внутрь .shop-card ничего не добавлять. */
.shop-field:not(:last-child) {
    margin-bottom: 22px;
}

/* Адрес отделён сильнее (44px, требование макета). Селектор из двух классов —
   специфичность (0,3,0): 44px выигрывает у базового 22px детерминированно, не порядком правил. */
.shop-field.shop-field--address:not(:last-child) {
    margin-bottom: 44px;
}

/* ---- marker balloon popup ---- */

.wtb-balloon {
    background: var(--white);
    border-radius: var(--r-xs);
    box-shadow: var(--shadow-pop);
    padding: 14px 18px;
    min-width: 180px;
    max-width: 260px;
    font-family: var(--font);
    font-size: 13px;
    line-height: 1.4;

    & .wtb-balloon__name {
        font-weight: 700;
        margin-bottom: 6px;
    }

    & .wtb-balloon__addr,
    & .wtb-balloon__hours {
        color: var(--muted);
    }
}

.wtb-pin {
    width: 29px;
    height: 38px;
    display: block;
    color: var(--blue);
}

/* ---- visibility helper (used by script.js) ---- */

.is-hidden {
    display: none;
}

/* ---- retail map/list: view switcher arrow (new links, no .dot) ---- */

.wtb-views > a.wtb-view {
    text-decoration: none;

    & .arrow {
        width: 13px;
        height: 8px;
        flex: none;
        color: var(--blue);
        visibility: hidden;
    }

    &.is-active .arrow {
        visibility: visible;
    }
}

/* ---- retail map: geo search field ---- */

.shop-search__bar .ico {
    width: 18px;
    height: 18px;
    flex: none;
    color: var(--ink);
}

.shop-search__clear {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font-size: 20px;
    line-height: 1;
    color: var(--ink);
    cursor: pointer;
    flex: none;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font);
    transition: color 0.15s;

    &:hover {
        color: var(--blue);
    }
}

/* ---- retail map: geo-confirm card ---- */

.wtb-geo-confirm {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--white);
    border-radius: var(--wtb-confirm-radius);
    box-shadow: var(--wtb-confirm-shadow);
    padding: 14px 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 320px;
    z-index: 100;

    &[hidden] {
        display: none;
    }
}

.shop-search__col {
    width: min(745px, 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.shop-search__col .shop-search__field {
    width: 100%;
}

.wtb-geo-confirm__header {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    font-size: 16px;
    letter-spacing: -0.025em;
    color: var(--ink);
}

.wtb-geo-confirm__icon {
    width: 20px;
    height: 20px;
    flex: none;
    display: flex;
    align-items: center;
    color: var(--ink);
}

.wtb-geo-confirm__title {
    white-space: nowrap;
}

.wtb-geo-confirm__actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.wtb-geo-confirm__yes {
    background: var(--blue);
    color: var(--white);
    border: none;
    border-radius: 20px;
    padding: 8px 20px;
    font-family: var(--font);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;

    &:hover {
        background: var(--blue-hover);
    }
}

.wtb-geo-confirm__other {
    background: none;
    border: none;
    padding: 0;
    font-family: var(--font);
    font-size: 15px;
    color: var(--ink);
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s;

    &:hover {
        color: var(--blue);
    }
}

/* ============================================================ RESPONSIVE */

@media (width < 1490px) {
    .wtb-geo-confirm {
        min-width: min(320px, calc(100vw - 32px));
    }
}

@media (width < 1200px) {
    .shop-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .shop-card {
        padding: 20px 28px 24px;
    }

    .wtb-geo-confirm {
        top: calc(100% + 8px);
        bottom: auto;
    }
}

@media (width < 768px) {
    .shop-grid {
        grid-template-columns: 1fr;
    }

    .wtb-tabs {
        width: auto;
    }

    .map-wrap {
        height: clamp(300px, 60vw, 450px);
    }

    .shop-card {
        padding: 18px 20px 22px;
    }

    .wtb-geo-confirm {
        min-width: 0;
        padding: 12px 16px 14px;
    }

    .wtb-geo-confirm__actions {
        flex-wrap: wrap;
        gap: 12px;
        justify-content: center;
    }

    .shop-search__clear {
        font-size: 18px;
    }
}
