#branches-map {
    position: relative;
    width: 100%;
    min-height: 640px;
}

/* FOX MARKER*/

.marker-fox-wrapper {
    border: 0;
    background: transparent;
}

.marker-fox {
    display: block;
    width: 54px;
    height: 54px;
    object-fit: contain;
    filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.22));
    transition:
        transform 0.2s ease,
        filter 0.2s ease;
}

.marker-fox-wrapper:hover .marker-fox,
.marker-fox-wrapper--active .marker-fox {
    transform: translateY(-3px) scale(1.08);
    filter: drop-shadow(0 12px 16px rgba(251, 50, 91, 0.32));
}

/*CUSTOM POPUP OVERLAY */

body.popup-open {
    overflow: hidden;
}

.branch-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 30px;

    background: rgba(16, 12, 18, 0.62);
    backdrop-filter: blur(4px);
}

.branch-overlay.is-open {
    display: flex;
}

.branch-popup-container {
    width: 100%;
    max-width: 900px;
    max-height: calc(100vh - 60px);

    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;

    border-radius: 26px;

    scrollbar-width: thin;
    scrollbar-color:
        rgba(251, 50, 91, 0.5)
        rgba(25, 20, 30, 0.06);
}

.branch-popup-container::-webkit-scrollbar {
    width: 8px;
}

.branch-popup-container::-webkit-scrollbar-track {
    background: rgba(25, 20, 30, 0.05);
}

.branch-popup-container::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 20px;
    background:
        rgba(251, 50, 91, 0.5)
        padding-box;
}

/* BRANCH POPUP */

.branch-popup {
    --map-accent: rgb(251, 50, 91);
    --map-accent-dark: rgb(215, 24, 63);
    --map-accent-soft: rgba(251, 50, 91, 0.09);
    --map-accent-border: rgba(251, 50, 91, 0.22);

    --map-text: #1b1820;
    --map-muted: #706b76;
    --map-border: #ece9ee;
    --map-surface: #ffffff;

    position: relative;

    width: 100%;
    overflow: hidden;

    border-radius: 26px;

    background: var(--map-surface);
    color: var(--map-text);

    font-family: inherit;

    box-shadow:
        0 30px 80px rgba(26, 19, 30, 0.22),
        0 10px 28px rgba(26, 19, 30, 0.12);
}

.branch-popup__close {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 20;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;
    padding: 0;

    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 50%;

    background: rgba(24, 19, 27, 0.58);
    color: #ffffff;

    font-family: Arial, sans-serif;
    font-size: 28px;
    font-weight: 300;
    line-height: 1;

    cursor: pointer;
    backdrop-filter: blur(12px);

    transition:
        background-color 0.2s ease,
        transform 0.2s ease;
}

.branch-popup__close:hover {
    background: var(--map-accent);
    transform: rotate(8deg);
}

.branch-popup__hero {
    position: relative;
    min-height: 270px;
    overflow: hidden;
    background: #28232a;
}

.branch-popup__photo,
.branch-popup__photo-placeholder {
    display: block;
    width: 100%;
    height: 290px;
}

.branch-popup__photo {
    object-fit: cover;
    object-position: center;
    transition: transform 0.7s ease;
}

.branch-popup:hover .branch-popup__photo {
    transform: scale(1.025);
}

.branch-popup__photo-placeholder {
    background:
        radial-gradient(
            circle at 25% 20%,
            rgba(255, 255, 255, 0.2),
            transparent 32%
        ),
        linear-gradient(
            135deg,
            rgb(251, 50, 91),
            rgb(113, 29, 79)
        );
}

.branch-popup__overlay {
    position: absolute;
    inset: 0;

    background:
        linear-gradient(
            180deg,
            rgba(10, 8, 12, 0.08) 10%,
            rgba(10, 8, 12, 0.28) 52%,
            rgba(10, 8, 12, 0.9) 100%
        );
}

.branch-popup__hero-content {
    position: absolute;
    right: 28px;
    bottom: 27px;
    left: 28px;
    z-index: 2;
}

.branch-popup__eyebrow {
    display: inline-flex;
    margin-bottom: 11px;
    padding: 7px 12px;

    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;

    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;

    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.08em;
    text-transform: uppercase;

    backdrop-filter: blur(10px);
}

.branch-popup__title {
    margin: 0;

    color: #ffffff;

    font-size: clamp(28px, 4vw, 39px);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.035em;

    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.38);
}

.branch-popup__body {
    padding: 28px;
}

.branch-popup__intro {
    padding-bottom: 27px;
    border-bottom: 1px solid var(--map-border);
}

.branch-popup__address {
    display: flex;
    align-items: flex-start;
    gap: 11px;

    color: var(--map-text);

    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
}

.branch-popup__pin {
    flex: 0 0 auto;
    margin-top: 7px;

    color: var(--map-accent);

    font-size: 12px;
    line-height: 1;
}

.branch-popup__description {
    margin: 15px 0 0;

    color: var(--map-muted);

    font-size: 15px;
    line-height: 1.7;
}

/*CLUBS SECTION */

.branch-popup__clubs-section {
    padding-top: 27px;
}

.branch-popup__section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;

    margin-bottom: 19px;
}

.branch-popup__section-label {
    display: block;
    margin-bottom: 5px;

    color: var(--map-accent);

    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.branch-popup__section-title {
    margin: 0;

    color: var(--map-text);

    font-size: 24px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.branch-popup__count {
    display: flex;
    flex: 0 0 40px;
    align-items: center;
    justify-content: center;

    width: 40px;
    height: 40px;

    border-radius: 50%;

    background: var(--map-accent);
    color: #ffffff;

    font-size: 15px;
    font-weight: 800;
    line-height: 1;

    box-shadow:
        0 9px 22px rgba(251, 50, 91, 0.28);
}

.branch-popup__clubs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.branch-popup__empty {
    margin: 0;
    padding: 20px;

    border: 1px dashed var(--map-accent-border);
    border-radius: 18px;

    background: var(--map-accent-soft);
    color: var(--map-muted);

    text-align: center;
}

/*CLUB CARD */

.branch-club-card {
    position: relative;
    overflow: hidden;

    border: 1px solid var(--map-border);
    border-radius: 21px;

    background:
        linear-gradient(
            145deg,
            #ffffff 0%,
            #ffffff 73%,
            rgba(251, 50, 91, 0.04) 100%
        );

    box-shadow:
        0 10px 30px rgba(31, 24, 36, 0.065);

    transition:
        transform 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease;
}

.branch-club-card:hover {
    transform: translateY(-3px);
    border-color: var(--map-accent-border);

    box-shadow:
        0 18px 42px rgba(31, 24, 36, 0.11),
        0 8px 24px rgba(251, 50, 91, 0.08);
}

.branch-club-card__accent {
    height: 5px;

    background:
        linear-gradient(
            90deg,
            var(--map-accent) 0%,
            rgb(255, 112, 143) 60%,
            rgba(255, 112, 143, 0.16) 100%
        );
}

.branch-club-card__content {
    padding: 22px;
}

.branch-club-card__header {
    display: flex;
    align-items: center;
    gap: 17px;
}

.branch-club-card__logo-box {
    display: flex;
    /* flex: 0 0 82px; */
    align-items: center;
    justify-content: center;

    /* width: 82px; */
    height: 120px;
    padding: 2px;

    /* border: 1px solid var(--map-border);
    border-radius: 19px;

    background: #ffffff;

    box-shadow:
        0 8px 24px rgba(28, 22, 34, 0.075); */
}

.branch-club-card__logo {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.branch-club-card__logo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;

    border-radius: 13px;

    background: var(--map-accent-soft);
    color: var(--map-accent);

    font-size: 30px;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
}

.branch-club-card__heading {
    min-width: 0;
}

.branch-club-card__name {
    margin: 0;

    color: var(--map-text);

    font-size: 22px;
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: -0.025em;
}

.branch-club-card__subtitle {
    margin: 5px 0 0;

    color: var(--map-muted);

    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
}

.branch-club-card__styles {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;

    margin-top: 19px;
}

.branch-club-card__style {
    display: inline-flex;
    align-items: center;

    min-height: 29px;
    padding: 6px 11px;

    border: 1px solid var(--map-accent-border);
    border-radius: 999px;

    background: var(--map-accent-soft);
    color: var(--map-accent-dark);

    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.branch-club-card__description {
    margin: 17px 0 0;

    color: var(--map-muted);

    font-size: 14px;
    line-height: 1.65;
}

.branch-club-card__footer {
    display: flex;
    justify-content: flex-end;

    margin-top: 19px;
    padding-top: 17px;

    border-top: 1px solid var(--map-border);
}

.branch-club-card__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    min-height: 42px;
    padding: 10px 17px;

    border-radius: 999px;

    background: var(--map-accent);
    color: #ffffff !important;

    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none !important;

    box-shadow:
        0 9px 20px rgba(251, 50, 91, 0.23);

    transition:
        transform 0.2s ease,
        background-color 0.2s ease,
        box-shadow 0.2s ease;
}

.branch-club-card__button:hover {
    transform: translateY(-1px);

    background: var(--map-accent-dark);

    box-shadow:
        0 12px 26px rgba(251, 50, 91, 0.31);
}

.branch-club-card__arrow {
    font-size: 18px;
    line-height: 1;

    transition: transform 0.2s ease;
}

.branch-club-card__button:hover .branch-club-card__arrow {
    transform: translateX(3px);
}

/*  TABLET */

@media (max-width: 767px) {
    #branches-map {
        min-height: 560px;
    }

    .branch-overlay {
        padding: 18px;
    }

    .branch-popup-container {
        max-width: 440px;
        max-height: calc(100vh - 36px);
        border-radius: 21px;
    }

    .branch-popup {
        border-radius: 21px;
    }

    .branch-popup__hero {
        min-height: 220px;
    }

    .branch-popup__photo,
    .branch-popup__photo-placeholder {
        height: 235px;
    }

    .branch-popup__hero-content {
        right: 20px;
        bottom: 21px;
        left: 20px;
    }

    .branch-popup__body {
        padding: 21px;
    }

    .branch-popup__section-title {
        font-size: 21px;
    }

    .branch-popup__clubs {
        grid-template-columns: 1fr;
    }

    .branch-club-card__content {
        padding: 18px;
    }

    .branch-club-card__logo-box {
        flex-basis: 70px;
        width: 70px;
        height: 70px;
    }

    .branch-club-card__name {
        font-size: 20px;
    }
}

/* MOBILE */

@media (max-width: 420px) {
    .branch-overlay {
        align-items: flex-start;
        padding: 13px;
    }

    .branch-popup-container {
        max-width: none;
        max-height: calc(100vh - 26px);
    }

    .branch-popup__close {
        top: 12px;
        right: 12px;

        width: 38px;
        height: 38px;

        font-size: 25px;
    }

    .branch-popup__hero {
        min-height: 195px;
    }

    .branch-popup__photo,
    .branch-popup__photo-placeholder {
        height: 205px;
    }

    .branch-popup__title {
        padding-right: 35px;
        font-size: 27px;
    }

    .branch-popup__body {
        padding: 17px;
    }

    .branch-popup__description {
        font-size: 14px;
    }

    .branch-popup__section-head {
        align-items: center;
    }

    .branch-popup__section-title {
        font-size: 20px;
    }

    .branch-club-card__header {
        align-items: flex-start;
        gap: 13px;
    }

    .branch-club-card__logo-box {
        flex-basis: 62px;
        width: 62px;
        height: 62px;
        padding: 8px;

        border-radius: 16px;
    }

    .branch-club-card__name {
        font-size: 18px;
    }

    .branch-club-card__styles {
        margin-top: 16px;
    }

    .branch-club-card__footer {
        justify-content: stretch;
    }

    .branch-club-card__button {
        width: 100%;
    }
}