/* Shared responsive fixes for all regional sites using new_2024. */
@font-face {
    font-family: "Inter SIP";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/Inter-SemiBold.woff2") format("woff2");
}
/* The original face above covers other scripts; keep identical glyphs/metrics. */
@font-face {
    font-family: "Inter SIP";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/Inter-SemiBold-latin-cyrillic-c2fe3aa65721.woff2") format("woff2"),
         url("../fonts/Inter-SemiBold.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0300-036F, U+0400-052F, U+1C80-1C8F, U+2000-206F, U+2070-209F, U+20A0-20CF, U+2100-214F, U+2DE0-2DFF, U+A640-A69F, U+FEFF, U+FFFD;
}
/* The whole existing map marker is a link, not just its numeral. */
.main-map-block > a.main-map-projects {
    --map-marker-size: 36px;
    width: var(--map-marker-size);
    height: var(--map-marker-size);
    border-width: 3px;
    border-radius: 50%;
    color: #333;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    touch-action: manipulation;
    z-index: 1;
}
.main-map-block > a.main-map-projects.map-border-1,
.main-map-block > a.main-map-projects.map-border-2 { --map-marker-size: 30px; }
.main-map-block > a.main-map-projects.map-border-12 { --map-marker-size: 40px; }
.main-map-block > a.main-map-projects:hover { background-color: #eef3e8; }
.main-map-block > a.main-map-projects:focus-visible {
    outline: 2px solid #333;
    outline-offset: 3px;
    z-index: 2;
}
@media (max-width: 991.98px) {
    .main-map-block > a.main-map-projects {
        --map-marker-size: 28px;
        border-width: 2px;
        font-size: 12px;
    }
    .main-map-block > a.main-map-projects.map-border-1,
    .main-map-block > a.main-map-projects.map-border-2 { --map-marker-size: 24px; }
    .main-map-block > a.main-map-projects.map-border-12 { --map-marker-size: 32px; }
}
@media (min-width: 992px) {
    .bx_filter.bx_filter_vertical.catalog #modef_mobile { display: none !important; }
    .main-map-block > a.main-map-projects.kursk-6 { top: 37px; }
    .main-map-block > a.main-map-projects.oskol-7 { left: 212px; }
}
@media (min-width: 576px) and (max-width: 991.98px) {
    .main-map-block > a.main-map-projects.kursk-6 { transform: translate(12px, -20px); }
    .main-map-block > a.main-map-projects.kursk-7 { transform: translateX(-4px); }
}
@media (max-width: 575.98px) {
    /* Only separate crowded badges; map artwork, city labels and link coordinates stay intact. */
    .main-map-block > a.main-map-projects.kursk-1 { left: 9.07%; top: 8.83%; }
    .main-map-block > a.main-map-projects.kursk-2 { left: 7.12%; top: 20.92%; }
    .main-map-block > a.main-map-projects.kursk-3 { left: 27.68%; top: 10.3%; }
    .main-map-block > a.main-map-projects.kursk-5 { left: 31.16%; top: 23.52%; }
    .main-map-block > a.main-map-projects.kursk-6 { left: 18.11%; top: 2.84%; }
    .main-map-block > a.main-map-projects.kursk-7 { left: 19.81%; top: 24%; }
    .main-map-block > a.main-map-projects.oskol-1 { left: 12.55%; top: 51.93%; }
    .main-map-block > a.main-map-projects.oskol-2 { left: 13.91%; top: 36.47%; }
    .main-map-block > a.main-map-projects.oskol-3 { left: 38.91%; top: 33.16%; }
    .main-map-block > a.main-map-projects.oskol-4 { left: 23.9%; top: 50.31%; }
    .main-map-block > a.main-map-projects.oskol-5 { left: 39.22%; top: 48.86%; }
    .main-map-block > a.main-map-projects.oskol-6 { left: 32.23%; top: 63.17%; }
    .main-map-block > a.main-map-projects.oskol-7 { left: 27.75%; top: 36.92%; }
    .main-map-block > a.main-map-projects.voronezh-1 { left: 50.22%; top: 41.2%; }
    .main-map-block > a.main-map-projects.voronezh-3 { left: 61.53%; top: 39.94%; }
    .main-map-block > a.main-map-projects.voronezh-5 { left: 53.81%; top: 54.61%; }
}

@media (min-width: 992px) and (max-width: 1279.98px) {
    /* Include the 1200px container breakpoint: off-canvas arrows still overflow there. */
    .clients-slides .flex-direction-nav .flex-prev { left: 0; }
    .clients-slides .flex-direction-nav .flex-next { right: 0; }
    /* Do not animate from off-screen positions while crossing a breakpoint. */
    .clients-slides .flex-direction-nav a { transition-property: opacity; }
}

@media (max-width: 991.98px) {
    body {
        font-size: 16px;
        line-height: 1.5;
    }

    h1, .h1 {
        font-size: clamp(28px, 7vw, 40px);
        line-height: 1.2;
        overflow-wrap: anywhere;
    }

    h2, .h2 {
        font-size: clamp(26px, 6vw, 34px);
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    h3, .h3 { font-size: 24px; line-height: 1.3; }
    h4, .h4 { font-size: 20px; line-height: 1.4; }
    .breadcrumb { font-size: 14px; line-height: 1.5; }

    .container, .container-fluid, .container-lg {
        padding-left: 16px;
        padding-right: 16px;
    }

    header { padding: 16px 0; }
    .header-menu { top: 0; margin-bottom: 0; }
    .header-menu .navbar > .container-fluid { gap: 8px; }

    .header-logo.mobile {
        position: static;
        flex: 1 1 0;
        min-width: 0;
        margin-right: auto;
    }

    .header-logo.mobile a { display: block; }
    .header-logo.mobile img {
        display: block;
        width: 180px;
        max-width: 100%;
        height: auto;
        margin: 0;
    }

    .header-menu .header-phone { flex: 0 0 48px; height: 48px; }
    .header-menu .header-phone > a {
        float: none;
        width: 48px;
        justify-content: center;
    }
    .header-phone-img img { width: 28px; height: 28px; margin: 0; }
    .header-menu .navbar-toggler { width: 48px; height: 48px; padding: 8px; font-size: 20px; }
    .header-menu .navbar-toggler-icon { width: 28px; height: 28px; }
    #MainMenu { flex-basis: 100%; width: 100%; }
    .header-menu .nav-link {
        min-height: 48px;
        padding: 12px 24px 12px 0;
        font-size: 16px;
        line-height: 1.5;
    }
    .header-menu .dropdown-item {
        min-height: 48px;
        font-size: 16px;
        white-space: normal;
    }

    .main-feedback { background: none; }
    .main-feedback-block { padding-left: 0; padding-right: 0; min-width: 0; }
    .feedback-contacts { flex-wrap: wrap; gap: 12px 24px; }
    .feedback-phone, .feedback-mail { padding: 0; max-width: 100%; }
    .feedback-contacts a { overflow-wrap: anywhere; }
    .main-feedback-block .form-control { font-size: 16px; min-height: 48px; }
    .main-feedback-block .form-check { font-size: 14px; line-height: 1.5; }
    .main-feedback-block .btn { min-height: 48px; }

    footer a { overflow-wrap: anywhere; }
    footer .footer-menu > li { min-width: 0; }
    footer .footer-menu ul { padding-top: 12px; }
    footer .footer-menu ul li { padding-bottom: 12px; }

    .catalog.detail .info > .row > .col-2 {
        flex: 0 0 33.333333%;
        width: 33.333333%;
    }
    .catalog.detail .info > .d-lg-none.d-flex { flex-wrap: wrap; gap: 16px; }
    .catalog.detail .info-big { font-size: 28px; }
    .projects-buttons a { max-width: 100%; min-height: 48px; white-space: normal; }

    /* Keep the controls within the catalogue, never over the feedback form. */
    .filter_button {
        position: sticky;
        top: 8px;
        bottom: auto;
        width: max-content;
        max-width: 100%;
        margin-bottom: 16px;
        font-size: 16px;
    }
    .filter_button .btn-link { min-height: 48px; padding: 12px; }
    .bx_filter.catalog {
        /* Above Bitrix24's launcher (10150), below its form overlay (15000). */
        z-index: 10200;
        max-height: 90vh;
        max-height: 90dvh;
        overflow-y: auto;
        overscroll-behavior: contain;
    }
    /* A desktop tooltip at left:104% must not widen the mobile filter drawer.
       Keep one result count in normal flow, above the existing apply button. */
    .bx_filter.bx_filter_vertical.catalog #modef { display: none !important; }
    .bx_filter.bx_filter_vertical.catalog #modef_mobile {
        position: static;
        left: auto;
        top: auto;
        width: 100%;
        max-width: 100%;
        margin: 12px 0 0;
        padding: 0;
        white-space: normal;
        line-height: 1.5;
        font-size: 14px;
        color: #333;
        background: none;
    }
    .bx_filter.bx_filter_vertical.catalog #modef_mobile:before,
    .bx_filter.bx_filter_vertical.catalog #modef_mobile a { display: none; }
    .bx_filter.catalog .bx_ui_slider_handle {
        touch-action: none;
        -webkit-user-select: none;
        user-select: none;
    }
    /* Increase finger tolerance without changing the visible 17px circle.
       The horizontal hit area stays within the drawer's 16px side padding. */
    .bx_filter.catalog .bx_ui_slider_handle:before {
        content: "";
        position: absolute;
        left: 50%;
        top: 50%;
        width: 30px;
        height: 44px;
        transform: translate(-50%, -50%);
    }
    .bx_filter .bx_filter_parameters_box_title { font-size: 20px; }
    .bx_filter .bx_filter_parameters_box_container input[type=text] {
        font-size: 16px;
        min-height: 48px;
        padding: 10px;
    }
    select.sort.btn, #inputSearchBlock { max-width: 100%; font-size: 16px; }

    /* Let the hero copy define its height; never position it above the header. */
    .mainBannerCarousel { min-height: 420px; }
    .mainBannerCarousel .main-banner-slides {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        border: 0;
        z-index: 0;
    }
    .main-banner-slides .flex-viewport,
    .main-banner-slides .slides,
    .main-banner-slides .slides > li { height: 100% !important; }
    .main-banner-slides .slides > li img { height: 100%; object-fit: cover; }
    #mainBannerCarouselText:not(.d-none) {
        display: flex;
        align-items: center;
        position: relative;
        min-height: 420px;
        z-index: 1;
        pointer-events: none;
    }
    #mainBannerCarouselText .container-lg {
        position: static;
        width: 100%;
        max-width: 720px;
        margin: 0 auto;
        padding: 32px 24px 64px;
    }
    #mainBannerCarouselText div,
    #mainBannerCarouselText ul { font-size: 16px; line-height: 1.5; }
    #mainBannerCarouselText ul { padding-left: 20px; margin-bottom: 0; }
    #mainBannerCarouselText li + li { margin-top: 8px; }
    #mainBannerCarouselText .btn-lg {
        margin-top: 24px;
        max-width: 100%;
        min-height: 48px;
        padding: 12px 16px;
        font-size: 16px;
        line-height: 1.35;
        white-space: normal;
        pointer-events: auto;
    }
    .main-banner-slides .flex-control-nav { z-index: 3; margin-bottom: 12px; }
    .main-banner-slides .flex-control-nav li { margin: 0 2px; }
    .main-banner-slides .flex-control-paging li a {
        width: 32px;
        height: 32px;
        border: 8px solid transparent;
        background-clip: padding-box;
        background-color: rgba(255,255,255,.5);
    }
    .main-banner-slides .flex-control-paging li a.flex-active {
        background-clip: padding-box;
        background-color: #fff;
    }

    /* Images participate in flow, instead of sitting at the foot of a 522px box. */
    #mainSelectProject { padding-top: 24px !important; padding-bottom: 16px !important; }
    .card-block { height: auto; }
    .card-block > .card-block-link { height: auto; }
    .card-block > .card-block-link img { position: static; display: block; height: auto; }
    .card-block .card-block-name {
        left: 20px;
        bottom: 16px;
        right: 16px;
        font-size: 20px;
        line-height: 1.3;
        text-shadow: 0 1px 8px #000;
    }
    /* Figma 3739:1959: the heading is a tile in the two-column project grid. */
    #mainProjectsList { margin-left: 4px; margin-right: 4px; }
    #mainProjectsList > .row {
        display: grid;
        grid-template-columns: calc((100% - 15px) / 2 + .5px) minmax(0, 1fr);
        gap: 5px 15px;
        margin: 0;
    }
    #mainProjectsList .card-block-sm {
        width: auto;
        min-width: 0;
        min-height: 125px;
        height: auto;
        padding: 0;
        margin-bottom: 0 !important;
    }
    #mainProjectsList .card-block-sm:nth-child(odd) { aspect-ratio: 261 / 180; }
    #mainProjectsList .card-block-sm > .card-block-link { display: block; height: 100%; }
    #mainProjectsList .card-block-sm:first-child > .card-block-link {
        background: #333;
        padding: 0;
    }
    #mainProjectsList .card-block-sm:first-child .h4 {
        top: 4.027%;
        left: 2.692%;
        width: 86.154% !important;
        margin: 0;
        padding: 0;
        font-size: clamp(13px, calc((100vw - 54px) * .0498084), 26px);
        font-weight: 600;
        line-height: 1.385;
        overflow-wrap: normal;
    }
    #mainProjectsList .card-block-sm:first-child .pos-r-1 {
        right: 2.778%;
        bottom: 12%;
    }
    #mainProjectsList .card-block-sm:first-child .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 116px;
        max-width: 100%;
        height: 28.8px;
        min-height: 0;
        padding: 0 8px;
        border: 0;
        border-radius: 6px;
        background: #fff;
        color: #333;
        font-family: "Inter SIP", sans-serif;
        font-size: 12px;
        font-weight: 600;
        line-height: 15px;
        white-space: nowrap;
        text-transform: none;
    }
    #mainProjectsList a.card-block-link > img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    #mainProjectsList a.card-block-link .mask { display: block; }
    #mainProjectsList a.card-block-link .visible-hover {
        position: absolute;
        inset: 20px;
        padding: 0;
        opacity: 0;
        font-family: "Inter SIP", sans-serif;
    }
    #mainProjectsList a.card-block-link:hover .visible-hover,
    #mainProjectsList a.card-block-link:focus-visible .visible-hover { opacity: 1; }
    #mainProjectsList a.card-block-link .btn-sm {
        display: inline-block;
        padding: 5px 7px;
        border-radius: 6px;
        font-size: 12px;
        font-weight: 600;
        line-height: 15px;
    }
    #mainProjectsList .card-block-caption {
        padding: 10px 0 0;
        color: #fff;
        font-size: 16px;
        font-weight: 600;
        line-height: 19px;
    }
    #mainProjectsList a.card-block-link:focus-visible {
        outline: 2px solid #333;
        outline-offset: 2px;
    }

    /* Figma 3739:1998: heading, illustration, then a separate 3 x 2 button grid. */
    #mainSocialBlock > .container-lg { padding-left: 20px; padding-right: 20px; }
    #mainSocialBlock .main-social-pc { background: none; padding: 0; }
    #mainSocialBlock .main-social-pc h2 {
        min-height: 0;
        margin: 0;
        padding: 0;
        color: #333;
        font-family: "Inter SIP", sans-serif;
        font-size: clamp(22px, 5.90278vw, 34px);
        font-weight: 600;
        line-height: 1.205882;
        letter-spacing: 0;
        overflow-wrap: normal;
    }
    #mainSocialBlock .main-social-art {
        width: calc(100% + 20px);
        margin: 31px 0 0;
        overflow: hidden;
    }
    #mainSocialBlock .main-social-art img {
        display: block;
        width: calc((100% - 20px) * .9458955);
        max-width: 507px;
        height: auto;
        margin-left: calc((100% - 20px) * .0914179);
    }
    #mainSocialBlock .main-social-buttons {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 20px clamp(8px, 3.47222vw, 20px);
        width: calc(100% - 16px);
        max-width: 520px;
        margin: 31px auto 0;
    }
    #mainSocialBlock .main-social-buttons > div {
        width: auto;
        min-width: 0;
        margin: 0;
        padding: 0 !important;
    }
    #mainSocialBlock .main-social-buttons a {
        height: 40px;
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: clamp(4px, 2.08333vw, 12px);
        padding: 0 4px;
        font-size: clamp(11px, 2.43056vw, 14px);
        font-weight: 700;
        line-height: 19px;
        white-space: nowrap;
    }
    #mainSocialBlock .main-social-buttons img {
        flex-shrink: 0;
        width: clamp(18px, 4.16667vw, 24px);
        height: clamp(18px, 4.16667vw, 24px);
        object-fit: contain;
        margin: 0;
    }
    .main-contacts-map {
        background-position: center bottom;
        background-size: 100% auto;
        padding-bottom: clamp(180px, 42vw, 340px);
    }
    .main-contacts-map .contact-block { font-size: 16px; min-width: 0; }
    .main-contacts-map .footer-socials {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        max-width: 100%;
    }
    .main-contacts-map .footer-socials a { width: 44px; height: 44px; margin: 0; }
    .main-contacts-map .footer-socials > div { flex: 0 0 44px; width: 44px; padding: 0; }
    .main-contacts-map .footer-socials { margin-left: 0; margin-right: 0; }
    .main-contacts-info { padding-top: 16px; }
    .main-map-block .btn { font-size: 16px; padding: 16px; min-height: 48px; }
    .staff .feedback-mail a { overflow-wrap: anywhere; }
    .flex-direction-nav a { transition: none; }
    .picture-slides .flex-direction-nav .flex-prev { left: 0; }
    .picture-slides .flex-direction-nav .flex-next { left: 70px; right: auto; }
    .sticker_new, .sticker_recomend, .sticker_hit, .sticker_sale {
        width: clamp(64px, 18vw, 88px);
        height: clamp(64px, 18vw, 88px);
    }
    .sticker_bottom { font-size: 14px; line-height: 1.4; margin-right: 8px; }
}

@media (max-width: 575.98px) {
    .main-contacts-map > .row > div { flex: 0 0 100%; width: 100%; }
    /* Keep the same two-column composition without touching title/button hit areas. */
    #mainProjectsList .card-block-sm:first-child > .card-block-link {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        gap: 8px;
        padding: 8px;
    }
    #mainProjectsList .card-block-sm:first-child .h4 {
        position: static;
        width: 100% !important;
        line-height: 1.3;
    }
    #mainProjectsList .card-block-sm:first-child .pos-r-1 {
        position: static;
        align-self: flex-end;
    }
    #mainProjectsList .card-block-sm:first-child .btn { width: 104px; height: 24px; font-size: 11px; }
    #mainProjectsList a.card-block-link .visible-hover { inset: 12px; }
    #mainProjectsList a.card-block-link .btn-sm { font-size: 10px; line-height: 12px; padding: 4px 5px; }
    #mainProjectsList .card-block-caption { font-size: 12px; line-height: 15px; padding-top: 6px; }
    footer .contact-block { flex: 0 0 100%; width: 100%; padding-bottom: 24px; font-size: 16px; }
    footer .contact-city { font-size: 20px; }
    .staff .tab-pane > .row > .col-6,
    .ipoteka .tab-pane > .row > .col-6 { flex: 0 0 100%; width: 100%; }
    .ipoteka .tab-pane > .row { row-gap: 24px; }
    .main-contacts-map .contact-block { padding-bottom: 24px; }
    .main-contacts-map .contact-city { font-size: 20px; }
    footer > .container-lg > .row > .col-12 > .row > div {
        flex: 0 0 100%;
        width: 100%;
    }
    footer .footer-menu > li { flex: 0 0 100%; width: 100%; margin-top: 20px; }
}

@media (max-width: 359.98px) {
    /* Keep the standard 304px CAPTCHA inside the page, using the side gutters. */
    .main-feedback-block .g-recaptcha {
        width: 304px;
        margin-left: calc((100% - 304px) / 2);
    }
}
