/* Change 006: responsive layout ONLY for the front-page template.
   Every rule is scoped to body.nedra-home-mobile and to screens <=1199px.
   Original desktop CSS, map coordinates, form handling and HTML contents remain intact. */
@media screen and (max-width: 1199px) {
    body.nedra-home-mobile { min-width: 0; overflow-x: clip; }
    body.nedra-home-mobile .wrapper,
    body.nedra-home-mobile .content,
    body.nedra-home-mobile .header,
    body.nedra-home-mobile .footer { min-width: 0; width: 100%; }
    body.nedra-home-mobile .wrapper { overflow-x: clip; }
    body.nedra-home-mobile .container,
    body.nedra-home-mobile .section__header-container {
        width: 100%; max-width: 100%; min-width: 0;
        margin-left: auto; margin-right: auto;
        padding-left: 16px; padding-right: 16px;
    }
    body.nedra-home-mobile .section__header-container { overflow: hidden; }
    body.nedra-home-mobile .header__top,
    body.nedra-home-mobile .navigation,
    body.nedra-home-mobile .top__section,
    body.nedra-home-mobile .map__section,
    body.nedra-home-mobile .advantage__section,
    body.nedra-home-mobile .why__we,
    body.nedra-home-mobile .contacts__section,
    body.nedra-home-mobile .copyright,
    body.nedra-home-mobile #contacts__section-map { min-width: 0; width: 100%; }

    /* Shared header elements are changed on this template only. */
    body.nedra-home-mobile .header__top .container {
        display: flex; flex-wrap: wrap; justify-content: center;
        column-gap: 20px; row-gap: 2px; padding-top: 6px; padding-bottom: 6px;
    }
    body.nedra-home-mobile .header__top-adress,
    body.nedra-home-mobile .header__top-mail {
        margin: 0; padding-left: 0; text-align: center; line-height: 1.4;
    }
    body.nedra-home-mobile .header__top-adress::after,
    body.nedra-home-mobile .header__top-mail::after { display: none; }
    body.nedra-home-mobile .header__top a { line-height: 1.5; font-size: 12px; }
    body.nedra-home-mobile .header__middle-container {
        display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
        gap: 12px; padding-top: 12px; padding-bottom: 12px;
        text-align: left;
    }
    body.nedra-home-mobile .header__middle-container::after { display: none; }
    body.nedra-home-mobile .header__middle-logo { flex: 0 1 auto; }
    body.nedra-home-mobile .header__middle-logo .logo-pic { width: 100px; height: 46px; }
    body.nedra-home-mobile .header__middle-logo .logo-text { font-size: 13px; line-height: 1.2; padding: 0 4px; }
    body.nedra-home-mobile .header__middle-phone { padding: 0; text-align: right; }
    body.nedra-home-mobile .header__middle-phone::after { display: none; }
    body.nedra-home-mobile .header__middle-phone a { font-size: 15px; line-height: 1.45; }
    body.nedra-home-mobile .header__middle-btn {
        display: flex; flex: 1 0 100%; justify-content: center; flex-wrap: wrap; gap: 10px;
        order: 3;
    }
    body.nedra-home-mobile .popup__btn-header {
        font-size: 13px; line-height: 1.25; padding: 11px 14px; text-align: center;
    }
    body.nedra-home-mobile .navigation { margin-top: 0; }
    body.nedra-home-mobile .navigation .menu {
        display: flex; align-items: stretch; justify-content: flex-start;
        gap: 20px; white-space: nowrap;
        overflow-x: auto; overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin; scrollbar-color: #f28943 #333236;
    }
    body.nedra-home-mobile .navigation__item {
        display: block; flex: 0 0 auto; margin: 0; list-style: none;
    }
    body.nedra-home-mobile .navigation__item a {
        display: block; font-size: 14px; padding: 12px 0;
    }

    /* Intro and ordinary content. */
    body.nedra-home-mobile .top__section {
        display: flex; align-items: flex-start; justify-content: center;
        height: 320px; background-position: center; background-size: cover;
    }
    body.nedra-home-mobile .top__section::before { display: none; }
    body.nedra-home-mobile .my_cont {
        display: block; width: 100%; max-width: 100%; padding: 0 16px;
    }
    body.nedra-home-mobile .top__section-banner {
        float: none; display: inline-block; max-width: 100%;
        margin: 22px auto 0; padding: 18px 20px;
    }
    body.nedra-home-mobile .banner__text-big { font-size: 34px; line-height: 1.18; }
    body.nedra-home-mobile .banner__text-small { font-size: 23px; line-height: 1.25; }
    body.nedra-home-mobile .section__header-title {
        max-width: 100%; padding: 18px 12px;
        font-size: 21px; line-height: 1.3;
    }
    body.nedra-home-mobile .nedra-home-intro-title,
    body.nedra-home-mobile .nedra-home-map-title { line-height: 1.3; }
    body.nedra-home-mobile .map__descr .container { font-size: 15px; line-height: 1.6; }
    body.nedra-home-mobile .map__descr .container > p {
        margin: 14px 0; text-align: left; overflow-wrap: anywhere;
    }
    body.nedra-home-mobile .map__descr .container img,
    body.nedra-home-mobile .map__descr .container iframe {
        max-width: 100%; height: auto;
    }
    body.nedra-home-mobile .nedra-home-types-title {
        font-size: 20px; line-height: 1.35;
    }
    body.nedra-home-mobile .map__descr .grid:not(.gridmy) {
        display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px; height: auto !important; max-width: 100%;
        padding: 12px 0 28px; margin: 0 !important;
    }
    body.nedra-home-mobile .map__descr .grid figure {
        float: none; margin: 0; width: 100%; min-width: 0; max-width: none;
        height: 210px; max-height: none;
    }
    body.nedra-home-mobile .map__descr .grid figure img {
        width: 100%; height: 100%; min-height: 0; max-width: none; object-fit: cover;
    }
    body.nedra-home-mobile .map__descr .grid figure figcaption { padding: 14px; }
    body.nedra-home-mobile .map__descr .grid figure .nedra-home-card-title {
        font-size: 18px; line-height: 1.25;
    }

    /* The interactive depth map uses absolute pixel coordinates.
       Preserve its original geometry and allow swipe inside the map only. */
    body.nedra-home-mobile .map__controls-list {
        display: flex; width: 100%; max-width: 100%; gap: 8px; padding: 5px 0;
    }
    body.nedra-home-mobile .map__controls-item { width: auto; flex: 1 1 50%; }
    body.nedra-home-mobile .map__controls-link {
        display: flex; align-items: center; justify-content: center;
        min-height: 44px; width: 100%; margin: 0;
        font-size: 14px; line-height: 1.2; padding: 8px 5px;
    }
    body.nedra-home-mobile .map__body-list {
        display: block; width: 100%; max-width: 100%; overflow-x: auto;
        overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
        scrollbar-width: thin; scrollbar-color: #f28943 #ddd;
    }
    body.nedra-home-mobile .map__body-list > .map__item {
        width: 1160px; max-width: none; min-width: 1160px;
        margin-left: 0; margin-right: 0; padding-left: 20px; padding-right: 20px;
    }
    body.nedra-home-mobile .map__body-list .map_deeps_container { width: 100%; }

    /* Advantages, portfolio and stages. */
    body.nedra-home-mobile .advantage__section .container {
        padding-top: 22px; padding-bottom: 24px;
    }
    body.nedra-home-mobile .advantage__section .container > a {
        display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px; text-decoration: none;
    }
    body.nedra-home-mobile .advantage__item {
        display: flex; align-items: center; gap: 8px;
        width: 100%; min-width: 0; vertical-align: top;
    }
    body.nedra-home-mobile .advantage__pic {
        flex: 0 0 40px; width: 40px; height: 45px; overflow: hidden;
    }
    body.nedra-home-mobile .advantage__pic .material-icons {
        display: block; font-size: 26px; line-height: 40px;
    }
    body.nedra-home-mobile .advantage__text {
        width: auto; min-width: 0; flex: 1;
    }
    body.nedra-home-mobile .advantage__text-big {
        font-size: 12px; line-height: 1.4; overflow-wrap: anywhere;
    }
    body.nedra-home-mobile .our__works .container { padding-top: 12px; padding-bottom: 28px; }
    body.nedra-home-mobile .our__works .bx-wrapper { max-width: 100%; }
    body.nedra-home-mobile .our__works .bx-viewport {
        width: 100% !important; height: auto !important;
        overflow-x: auto !important; overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
    }
    body.nedra-home-mobile .our__works-slider {
        display: flex !important; gap: 10px;
        width: max-content !important; transform: none !important;
        transition: none !important; padding: 0 !important;
    }
    body.nedra-home-mobile .our__works-slider .bx-clone { display: none !important; }
    body.nedra-home-mobile .our__works-slider li {
        display: block; flex: 0 0 220px;
        width: 220px !important; float: none !important; list-style: none;
    }
    body.nedra-home-mobile .our__works-slider img {
        display: block; width: 100%; height: auto; max-width: 100%;
    }
    body.nedra-home-mobile .our__works .bx-controls { display: none; }
    body.nedra-home-mobile .why__we .container { padding-top: 14px; padding-bottom: 25px; }
    body.nedra-home-mobile .why__we .gridmy {
        display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px; width: 100%; max-width: 100%; padding: 0;
    }
    body.nedra-home-mobile .why__we .gridmy figure.effect-oscar {
        float: none; width: 100%; min-width: 0; max-width: none;
        height: auto; min-height: 300px; max-height: none; margin: 0;
    }
    body.nedra-home-mobile .why__we .gridmy figure.effect-oscar img {
        position: absolute; inset: 0;
        width: 100%; height: 100%; min-height: 0;
        max-width: none; object-fit: cover; opacity: .32;
    }
    body.nedra-home-mobile .why__we .gridmy figure.effect-oscar figcaption {
        position: relative; height: auto; min-height: 300px; padding: 22px 18px;
        background: rgba(0,0,0,.52);
    }
    body.nedra-home-mobile .why__we .gridmy figure.effect-oscar figcaption::before { display: none; }
    body.nedra-home-mobile .why__we .gridmy figure.effect-oscar .nedra-home-card-title,
    body.nedra-home-mobile .why__we .gridmy figure.effect-oscar:hover .nedra-home-card-title {
        position: static; transform: none; -webkit-transform: none;
        font-size: 19px; line-height: 1.3; margin: 0 0 12px;
        text-align: left; color: #fff;
    }
    body.nedra-home-mobile .why__we .gridmy figure.effect-oscar p {
        opacity: 1; transform: none; -webkit-transform: none;
        font-size: 13px; line-height: 1.5;
        text-transform: none; text-align: left; letter-spacing: normal;
        margin: 0; color: #fff;
    }
    body.nedra-home-mobile .why__we .gridmy figure.effect-oscar:hover p { transform: none; -webkit-transform: none; }

    /* Footer and popup belong to the home page in this scoped layout. */
    body.nedra-home-mobile .info__section-item {
        width: 100%; display: flex; flex-wrap: wrap;
        margin: 10px 0 18px; gap: 10px;
    }
    body.nedra-home-mobile .info__section-pic { width: 35%; margin: 0; }
    body.nedra-home-mobile .info__section-text { width: calc(65% - 10px); padding: 0; margin: 0; }
    body.nedra-home-mobile .info__section .container { padding-top: 14px; padding-bottom: 18px; }
    body.nedra-home-mobile .info__section-btn { padding: 15px 0 5px; }
    body.nedra-home-mobile .info__section-btn a { max-width: calc(100% - 40px); }
    body.nedra-home-mobile .contacts__section .container {
        display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px;
    }
    body.nedra-home-mobile .contacts__section .contacts__item,
    body.nedra-home-mobile .contacts__section .contacts__item.contacts__item-btn {
        display: block; width: 100%; margin: 0; padding: 0;
    }
    body.nedra-home-mobile .contacts__item-bottom { overflow-wrap: anywhere; }
    body.nedra-home-mobile .contacts__item-bottom a { font-size: 15px; }
    body.nedra-home-mobile .copyright { padding: 10px 16px; line-height: 1.5; }
    body.nedra-home-mobile .popupBox {
        width: calc(100% - 24px); max-width: 500px; max-height: 90vh;
        top: 5vh; left: 50%; margin: 0;
        transform: translateX(-50%); overflow-y: auto; overscroll-behavior: contain;
    }
    body.nedra-home-mobile .popupBox .popupInn { padding: 18px 12px 16px; }
    body.nedra-home-mobile .popupBox .formBox { padding: 12px; }
    body.nedra-home-mobile .popupBox .formBox input:not([type="checkbox"]) {
        max-width: 100%; box-sizing: border-box;
    }
    body.nedra-home-mobile .popupBox .btnBox input {
        width: 100%; margin-top: 20px !important; padding: 10px 12px;
    }
}

@media screen and (max-width: 640px) {
    body.nedra-home-mobile .header__middle-container { justify-content: center; gap: 10px; }
    body.nedra-home-mobile .header__middle-phone { text-align: center; }
    body.nedra-home-mobile .header__middle-btn { gap: 8px; }
    body.nedra-home-mobile .popup__btn-header { flex: 1 1 130px; font-size: 12px; padding: 10px 7px; }
    body.nedra-home-mobile .top__section { height: 265px; }
    body.nedra-home-mobile .top__section-banner { padding: 16px 10px; }
    body.nedra-home-mobile .banner__text-big { font-size: clamp(22px, 6vw, 30px); line-height: 1.2; }
    body.nedra-home-mobile .banner__text-small { font-size: clamp(16px, 4.4vw, 21px); }
    body.nedra-home-mobile .section__header-title { font-size: 19px; line-height: 1.35; }
    body.nedra-home-mobile .map__descr .container { font-size: 14px; }
    body.nedra-home-mobile .map__descr .grid:not(.gridmy) { grid-template-columns: 1fr; }
    body.nedra-home-mobile .map__descr .grid figure { height: 210px; }
    body.nedra-home-mobile .map__descr .grid figure .nedra-home-card-title { font-size: 21px; }
    body.nedra-home-mobile .advantage__section .container > a,
    body.nedra-home-mobile .why__we .gridmy,
    body.nedra-home-mobile .contacts__section .container { grid-template-columns: 1fr; }
    body.nedra-home-mobile .advantage__item { min-height: 58px; }
    body.nedra-home-mobile .why__we .gridmy { gap: 14px; }
    body.nedra-home-mobile .why__we .gridmy figure.effect-oscar,
    body.nedra-home-mobile .why__we .gridmy figure.effect-oscar figcaption { min-height: 0; }
    body.nedra-home-mobile .info__section-item { display: block; }
    body.nedra-home-mobile .info__section-pic,
    body.nedra-home-mobile .info__section-text { width: 100%; }
    body.nedra-home-mobile .info__section-pic img { width: 100%; height: auto; }
    body.nedra-home-mobile .contacts__section .container { gap: 18px; }
    body.nedra-home-mobile .popupBox .top_block h3 { font-size: 19px; line-height: 1.2; }
}

/* Change 007: scale both original interactive SVG maps uniformly to fit the
   mobile screen. Each SVG, its labels and its hit targets use one transform. */
@media screen and (max-width: 1199px) {
    body.nedra-home-mobile .map__body-list {
        width: 100%; max-width: 100%; overflow: hidden;
    }
    body.nedra-home-mobile .map__body-list > .map__item {
        width: 100%; max-width: 100%; min-width: 0;
        margin: 0 auto; padding-left: 8px; padding-right: 8px;
    }
    body.nedra-home-mobile .map__body-list > .map__item.active {
        display: flow-root;
    }
    body.nedra-home-mobile .map__body-list .map_deeps_container {
        position: relative; float: none; width: 100%;
        height: 210px; /* JS replaces this with the actual scaled height. */
    }
    body.nedra-home-mobile .map__body-list .map_deeps_content {
        position: relative; width: 1120px; height: 700px;
        transform-origin: top left;
        transform: scale(var(--nedra-depth-scale, .3));
    }
}

/* Change 010: a separate readable mobile map with tap-to-select details.
   The old two-map widget is left untouched for desktop and as JS fallback. */
body.nedra-home-mobile .nedra-map-mobile { display: none; }

@media screen and (max-width: 1199px) {
    body.nedra-home-mobile .nedra-map-mobile {
        display: block; width: 100%; max-width: 720px;
        margin: 0 auto 28px; padding: 12px 16px 0;
        box-sizing: border-box;
    }
    body.nedra-home-mobile .map__section.nedra-map-mobile-ready .map__header,
    body.nedra-home-mobile .map__section.nedra-map-mobile-ready .map__body-list {
        display: none !important;
    }
    body.nedra-home-mobile .nedra-mobile-map-intro p {
        margin: 4px 0 12px; font-size: 14px;
        line-height: 1.5; color: #4b4b4b; text-align: left;
    }
    body.nedra-home-mobile .nedra-mobile-map-graphic {
        width: 100%; padding: 10px 7px;
        background: #f9fafb; border: 1px solid #e3e5e8;
        border-radius: 9px; box-sizing: border-box; overflow: hidden;
    }
    body.nedra-home-mobile .nedra-mobile-regions-svg {
        display: block; width: 100%; height: auto;
        max-width: 100%; overflow: visible;
        touch-action: manipulation;
    }
    body.nedra-home-mobile .nedra-mobile-regions-svg path {
        stroke: #fff; stroke-width: 1.5;
    }
    body.nedra-home-mobile .nedra-mobile-regions-svg path[data-nedra-region] {
        fill: #b0b6bc !important;
        cursor: pointer;
        transition: fill .15s ease;
    }
    body.nedra-home-mobile .nedra-mobile-regions-svg path[data-nedra-region]:hover,
    body.nedra-home-mobile .nedra-mobile-regions-svg path[data-nedra-region]:focus-visible,
    body.nedra-home-mobile .nedra-mobile-regions-svg path.nedra-map-region-selected {
        fill: #f28943 !important;
        outline: none;
    }
    body.nedra-home-mobile .nedra-mobile-map-select-wrap {
        margin: 15px 0 13px;
    }
    body.nedra-home-mobile .nedra-mobile-map-select-wrap label {
        display: block; margin-bottom: 7px;
        font-size: 13px; font-weight: 600; color: #333236;
    }
    body.nedra-home-mobile .nedra-mobile-map-select-wrap select {
        display: block; width: 100%; min-height: 46px;
        padding: 10px 12px; border: 1px solid #c8cbd0;
        border-radius: 7px; color: #333236; background: #fff;
        box-sizing: border-box; font-size: 15px;
    }
    body.nedra-home-mobile .nedra-mobile-region-card {
        margin: 0; padding: 18px 16px;
        border: 1px solid #ededed; border-top: 4px solid #f28943;
        border-radius: 8px; background: #fff;
        box-shadow: 0 4px 18px rgba(30,30,30,.07);
    }
    body.nedra-home-mobile .nedra-mobile-region-card .nedra-mobile-region-title {
        margin: 0 0 12px; padding: 0; color: #333236;
        font-size: 20px; line-height: 1.25;
        font-family: 'OpenSansBold', Arial, sans-serif;
        text-transform: none;
    }
    body.nedra-home-mobile .nedra-mobile-region-details {
        display: grid; grid-template-columns: repeat(2,minmax(0,1fr));
        gap: 12px; margin: 0 0 12px;
    }
    body.nedra-home-mobile .nedra-mobile-region-details[hidden] {
        display: none !important;
    }
    body.nedra-home-mobile .nedra-mobile-region-details > div {
        min-width: 0; padding: 12px; border-radius: 6px;
        background: #f4f5f6;
    }
    body.nedra-home-mobile .nedra-mobile-region-details dt {
        margin-bottom: 7px; font-size: 12px;
        line-height: 1.4; color: #676767;
    }
    body.nedra-home-mobile .nedra-mobile-region-details dd {
        margin: 0; font-size: 16px; font-weight: 700;
        line-height: 1.45; color: #333236;
        overflow-wrap: anywhere;
    }
    body.nedra-home-mobile .nedra-mobile-region-hint {
        margin: 0; color: #666; font-size: 12px; line-height: 1.5;
    }
}

@media screen and (max-width: 390px) {
    body.nedra-home-mobile .nedra-mobile-region-details {
        grid-template-columns: 1fr;
    }
}
