/**
 *
 *   Search results (Findbar)
 *   ========================
 *
 *   /search-results/ is drawn entirely by Findbar's script (app.findbar.io,
 *   loaded from nvm_extend_woo/includes/findbar.php). Its markup is plain DOM
 *   with fbr-* classes and its own inline stylesheet, so the only lever on our
 *   side is CSS. Everything here is scoped to the body class Findbar adds on
 *   that page, fbr-search-results-page, so the header search box and the
 *   quick-search dropdown on other pages are not touched.
 *
 *   The result cards reuse WooCommerce's loop markup (h2 title, note-
 *   availability, price, add_to_cart_button), so the shop's own card styles
 *   already apply; this sheet only corrects what Findbar adds around them and
 *   brings the image and sidebar in line with the product category pages.
 *
 *   Findbar's inline sheet is loaded after ours and uses two-class selectors,
 *   hence the body-class prefix everywhere, and !important where it sets the
 *   same property with equal weight.
 *
 */


.fbr-search-results-page {
    --nvm-search-navy: #474972;
    --nvm-search-pink: #f897c2;
    --nvm-search-mint: #d7e7e7;
    --nvm-search-line: #e6e6ea;
}


/* Heading: "Αναζήτηση–nef". A slim band instead of a 140px block. */

.fbr-search-results-page .fbr-search-query {
    margin: 0 0 24px;
    padding: 22px 28px;
    border-left: 4px solid var( --nvm-search-pink );
}

.fbr-search-results-page .fbr-search-query p {
    margin: 0;
    font-size: clamp( 24px, 2.6vw, 34px );
    line-height: 1.2;
}


/* Toolbar: result count left, sort right, on one line. */

.fbr-search-results-page .fbr-search-content-toolbar {
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var( --nvm-search-line );
}

.fbr-search-results-page .fbr-search-content-toolbar > div {
    min-width: 0;
    margin: 0;
}

.fbr-search-results-page .fbr-totals {
    color: #6b6b7b;
}

.fbr-search-results-page .fbr-search-content-toolbar .fbr-sort {
    min-width: 220px;
    height: 44px;
    padding: 0 36px 0 14px;
    border: 1px solid var( --nvm-search-navy );
    border-radius: 4px;
    color: var( --nvm-search-navy );
    font-size: 15px;
    line-height: 42px;
}


/* Result cards. */

.fbr-search-results-page .fbr-result {
    position: relative;
    height: 100%;
    padding-bottom: 16px !important;
}

/* "Πρωτότυπη εικόνα" is the caption Findbar gives the source image of a
   visual search; it should never show on a plain result. */
.fbr-search-results-page .fbr-result .fbr-source-image-title {
    display: none !important;
}

/* Same 4:5 portrait crop as the category pages (woocommerce_thumbnail is
   300x375). Findbar hands over the full-size original, so crop it here. */
.fbr-search-results-page .fbr-result .thumbnail-wrapper {
    display: block;
    overflow: hidden;
    aspect-ratio: 4 / 5;
    background: #f5f5f5;
}

.fbr-search-results-page .fbr-result .thumbnail-wrapper img {
    width: 100%;
    height: 100% !important;
    object-fit: cover;
    transition: transform .4s ease;
}

.fbr-search-results-page .fbr-result:hover .thumbnail-wrapper img {
    transform: scale( 1.03 );
}

/* "Δείτε παρόμοια" becomes a small pill over the image's top corner instead
   of a row of its own between image and title. */
.fbr-search-results-page .fbr-result .fbr-visual-recommendations-container {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    margin: 0;
}

.fbr-search-results-page .fbr-result .fbr-visual-recommendations {
    position: static;
    padding: 6px 10px;
    border: 0;
    border-radius: 999px;
    background: rgba( 255, 255, 255, .92 );
    box-shadow: 0 1px 4px rgba( 0, 0, 0, .12 );
    font-size: 13px;
    line-height: 1;
}

.fbr-search-results-page .fbr-result .fbr-visual-recommendations:hover {
    background: #fff;
}

.fbr-search-results-page .fbr-result .fbr-visual-recommendations-text {
    color: var( --nvm-search-navy );
    font-size: 13px;
    line-height: 1;
}

/* Titles in full: the size and colour at the end of the name are what
   people compare on. */
.fbr-search-results-page .fbr-result .woocommerce-loop-product__title {
    margin-top: 14px !important;
    padding: 0 12px;
}

.fbr-search-results-page .fbr-result .note-availability {
    padding: 0 12px;
}

/* Findbar leaves an empty <p> after the price. */
.fbr-search-results-page .fbr-result > div > p:empty {
    display: none;
}


/* "Περισσότερα" (load more): a proper button. */

.fbr-search-results-page .fbr-load-more {
    margin: 32px 0 16px;
    text-align: center;
}

.fbr-search-results-page .fbr-load-more span {
    display: inline-block;
    min-width: 240px;
    padding: 14px 32px;
    border: 2px solid var( --nvm-search-navy );
    border-radius: 999px;
    background: #fff;
    color: var( --nvm-search-navy );
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}

.fbr-search-results-page .fbr-load-more span:hover,
.fbr-search-results-page .fbr-load-more span:focus-visible {
    background: var( --nvm-search-navy );
    color: #fff;
}


/* Filters sidebar, laid out like FiboFilters on the category pages: tinted
   heading chip, compact rows, long lists scroll instead of running on. */

.fbr-search-results-page .fbr-search-content-filters {
    padding: 0 20px 0 0;
}

.fbr-search-results-page .fbr-search-content .fbr-search-content-filters.fbr-left {
    border-right: 0;
}

.fbr-search-results-page .fbr-search-content-filters .fbr-filter {
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var( --nvm-search-line );
}

.fbr-search-results-page .fbr-search-content-filters .fbr-filter .fbr-title {
    align-items: center;
    margin-bottom: 12px;
    padding: 10px 14px;
    border-bottom: 0;
    font-size: 17px;
    font-weight: 400;
}

.fbr-search-results-page .fbr-search-content-filters .fbr-filter.fbr-collapsed .fbr-title {
    margin-bottom: 0;
}

.fbr-search-results-page .fbr-search-content-filters .fbr-filter-list {
    max-height: 232px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.fbr-search-results-page .fbr-search-content-filters .fbr-filter-list .fbr-filter-list-entry {
    align-items: center;
    margin-bottom: 0;
    padding: 6px 0;
}

.fbr-search-results-page .fbr-search-content-filters .fbr-filter-list .fbr-filter-list-entry:hover label {
    color: var( --nvm-search-navy );
}

.fbr-search-results-page .fbr-search-content-filters .fbr-filter-value label {
    font-size: 15px;
    line-height: 1.3;
    cursor: pointer;
}

.fbr-search-results-page .fbr-search-content-filters .fbr-filter-list .fbr-filter-list-entry .fbr-filter-value-count {
    color: #8a8a96;
    font-size: 13px;
}


/* Phones and tablets. Findbar moves the filters into an off-canvas drawer
   whose "Φίλτρα" header peeks out as a tab; that is left as Findbar draws it. */

@media ( max-width: 1023px ) {

    .fbr-search-results-page .fbr-search-query {
        margin-bottom: 16px;
        padding: 16px 18px;
    }

    .fbr-search-results-page .fbr-search-content-toolbar {
        flex-wrap: wrap;
    }

    .fbr-search-results-page .fbr-search-content-toolbar .fbr-sorter {
        display: flex;
        flex: 1 1 100%;
        align-items: center;
        gap: 8px;
    }

    .fbr-search-results-page .fbr-search-content-toolbar .fbr-sort-container,
    .fbr-search-results-page .fbr-search-content-toolbar .fbr-sort {
        flex: 1 1 auto;
        width: 100%;
        min-width: 0;
    }

    .fbr-search-results-page .fbr-result .woocommerce-loop-product__title {
        padding: 0 8px;
        font-size: 15px;
    }

    .fbr-search-results-page .fbr-result .note-availability {
        padding: 0 8px;
    }

    .fbr-search-results-page .fbr-result .fbr-visual-recommendations {
        padding: 6px;
    }

    /* Icon only on phones; the label does not fit on a half-width card. */
    .fbr-search-results-page .fbr-result .fbr-visual-recommendations-text {
        display: none;
    }

}
