/* Last-loaded mobile/tablet overrides: keep blocks in flow so nothing
   slides off the 1200px Tilda artboard. */

html,
body,
.al-page,
.al-main {
    max-width: 100%;
}

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

@media (max-width: 1100px) {
    html,
    body {
        overflow-x: hidden;
    }

    body {
        min-width: 0;
    }

    .al-page,
    .al-main,
    section,
    footer.al-footer {
        max-width: 100%;
        overflow-x: hidden;
    }

    .al-vehicle::after {
        inset: 8px 8px -8px 8px;
    }

    .al-vehicle {
        overflow: hidden;
    }

    .al-vehicle img {
        width: min(90%, 280px);
        max-width: 100%;
    }

    .al-btn--green {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .al-estimate {
        height: auto;
        min-height: 0;
        padding: 40px 0 0;
        overflow: hidden;
    }

    .al-estimate__inner {
        height: auto;
    }

    .al-estimate__inner h2,
    .al-estimate__copy,
    .al-estimate__hand {
        position: static;
        left: auto;
        top: auto;
        width: auto;
        max-width: 100%;
        height: auto;
    }

    .al-estimate__copy .al-btn {
        position: static;
        width: 100%;
        min-width: 0;
        margin-top: 20px;
    }

    .al-estimate__hand {
        width: min(100%, 320px);
        max-width: 100%;
        height: auto;
        margin: 0 auto;
        display: block;
        object-fit: contain;
    }

    /* Examples: never keep a 510+510 row on a tablet */
    section.al-examples .al-examples__grid {
        display: grid;
        grid-template-columns: min(510px, 100%);
        justify-content: center;
        width: 100%;
    }

    section.al-examples .al-card,
    section.al-examples .al-card__inner {
        width: min(510px, 100%);
        max-width: 100%;
        overflow: hidden;
    }

    section.al-examples .al-card img,
    section.al-examples .al-card__media,
    section.al-examples .al-card__prices {
        max-width: 100%;
    }

    /* Callback: drop desktop absolute canvas */
    section.al-callback {
        height: auto !important;
        min-height: 0 !important;
        padding: 48px 0 0 !important;
        overflow: hidden !important;
    }

    section.al-callback::before,
    section.al-callback::after {
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        top: 0;
        height: 100%;
        background-size: cover;
        background-position: center;
    }

    section.al-callback .al-callback__inner {
        display: flex !important;
        flex-direction: column;
        height: auto;
        padding-bottom: 0;
    }

    section.al-callback .al-callback__copy {
        position: relative;
        top: auto;
        left: auto;
        width: 100%;
        max-width: 405px;
        margin: 0 auto;
        padding: 0 4px 24px;
    }

    section.al-callback .al-form--default {
        width: 100%;
        max-width: 363px;
    }

    section.al-callback .al-form--default .al-btn {
        width: min(300px, 100%);
        max-width: 100%;
    }

    section.al-callback .al-callback__deco {
        position: relative;
        height: 320px;
        min-height: 0 !important;
        overflow: hidden;
        margin-top: 8px;
    }

    section.al-callback .al-callback__deco img.al-callback__car,
    section.al-callback .al-callback__deco img.al-callback__person {
        position: absolute !important;
        max-width: 100% !important;
        height: auto !important;
    }

    section.al-callback .al-callback__deco img.al-callback__car {
        left: 50% !important;
        right: auto !important;
        top: 24px !important;
        width: min(327px, 92%) !important;
        transform: translateX(-46%);
    }

    section.al-callback .al-callback__deco img.al-callback__person {
        left: 8% !important;
        right: auto !important;
        top: 20px !important;
        width: min(264px, 70%) !important;
        transform: none;
    }

    /* Contacts: never keep 1200px inner */
    .al-contacts,
    .al-contacts .al-contacts__inner.al-wrap,
    .al-contacts .al-contacts__inner {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
    }

    .al-contacts .al-contacts__card,
    .al-contacts .al-contacts__map,
    .al-contacts .al-contacts__map iframe {
        width: 100% !important;
        max-width: 100% !important;
        left: auto;
    }

    .al-contacts .al-wa.al-wa--contacts {
        max-width: 100%;
    }

    /* Footer: stack instead of calc(50% - 600px) */
    footer.al-footer,
    footer.al-footer .al-footer__inner {
        height: auto !important;
        min-height: 0 !important;
    }

    footer.al-footer .al-footer__inner {
        display: flex !important;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 40px 16px 32px;
        box-sizing: border-box;
    }

    .al-home footer.al-footer .al-logo,
    footer.al-footer .al-logo.al-logo--footer,
    footer.al-footer .al-footer__phone,
    footer.al-footer .al-footer__callback.al-link-btn,
    footer.al-footer .al-footer__copy,
    footer.al-footer .al-footer__privacy,
    footer.al-footer .al-city--footer,
    footer.al-footer .al-footer__legal {
        position: static;
        top: auto;
        left: auto;
        right: auto;
        width: auto;
        max-width: 100%;
        transform: none;
        text-align: left;
        margin: 0;
    }

    footer.al-footer .al-footer__legal {
        width: 100%;
        margin-top: 12px;
        font-size: 12px;
        line-height: 1.45;
    }

    footer.al-footer .al-footer__copy {
        margin-top: 16px;
        white-space: normal;
    }

    footer.al-footer .al-city--footer {
        display: flex;
    }
}

@media (max-width: 640px) {
    .al-wrap {
        padding-left: 16px;
        padding-right: 16px;
        box-sizing: border-box;
    }

    .al-home .al-header {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        padding: 12px 0 0;
    }

    .al-header__inner {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        grid-template-columns: none;
    }

    .al-home .al-logo {
        padding-top: 0;
        flex: none;
    }

    .al-logo img {
        width: 140px;
    }

    .al-city {
        margin: 0;
        padding-top: 0;
        min-width: 0;
    }

    .al-city__btn span,
    .al-city__btn strong {
        font-size: 14px;
    }

    .al-home .al-hero {
        height: auto;
        min-height: 720px;
        overflow: hidden;
    }

    .al-home .al-hero__grid {
        display: flex;
        flex-direction: column;
        align-items: center;
        height: auto;
        min-height: 720px;
        padding-top: 72px;
        padding-bottom: 36px;
        position: relative;
        z-index: 2;
    }

    .al-hero__mobile-bg {
        display: block;
        opacity: 1;
        background-position: 68% top;
        background-size: cover;
    }

    .al-hero__media {
        position: absolute;
        inset: 0;
        min-height: 0;
        order: 0;
        overflow: hidden;
        pointer-events: none;
        z-index: 1;
    }

    .al-hero__media img {
        position: absolute;
        top: 0;
        left: 50%;
        width: auto;
        min-width: 160%;
        max-width: none;
        height: 100%;
        margin: 0;
        object-fit: cover;
        object-position: 62% top;
        transform: translateX(-42%);
    }

    .al-hero__copy {
        position: relative;
        z-index: 3;
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        max-width: 360px;
        padding-top: 8px;
        text-align: center;
    }

    .al-hero__copy h1 {
        font-size: 22px;
        line-height: 1.15;
        text-align: center;
    }

    .al-hero__sub {
        margin: 8px 0 16px;
        max-width: 280px;
        font-size: 18px;
        line-height: 1.25;
        text-align: center;
    }

    .al-hero__badge {
        min-width: 132px;
        width: auto;
        height: 32px;
        font-size: 16px;
        padding: 0 14px;
    }

    .al-hero__note {
        max-width: 276px;
        margin: 18px 0 56px;
        font-size: 14px;
        text-align: center;
    }

    .al-wa {
        width: min(293px, 100%);
        max-width: 100%;
    }

    .al-wa img {
        width: 96px;
        top: -48px;
        max-width: none;
    }

    .al-vehicles,
    .al-steps,
    .al-examples,
    .al-callback,
    .al-contacts,
    .al-estimate {
        padding-left: 0;
        padding-right: 0;
    }

    .al-vehicles h2,
    .al-steps h2,
    .al-examples h2,
    .al-callback h2,
    .al-contacts h2,
    .al-estimate__inner h2 {
        width: 100%;
        max-width: 100%;
        font-size: 22px;
        text-align: left;
    }

    section.al-callback .al-callback__copy h2,
    section.al-callback h2 {
        font-size: 22px !important;
        max-width: 100%;
    }

    section.al-callback .al-callback__deco {
        height: 280px;
    }

    section.al-steps {
        height: auto;
        min-height: 0;
        padding: 40px 0 48px;
        overflow: hidden;
    }

    section.al-steps .al-wrap {
        height: auto;
        padding: 0 16px;
        max-width: 100%;
    }

    section.al-steps h2 {
        position: static;
        width: 100%;
        max-width: 100%;
        margin: 0 0 32px;
    }

    section.al-steps .al-steps__grid {
        display: flex;
        flex-direction: column;
        gap: 48px;
        width: 100%;
        max-width: 330px;
        margin: 0 auto;
    }

    section.al-steps .al-step,
    section.al-steps .al-step--1,
    section.al-steps .al-step--2,
    section.al-steps .al-step--3 {
        position: relative;
        top: auto;
        left: auto;
        width: 100%;
        max-width: 100%;
        height: 377px;
        margin: 0 auto;
        overflow: hidden;
    }

    section.al-steps .al-step__offset {
        width: calc(100% - 22px);
        max-width: 100%;
        left: 11px;
    }

    section.al-steps .al-step__img,
    section.al-steps .al-step__img--car,
    section.al-steps .al-step__img--docs {
        max-width: 100%;
    }

    section.al-steps .al-step__img--docs {
        width: 100%;
        left: 0;
    }

    section.al-steps .al-form--step {
        left: 16px;
        width: calc(100% - 32px);
        max-width: 256px;
    }

    section.al-steps .al-form--step .al-btn,
    section.al-steps .al-form--step .al-btn--yellow {
        width: min(200px, 100%);
        min-width: 0;
    }

    section.al-examples .al-wrap,
    section.al-examples .al-examples__inner {
        padding: 0 16px;
        width: 100%;
        max-width: 100%;
    }

    section.al-examples h2 {
        width: 100%;
        max-width: 299px;
        margin: 0 auto 20px;
        text-align: center;
        font-size: 18px;
    }

    section.al-examples .al-examples__grid {
        grid-template-columns: min(292px, 100%);
    }

    section.al-examples .al-card,
    section.al-examples .al-card__inner {
        width: 100%;
        max-width: 292px;
        height: 185px;
        min-height: 185px;
    }

    .al-contacts .al-contacts__inner.al-wrap,
    .al-contacts .al-contacts__inner {
        padding: 0 16px !important;
    }

    .al-contacts .al-contacts__card {
        padding: 24px 16px 32px;
        overflow: hidden;
    }

    .al-contacts .al-contacts__map {
        height: 250px;
        margin-top: 12px;
    }

    .al-contacts .al-wa.al-wa--contacts {
        width: min(293px, 100%);
    }

    footer.al-footer .al-footer__inner {
        padding: 40px 16px 88px;
    }

    footer.al-footer .al-footer__legal {
        font-size: 10px;
    }

    .al-popup {
        padding: 12px;
        align-items: end;
    }

    .al-popup--success {
        align-items: center;
    }

    .al-popup__dialog {
        width: 100%;
        max-width: 100%;
        padding: 28px 18px 22px;
    }
}
