/* XS */
@media screen and (max-width: 768px) {
    .xs-hide {
        display: none;
    }
    
    /* Компенсация фиксированного мобильного хедера — чтобы контент
       (хлебные крошки/hero) не уезжал под него */
    main {
        padding-top: 72px;
    }
    body.home-page main { padding-top: 64px; }

    .header-mobile {
        padding: 6px 14px;
        border-bottom-left-radius: 14px;
        border-bottom-right-radius: 14px;
    }

    .header-mobile a img {
        width: 70px !important;
        height: auto;
    }

    .header-mobile__right {
        gap: 14px;
        align-items: center;
    }

    .header-mobile__phone {
        font-size: 16px;
        font-weight: 700;
        color: var(--pirple-dark);
        letter-spacing: -0.01em;
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }

    .header-mobile__phone svg {
        width: 14px;
        height: 14px;
        margin-right: 0;
    }

    .header-mobile__phone svg path { fill: var(--pirple-50-dark); }

    .header-mobile__burger {
        width: 32px;
        height: 14px;
    }
    .header-mobile__burger:after,
    .header-mobile__burger:before {
        background-color: var(--pirple-dark);
    }

    .tags {
        max-width: 170px;
    }

    .tags--absolute {
        left: 24px;
    }

    .tag {
        font-size: 10px;
        font-weight: 500;
    }

    .btn {
        padding: 20px 28px;
    }

    .object .object__img {
        height: 210px;
    }

    .cookie-alert {
        max-width: 90%;
        left: 50%;
        width: 90%;
        bottom: 100px;
        transform: translateX(-50%)!important;
    }

    .footer__infolinks {
        gap: 25px;
    }

    .footer__infolinks > * {
        width: 100%;
        display: inline-block;
    }

    .object .object__content .object__content__jobs:not(:last-child) {
        margin-bottom: 25px;
    }

    .object__content__jobs > div:first-child {
        margin-bottom: 15px;
    }

    .heading-plashk {
        color: var(--pirple-dark);
        margin-bottom: 30px;
    }

    .objects-slider {
        margin-top: 24px;
    }

    .btn-link,
    .post-item__meta, .post-item a {
        font-size: 14px!important;
    }

    .btn-link svg {
        width: 30px;
        height: 30px;
    }

    h1.plashk:before {
        display: none;
    }

    .page-404 h1 {
        font-size: 100px!important;
    }

    section.first h1,
    h2, 
    .loader__title,
    .other__title {
        font-size: 30px;
    }

    h3,
    .object h1 {
        font-size: 25px;
    }

    .other__title {
        margin-bottom: 0;
    }

    .page-404 h1.thanks-title {
        font-size: 35px;
    }

    section.page-404,
    section.other {
        padding-top: 100px!important;
    }

    .ordered {
        order: inherit!important;
    }

    .xs-mb-24 {
        margin-bottom: 24px;
    }

    section.first .first__btn {
        margin: 50px 0px;
    }

    .xs-mt-24,
    .xs-mt-blocks > div {
        margin-top: 24px;
    }

    .catalog-item {
        flex-direction: column;
    }

    .catalog-item {
        width: 100%!important;
        height: auto!important;
    }

    .tags:not(.tags--absolute) {
        max-width: 100%!important;
    }

    .modal {
        transform: translate(0, -50%);
        left: 1.5%;
        width: 97%;
    }

    .modal__close {
        right: 0px;
        top: -49px;
    }

    .catalog-item .object__gallery {
        max-width: 100%;
    }

    .objects-slider > .slick-prev {
        left: 0;
        transform: translateX(0);
    }

    .objects-slider > .slick-next {
        right: 0;
        transform: translateX(0);
    }

    section.first {
        padding: 40px 0px 40px;
    }

    section.second,
    footer.footer {
        padding-top: 50px;
    }

    section.second:not(:first-child) {
        margin-top: 40px;
    }

    section.first .first__fact {
        padding: 30px 0px;
    }

    section.first .first__img img {
        position: static;
        width: 100%;
    }

    .xs-text-left {
        text-align: left!important;
    }

    .xs-flex-left {
        justify-content: flex-start!important;
    }

    footer img[src="/assets/img/logo.svg"] {
        max-width: 100%;
    }

    .loader img {
        max-width: 250px;
    }

    .object .object__content,
    .form {
        padding: 24px;
    }

    .other__breadcrumbs .other__title {
        margin: 44px 0px;
    }
    
    .breadcrumb ,
    .reputation_block p{
        font-size: 12px;
    }

    .loader video, .loader iframe {
        width: auto;
        height: 100vh;
    }

    section.first video  {
        width: auto;
        height: 100%;
        left: -200%;
    }
}   

/* MD */
@media screen and (min-width: 768px) and (max-width: 1000px) {
    .header__phone {
        font-size: 16px!important;
        position: absolute;
        right: 0;
        top: 100px;
    }

    .header__top > div:first-child {
        font-size: 12px;
    }
}

@media screen and (min-width: 768px) and (max-width: 1280px) {
    section.first h1 {
        font-size: 35px;
    }

    .catalog-item .object__gallery {
        max-width: 400px;
    }

    .header .col-md-2 img {
        max-width: 120px;
    }

    .header .row > .col-md-2 {
        display: flex;
        align-items: center;
    }

    nav a,
    .header__top,
    section.first .first__fact  {
        font-size: 14px;
    }

    .header__bottom nav,
    .header__top > div:first-child {
        gap: 15px!important;
    }

    .header__phone {
        font-size: 20px;
    }

    .page-404 h1.thanks-title {
        font-size: 70px;
    }

    h2 {
        font-size: 35px;
    }
    
    .loader video,
    section.first video  {
        width: auto;
        height: 100vh;
        min-width: 100vw;
    }
}

/* LG */
@media screen and (min-width: 1280px) and (max-width: 1500px) {
    section.first h1 {
        font-size: 48px;
    }

    .catalog-item .object__gallery {
        max-width: 500px;
    }

    .header .col-md-2 img {
        max-width: 180px;
    }

    .header__phone {
        font-size: 20px;
    }

    nav a,
    section.first .first__fact {
        font-size: 16px;
    }

    .loader video,
    section.first video  {
        width: auto;
        height: 100vh;
        min-width: 100vw;
    }
}

/* OTHER */
@media screen and (min-width: 768px) {
    .post-item__meta {
        opacity: 0;
    }
	
	.object .object__content h3 {
		min-height: 100px;
	}
    
    .object__btns {
        position: absolute;
        left: 50%;
        width: 86%;
        transform: translateX(-50%);
        bottom: 28px;
    }
    .post-item__heading p {
        bottom: -200px;
    }
    .post-item__heading h3 {
        bottom: -85px;
    }
    
    .xs-show {
        display: none!important;
    }
}

/* ============================================
   Modern templates — Tablet (≤1280px)
   ============================================ */
@media screen and (max-width: 1280px) {
    .page-hero__inner { padding: 56px 44px; border-radius: 28px; }
    .page-hero__title { font-size: clamp(30px, 5vw, 48px); }
    .service-featured__card { padding: 40px 36px; border-radius: 28px; }
    .service-featured__grid { grid-template-columns: 1fr; gap: 32px; }
    .service-featured__media { min-height: 360px; }
    .service-featured__media .object__gallery { min-height: 360px; }
    .service-featured__watermark { font-size: 140px; top: -32px; }
    .steps { grid-template-columns: repeat(3, 1fr); gap: 16px; }
    .step::after { display: none; }
    .catalog-features { grid-template-columns: repeat(2, 1fr); }
    .cta-banner__inner { padding: 48px 40px; grid-template-columns: 1fr; gap: 32px; border-radius: 28px; }
}

/* ============================================
   Modern templates — Small Tablet / Large Mobile (≤900px)
   ============================================ */
@media screen and (max-width: 900px) {
    .page-hero__stats { grid-template-columns: repeat(2, 1fr); gap: 0; }
    .page-hero__stat { padding: 18px 20px; border-left: 1px solid rgba(255,255,255,.12); border-top: 1px solid rgba(255,255,255,.12); }
    .page-hero__stat:first-child { padding-left: 20px; border-top: 1px solid rgba(255,255,255,.12); }
    .page-hero__stat:nth-child(2n+1) { border-left: none; padding-left: 0; }
    .page-hero__stat:nth-child(-n+2) { border-top: none; padding-top: 0; }
    .page-hero__stats { padding-top: 32px; margin-top: 40px; }
    .steps { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================
   Modern templates — Mobile (≤768px)
   ============================================ */
@media screen and (max-width: 768px) {
    .page-hero { padding: 14px 0 32px; }
    .page-hero__inner { padding: 32px 20px; border-radius: 18px; }
    .page-hero__title { font-size: 28px; line-height: 1.08; margin: 14px 0 16px; letter-spacing: -0.02em; }
    .page-hero__lead { font-size: 14.5px; line-height: 1.55; margin-bottom: 24px; }
    .page-hero__cta { flex-direction: column; gap: 10px; }
    .page-hero__cta .btn { width: 100%; padding: 15px 22px; font-size: 14.5px; border-radius: 14px; }

    .page-hero__stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0;
        padding-top: 22px;
        margin-top: 28px;
    }
    .page-hero__stat {
        padding: 14px 12px !important;
        border-left: none !important;
        border-top: none !important;
    }
    .page-hero__stat:nth-child(odd) {
        border-right: 1px solid rgba(255,255,255,.12);
    }
    .page-hero__stat:nth-child(n+3) {
        border-top: 1px solid rgba(255,255,255,.12);
    }
    .page-hero__stat-num { font-size: 26px; margin-bottom: 6px; }
    .page-hero__stat-label { font-size: 11px; letter-spacing: .03em; }

    .location-badge { font-size: 11.5px; padding: 6px 12px 6px 10px; gap: 6px; }
    .location-badge svg { width: 13px; height: 13px; }

    .service-featured { padding: 16px 0 32px; }
    .service-featured__card { padding: 24px 20px 28px; border-radius: 18px; }
    .service-featured__title { font-size: 24px; margin-bottom: 14px; }
    .service-featured__watermark { display: none; }
    .service-featured__media { min-height: 220px; border-radius: 14px; }
    .service-featured__media .object__gallery { min-height: 220px; }
    .service-featured__benefits { grid-template-columns: 1fr; gap: 10px; margin-bottom: 22px; }
    .service-featured__benefits li { font-size: 13.5px; padding-left: 26px; }
    .service-featured__benefits li::before { width: 18px; height: 18px; }
    .service-featured__params { grid-template-columns: 1fr; padding: 14px 16px; gap: 10px; }
    .service-featured__cta { flex-direction: column; gap: 10px; }
    .service-featured__cta .btn { width: 100%; padding: 14px 22px; font-size: 14.5px; }
    .service-featured__desc { font-size: 14.5px; }

    .services-advantages { padding: 16px 0; }
    .services-advantages__title { margin-bottom: 24px; font-size: 26px; }
    /* Полный сброс flex на мобиле + явный отступ между карточками преимуществ */
    .services-advantages__grid { row-gap: 14px; }
    .services-advantages__grid > [class*="col-"] {
        display: block !important;
        margin-bottom: 14px;
    }
    .advantage-tile { padding: 22px 20px; border-radius: 14px; margin-bottom: 0; }
    .advantage-tile h3 { font-size: 16px; }

    .services-steps { padding: 16px 0 36px; }
    .services-steps h2 { margin-bottom: 22px; font-size: 26px; }
    .steps { grid-template-columns: 1fr; gap: 12px; }
    .step { padding: 20px 20px; border-radius: 14px; }
    .step__num { font-size: 30px; margin-bottom: 6px; }
    .step h3 { font-size: 16px; }
    .step p { font-size: 13px; }

    .services-list { padding: 24px 0 32px; }
    .services-list h2 { font-size: 26px; }
    .services-list__subtitle { font-size: 14px; }
    .service-card { border-radius: 16px; }
    .service-card__body { padding: 20px 20px 22px; }
    .service-card__title { font-size: 17px; }
    .service-card__footer { flex-direction: column; align-items: stretch; gap: 10px; }
    .service-card__footer .btn--sm { width: 100%; padding: 12px 18px; }
    .service-card__more { justify-content: center; }

    .catalog-features { grid-template-columns: 1fr; gap: 10px; margin-top: 22px; }
    .catalog-feature { padding: 12px 14px; gap: 12px; }
    .catalog-feature__icon { width: 38px; height: 38px; }

    .catalog-list { padding: 24px 0 32px; }
    .equipment-card { border-radius: 16px; }
    .equipment-card__body { padding: 20px 20px 22px; }
    .equipment-card__title { font-size: 17px; }
    .equipment-card__specs { padding: 12px 14px; }

    .objects-list { padding: 24px 0 32px; }
    .project-card { border-radius: 16px; }
    .project-card__body { padding: 20px 20px 22px; }
    .project-card__title { font-size: 17px; }
    .project-card__overlay { opacity: 1; background: linear-gradient(180deg, rgba(0,56,88,0) 55%, rgba(0,56,88,.65) 100%); padding: 18px; }
    .project-card__overlay-cta { font-size: 12.5px; padding: 9px 14px; }

    .cta-banner { padding: 16px 0 36px; }
    .cta-banner__inner { padding: 28px 20px; border-radius: 18px; gap: 22px; }
    .cta-banner__title { font-size: 22px; line-height: 1.15; margin-bottom: 12px; }
    .cta-banner__lead { font-size: 14px; margin-bottom: 18px; }
    .cta-banner__features li { font-size: 13.5px; }
    .cta-banner__action { padding: 20px; gap: 10px; border-radius: 16px; }
    .cta-banner__phone { font-size: 18px; }
    .cta-banner__action .btn { padding: 14px 22px; font-size: 14.5px; }

    .page-hero__inner::after { display: none; }
}

/* Very small phones (≤380px) */
@media screen and (max-width: 380px) {
    .page-hero__inner { padding: 26px 16px; }
    .page-hero__title { font-size: 24px; }
    .page-hero__stat-num { font-size: 22px; }
    .page-hero__stat-label { font-size: 10.5px; }
}

/* Avoid the global .object min-height applying to new card grids */
.service-card,
.equipment-card,
.project-card {
    min-height: 0 !important;
}

/* ============================================
   Pricing / cost / FAQ / contacts — Tablet (≤1280px)
   ============================================ */
@media screen and (max-width: 1280px) {
    .gnb-pricing__head { flex-direction: column; align-items: flex-start; gap: 24px; }
    .gnb-pricing__head .btn { width: 100%; padding: 16px 22px; }
    .cost-factors__grid { grid-template-columns: repeat(2, 1fr); }
    .contacts-grid__inner { grid-template-columns: 1fr; gap: 32px; }
}

/* ============================================
   Pricing / cost / FAQ / contacts — Mobile (≤768px)
   ============================================ */
@media screen and (max-width: 768px) {
    .gnb-pricing { padding: 24px 0 36px; }
    .gnb-pricing__head h2 { font-size: 24px; }
    .gnb-pricing__lead { font-size: 14.5px; }
    .gnb-pricing__table-wrap { border-radius: 14px; overflow-x: auto; }
    .gnb-pricing__table thead th { padding: 16px 16px; font-size: 11.5px; }
    .gnb-pricing__table tbody td { padding: 14px 16px; font-size: 14.5px; }
    .gnb-pricing__table tbody td:first-child { width: auto; }
    .gnb-pricing__note { font-size: 12.5px; }

    .cost-factors { padding: 16px 0 36px; }
    .cost-factors h2 { font-size: 24px; }
    .cost-factors__grid { grid-template-columns: 1fr; gap: 14px; }
    .cost-factor { padding: 22px 22px; border-radius: 14px; }
    .cost-factor__num { font-size: 36px; margin-bottom: 8px; }
    .cost-factor h3 { font-size: 16px; }

    .faq-section { padding: 16px 0 36px; }
    .faq-section h2 { font-size: 24px; }
    .faq-section .faq { border-radius: 14px; }
    .faq-section .faq__title { padding: 18px 20px; font-size: 14.5px; }
    .faq-section .faq__content { padding: 0 20px; font-size: 13.5px; }
    .faq-section .faq.faq--visible .faq__content { padding-bottom: 18px; }

    .contacts-grid { padding: 16px 0 36px; }
    .contacts-grid__info { grid-template-columns: 1fr; gap: 12px; }
    .contact-card { padding: 22px 22px 24px; border-radius: 14px; }
    .contact-card__primary { font-size: 18px; }
    .contact-form-card { padding: 28px 22px; border-radius: 18px; }
    .contact-form-card__title { font-size: 22px; }
    .contact-form-card__lead { font-size: 14px; }
    .contact-form__field input,
    .contact-form__field textarea { padding: 12px 14px; font-size: 14.5px; }

    .map-placeholder { padding: 12px 0 36px; }
    .map-placeholder__card { padding: 36px 22px; border-radius: 18px; }
    .map-placeholder__icon { width: 64px; height: 64px; margin-bottom: 16px; }
    .map-placeholder__icon svg { width: 40px; height: 40px; }
    .map-placeholder__title { font-size: 22px; }
    .map-placeholder__lead { font-size: 14px; }
    .map-placeholder__actions { flex-direction: column; }
    .map-placeholder__actions .btn { width: 100%; padding: 14px 22px; }
}


/* === Глобальные мобильные страховки против overflow и кривой вёрстки === */
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: hidden; max-width: 100vw; }

img, video, iframe, canvas, svg { max-width: 100%; }

@media screen and (max-width: 1280px) {
    .container { max-width: 100%; padding-left: 24px; padding-right: 24px; }
}
@media screen and (max-width: 900px) {
    .container { padding-left: 18px; padding-right: 18px; }
}
@media screen and (max-width: 768px) {
    .container { padding-left: 14px; padding-right: 14px; }

    /* Тексты не должны вырываться за пределы карточек */
    p, h1, h2, h3, h4, h5, li, td, th { word-wrap: break-word; overflow-wrap: break-word; }
    h1, h2, h3 { hyphens: auto; }

    /* Длинные ссылки и ID не должны ломать вёрстку */
    a[href], code { word-break: break-word; }

    /* Hero-блоки: уменьшаем внутренние отступы и шрифты */
    .page-hero { padding-top: 14px; padding-bottom: 24px; }
    .page-hero__inner { padding: 22px 18px !important; border-radius: 16px; }
    .page-hero__title { font-size: 26px !important; line-height: 1.2; }
    .page-hero__lead { font-size: 14.5px; }
    .page-hero__stats { gap: 10px; }
    .page-hero__stat { padding: 12px 10px; }
    .page-hero__stat-num { font-size: 22px; }
    .page-hero__stat-label { font-size: 11px; }
    .page-hero__cta { flex-direction: column; gap: 10px; }
    .page-hero__cta .btn { width: 100%; padding: 14px 18px; font-size: 14px; }

    /* CTA-баннеры внизу страниц */
    .cta-banner__inner { grid-template-columns: 1fr !important; padding: 26px 22px !important; border-radius: 18px; gap: 20px; }
    .cta-banner__title { font-size: 22px !important; line-height: 1.25; }
    .cta-banner__title br { display: none; }
    .cta-banner__lead { font-size: 14px; }
    .cta-banner__action { flex-direction: column; gap: 12px; align-items: stretch !important; }
    .cta-banner__action .btn { width: 100%; padding: 14px 18px; }
    .cta-banner__phone { text-align: center; font-size: 18px; }

    /* Бутстрап-сетка: колонки в карточных секциях не слипаются */
    .services-list .col-md-6, .services-list .col-md-4, .services-list .col-md-12,
    .catalog-list .col-md-6, .catalog-list .col-xl-4,
    .objects-list .col-md-6, .objects-list .col-xl-4,
    .other .col-md-4 {
        margin-bottom: 16px;
    }

    /* Бейджи и теги — не вылезают в одну строку */
    .tags { flex-wrap: wrap; gap: 6px; }
    .tag { font-size: 11px; padding: 4px 9px; }
    .location-badge { font-size: 12px; padding: 6px 12px; }

    /* Хлебные крошки переносятся, не скроллятся */
    .breadcrumb { font-size: 12px; flex-wrap: wrap; gap: 4px 6px; }

    /* Преимущества/advantages сетка в 1 колонку */
    .item-advantages__grid { grid-template-columns: 1fr !important; gap: 12px; }
    .item-advantages__title { font-size: 24px !important; }

    /* Калькулятор ГНБ — стэк, без overflow */
    .gnb-calc__inner { padding: 28px 20px !important; border-radius: 18px; gap: 24px; }
    .gnb-calc__title { font-size: 22px !important; line-height: 1.25; }
    .gnb-calc__form { padding: 22px 18px; border-radius: 14px; }
    .gnb-calc__field select, .gnb-calc__field input { width: 100%; box-sizing: border-box; font-size: 16px; padding: 12px 14px; }
    .gnb-calc__result-value { font-size: 22px !important; }

    /* SEO-тексты (.geo-content) — таблицы и блоки внутри */
    .geo-content__inner { font-size: 14.5px; line-height: 1.65; }
    .geo-content__inner h2 { font-size: 22px; }
    .geo-content__inner h3 { font-size: 18px; }
    .geo-content__inner table { display: block; overflow-x: auto; max-width: 100%; }
    .geo-content__inner img { border-radius: 12px; height: auto; }

    /* Sticky-сайдбар на карточке услуги: убираем sticky */
    .item-side__inner { position: static !important; top: auto !important; }
    .item-side__card { padding: 22px 20px; border-radius: 18px; }

    /* Таблицы характеристик скроллятся горизонтально */
    .item-specs { display: block; overflow-x: auto; max-width: 100%; }

    /* Карточки спецтехники/проектов: заголовки крупнее не нужны */
    .equipment-card__title, .project-card__title, .service-card__title { font-size: 17px !important; line-height: 1.3; }
    .equipment-card__body, .project-card__body { padding: 18px 18px 20px; }
    .equipment-card__specs, .project-card__specs { padding: 12px 14px; }

    /* Шапка — главное меню скрыто, mobile-кнопки */
    .header__phone { font-size: 14px; }

    /* Footer колонки в одну */
    .footer .row > [class*="col-"] { margin-bottom: 22px; }

    /* Формы модалок — без огромных отступов */
    .modal__content { padding: 26px 22px; border-radius: 18px; }
    .modal__content input, .modal__content textarea, .modal__content select {
        width: 100%; box-sizing: border-box; font-size: 16px; padding: 12px 14px;
    }
    .modal__content .btn { width: 100%; padding: 14px 18px; font-size: 14.5px; }
}

@media screen and (max-width: 380px) {
    .container { padding-left: 12px; padding-right: 12px; }
    .page-hero__title { font-size: 22px !important; }
    .page-hero__stat-num { font-size: 18px; }
    .gnb-calc__title { font-size: 19px !important; }
}
