/**
 * HiGuppy Mobile Layout Fix
 *
 * Full mobile responsive overrides for the homepage and XStore layout issues.
 * Covers XStore wrapper fixes, homepage section stacking, and all new
 * higuppy-home__ component classes.
 *
 * @package HiGuppy
 * @since 1.1.0
 */

/* ==========================================================================
   GLOBAL — prevent horizontal scroll on all viewports
   ========================================================================== */

html,
body {
    overflow-x: hidden !important;
    max-width: 100vw;
}

/* ==========================================================================
   XSTORE WRAPPER FIX — full-width homepage on all viewports
   XStore wraps page content in col-md-9 + col-md-3 sidebar.
   We force full-width and hide sidebar on homepage.
   ========================================================================== */

body.home .container.content-page,
body.home .content-page {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

body.home .content-page .sidebar-position-right,
body.home .content-page .row {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.home .content-page .content,
body.home .content-page .content.col-md-9,
body.home .content-page [class*="col-md-9"] {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Hide sidebar completely on homepage */
body.home .content-page .col-md-3,
body.home .content-page aside,
body.home .content-page .sidebar,
body.home [class*="sidebar-right"],
body.home .sidebar-widget,
body.home #sidebar,
body.home .widget-area,
/* XStore slider arrows that show up in sidebar area */
body.home .et-slider-navigation,
body.home .slick-arrow,
body.home .swiper-button-next,
body.home .swiper-button-prev {
    display: none !important;
}

/* ==========================================================================
   TABLET (≤991px) — XStore layout fixes
   ========================================================================== */

@media (max-width: 991px) {

    /* Force sidebar-position-right visible so homepage renders */
    body.home .content-page.sidebar-mobile-bottom > .sidebar-position-right {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible !important;
    }

    body.home .content-page.sidebar-mobile-bottom > .sidebar-position-right > .row {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
    }

    body.home .content-page.sidebar-mobile-bottom .content.col-md-9 {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        padding: 0 !important;
    }
}

/* ==========================================================================
   HOMEPAGE COMPONENTS — tablet (≤991px)
   ========================================================================== */

@media (max-width: 991px) {

    /* Hero: switch from 2-col to single col */
    .higuppy-home__hero {
        grid-template-columns: 1fr !important;
        padding: 36px 16px 32px !important;
        gap: 24px !important;
    }

    /* Hide the highlight panel on mobile — takes too much space */
    .higuppy-home__hero-panel {
        display: none !important;
    }

    .higuppy-home h1 {
        font-size: clamp(2rem, 7vw, 2.75rem) !important;
    }

    .higuppy-home__intro {
        font-size: 1rem !important;
    }

    /* Stats bar under hero CTA */
    .higuppy-home__hero-stats {
        flex-wrap: wrap !important;
        gap: 12px !important;
        padding-top: 16px !important;
        margin-top: 20px !important;
    }

    .higuppy-home__mini-stat strong {
        font-size: 1.25rem !important;
    }

    /* Sections: reduce padding */
    .higuppy-home__section,
    .higuppy-home__category-grid {
        padding: 36px 16px !important;
        max-width: 100% !important;
    }

    .higuppy-home__section--alt {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    /* Category grid: 1 col on mobile */
    .higuppy-home__category-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .higuppy-home__category {
        min-height: auto !important;
        padding: 20px 16px !important;
    }

    /* Steps: 1 col on mobile */
    .higuppy-home__steps {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    .higuppy-home__step {
        padding: 24px 20px !important;
        text-align: left !important;
        display: flex !important;
        align-items: flex-start !important;
        gap: 16px !important;
    }

    .higuppy-home__step-number {
        flex-shrink: 0 !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 1rem !important;
        margin-bottom: 0 !important;
    }

    .higuppy-home__step h3 {
        font-size: 1rem !important;
        margin-bottom: 6px !important;
    }

    /* Why / Split section: 1 col */
    .higuppy-home__split {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }

    /* Testimonials: 1 col */
    .higuppy-home__testimonials {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    .higuppy-home__testimonial {
        padding: 20px 16px !important;
    }

    /* Resource cards: 1 col (already row layout, just ensure gap) */
    .higuppy-home__resource-cards {
        gap: 12px !important;
    }

    /* Final CTA: reduce padding */
    .higuppy-home__final-cta {
        padding: 48px 16px !important;
        margin: 24px 0 !important;
        border-radius: 12px !important;
    }

    .higuppy-home__final-cta h2 {
        font-size: 1.5rem !important;
    }

    .higuppy-home__final-cta .higuppy-home__actions {
        flex-direction: column !important;
        align-items: center !important;
    }

    /* Buttons: full-width on mobile */
    .higuppy-home__actions {
        flex-direction: column !important;
        gap: 10px !important;
    }

    .higuppy-home__button {
        width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
    }

    /* Trust bar: wrap tightly */
    .higuppy-trust-bar {
        gap: 10px !important;
        padding: 12px 16px !important;
        flex-wrap: wrap !important;
        font-size: 0.8125rem !important;
        justify-content: flex-start !important;
    }

    /* Feature items */
    .higuppy-home__feature {
        padding: 16px !important;
        margin-bottom: 12px !important;
    }

    /* Section headings */
    .higuppy-home__section-heading h2 {
        font-size: 1.5rem !important;
    }

    /* Remove XStore slider arrows globally on mobile */
    .et-slider-navigation,
    .slick-arrow,
    .swiper-button-next,
    .swiper-button-prev,
    .owl-nav,
    button.slick-prev,
    button.slick-next {
        display: none !important;
    }
}

/* ==========================================================================
   SMALL MOBILE (≤480px)
   ========================================================================== */

@media (max-width: 480px) {

    .higuppy-home__hero {
        padding: 28px 14px 24px !important;
    }

    .higuppy-home h1 {
        font-size: 1.875rem !important;
        line-height: 1.1 !important;
    }

    .higuppy-home__section,
    .higuppy-home__category-grid {
        padding: 28px 14px !important;
    }

    .higuppy-home__mini-stat strong {
        font-size: 1.125rem !important;
    }

    .higuppy-home__step {
        padding: 18px 14px !important;
    }

    .higuppy-home__testimonial {
        padding: 16px 14px !important;
    }

    .higuppy-home__final-cta {
        padding: 36px 14px !important;
    }

    .higuppy-home__final-cta h2 {
        font-size: 1.375rem !important;
    }
}
