/* MBbuh — mobile & tablet responsive (desktop ≥1280 unchanged for header nav) */

/* ——— Base mobile tokens ——— */
@media (max-width:767px){
  :root{
    --container-padding:16px;
    --section-padding:40px;
    --section:40px;
  }
  body{
    font-size:16px;
    line-height:1.5;
  }
  h1,.page-hero h1,.hero h1{
    font-size:30px !important;
    line-height:1.15;
  }
  h2,.section-title,.page-hero h2{
    font-size:24px;
    line-height:1.25;
  }
  h3{font-size:18px;line-height:1.35;}
  .section-lead,.hero__lead,p:not(.review-card p){
    font-size:15px;
    line-height:1.5;
  }
  small,.text-small,.reviews__source{font-size:14px;}
  .btn,.header__cta{
    width:100%;
    max-width:100%;
    min-height:52px;
    height:52px;
    min-width:0;
    padding:16px 28px;
    font-size:16px;
    font-weight:600;
    line-height:1.2;
    white-space:nowrap;
    justify-content:center;
    text-align:center;
    box-sizing:border-box;
  }
  .buttons{
    flex-direction:column;
    align-items:stretch;
    width:100%;
    gap:12px;
  }
  .section-pad,.home-page .home-block{padding:var(--section-padding) 0;}
  img,video,iframe{max-width:100%;height:auto;}
  table{display:block;max-width:100%;}
  .price-table-wrap,
  .table-scroll,
  .calc-summary-table-wrap{
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    max-width:100%;
    margin:0 calc(-1 * var(--container-padding));
    padding:0 var(--container-padding);
  }
  .price-table{min-width:520px;}
}

@media (max-width:576px){
  .hero__photo{max-width:100%;}
  .svc-cta__box{padding:24px 18px;}
}

@media (max-width:480px){
  .hero h1{font-size:28px !important;}
  .services-page .trust .section-title{font-size:22px;}
}

@media (max-width:390px){
  :root{--container-padding:16px;}
}

@media (max-width:360px){
  .hero h1{font-size:26px !important;}
}

/* ——— Header & burger ——— */
.nav-backdrop{
  position:fixed;
  inset:0;
  top:var(--header-h);
  z-index:190;
  background:rgba(7,22,53,.48);
  border:0;
  padding:0;
  cursor:pointer;
  opacity:0;
  visibility:hidden;
  transition:opacity .28s ease, visibility .28s ease;
}
.nav-backdrop.is-visible{
  opacity:1;
  visibility:visible;
}
body.nav-open{overflow:hidden;}

@media (max-width:1279px){
  .header__nav{
    margin-left:0;
    width:auto;
    max-width:none;
    padding-right:0;
  }
  .header__logo{margin-right:0;}
  .header__cta{display:none;}
  .nav-toggle{
    margin-left:auto;
    order:10;
    z-index:210;
  }
  .header__logo{order:0;}
  .header__nav{order:20;}
  .header.is-open .header__nav{
    max-height:min(85vh,640px);
    overflow-y:auto;
    z-index:205;
    animation:mbuhNavIn .28s ease;
  }
  @keyframes mbuhNavIn{
    from{opacity:0;transform:translateY(-8px);}
    to{opacity:1;transform:translateY(0);}
  }
  .header.is-open .header__nav a{
    min-height:48px;
    display:flex;
    align-items:center;
    padding:12px 8px;
    font-size:17px;
    border-bottom:1px solid rgba(215,227,244,.65);
  }
  .header.is-open .header__nav a:last-child{border-bottom:0;}
  .header.is-open .nav-toggle span:nth-child(1){
    transform:translateY(8px) rotate(45deg);
  }
  .header.is-open .nav-toggle span:nth-child(2){
    opacity:0;
  }
  .header.is-open .nav-toggle span:nth-child(3){
    transform:translateY(-8px) rotate(-45deg);
  }
  .nav-toggle span{transition:transform .25s ease, opacity .2s ease;}
}

/* ——— Hero ——— */
@media (max-width:767px){
  .hero{
    padding:calc(var(--header-h) + 12px) 0 28px;
  }
  .hero__inner{
    gap:20px;
  }
  .hero__text{order:1;}
  .hero__photo{
    order:2;
    width:100%;
    max-width:100%;
    margin:0 auto;
  }
  .hero__photo img{
    width:100%;
    height:auto;
    max-height:min(115vw, 440px);
    aspect-ratio:4/5;
    object-fit:cover;
    object-position:center center;
    display:block;
  }
  .hero__buttons{
    display:flex;
    flex-direction:column;
    width:100%;
  }
  .hero .btn{
    min-height:52px;
    height:52px;
    width:100%;
    white-space:nowrap;
  }
  .hero__chips{
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:8px;
  }
  .hero__chips li{
    width:100%;
    white-space:normal;
    height:auto;
    min-height:36px;
    padding:8px 12px;
    justify-content:flex-start;
  }
  .page-hero{
    padding:calc(var(--header-h) + 16px) 0 24px;
  }
  .page-hero .buttons{
    flex-direction:column;
    margin-top:16px;
  }
}

@media (min-width:768px) and (max-width:1023px){
  .hero__inner{
    grid-template-columns:1fr;
    gap:24px;
  }
  .hero__text{order:1;}
  .hero__photo{
    order:2;
    width:100%;
    max-width:min(400px, 100%);
    margin:0 auto;
  }
}

/* ——— Services cards grid ——— */
@media (min-width:768px) and (max-width:1023px){
  .services-page .trust__grid{
    grid-template-columns:repeat(2,1fr);
    gap:16px;
  }
}

@media (max-width:767px){
  .services-page .trust{
    padding:var(--section-padding) 0;
  }
  .services-page .trust + .trust{
    padding-top:0;
  }
  .services-page .trust__head{
    margin-bottom:16px;
  }
  .services-page .trust .section-title{
    font-size:23px;
    letter-spacing:-.02em;
    margin-bottom:10px;
    overflow-wrap:break-word;
    hyphens:auto;
  }
  .services-page .trust__grid{
    grid-template-columns:1fr;
    gap:15px;
  }
  .services-page .trust-card[data-trust]{
    width:100%;
    min-height:0;
    height:auto;
    padding:19px 18px;
    overflow:visible;
  }
  .services-page .trust-card[data-trust] h3,
  .services-page .trust-card[data-trust] p{
    display:block;
    -webkit-line-clamp:unset;
    -webkit-box-orient:unset;
    overflow:visible;
    min-height:0;
    overflow-wrap:break-word;
  }
  .services-page .trust-card[data-trust] h3{
    font-size:17px;
    margin-bottom:8px;
  }
  .services-page .trust-card[data-trust] p{
    font-size:15px;
    line-height:1.5;
  }
  .home-page .home-preview .trust-card,
  .home-page .trust-card,
  .home-page .process-step{
    min-height:0;
    max-height:none;
    height:auto;
  }
  .trust__grid,
  .services__grid,
  .prices__grid,
  .prices-page .pr-grid,
  .prices-page .pr-grid--4,
  .prices-page .pr-grid--2,
  .prices-page .pr-grid--5,
  .prices-page .pr-grid--once{
    grid-template-columns:1fr !important;
    gap:16px;
  }
  .svc-grid,.svc-grid--3,.svc-grid--4{
    grid-template-columns:1fr;
    gap:16px;
  }
  a.svc-card,.svc-card{
    height:auto;
    min-height:0;
    max-height:none;
  }
  .svc-block .section-title{font-size:23px;}
}

@media (min-width:768px) and (max-width:1023px){
  .svc-grid,.svc-grid--3,.svc-grid--4{grid-template-columns:repeat(2,1fr);}
  .prices-page .pr-grid--4,
  .prices-page .pr-grid--2{grid-template-columns:repeat(2,1fr) !important;}
}

/* ——— Reviews swiper ——— */
@media (max-width:767px){
  .reviews__grid{
    display:flex;
    flex-wrap:nowrap;
    overflow-x:auto;
    scroll-snap-type:x mandatory;
    -webkit-overflow-scrolling:touch;
    gap:16px;
    padding-bottom:8px;
    margin:0 calc(-1 * var(--container-padding));
    padding-left:var(--container-padding);
    padding-right:var(--container-padding);
    scrollbar-width:none;
  }
  .reviews__grid::-webkit-scrollbar{display:none;}
  .reviews__grid .review-card{
    flex:0 0 calc(100% - 8px);
    scroll-snap-align:start;
    min-width:0;
    max-width:100%;
  }
  .reviews__grid::after{
    content:"";
    flex:0 0 1px;
  }
}

/* ——— Contacts ——— */
@media (max-width:767px){
  .contacts-layout{
    grid-template-columns:1fr;
    gap:16px;
  }
  .contacts-panel{
    padding:20px 18px;
  }
  .contacts-panel > div{
    padding:14px 0;
    border-bottom:1px solid var(--border);
  }
  .contacts-panel > div:last-of-type{border-bottom:0;}
  .contacts-panel__actions{
    display:flex;
    flex-direction:column;
    gap:12px;
    margin-top:16px;
  }
  .contacts-panel__actions .btn{
    min-height:52px;
    height:52px;
    white-space:nowrap;
  }
  .trust-modal__actions{
    flex-direction:column;
    gap:12px;
  }
  .trust-modal__actions .btn{
    flex:1 1 auto;
    width:100%;
    min-width:0;
    height:52px;
    min-height:52px;
    white-space:nowrap;
  }
  .lead-form label input,
  .lead-form label select,
  .lead-form label textarea{
    width:100%;
  }
  .map-card{
    width:100%;
    margin-left:0;
    margin-right:0;
    border-radius:var(--card-radius);
    overflow:hidden;
  }
  .map-card img,
  .map-card__visual,
  .map-card__iframe{
    width:100%;
    height:260px;
    min-height:260px;
    max-height:260px;
    object-fit:cover;
  }
  .map-card iframe{
    width:100%;
    height:260px;
    border:0;
  }
}

/* ——— Calculator V5 ——— */
@media (max-width:767px){
  .calculator--v5 .calculator__layout--v5{
    grid-template-columns:1fr;
    gap:16px;
  }
  .calculator--v5 input,
  .calculator--v5 select,
  .calculator--v5 textarea,
  .calculator--v5 .calc-v5-field input,
  .calculator--v5 .calc-v5-field select{
    width:100%;
    max-width:100%;
  }
  .calculator--v5 .calc-v5-picks,
  .calculator--v5 .calc-v5-picks--activity{
    grid-template-columns:1fr;
  }
  .calculator--v5 .calc-range--v5:hover::-webkit-slider-thumb{
    width:28px;
    height:28px;
    margin-top:-9px;
  }
  .calculator--v5 .calc-range--v5:active::-webkit-slider-thumb{
    width:30px;
    height:30px;
    margin-top:-10px;
  }
  .calculator--v5 .btn,
  .calculator--v5 .calc-v5-wa-btn{
    width:100%;
    min-height:52px;
  }
  .calculator{padding-left:var(--container-padding);padding-right:var(--container-padding);}
}

/* ——— Footer ——— */
@media (max-width:767px){
  .site-footer__main{
    grid-template-columns:1fr;
    gap:28px;
  }
  .site-footer__contacts{
    display:flex;
    flex-direction:column;
    gap:12px;
  }
}

/* ——— Service detail ——— */
@media (max-width:767px){
  .sd-hero__inner{grid-template-columns:1fr;gap:20px;}
  .sd-hero__photo{max-width:100%;margin:0 auto;}
}

/* ——— Touch: tap instead of hover ——— */
@media (hover:none){
  .trust-card:hover,
  .trust-card.reveal.is-visible:hover,
  .services-page .trust-card[data-trust]:hover,
  .svc-card:hover,
  .mb-card:hover,
  .review-card:hover,
  .pr-card:hover,
  .btn-primary:hover,
  .hero .btn-primary:hover{
    transform:none;
  }
  .trust-card:active,
  .services-page .trust-card[data-trust]:active,
  .svc-card:active,
  .mb-card:active,
  .review-card:active,
  .btn:active{
    transform:scale(.98);
    transition:transform .12s ease;
  }
}

/* ——— Wide screens: no change below 1280 for nav (defined in style.css) ——— */
@media (min-width:1200px){
  /* anchor breakpoint — layout uses container-max */
}

/* Tablet & phone — override desktop fixed hero photo sizes */
@media (max-width:1023px){
  .hero{
    overflow-x:hidden;
    overflow-y:visible;
    max-height:none;
  }
  .home-page .hero__inner,
  .services-page .hero__inner,
  .legal-page .hero__inner,
  .about-page .hero__inner,
  .prices-page .hero__inner{
    grid-template-columns:1fr !important;
    min-height:0 !important;
    align-items:stretch;
  }
  .home-page .hero__photo,
  .services-page .hero__photo,
  .legal-page .hero__photo,
  .about-page .hero__photo,
  .prices-page .hero__photo{
    width:100% !important;
    max-width:min(400px, 100%) !important;
    margin-left:auto !important;
    margin-right:auto !important;
  }
  .home-page .hero__photo img,
  .services-page .hero__photo img,
  .legal-page .hero__photo img,
  .about-page .hero__photo img,
  .prices-page .hero__photo img{
    width:100% !important;
    height:auto !important;
    max-height:min(115vw, 460px) !important;
    aspect-ratio:4/5;
    object-fit:cover;
  }
  .sd-hero__inner{
    grid-template-columns:1fr !important;
    gap:20px;
  }
  .sd-hero__photo{
    width:100% !important;
    max-width:min(400px, 100%) !important;
    margin:0 auto !important;
  }
  .sd-hero__photo img{
    width:100% !important;
    height:auto !important;
    max-height:min(115vw, 460px) !important;
    aspect-ratio:4/5;
    object-fit:cover;
  }
  .legal-page .hero__inner--band,
  .legal-page .hero__inner--band.hero__inner--reverse{
    grid-template-columns:1fr;
    min-height:0;
    gap:24px;
  }
  .legal-page .hero__inner--band .hero__photo,
  .legal-page .hero__inner--band.hero__inner--reverse .hero__photo{
    width:100%;
    max-width:100%;
    margin:0;
    order:0 !important;
  }
  .legal-page .hero__inner--band .hero__text,
  .legal-page .hero__inner--band.hero__inner--reverse .hero__text{
    order:1;
  }
  .legal-page .hero__inner--band .hero__photo img{
    width:100%;
    height:auto;
    max-height:none;
    aspect-ratio:520 / 360;
  }
}

/* ——— Site-wide mobile polish ——— */
@media (max-width:767px){
  html,
  body{
    overflow-x:hidden;
    max-width:100%;
  }
  main{
    overflow-x:clip;
  }
  .section-inner,
  .header__inner,
  .site-footer__main,
  .site-footer__bottom{
    padding-left:var(--container-padding);
    padding-right:var(--container-padding);
    box-sizing:border-box;
  }
  .calc-cta{
    padding:var(--section-padding) 0;
  }
  .calc-cta__box{
    padding:24px 18px;
    min-height:0;
    height:auto;
  }
  .calc-cta__box h2{
    font-size:22px;
    line-height:1.25;
  }
  .trust-modal__dialog{
    width:calc(100% - 24px);
    max-width:100%;
    margin:12px auto;
    max-height:calc(100dvh - 24px);
    overflow-y:auto;
    padding:20px 18px 18px;
  }
  .float-wa{
    width:52px;
    height:52px;
    right:16px;
    bottom:16px;
  }
  .to-top{
    right:16px;
    bottom:78px;
  }
}

/* ——— Legal hub & detail ——— */
@media (max-width:767px){
  .legal-page .trust__grid{
    grid-template-columns:1fr !important;
    gap:15px;
  }
  .legal-page .trust-card[data-trust],
  .legal-page .legal-why .trust-card,
  .services-page.legal-page .trust__grid > a.trust-card.legal-svc-card{
    min-height:0 !important;
    max-height:none !important;
    height:auto !important;
    padding:19px 18px;
  }
  .legal-page .trust-card h3,
  .legal-page .trust-card p,
  .services-page.legal-page .trust__grid > a.trust-card.legal-svc-card h3,
  .services-page.legal-page .trust__grid > a.trust-card.legal-svc-card p{
    display:block;
    -webkit-line-clamp:unset;
    -webkit-box-orient:unset;
    overflow:visible;
    min-height:0;
    overflow-wrap:break-word;
  }
  .legal-page .legal-work .process__line,
  .services-page .legal-work .process__line{
    grid-template-columns:1fr !important;
    gap:15px;
  }
  .legal-page .legal-work .process-step,
  .services-page .legal-work .process-step{
    min-height:0 !important;
    height:auto !important;
    max-height:none !important;
    padding:19px 18px;
  }
  .legal-page .legal-faq .faq-item summary{
    font-size:16px;
    line-height:1.35;
    padding:12px 36px 12px 0;
  }
  .legal-page .trust--band .hero__text .section-title{
    font-size:26px;
  }
}

@media (min-width:768px) and (max-width:1023px){
  .legal-page .trust__grid{
    grid-template-columns:repeat(2,1fr) !important;
  }
  .legal-page .legal-work .process__line,
  .services-page .legal-work .process__line{
    grid-template-columns:repeat(2,1fr);
    gap:16px;
  }
  .legal-page .legal-why .trust__grid{
    grid-template-columns:repeat(2,1fr) !important;
  }
}

/* ——— Service detail pages ——— */
@media (max-width:767px){
  .service-detail-page .sd-grid,
  .service-detail-page .sd-grid--3,
  .service-detail-page .sd-grid--4,
  .service-detail-page .sd-grid--6{
    grid-template-columns:1fr !important;
    gap:15px;
  }
  .service-detail-page .sd-card,
  .service-detail-page .mb-card.sd-card{
    height:auto !important;
    min-height:0 !important;
    max-height:none !important;
    padding:19px 18px;
  }
  .service-detail-page .sd-card p{
    -webkit-line-clamp:unset;
    overflow:visible;
    display:block;
  }
  .service-detail-page .sd-related .trust__grid{
    grid-template-columns:1fr !important;
    gap:15px;
  }
  .service-detail-page .sd-related a.trust-card{
    min-height:0 !important;
    height:auto !important;
    max-height:none !important;
  }
  .service-detail-page .sd-kicker{
    font-size:14px;
    line-height:1.4;
    overflow-wrap:anywhere;
  }
  .service-detail-page .sd-hero h1{
    font-size:28px !important;
  }
  .service-detail-page .sd-price{
    min-height:0;
    padding:22px 18px;
    max-width:100%;
  }
}

/* ——— About ——— */
@media (max-width:767px){
  .about-page .about-mission__grid,
  .about-page .about-values__grid,
  .about-page .about-stats__grid,
  .about-page .about-team__grid,
  .about-page .about-lead__grid{
    grid-template-columns:1fr !important;
    gap:16px;
  }
  .about-page .about-mission__card,
  .about-page .about-value-card,
  .about-page .about-team-card{
    min-height:0;
    height:auto;
  }
  .about-page .about-pillars li{
    flex-wrap:wrap;
    gap:10px;
  }
  .about-page .trust-card{
    min-height:0;
    height:auto;
  }
}

@media (min-width:768px) and (max-width:1023px){
  .about-page .about-values__grid,
  .about-page .about-stats__grid{
    grid-template-columns:repeat(2,1fr) !important;
  }
}

/* ——— Blog, FAQ, reviews, privacy ——— */
@media (max-width:767px){
  .blog-page .blog__grid{
    grid-template-columns:1fr !important;
    gap:16px;
  }
  .blog-page .blog-card{
    min-height:0;
    height:auto;
  }
  .faq-page .faq-item summary{
    font-size:16px;
    line-height:1.35;
    padding:12px 36px 12px 0;
  }
  .reviews-page .reviews__head{
    margin-bottom:16px;
  }
  .privacy-page .section-inner,
  .error-page-body .error-page{
    padding-left:var(--container-padding);
    padding-right:var(--container-padding);
  }
  .home-page .stats__grid{
    grid-template-columns:1fr 1fr !important;
    gap:12px;
  }
  .home-page .stat-card{
    padding:16px 14px;
    min-height:0;
    height:auto;
  }
  .home-page .stat-card__num{
    font-size:34px;
  }
}

@media (max-width:480px){
  .home-page .stats__grid{
    grid-template-columns:1fr !important;
  }
}
