/*
 * Compatibility and responsive cleanup for the Moscow build.
 * Loaded after the legacy stylesheet so the original design is preserved
 * while unstable float/absolute layouts are replaced at narrow widths.
 */
*,*::before,*::after{box-sizing:border-box}
html,body{max-width:100%;overflow-x:hidden}
img,video,iframe,svg{max-width:100%;height:auto}
.wrap{width:100%;max-width:1170px;padding-left:16px;padding-right:16px}

/* Header: stable three-column layout on desktop. */
@media (min-width:1025px){
  .top-line_header{min-height:82px;padding:10px 0;display:flex;align-items:center}
  .top-line_header .my-header-wrap{
    display:grid;
    grid-template-columns:auto minmax(175px,220px) minmax(0,1fr);
    gap:16px;
    align-items:center;
  }
  .top-line_header .logo-info,
  .top-line_header .logo-text,
  .top-line_header .right-box_head,
  .top-line_header .contact-head_box,
  .top-line_header .phone-head_box,
  .top-line_header .call-top_head{float:none;margin:0;max-width:none}
  .top-line_header .logo-text{line-height:1.35}
  .top-line_header .right-box_head{
    display:grid;
    grid-template-columns:minmax(220px,1fr) minmax(170px,auto) auto;
    gap:18px;
    align-items:center;
    width:100%;
  }
  .top-line_header .contact-head_box{min-width:0}
  .top-line_header .adress-top_head{font-size:14px;line-height:1.35;overflow-wrap:anywhere}
  .top-line_header .phone-head_box{text-align:right;white-space:nowrap}
  .top-line_header .timework-top_head{justify-content:flex-end}
  .top-line_header .button-border{white-space:nowrap;padding-left:18px;padding-right:18px}
  .top-menu_box{margin-top:82px}
}

/* Tablet header: no fixed layer and no overlap with navigation. */
@media (min-width:768px) and (max-width:1024px){
  .top-line_header{position:static!important;min-height:0;padding:12px 0!important}
  .top-line_header .my-header-wrap{
    display:grid!important;
    grid-template-columns:auto minmax(180px,1fr);
    gap:12px 20px;
    align-items:center;
  }
  .top-line_header .logo-info,
  .top-line_header .logo-text,
  .top-line_header .right-box_head,
  .top-line_header .contact-head_box,
  .top-line_header .phone-head_box,
  .top-line_header .call-top_head{float:none!important;margin:0!important;max-width:none!important}
  .top-line_header .logo-text{text-align:left!important;max-width:none}
  .top-line_header .right-box_head{
    grid-column:1/-1;
    display:grid!important;
    grid-template-columns:minmax(240px,1fr) auto auto;
    gap:18px;
    align-items:center;
    width:100%;
  }
  .top-line_header .phone-head_box{text-align:right!important;white-space:nowrap}
  .top-line_header .timework-top_head{justify-content:flex-end}
  .top-menu_box{margin-top:0!important}
}

/* Phones: logo and telephone on the first row, address below. */
@media (max-width:767px){
  .top-line_header{position:static!important;min-height:0;padding:10px 0!important}
  .top-line_header .my-header-wrap{
    display:grid!important;
    grid-template-columns:minmax(118px,145px) minmax(0,1fr);
    gap:8px 12px;
    align-items:center;
  }
  .top-line_header .logo-info{
    grid-column:1;
    grid-row:1;
    width:auto!important;
    max-width:none!important;
    float:none!important;
    margin:0!important;
  }
  .top-line_header .logo_link{
    display:flex;
    align-items:center;
    justify-content:center;
    min-height:48px;
    padding:6px 8px!important;
    font-size:12px;
    line-height:1.15;
    text-align:center;
    overflow-wrap:anywhere;
  }
  .top-line_header .logo-text{display:none!important}
  .top-line_header .right-box_head{display:contents!important}
  .top-line_header .phone-head_box{
    grid-column:2;
    grid-row:1;
    position:static!important;
    float:none!important;
    width:auto!important;
    max-width:none!important;
    margin:0!important;
    text-align:right!important;
    white-space:nowrap;
  }
  .top-line_header .phone-head_box .tel_header{font-size:17px;line-height:1.2;margin-bottom:4px}
  .top-line_header .timework-top_head{justify-content:flex-end;font-size:12px;line-height:1.2}
  .top-line_header .timework-top_head:before{width:10px;height:10px;flex:0 0 10px}
  .top-line_header .contact-head_box{
    grid-column:1/-1;
    grid-row:2;
    position:static!important;
    float:none!important;
    width:100%!important;
    max-width:none!important;
    margin:0!important;
    text-align:left!important;
  }
  .top-line_header .adress-top_head{
    min-height:24px;
    padding:3px 0 3px 28px;
    font-size:13px;
    line-height:1.35;
    overflow-wrap:anywhere;
  }
  .top-line_header .adress-top_head:after{top:0;transform:scale(.85);transform-origin:left top}
  .top-line_header .call-top_head{display:none!important}
  .top-menu_box{float:none!important;margin:0!important;min-height:44px}
  .slicknav_menu{width:100%;text-align:left!important}
  a.slicknav_btn{display:inline-flex!important;align-items:center;min-height:44px;padding:8px 8px 8px 42px!important}
  ul.slicknav_nav{top:44px!important;width:min(310px,calc(100vw - 32px))!important;left:0!important;right:auto!important;max-height:calc(100vh - 140px);overflow:auto}

  .breadcrumbs{font-size:13px;line-height:1.45;overflow-wrap:anywhere}
  .title-ecr-vnmain{font-size:29px!important;line-height:1.15!important;text-align:left!important;overflow-wrap:anywhere}
  .title-ecr-vnmain:after{margin-left:0!important;margin-right:auto!important}

  .main-ecr-1{padding:18px 0 28px}
  .main-ecr-1 .my-header-wrap{display:block!important}
  .my-header-right_block{width:100%!important;padding:0!important}
  .left_ecr-1{width:100%!important;margin:0!important;padding:12px 0 18px!important}
  .left_ecr-1 h1{font-size:28px!important;line-height:1.2!important;overflow-wrap:anywhere}
  .left_ecr-1 .left_ecr_span{font-size:25px!important;line-height:1.25!important;overflow-wrap:anywhere}
  .form-right_ecr-1{width:100%;max-width:100%;padding:18px!important;border-width:5px!important}

  /* Service page gallery and calculation form must stack, never squeeze side by side. */
  section.vnmain-ecr-3{padding-top:18px}
  .podg_uch_first-screen{display:block!important;width:100%;margin-bottom:25px}
  .podg_uch_first-screen>.example_gallery,
  .podg_uch_first-screen>.example_content{
    display:block!important;
    float:none!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    height:auto!important;
    padding-left:0!important;
    padding-right:0!important;
  }
  .podg_uch_first-screen>.example_gallery{margin:0 0 18px!important}
  .podg_uch_first-screen>.example_content{
    margin:0!important;
    padding:20px!important;
    border-width:4px!important;
  }
  .example_gallery .review-slides{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;height:auto!important}
  .example_gallery .review-slides>a{display:block;min-width:0}
  .example_gallery .review-slides img{display:block;width:100%!important;height:auto!important;margin:0!important}
  .example_content .form-title-box{font-size:26px!important;line-height:1.12!important;margin-bottom:18px;text-align:center}
  .example_content .form-style-st,
  .example_content .input-item,
  .example_content .wpcf7-form-control-wrap,
  .example_content .submit-form{display:block;width:100%;max-width:100%}
  .example_content input[type="text"],
  .example_content input[type="tel"],
  .example_content input[type="email"],
  .example_content input[type="submit"],
  .example_content .button-form{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin-left:0!important;
    margin-right:0!important;
    white-space:normal!important;
  }
  .example_content input[type="text"],
  .example_content input[type="tel"],
  .example_content input[type="email"]{font-size:16px!important}
  .example_content .accept-chack{font-size:13px;line-height:1.35;overflow-wrap:anywhere}
  .example_content .form__checkbox{width:100%;overflow-wrap:anywhere}
  .example_content .form__checkbox a{overflow-wrap:anywhere}

  .post table{min-width:600px}
  .tableContainer,.post .table-wrapper{overflow-x:auto;-webkit-overflow-scrolling:touch}
}

@media (max-width:430px){
  .wrap{padding-left:12px;padding-right:12px}
  .top-line_header .my-header-wrap{grid-template-columns:118px minmax(0,1fr);gap:7px 9px}
  .top-line_header .phone-head_box .tel_header{font-size:15px}
  .top-line_header .adress-top_head{font-size:12px}
  .title-ecr-vnmain{font-size:27px!important}
  .example_gallery .review-slides{grid-template-columns:1fr}
  .left_ecr-1 h1{font-size:26px!important}
  .left_ecr-1 .left_ecr_span{font-size:23px!important}
  .slide-to-quiz{display:none!important}
}

/* Flex fallbacks keep the header stable in engines without CSS Grid. */
@media (min-width:1025px){
  .top-line_header .my-header-wrap{
    display:flex!important;
    align-items:center;
    gap:16px;
  }
  .top-line_header .logo-info{flex:0 0 auto}
  .top-line_header .logo-text{flex:0 0 190px}
  .top-line_header .right-box_head{
    flex:1 1 auto;
    min-width:0;
    display:flex!important;
    align-items:center;
    justify-content:flex-end;
    gap:14px;
  }
  .top-line_header .contact-head_box{flex:1 1 220px;max-width:255px!important}
  .top-line_header .phone-head_box{flex:0 0 auto}
  .top-line_header .call-top_head{flex:0 0 auto}
}

@media (min-width:768px) and (max-width:1024px){
  .top-line_header .my-header-wrap{display:flex!important;flex-wrap:wrap;align-items:center;gap:12px 18px}
  .top-line_header .logo-info{flex:0 0 auto}
  .top-line_header .logo-text{flex:1 1 220px}
  .top-line_header .right-box_head{
    flex:1 0 100%;
    display:flex!important;
    align-items:center;
    justify-content:space-between;
    gap:16px;
  }
  .top-line_header .contact-head_box{flex:1 1 280px}
  .top-line_header .phone-head_box,.top-line_header .call-top_head{flex:0 0 auto}
}

@media (max-width:767px){
  .top-line_header .my-header-wrap{display:flex!important;flex-wrap:wrap;align-items:flex-start;gap:8px 10px}
  .top-line_header .logo-info{flex:0 0 125px!important}
  .top-line_header .right-box_head{
    display:flex!important;
    flex:1 1 calc(100% - 135px);
    min-width:0;
    flex-direction:column;
    align-items:stretch;
    gap:5px;
  }
  .top-line_header .phone-head_box{order:1;width:100%!important}
  .top-line_header .contact-head_box{order:2;width:100%!important}
  .top-line_header .call-top_head{display:none!important}
}

@media (max-width:520px){
  .desc-body_top{width:100%;max-width:100%}
  .desc-body_top ul{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px 14px;
    columns:auto!important;
    width:100%;
    margin:0;
    padding:0;
  }
  .desc-body_top li{
    display:block!important;
    width:auto!important;
    min-width:0;
    margin:0!important;
    padding-left:30px;
    overflow-wrap:anywhere;
  }
}
@media (max-width:350px){
  .desc-body_top ul{grid-template-columns:1fr}
}


/* GEO REGIONS LONG MENU */
@media (min-width: 769px) {
  #menu-item-rayony > .sub-menu { max-height: 72vh; overflow-y: auto; overscroll-behavior: contain; }
  #menu-item-rayony > .sub-menu a { padding-top: 10px; padding-bottom: 10px; }
}
