/* Site fixes — keep this file when installing new scripts */

/* Horizontal promo banners: full image on mobile */
.promo-banner,
.app-home .promo-banner {
    min-height: 0 !important;
    height: auto !important;
    overflow: visible !important;
    background: none !important;
    background-image: none !important;
}

.promo-banner-img,
.app-home .promo-banner-img {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    object-fit: contain !important;
    object-position: center !important;
    display: block !important;
}

/* Fallback if old background-image markup still exists */
.promo-banner[style*="background-image"] {
    min-height: 0 !important;
    aspect-ratio: 16 / 5;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
}

@media (max-width: 900px) {
    .promo-banner[style*="background-image"] {
        aspect-ratio: 16 / 7;
    }
}


/* ==========================================================
   Mobile scroll stability / stuck-page recovery
   ========================================================== */
@media (max-width: 900px) {
    html,
    body {
        width: 100%;
        min-height: 100%;
        max-width: 100%;
        overflow-x: hidden;
        overscroll-behavior-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Old inline overflow:hidden values must never keep the site frozen after
       a drawer/modal has closed. Only the managed class may lock scrolling. */
    body:not(.scroll-lock-active),
    html:not(.scroll-lock-active) {
        overflow-y: auto !important;
    }

    body:not(.scroll-lock-active) {
        position: static !important;
        top: auto !important;
        width: 100% !important;
        touch-action: auto !important;
    }

    body.app-home:not(.scroll-lock-active) {
        overflow-y: auto !important;
        overscroll-behavior-y: auto !important;
        touch-action: auto !important;
    }

    html.scroll-lock-active,
    body.scroll-lock-active {
        overflow: hidden !important;
        overscroll-behavior: none;
    }

    /* Drawers themselves remain independently scrollable while the page is locked. */
    .app-home .drawer-links,
    .shop-sidebar {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-y;
    }

    .app-home .main-nav {
        max-height: 100dvh;
    }

    .app-home .nav-overlay,
    .shop-sidebar-overlay {
        touch-action: none;
    }

    /* Horizontal category strips can still swipe horizontally without
       disabling normal vertical page scrolling. */
    .mobile-category-scroll,
    .category-menu-scroll,
    .market-category-track {
        touch-action: pan-x pan-y;
    }
}
