/* KupetzEliseevs search results compatibility, loaded only on WSS results
   with the KupetzEliseevs (your-clean-template-3) theme. This does NOT change
   the site's normal shop/catalog cards, other themes or the suggestion UI. */

/* WSS virtual search URLs are rooted at /, so WordPress can report is_front_page().
   Kupetz header.php then adds --home to the fixed nav bar, which normally starts
   140px below the top on the REAL homepage. On WSS pages that creates an empty
   strip and overlaps the search heading. Only cancel this homepage offset here. */
body.wss-search-results-page.wp-theme-your-clean-template-3 .kupetz-site-header__bar--home {
    margin-top: 0;
}

/* The theme footer has margin-top:-320px. Its regular page templates offset it
   with 377px bottom padding on .kupetz-content-shell. WSS uses a virtual page
   template without that shell, so its cards can run behind the footer.
   Restore the same bottom clearance ONLY on WSS results pages. */
body.wss-search-results-page.wp-theme-your-clean-template-3 main#wss-search-main {
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    display: block;
    clear: both;
    float: none;
    width: min(var(--wss-container-width, 1200px), calc(100vw - 48px));
    max-width: none;
    min-width: 0;
    margin: calc(var(--kupetz-header-bar-height, 50px) + 28px) 0 64px;
    padding: 0 0 377px;
    overflow: visible;
    box-sizing: border-box;
}

body.wss-search-results-page.wp-theme-your-clean-template-3 .wss-search-page__heading {
    position: relative;
    width: 100%;
    margin: 0 0 26px;
    text-align: center;
}
body.wss-search-results-page.wp-theme-your-clean-template-3 .wss-search-page__heading > h1 {
    margin: 0 0 18px;
}
body.wss-search-results-page.wp-theme-your-clean-template-3 .wss-search-page__heading > .wss-woo-search {
    width: min(100%, 900px);
    max-width: 900px;
    margin: 0 auto;
    text-align: left;
}
body.wss-search-results-page.wp-theme-your-clean-template-3 .wss-search-page__dynamic,
body.wss-search-results-page.wp-theme-your-clean-template-3 .wss-search-page__layout,
body.wss-search-results-page.wp-theme-your-clean-template-3 .wss-search-page__list {
    width: 100%;
    max-width: none;
    min-width: 0;
}
body.wss-search-results-page.wp-theme-your-clean-template-3 .wss-search-page__layout {
    display: grid;
    grid-template-columns: 245px minmax(0, 1fr);
    align-items: start;
    column-gap: 28px;
}
body.wss-search-results-page.wp-theme-your-clean-template-3 .wss-search-page__native-grid.products,
body.wss-search-results-page.wp-theme-your-clean-template-3 .wss-search-page__grid {
    display: grid;
    grid-template-columns: repeat(var(--wss-cols, 3), minmax(0, 1fr));
    gap: 22px;
    width: 100%;
    max-width: none;
    min-width: 0;
}
body.wss-search-results-page.wp-theme-your-clean-template-3 .wss-search-page__native-grid.products > li.product {
    box-sizing: border-box;
    min-width: 0;
    width: auto;
    max-width: none;
}
body.wss-search-results-page.wp-theme-your-clean-template-3 .wss-search-page__native-grid.products .product-item,
body.wss-search-results-page.wp-theme-your-clean-template-3 .wss-search-page__native-grid.products .product-item-wrapper {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}
body.wss-search-results-page.wp-theme-your-clean-template-3 .wss-search-page__native-grid.products img {
    max-width: 100%;
    height: auto;
}

@media (max-width: 1000px) {
    body.wss-search-results-page.wp-theme-your-clean-template-3 .wss-search-page__layout {
        grid-template-columns: 215px minmax(0, 1fr);
        column-gap: 20px;
    }
    body.wss-search-results-page.wp-theme-your-clean-template-3 .wss-search-page__native-grid.products,
    body.wss-search-results-page.wp-theme-your-clean-template-3 .wss-search-page__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }
}
@media (max-width: 760px) {
    body.wss-search-results-page.wp-theme-your-clean-template-3 main#wss-search-main {
        width: calc(100vw - 24px);
        margin-top: calc(var(--kupetz-header-bar-height, 50px) + 20px);
        margin-bottom: 40px;
    }
    body.wss-search-results-page.wp-theme-your-clean-template-3 .wss-search-page__layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }
    body.wss-search-results-page.wp-theme-your-clean-template-3 .wss-search-page__native-grid.products,
    body.wss-search-results-page.wp-theme-your-clean-template-3 .wss-search-page__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
    body.wss-search-results-page.wp-theme-your-clean-template-3 .wss-search-page__heading > .wss-woo-search {
        width: 100%;
    }
}
@media (max-width: 410px) {
    body.wss-search-results-page.wp-theme-your-clean-template-3 .wss-search-page__native-grid.products,
    body.wss-search-results-page.wp-theme-your-clean-template-3 .wss-search-page__grid {
        gap: 8px;
    }
}
