@media (max-width: 1199px) {
    
    .house-dialog { --modal-padding: 40px 32px; border-radius: 32px; }
    .house-layout { gap: 32px; }
    .house-prices strong { font-size: 28px; }

    .section {
        padding: 88px 28px;
    }

    h1, h2 {
        font-size: 42px;
    }

    .site-header {
        flex-wrap: wrap;
        padding: 16px 24px;
        gap: 16px;
        border-radius: 32px;
    }

       .site-header .logo { flex: 1; min-width: 0; gap: 6px; }
    .site-header .logo > img {   height: auto; }
    .site-header .logo span { font-size: clamp(12px, 3.6vw, 17px); }
    .site-header .logo small { font-size: clamp(4.5px, 1.35vw, 6.5px); }

    .header-contacts { order: 2; }
    .header-phone, .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        flex-shrink: 0;
        border: 1px solid #bdbdbd;
        border-radius: 8px;
        background: #fff;
    }

    .header-phone span { display: none; }
    .header-phone img { display: block; width: 20px; height: 20px; }
    .menu-toggle { order: 3; flex-direction: column; gap: 4px; }
    .menu-toggle span { width: 18px; height: 2px; background: var(--muted-color); transition: transform .2s, opacity .2s; }
    .menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(6px) rotate(45deg); }
    .menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
    .menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-6px) rotate(-45deg); }

    .main-nav { display: none; order: 4; width: 100%; }
    .main-nav.is-open { display: block; }
    .main-nav ul { align-items: stretch; flex-direction: column; }
    .main-nav .socials { margin-top: 16px; padding: 16px 8px 4px; border-top: 1px solid var(--border-color); }


    .hero-card {
        max-width: 660px;
    }

    .card-heading {
        flex-wrap: wrap;
    }

    .selection-panel, .budget-layout, .viewing-layout,
    .steps-layout, .about-layout {
        gap: 40px;
    }

    .form-panel {
        padding: 36px;
    }

    .viewing-gallery {
        margin: 0;
    }

    .tour-banner {
        grid-template-columns: 160px minmax(0, 1fr);
        padding: 24px;
    }

    .tour-banner > img {
        grid-row: span 2;
        border-radius: 12px;
    }

    .tour-banner > div {
        padding: 0;
    }

    .tour-banner .button {
        justify-self: start;
    }

    .stats {
        gap: 12px;
    }

    .stats dt {
        font-size: 40px;
    }

    .stats dd {
        white-space: normal;
        font-size: 14px;
    }

    .review-person {
        flex-wrap: wrap;
        gap: 8px;
    }

    .review-source {
        width: 32px;
        height: 32px;
    }
    
}


@media (max-width: 991px) {
    .escrow-tooltip {
        right: auto;
        left: 0;
    }

    /* Модальное окно дома */
    .house-layout { grid-template-columns: minmax(0, 1fr); } 
    .house-plan { min-height: auto; }

    :root {
        --section-radius: 32px;
    }

    .section {
        padding: 72px 24px;
    }

    .section h2, .section-intro {
        margin-bottom: 40px;
    }

    .section-intro h2 {
        margin-bottom: 24px;
    }

    .grid-three, .grid-four {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hero {
        padding: 24px;
    }

    .hero-card {
        max-width: 620px;
        padding: 36px;
    }

    .hero-card .tags {
        margin-top: 48px;
    }

    .choice-grid {
        grid-template-columns: 1fr;
    }

    .choice-grid h3 {
        max-width: none;
    }

    .selection-panel, .budget-layout, .about-layout, .faq-layout {
        grid-template-columns: 1fr;
    }

    .form-panel .section-intro {
        margin-bottom: 0;
    }

    .viewing-layout, .steps-layout {
        gap: 32px;
        grid-template-columns: 1.2fr 1fr;
    }

    .viewing-gallery {
        grid-template-columns: minmax(0, 1fr);
    }

    .viewing-gallery > div {
        display: none;
    }

    .viewing-gallery > img {
        height: auto;
        aspect-ratio: 2 / 3;
    }

    .viewing-layout .button {
        margin-top: 32px;
    }

    .steps-image {
        align-self: stretch;
        height: 100%;
    }

    .contacts-layout {
        grid-template-columns: 1fr 1.2fr;
        gap: 32px;
    }

    .contact-actions {
        flex-direction: column;
        align-items: stretch;
    }

    /* Футер */
    .site-footer .container { gap: 20px 28px; }
    .footer-contacts { flex-wrap: wrap; justify-content: flex-end; gap: 16px; }
}

/* Мобильные устройства */
@media (max-width: 767px) {
    html {
        --header-inset: 12px;
    }
    .cookie-notice {
        left: 16px;
        bottom: 16px;
        width: calc(100% - 44px);
        padding: 16px;
        gap: 12px;
        font-size: 14px;
        line-height: 1.4;
    }

    .cookie-close { right: -12px; }


    /* Страница политики */
    .policy-page {
        padding: 16px;
    }

    
    .policy-content h1 {
        margin-bottom: 28px;
    }

    .policy-text > h1 + p, .policy-text h2 {
        font-size: 20px;
    }

    .policy-text > h1 + p {
        margin-bottom: 28px;
    }

    .policy-text h2 {
        margin-top: 28px;
    }

    /* Модальные формы */
    .dialog.form-modal {
        --modal-padding: 56px 24px 24px;
        border-radius: 24px;
    }

    .form-modal h2 {
        font-size: 30px;
    }


    /* Модальное окно дома */
    .house-dialog { --modal-padding: 56px 20px 24px; border-radius: 24px; }
    .house-details h2 { font-size: 32px; }
    .house-specs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .house-fields { grid-template-columns: minmax(0, 1fr); }
    .house-energy { font-size: 12px; margin: 8px; padding: 4px 8px; }
    .house-energy img { width: 18px; }
    .house-counter { margin: 8px; font-size: 14px; }

    :root {
        --section-radius: 24px;
    }

    h1, h2 {
        font-size: 32px;
        line-height: 1.08;
    }

    h3, .faq-question {
        font-size: 22px;
    }

    .section {
        padding: 56px 16px;
    }

    #equipment.section {
        padding: 90px 16px 56px;
    }

    .section h2, .section-intro {
        margin-bottom: 32px;
    }

    .section-intro h2 {
        margin-bottom: 20px;
    }

    .grid-three, .grid-four, .viewing-layout,
    .steps-layout, .contacts-layout {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 12px 12px 32px;
        background-position: 65% center;
    }

    .site-header {
        padding: 12px;
        gap: 16px 8px;
        border-radius: 20px;
    }

    .logo {
        gap: 8px;
    }

    .logo > img {
         
        height: 34px;
    }

    .logo span {
        font-size: 17px;
    }

    .logo small {
        font-size: 6.5px;
    }
 

    .main-nav {
        display: none;
    }

    .main-nav.is-open {
        display: block;
    }

    .main-nav ul {
        align-items: stretch;
        flex-direction: column;
    }

    .hero-section {
        margin-top: 160px;
    }

    .hero-card, .form-panel {
        padding: 24px;
    }

    .hero-copy h1 {
        font-size: clamp(26px, 6.8vw, 36px);
    }

    .hero-copy h1 br {
        display: none;
    }

    .hero-copy h1 span {
        display: block;
    }

    .hero-copy .button {
        margin-top: 28px;
        max-width: none;
    }

    .hero-card .tags {
        margin-top: 32px;
        gap: 6px;
        font-size: 13px;
        line-height: 1.3;
    }

    .hero-card .tags li {
        padding: 6px 10px;
    }

    .info-card, .review-card {
        padding: 24px;
    }

    .card-heading {
        flex-wrap: nowrap;
    }

    .payment strong {
        font-size: 22px;
        margin-left: 2px;
    }

    .payment {
        font-size: 14px;
    }

    .village-map {
        aspect-ratio: 4 / 3;
    }

    .filter-tabs {
        margin: 28px 0;
    }

    .filter-tabs button {
        padding: 9px;
    }

    .selection-panel, .budget-layout {
        gap: 32px;
    }

    .quiz-step {
        gap: 28px;
    }

    .quiz-group legend {
        font-size: 22px;
        margin-bottom: 16px;
    }

    .quiz-options-four {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
    }

    .quiz-contact-method legend {
        font-size: 16px;
    }

    .budget-layout .lead-form {
        padding: 0;
        border: 0;
    }

    .form-actions {
        flex-direction: column;
    }

    .request-panel .lead-form {
        margin-top: 32px;
    }

    .viewing-gallery {
        grid-template-columns: minmax(0, .8fr) minmax(0, 1fr);
    }

    .viewing-gallery > div {
        display: grid;
    }

    .viewing-gallery img {
        border-radius: 12px;
        height: 100%;
        aspect-ratio: auto;
    }

    .tour-banner {
        grid-template-columns: 1fr;
        padding: 24px;
    }

    .tour-banner > img {
        grid-row: auto;
        aspect-ratio: 2 / 1;
        order: 2;
    }

    .tour-banner .button {
        justify-self: stretch;
    }

    .steps-image {
        height: auto; 
        object-position: center 45%;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
        margin-top: 32px;
    }

    .reviews-subtitle {
        margin-top: 40px;
    }

    .reviews-arrow {
        width: 32px;
        height: 32px;
    }

    .faq-layout h2 {
        margin-top: 0;
    }

    .faq-item {
        padding: 24px 0;
    }

    /* Футер */
    .site-footer {
        padding: 32px 16px;
        border-radius: 32px 32px 0 0;
    }

    .site-footer .container { grid-template-columns: 1fr; gap: 24px; }
    .footer-contacts { justify-self: start; flex-direction: column; align-items: flex-start; }
    .footer-links { align-items: flex-start; flex-direction: column; gap: 8px; }
    .footer-disclaimer { margin-top: 0; }

    .dialog {
        padding: 24px;
    }

    .dialog h2 {
        font-size: 26px;
    }

    .house-details-row { 
        flex-wrap: wrap;
    }

    .house-details-row h2{ 
        margin-bottom: 0;
    }

    .steps-layout.reveal>div {
        padding: 0 16px;
    }

    section#steps {
        padding: 56px 0px;
    }
	
	body.page-template-thanks .dialog.form-modal { 
		margin-top: 125px;
	}
}

@media (max-width: 499px) {
    .hero {
        position: relative;
        padding-bottom: 48px;
        border-radius: 0;
        background: var(--light-color);
    }

    .hero::before {
        content: "";
        position: absolute;
        inset: 0 0 auto;
        height: 103vw;
        border-radius: 0 0 24px 24px;
        background: url("../images/hero.jpg") right center / cover no-repeat;
    }

    .hero-section {
        position: relative;
        margin-top: calc(86.5vw - var(--header-height, 64px) - 12px);
    }

    .hero-card { padding: 24px 20px; border-radius: 24px; }
    .hero-copy h1 { font-size: clamp(24px, 6.7vw, 32px); line-height: 1.08; }
    .hero-copy p { font-size: 14px; line-height: 1.45; }
    .hero-copy .button { font-size: 14px; }
    .hero-card .tags { font-size: 12px; }
    .hero-card .tags li { padding: 6px 9px; }
	.policy-content .container {
		padding: 0 16px;
	}

    .h-mob {
        display: block;
    }

    .h-pc {
        display: none;
    }

    .house-plan { 
        display: none;
    }

    .house-energy2 { 
        display: inline-flex; 
        margin-bottom: 10px;
    }

    .house-visuals {
        gap: 15px;
    }

    .house-specs {
        order: -1;
    }

    .house-form {
        margin-top: 0px; 
    }

    .modal-body { 
        padding: 20px; 
    }
	
	.success-modal .modal-body {
        padding: 40px 20px 20px;
    }
}




/* Системное предпочтение: уменьшение анимации */
@media (prefers-reduced-motion: reduce) {
    .reveal.is-revealing, .hero .site-header, .hero-card {
        animation: none;
    }

    .reveal-pending {
        opacity: 1;
    }

    html {
        scroll-behavior: auto;
    }

    .button, .faq-answer, .faq-icons, .faq-icons::after {
        transition: none;
    }
}
