/* ==========================================================================
   Webmaster Plus — Elementor global mobile / PWA (loads last in wp_footer)
   ========================================================================== */

.site-main,
.site-main .elementor,
.site-main .elementor-section,
.elementor-page,
.wmplus-main,
.wmplus-main .elementor,
.wmplus-main .elementor-section,
.wmplus-main--full,
.wmplus-main--full .elementor,
.wmplus-main--full .elementor-section {
    max-width: 100%;
}

/* ── Tablet: tighten Elementor boxed sections ── */
@media (max-width: 991.98px) {
    .site-main .elementor-section.elementor-section-boxed > .elementor-container,
    .site-main .elementor .e-con-boxed > .e-con-inner {
        max-width: 100%;
    }
}

/* ── Mobile: stacks, grids, touch targets ── */
@media (max-width: 767.98px) {
    .site-main .elementor-element,
    .site-main .elementor-widget-wrap,
    .site-main .elementor-widget-container {
        max-width: 100%;
        min-width: 0;
    }

    /* Elementor grid containers → single column */
    .site-main .e-grid.e-con > .e-con-inner {
        grid-template-columns: 1fr !important;
    }

    /* Flex row containers: allow wrap + full-width children */
    .site-main .e-con.e-parent > .e-con-inner {
        flex-wrap: wrap !important;
        gap: 16px !important;
    }

    .site-main .e-con.e-child:not(.wm-plus-header__logo):not(.wm-plus-header__menu-pill) {
        --width: 100% !important;
        --flex-grow: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        flex-basis: 100% !important;
    }

    /* Theme module grids — force 1 column on phone */
    .wm-plus-home [class$="__grid"],
    .wm-sl-page [class$="__grid"],
    .wm-wd-page [class$="__grid"],
    .wm-cd-page [class$="__grid"],
    .wm-ec-page [class$="__grid"],
    .wm-seo-page [class$="__grid"],
    .wm-n8n-page [class$="__grid"],
    .wm-dm-page [class$="__grid"],
    .wm-vip-page [class$="__grid"],
    .wm-product-page [class$="__grid"],
    .wm-blog-page [class$="__grid"],
    .wm-pt-page [class$="__grid"],
    .wm-ac-page [class$="__grid"] {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    /* Card / pillar blocks */
    .wm-plus-pillar,
    .wm-plus-plan,
    .wm-plus-task,
    .wm-plus-stat,
    .wm-sl-card,
    .wm-sl-feature,
    .wm-sl-pricing-card,
    .wm-wd-card,
    .wm-dm-card {
        padding: 20px 16px !important;
    }

    .wm-plus-pillar p,
    .wm-sl-card p,
    .wm-wd-card p {
        font-size: 0.88rem;
        line-height: 1.75;
    }

    /* CTAs — full width in stacked cards */
    .wm-plus-pillar .wm-plus-btn,
    .wm-plus-hero__actions .wm-plus-btn,
    .wm-sl-card .wm-sl-btn,
    .wm-wd-card .wm-wd-btn,
    .wm-dm-card .wm-dm-btn,
    .site-main .elementor-widget-button:not(.site-header .elementor-widget-button) .elementor-button-link {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    /* Elementor widgets — touch + typography */
    .site-main .elementor-widget-button .elementor-button {
        min-height: var(--wm-touch-min, 44px);
        padding-inline: 20px;
    }

    .site-main .elementor-widget-heading .elementor-heading-title {
        word-break: break-word;
        hyphens: auto;
    }

    .site-main .elementor-widget-text-editor,
    .site-main .elementor-widget-text-editor p {
        font-size: 0.92rem;
        line-height: 1.8;
    }

    .site-main .elementor-widget-image img {
        width: 100%;
        height: auto;
    }

    .site-main .elementor-widget-icon-box .elementor-icon-box-wrapper {
        flex-wrap: wrap;
        gap: 12px;
    }

    .site-main .elementor-widget-icon-list .elementor-icon-list-items {
        gap: 10px;
    }

    /* Swiper / carousel slides */
    .site-main .swiper-slide {
        width: 100% !important;
        max-width: 100%;
    }

    /* Tables — horizontal scroll on wrapper, not on table (avoids scrollbar at table bottom) */
    .site-main figure.wp-block-table,
    .site-main figure:has(> table),
    .site-main .wm-blog-table-scroll,
    .site-main .wm-blog-compare__scroll {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
    }

    .site-main table {
        display: table;
        width: max-content;
        min-width: 100%;
        overflow-x: visible;
    }

    /* Forms */
    .site-main input[type="text"],
    .site-main input[type="email"],
    .site-main input[type="tel"],
    .site-main input[type="url"],
    .site-main input[type="search"],
    .site-main textarea,
    .site-main select,
    .site-main .elementor-field-textual {
        min-height: var(--wm-touch-min, 44px);
        font-size: 16px;
    }

    /* Section vertical rhythm */
    .wm-plus-home > section,
    .wm-sl-page > section,
    .wm-wd-page > section,
    .wm-dm-page > section,
    .wm-seo-page > section,
    .wm-n8n-page > section {
        padding-block: clamp(40px, 11vw, 64px);
    }

    /* Plus-kit atomic widgets */
    .wm-sl-page--kit .wm-sl-kit-prose {
        font-size: 0.92rem;
    }

    .site-main [class*="elementor-widget-webmaster"],
    .site-main [class*="elementor-widget-pluskit"] {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* ── Small phones ── */
@media (max-width: 479.98px) {
    .wm-plus-home h1 {
        font-size: clamp(1.55rem, 7vw, 1.85rem);
    }

    .wm-plus-home h2 {
        font-size: clamp(1.25rem, 5.5vw, 1.5rem);
    }

    .wm-plus-pillar__media {
        width: 72px;
        height: 72px;
    }

    .site-main .elementor-widget-image-gallery .gallery-item {
        max-width: 100%;
    }
}

/* PWA standalone — slightly tighter section padding */
@media (display-mode: standalone) and (max-width: 767.98px) {
    .wm-plus-home > section,
    .wm-sl-page > section {
        padding-block: clamp(36px, 10vw, 56px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-main .swiper-wrapper {
        scroll-behavior: auto;
    }
}

/* ── FAQ accordions (all module pages) ── */
@media (max-width: 767.98px) {
    .wm-plus-faq { padding: 40px 0 48px; }

    .wm-plus-faq__lead {
        padding-inline: 16px;
    }

    .wm-wd-faq__layout,
    .wm-sl-faq__layout,
    .wm-dm-faq__layout,
    .wm-seo-faq__layout,
    .wm-vip-faq__layout,
    [class*="-faq__layout"] {
        display: block !important;
        gap: 20px !important;
    }

    .wm-wd-faq__aside,
    .wm-sl-faq__aside,
    [class*="-faq__aside"] {
        margin-bottom: 16px;
        text-align: center;
    }

    .wm-wd-acc__trigger,
    .wm-sl-acc__trigger,
    [class*="-acc__trigger"] {
        display: flex !important;
        align-items: flex-start !important;
        justify-content: space-between !important;
        gap: 10px !important;
        padding: 14px 16px !important;
        font-size: 0.88rem !important;
        line-height: 1.6 !important;
        text-align: start !important;
    }

    .wm-wd-acc__trigger > span,
    .wm-sl-acc__trigger > span,
    [class*="-acc__trigger"] > span:first-child {
        flex: 1 1 auto;
        min-width: 0;
        word-break: break-word;
    }

    .wm-wd-acc__trigger i,
    .wm-sl-acc__trigger i,
    [class*="-acc__trigger"] i {
        flex-shrink: 0;
        margin-top: 3px;
    }

    .wm-wd-acc__panel p,
    .wm-sl-acc__panel p,
    [class*="-acc__panel"] p {
        padding: 2px 16px 16px !important;
        font-size: 0.86rem !important;
        line-height: 1.82 !important;
    }
}
