/* Site-wide mobile fixes — load last on every page */

html {
    overflow-x: clip;
}

body {
    overflow-x: clip;
    min-width: 0;
}

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

/* ── Product panel (About product) — mobile ── */
@media (max-width: 1100px) {
    .video__inner.product-panel {
        min-height: 0 !important;
        height: auto !important;
        padding: 22px 16px !important;
        overflow: visible !important;
    }

    .product-panel__layout {
        min-height: 0 !important;
        height: auto !important;
        gap: 20px !important;
        align-items: stretch !important;
    }

    .product-panel__info {
        flex: none !important;
        max-width: 100% !important;
    }

    .product-panel__visual {
        flex: none !important;
        max-width: 100% !important;
        width: 100% !important;
        overflow: visible !important;
        margin: 0;
        padding: 0;
    }

    .product-panel__img {
        display: block;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        object-fit: contain;
        border-radius: 14px;
    }

    .product-panel__glare {
        display: none;
    }

    .product-panel__heading {
        font-size: 22px !important;
        margin-bottom: 12px;
    }

    .product-panel__text {
        margin-bottom: 16px;
        font-size: 14px;
    }

    .product-panel__list {
        margin-bottom: 18px;
    }

    .product-panel__list-item {
        margin-bottom: 10px;
        font-size: 14px;
        gap: 12px;
    }

    .product-panel__list-icon {
        width: 40px;
        height: 40px;
    }

    .product-panel__tag {
        margin-bottom: 10px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .video__inner.product-panel {
        padding: 16px 12px !important;
        border-radius: 16px;
    }

    .product-panel__heading {
        font-size: 20px !important;
    }
}

/* ── Mobile header: no burger, nav in footer ── */
.footer-nav {
    display: none;
}

@media (max-width: 1100px) {
    .header__burger {
        display: none !important;
    }

    .header__inner {
        justify-content: space-between;
        gap: 12px;
    }

    .header__wrapper {
        position: static !important;
        inset: auto !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        width: auto !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        flex-direction: row !important;
        justify-content: flex-end !important;
        align-items: center !important;
        gap: 10px;
        z-index: auto !important;
    }

    body.body--active .header__wrapper {
        position: static !important;
        inset: auto !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        width: auto !important;
        height: auto !important;
        min-height: 0 !important;
        display: flex !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        flex-direction: row !important;
        justify-content: flex-end !important;
        align-items: center !important;
        gap: 10px;
        z-index: auto !important;
    }

    body.body--active .menu,
    body.body--active .header__menu {
        display: none !important;
        position: static !important;
        height: auto !important;
        background: transparent !important;
    }

    body.body--active .header__button,
    .header__wrapper .header__button {
        display: inline-flex !important;
    }

    body.body--active {
        overflow: visible !important;
    }

    body.body--active .big-wrapper {
        position: relative !important;
    }

    .header__menu {
        display: none !important;
    }

    .footer-nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 6px 24px;
        width: 100%;
        order: 2;
        padding: 14px 0 4px;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        margin-top: 4px;
    }

    .footer-nav__link {
        color: rgba(255, 255, 255, 0.72);
        font-size: 14px;
        font-weight: 600;
        line-height: 1.3;
        text-decoration: none;
        padding: 4px 2px;
        transition: color 0.15s;
    }

    .footer-nav__link:hover {
        color: #46df83;
    }

    .footer__inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer__logo {
        order: 0;
    }

    .footer__copy {
        order: 3;
    }

    .footer__link {
        order: 4;
    }

    .steps__heading-link {
        display: none !important;
    }
}

/* ── Forms in legacy popups ── */
.popup-form__input,
.popup-form__textarea {
    max-width: 100%;
    box-sizing: border-box;
}

.popup-form__textarea {
    min-height: 120px;
    resize: vertical;
}

/* ── Homepage hero ── */
@media (max-width: 1000px) {
    .main-screen {
        margin-top: 0;
        overflow: hidden;
    }

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

    .main-screen__icons,
    .main-screen-icons {
        display: none !important;
    }

    .main-screen__heading,
    .main-screen-heading {
        width: 100%;
        max-width: 100%;
        padding-top: 28px !important;
        margin-bottom: 36px !important;
        align-items: stretch;
    }

    .main-screen-heading__title {
        margin-bottom: 14px !important;
        text-align: left;
    }

    .main-screen-heading__title span {
        display: block;
        margin-top: 6px;
    }

    .main-screen-heading__text {
        max-width: 100% !important;
        margin-bottom: 22px !important;
    }

    .main-screen-heading__bottom,
    .main-screen-bottom {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
    }

    .main-screen-bottom__link {
        width: 100%;
        justify-content: center;
        box-sizing: border-box;
    }

    .main-screen-bottom__info,
    .main-screen-bottom-info {
        width: 100%;
        align-items: flex-start;
    }

    .main-screen-bottom-info__text {
        flex-wrap: wrap;
        align-items: flex-start;
        line-height: 1.45 !important;
    }
}

@media (max-width: 480px) {
    .main-screen__heading,
    .main-screen-heading {
        padding-top: 16px !important;
        margin-bottom: 28px !important;
    }

    .main-screen-heading__title {
        font-size: 30px !important;
        line-height: 1.2 !important;
    }

    .main-screen-heading__text {
        font-size: 14px !important;
        line-height: 1.5 !important;
        margin-bottom: 18px !important;
    }

    .main-screen-bottom {
        gap: 14px;
    }

    .main-screen-bottom svg {
        max-width: min(100%, 200px);
        height: auto;
    }

    .main-screen-bottom-info__text {
        font-size: 12px !important;
        gap: 8px;
    }
}

/* ── Swiper / carousel bleed safety ── */
.main__partners,
.main__testimonials.testimonials {
    overflow-x: clip;
}

/* ── About decorative art ── */
@media (max-width: 700px) {
    .section-top,
    .advantages {
        overflow: hidden;
    }
}

/* ── Terms ── */
@media (max-width: 600px) {
    .terms__inner {
        padding: 24px 16px !important;
        gap: 28px !important;
    }

    .terms-box__title {
        font-size: 24px !important;
        line-height: 1.3 !important;
    }

    .terms-box__text,
    .terms-box__list-item {
        font-size: 14px;
        line-height: 1.55;
    }
}

/* ── Products cards ── */
@media (max-width: 500px) {
    .main__products.products--cards .products-item {
        padding: 18px 16px !important;
    }

    .main__products.products--cards .products-item__box-title {
        font-size: 20px !important;
    }
}

/* ── Testimonials pagination ── */
@media (max-width: 600px) {
    .testimonials-pagination {
        gap: 8px;
        margin-bottom: 28px;
        padding: 0 4px;
    }

    .testimonials-pagination__pages {
        gap: 6px;
    }

    .testimonials-pagination__page,
    .testimonials-pagination__btn {
        min-width: 36px;
        height: 36px;
        font-size: 13px;
    }
}

@media (max-width: 380px) {
    .testimonials-pagination__page,
    .testimonials-pagination__btn {
        min-width: 32px;
        height: 32px;
        font-size: 12px;
        padding: 0 8px;
    }
}

/* ── Account header (logged in) ── */
@media (max-width: 900px) {
    .page-account .header__inner {
        gap: 10px;
        min-width: 0;
    }

    .page-account .header__logo {
        flex-shrink: 0;
    }

    .page-account .header__wrapper {
        min-width: 0;
        flex: 0 0 auto;
        justify-content: flex-end;
    }

    .page-account .header__user {
        min-width: 0;
        gap: 8px;
        max-width: calc(100% - 8px);
    }

    .page-account .header__user-email,
    .page-account [data-header-user-email] {
        max-width: 110px;
    }
}

@media (max-width: 520px) {
    .page-account .header__user-email,
    .page-account [data-header-user-email] {
        display: none;
    }
}

/* ── Account LK ── */
@media (max-width: 760px) {
    .page-account .main__account.account {
        padding: 20px 0 48px;
    }

    .cabinet-toolbar {
        padding: 14px 16px;
        gap: 14px;
    }

    .cabinet-toolbar__title {
        font-size: 18px;
    }

    .cabinet-toolbar__email {
        word-break: break-all;
        font-size: 13px;
    }

    .cabinet-profile__logout {
        width: 100%;
        text-align: center;
    }

    .cabinet-plans-panel {
        padding: 14px !important;
        margin-bottom: 12px;
    }

    .page-account .account__inner.cabinet-shell {
        overflow-x: clip;
        border-radius: 14px;
    }

    .cabinet-main {
        padding: 14px !important;
    }

    .cabinet-stats__value {
        font-size: clamp(18px, 5vw, 26px);
    }

    .cabinet-locked-preview {
        min-height: 380px;
    }

    .cabinet-locked-preview__overlay {
        padding: 24px 16px;
    }

    .cabinet-locked-preview__title {
        font-size: 18px;
    }

    .cabinet-locked-preview__text {
        font-size: 13px;
        max-width: 100%;
    }

    .cabinet-locked-preview__list {
        grid-template-columns: minmax(0, 1fr);
        max-width: 280px;
    }

    .cabinet-plan-card__price {
        font-size: 28px;
    }

    .page-account .cabinet-plan-card .pt-pay-slot,
    .page-account .cabinet-plan-card > .btn.btn--green {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .page-account .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .cabinet-section-head__title {
        font-size: 18px;
    }
}

.cabinet-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.cabinet-table {
    min-width: 420px;
}

/* ── Settings modal ── */
@media (max-width: 520px) {
    .popup--settings .auth-modal__actions--settings {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .popup--settings .auth-modal__submit {
        min-width: 0;
        width: 100%;
    }

    .popup--settings .auth-modal__link--danger {
        text-align: center;
        order: 2;
    }
}

/* ── Footer ── */
@media (max-width: 480px) {
    .footer__inner {
        gap: 12px;
        padding: 20px 0;
    }

    .footer__copy {
        text-align: center;
        word-break: break-word;
    }
}

/* ── Burger disabled — nav moved to footer ── */

/* ── Popups: prevent edge bleed ── */
.popup {
    box-sizing: border-box;
}

@media (max-width: 520px) {
    .popup--auth {
        padding: 10px;
        align-items: center;
    }
}
