/**
 * Responsive adjustments for chrome, Elementor, and shared layout.
 * Canonical breakpoints: sm 640 · md 768 · lg 1024 (see --mpt-bp-* in global.css).
 */

/* ---------- Shared interaction / overflow hardening ---------- */
body.mpt-theme a,
body.mpt-theme button,
body.mpt-theme .mpt-button,
body.mpt-theme .mpt-nav-toggle,
body.mpt-theme .mpt-mobile-nav__submenu-toggle,
body.mpt-theme input[type="submit"],
body.mpt-theme input[type="button"],
body.mpt-theme [role="button"] {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 185, 181, 0.18);
}

body.mpt-theme .mpt-form-field input,
body.mpt-theme .mpt-form-field select,
body.mpt-theme .mpt-form-field textarea,
body.mpt-theme .mpt-form__field input,
body.mpt-theme .mpt-form__field select,
body.mpt-theme .mpt-form__field textarea,
body.mpt-theme .mpt-enquiry-field input,
body.mpt-theme .mpt-enquiry-field select,
body.mpt-theme .mpt-enquiry-field textarea,
body.mpt-theme .mpt-quotes-modal__field input,
body.mpt-theme .mpt-quotes-modal__field select,
body.mpt-theme .mpt-catalogue-filters input,
body.mpt-theme .mpt-catalogue-filters select,
body.mpt-theme .mpt-product-search input,
body.mpt-theme .mpt-resource-filters input,
body.mpt-theme .mpt-resource-filters select {
    font-size: 16px; /* prevent iOS input zoom */
}

body.mpt-theme,
body.mpt-theme .site-main,
body.mpt-theme .elementor,
body.mpt-theme .elementor-section,
body.mpt-theme .e-con,
body.mpt-theme .e-con-inner,
body.mpt-theme .elementor-widget-wrap,
body.mpt-theme .elementor-container {
    max-width: 100%;
}

body.mpt-theme .mpt-inner-page,
body.mpt-theme .mpt-inner,
body.mpt-theme .mpt-inner-band,
body.mpt-theme .mpt-quote,
body.mpt-theme .mpt-quote__inner,
body.mpt-theme .mpt-quote-compose,
body.mpt-theme .mpt-about-group,
body.mpt-theme .mpt-about-vision,
body.mpt-theme .mpt-about-values,
body.mpt-theme .mpt-about-whympt,
body.mpt-theme .mpt-about-whympt__stage {
    max-width: 100%;
    min-width: 0;
}

body.mpt-theme .elementor img,
body.mpt-theme .elementor video,
body.mpt-theme .elementor iframe,
body.mpt-theme .mpt-inner img,
body.mpt-theme .mpt-about-group img,
body.mpt-theme .mpt-about-whympt img {
    max-width: 100%;
    height: auto;
}

/* Absolute cover images keep height:100% (override height:auto above). */
body.mpt-theme .mpt-inner-media img,
body.mpt-theme .mpt-about-hero__visual img,
body.mpt-theme .mpt-about-group__media img,
body.mpt-theme .mpt-about-whympt__media img {
    height: 100%;
}

body.mpt-theme .mpt-table-wrap,
body.mpt-theme .mpt-inner-table-wrap,
body.mpt-theme .elementor .mpt-table-wrap,
body.mpt-theme .woocommerce-page table.shop_table,
body.mpt-theme .woocommerce table.shop_table,
body.mpt-theme .elementor-widget-table,
body.mpt-theme .wp-block-table {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

/* Horizontal scroller shells: never inflate page width */
body.mpt-theme .mpt-home-trust-slider__viewport,
body.mpt-theme .mpt-category-slider__viewport,
body.mpt-theme .mpt-product-slider__viewport,
body.mpt-theme .mpt-partners-marquee__viewport,
body.mpt-theme .mpt-partners-marquee__rail {
    max-width: 100%;
    overscroll-behavior-x: contain;
}

/* ---------- lg: ≤1024 — tablet / compact desktop ---------- */
@media (max-width: 1024px) {
    :root {
        --mpt-gutter-desktop: var(--mpt-gutter-tablet);
        --mpt-header-height: 86px;
    }

    .mpt-primary-nav { display: none; }

    .mpt-nav-toggle { display: inline-flex; }

    .mpt-site-footer__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mpt-site-footer__brand,
    .mpt-site-footer__contact {
        grid-column: 1 / -1;
    }

    .mpt-logo--full { display: none; }
    .mpt-logo--compact { display: inline-flex; }

    .mpt-logo img,
    .mpt-logo__img {
        max-height: 53px;
    }

    /* Products / catalogue / PDP */
    .mpt-products-hero__layout,
    .mpt-products-answer__layout,
    .mpt-products-paths__grid,
    .mpt-products-pathways__grid,
    .mpt-products-help__layout,
    .mpt-catalogue-archive__hero-layout,
    .mpt-catalogue-archive__pathways .mpt-products-pathways__grid,
    .mpt-product-single__layout,
    .mpt-product-extra__grid,
    .mpt-product-single__pathways .mpt-products-pathways__grid {
        grid-template-columns: 1fr;
    }

    .mpt-product-single__gallery {
        position: static;
    }

    .mpt-catalogue-archive__child-grid,
    .mpt-catalogue-archive__loop ul.products,
    body.single-product .related.products ul.products,
    body.single-product .upsells.products ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* Services / solutions / inner / resources — align with chrome */
    .mpt-services-hero,
    .mpt-service-hero__layout,
    .mpt-service-intro,
    .mpt-service-grid--three,
    .mpt-service-grid--two,
    .mpt-service-split,
    .mpt-solution-hero,
    .mpt-solution-hero__layout,
    .mpt-solution-intro,
    .mpt-solution-areas-grid,
    .mpt-solution-grid--three,
    .mpt-solution-grid--two,
    .mpt-solution-split,
    .mpt-inner-hero__layout,
    .mpt-inner-two-panel,
    .mpt-inner-split,
    .mpt-inner-split--media,
    .mpt-about-intro,
    .mpt-about-vision,
    .mpt-about-group,
    .mpt-about-whympt__stage,
    .mpt-about-divisions,
    .mpt-about-offers,
    .mpt-resources-hero .mpt-resource-hero__layout,
    .mpt-resource-hero__layout,
    .mpt-insights-intro,
    .mpt-faqs-intro,
    .mpt-resource-card-grid--three,
    .mpt-resource-pathways--three,
    .mpt-resource-prep,
    .mpt-resource-two-panel {
        grid-template-columns: minmax(0, 1fr);
    }

    .mpt-service-grid--four,
    .mpt-service-process--four,
    .mpt-solution-grid--four,
    .mpt-solution-process,
    .mpt-inner-card-grid--four,
    .mpt-inner-card-grid--provides,
    .mpt-inner-card-grid--six,
    .mpt-inner-card-grid--three,
    .mpt-inner-process:not(.mpt-inner-process--stack),
    .mpt-about-values,
    .mpt-about-why,
    .mpt-about-cats,
    .mpt-about-serve,
    .mpt-about-whympt__reasons,
    .mpt-about-whympt__pathways,
    .mpt-about-channels__grid,
    .mpt-resource-card-grid--four,
    .mpt-resource-pathways,
    .mpt-resource-filters,
    .mpt-resource-filter,
    .mpt-insight-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mpt-services,
    .mpt-services-page > .mpt-services,
    .mpt-service-band,
    .mpt-solutions,
    .mpt-resources-page > .mpt-resources,
    .mpt-resources,
    .single-post .entry-content {
        padding-inline: var(--mpt-gutter-tablet);
    }

    /* Elementor: prevent fixed/min widths from forcing page scroll */
    body.mpt-theme .elementor-section .elementor-container {
        flex-wrap: wrap;
    }

    body.mpt-theme .elementor-column.elementor-col-50,
    body.mpt-theme .elementor-column.elementor-col-33,
    body.mpt-theme .elementor-column.elementor-col-25 {
        width: 100%;
    }

    body.mpt-theme .e-con.e-flex > .e-con-inner {
        flex-wrap: wrap;
    }
}

/* ---------- md–lg tablet utility bar ---------- */
@media (min-width: 768px) and (max-width: 1024px) {
    .mpt-utility-bar__contacts {
        gap: 0.25rem 0.85rem;
    }

    .mpt-utility-bar__contacts span:last-child {
        max-width: 14rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* ---------- md: ≤768 — phone landscape / large phone ---------- */
@media (max-width: 768px) {
    :root {
        --mpt-gutter-desktop: var(--mpt-gutter-mobile);
        --mpt-utility-height: 0px;
        --mpt-section-spacing: var(--mpt-section-spacing-mobile);
    }

    .mpt-utility-bar { display: none; }

    .mpt-site-footer__grid {
        grid-template-columns: 1fr;
    }

    .mpt-header-actions .mpt-button--primary span.mpt-button__label-long {
        display: none;
    }

    /* Elementor nested containers: full bleed safe */
    body.mpt-theme .elementor-section.elementor-section-boxed > .elementor-container {
        max-width: 100%;
        padding-inline: var(--mpt-gutter-mobile);
    }

    body.mpt-theme .e-con > .e-con-inner {
        max-width: 100%;
        padding-inline: max(var(--mpt-gutter-mobile), env(safe-area-inset-left)) max(var(--mpt-gutter-mobile), env(safe-area-inset-right));
    }
}

/* ---------- sm: ≤640 — phones ---------- */
@media (max-width: 640px) {
    .mpt-catalogue-archive__child-grid,
    .mpt-catalogue-archive__loop ul.products,
    body.single-product .related.products ul.products,
    body.single-product .upsells.products ul.products,
    ul.products,
    .mpt-service-grid--four,
    .mpt-service-process--four,
    .mpt-solution-grid--four,
    .mpt-solution-process,
    .mpt-inner-card-grid--four,
    .mpt-inner-card-grid--six,
    .mpt-inner-card-grid--three,
    .mpt-inner-card-grid--provides,
    .mpt-about-values,
    .mpt-about-why,
    .mpt-about-cats,
    .mpt-about-serve,
    .mpt-about-whympt__reasons,
    .mpt-about-whympt__pathways,
    .mpt-about-channels__grid,
    .mpt-resource-card-grid--four,
    .mpt-resource-pathways,
    .mpt-resource-filters,
    .mpt-resource-filter,
    .mpt-insight-grid,
    .mpt-faq-search {
        grid-template-columns: minmax(0, 1fr);
    }

    .mpt-catalogue-filters__grid,
    .mpt-catalogue-archive__loop .mpt-catalogue-filters .mpt-catalogue-filters__grid {
        grid-template-columns: 1fr;
    }

    .mpt-catalogue-archive__actions,
    .mpt-catalogue-empty__actions,
    .mpt-catalogue-archive__footer-actions,
    .mpt-product-quote-panel,
    .mpt-products-cta__actions,
    .mpt-product-single__footer .mpt-products-cta__actions,
    .mpt-service-actions,
    .mpt-solution-actions,
    .mpt-inner-actions {
        width: 100%;
    }

    .mpt-catalogue-archive__actions .mpt-button,
    .mpt-catalogue-empty__actions .mpt-button,
    .mpt-catalogue-archive__footer-actions .mpt-button,
    .mpt-product-quote-panel .mpt-button,
    .mpt-products-cta__actions .mpt-button,
    .mpt-product-single__footer .mpt-products-cta__actions .mpt-button,
    .mpt-service-actions .mpt-button,
    .mpt-solution-actions .mpt-button,
    .mpt-inner-actions .mpt-button {
        flex: 1 1 auto;
        justify-content: center;
        text-align: center;
    }

    .mpt-services,
    .mpt-services-page > .mpt-services,
    .mpt-service-band,
    .mpt-solutions,
    .mpt-resources-page > .mpt-resources,
    .mpt-resources,
    .single-post .entry-content {
        padding-inline: var(--mpt-gutter-mobile);
        padding-block: var(--mpt-section-spacing-mobile);
    }

    /* Slider chrome: keep 44px targets, tighter side padding on narrow phones */
    .mpt-home-band--products .mpt-product-slider {
        padding-inline: 2.75rem;
    }

    .mpt-hero-slider__arrow,
    .mpt-category-slider__arrow,
    .mpt-home-band--products .mpt-product-slider__arrow {
        min-width: var(--mpt-touch-min);
        min-height: var(--mpt-touch-min);
        width: var(--mpt-touch-min);
        height: var(--mpt-touch-min);
    }

    .mpt-pattern,
    .mpt-service-visual,
    .mpt-solution-visual,
    .mpt-resource-visual {
        min-height: 220px;
    }
}

/* ---------- xs: ≤390 — very narrow phones ---------- */
@media (max-width: 390px) {
    .mpt-home-band--products .mpt-product-slider {
        padding-inline: 2.35rem;
    }

    .mpt-home-trust-shell[data-mpt-trust-slider] .mpt-home-trust__item {
        flex-basis: min(88vw, 20rem);
        width: min(88vw, 20rem);
    }

    .mpt-partners-marquee__item {
        width: 5.75rem;
        min-height: 2.5rem;
        padding-inline: 0.5rem;
    }

    .mpt-button {
        padding-inline: 1rem;
    }
}
