@media screen and (max-width: 1000px) {
    .site-topbar {
        grid-template-columns: 1fr auto;
        gap: 10px;
        align-items: center;
    }

    .site-logo {
        min-width: 0;
    }

    .site-nav {
        justify-self: end;
    }

    .site-search {
        display: none;
    }

    .content-shell {
        grid-template-columns: 1fr;
    }

    .content-main {
        order: 1;
    }

    .content-side {
        order: 2;
    }
}

@media screen and (max-width: 820px) {
    .page-wrap {
        width: calc(100% - 12px);
        margin: 6px auto 14px;
    }

    /* Важливо: dropdown не обрізається рамкою hero */
    .site-hero {
        min-height: 0;
        overflow: visible;
        border-radius: 18px;
    }

    .site-hero__backdrop {
        border-radius: 18px;
        overflow: hidden;
    }

    .site-hero__content {
        min-height: 0;
        padding: 8px 12px;
        overflow: visible;
    }

    /* На внутрішніх сторінках великий промоблок не потрібен */
    .inner-page .hero-panel {
        display: none;
    }

    .content-shell {
        margin-top: 8px;
        gap: 10px;
    }

    .content-main,
    .content-side {
        padding: 16px;
        border-radius: 18px;
    }

    .hero-intro,
    .manual-card-head,
    .feature-grid,
    .footer-grid,
    .manual-links-columns {
        grid-template-columns: 1fr;
    }

    .hero-intro {
        padding: 16px;
        border-radius: 18px;
    }
}

@media screen and (max-width: 620px) {
    body {
        background-attachment: scroll;
    }

    .content-main h1 {
        font-size: 25px;
        line-height: 1.12;
    }

    .content-text h2 {
        font-size: 21px;
    }

    .content-text h3 {
        font-size: 18px;
    }

    .site-logo {
        width: 155px;
        max-width: 155px;
    }

    .site-logo img {
        width: 155px;
        height: auto;
    }
}


/* Mobile width/overflow correction */
@media screen and (max-width: 820px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .page-wrap,
    .site-hero,
    .site-hero__content,
    .site-topbar,
    .content-shell,
    .content-main,
    .content-side,
    .content-text,
    .hero-panel,
    .hero-copy,
    .hero-intro,
    .hero-intro-copy,
    .hero-intro-visual,
    .feature-grid,
    .feature-card,
    .manual-card,
    .manual-card-head,
    .manual-card-copy,
    .manual-card-visual {
        min-width: 0;
        max-width: 100%;
    }

    .page-wrap {
        width: calc(100% - 12px);
        max-width: calc(100% - 12px);
    }

    .site-topbar {
        width: 100%;
        grid-template-columns: minmax(0, 1fr) 44px;
    }

    .site-logo {
        min-width: 0;
        max-width: 160px;
        overflow: hidden;
    }

    .site-logo img {
        display: block;
        width: 100%;
        max-width: 160px;
        height: auto;
        object-fit: contain;
    }

    .hero-panel {
        width: 100%;
        max-width: 100%;
        padding: 14px;
        overflow: hidden;
    }

    .hero-panel h2,
    .hero-panel p,
    .content-main h1,
    .content-text h2,
    .content-text h3,
    .feature-card h3,
    .feature-card p {
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: normal;
    }

    .hero-panel h2 {
        font-size: 25px;
        line-height: 1.12;
    }

    .hero-panel p {
        font-size: 13px;
        line-height: 1.55;
    }

    .hero-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        width: 100%;
    }

    .hero-actions a,
    .hero-actions .hero-action-alt {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        padding: 10px 12px;
        white-space: normal;
        text-align: center;
    }

    .content-shell {
        width: 100%;
        max-width: 100%;
    }

    .hero-intro img,
    .feature-card img,
    .manual-card img,
    .content-text img {
        width: 100%;
        max-width: 100%;
        height: auto;
    }

    .content-text table {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
    }
}
