/* Site fixes — survives style.css overwrite when master keeps this link */

/* Horizontal promo banners: show full image on mobile */
.promo-banner,
.app-home .promo-banner {
    min-height: 0 !important;
    height: auto !important;
    overflow: visible !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;
}

/* Header stays at the top while scrolling */
.site-header {
    position: sticky !important;
    top: 0 !important;
    margin-top: 0 !important;
    z-index: 1000;
    width: 100%;
}

/* Remove unwanted space above the header */
body.app-home .site-header {
    margin-block-start: 0 !important;
}

/* =========================================
   SHOP BY BRAND - DESKTOP DROPDOWN
========================================= */

.header-brand-menu {
    position: relative !important;
}

.header-brand-menu > .header-cat-link {
    display: flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    cursor: pointer;
}

.header-brand-dropdown {
    min-width: 220px;
    max-height: 420px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 9999;
}

.header-brand-menu:hover > .header-brand-dropdown,
.header-brand-menu:focus-within > .header-brand-dropdown {
    display: block;
}

.header-brand-dropdown .header-sub-link {
    display: block;
    padding: 10px 15px;
    white-space: normal;
    transition: background .2s ease, color .2s ease;
}

.header-brand-dropdown .header-sub-link:hover {
    background: #f7f7f7;
    color: var(--primary, #df2d4d);
}

/* =========================================
   SHOP BY BRAND - MOBILE DRAWER
========================================= */

.mobile-cat-group .mobile-cat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-cat-group .mobile-cat-parent {
    flex: 1;
}

.mobile-cat-group .mobile-sub-toggle {
    flex-shrink: 0;
    cursor: pointer;
}

.mobile-cat-group .drawer-sub-links {
    max-height: 300px;
    overflow-y: auto;
}

/* =========================================
   MOBILE RESPONSIVE
========================================= */

@media (max-width: 991px) {
    .header-brand-menu {
        display: none !important;
    }

    .mobile-cat-group .drawer-sub-parent {
        display: block;
        padding: 10px 15px;
    }
}

/* Brand page desktop sticky sidebar */
@media (min-width: 992px) {

    #shopLayout {
        align-items: start;
    }

    #shopSidebar {
        position: sticky !important;
        top: var(--shop-sticky-top, 160px);
        align-self: start;
        height: fit-content;
        max-height: calc(100vh - var(--shop-sticky-top, 160px) - 16px);
        overflow-y: auto;
        overflow-x: hidden;
        z-index: 10;
    }

    #shopSidebar.is-open {
        position: sticky !important;
    }
}
