/* HPD Search Intelligence — frontend design layer
 * Deliberately scoped to CommerceKit Ajax Search so it does not touch WooCommerce grids.
 */
.commercekit-wrapper .commercekit-ajs-results {
    --hpd-search-green: #214d12;
    --hpd-search-green-2: #376f2b;
    --hpd-search-green-soft: #f2f7ef;
    --hpd-search-yellow: #f6bd3c;
    --hpd-search-ink: #172015;
    --hpd-search-muted: #6b7468;
    --hpd-search-line: #e2e8de;
    --hpd-search-cream: #fbfaf6;
    min-height: 0 !important;
    margin-top: 7px !important;
    background: #fff;
    border: 1px solid var(--hpd-search-line);
    border-radius: 12px;
    box-shadow: 0 18px 48px rgba(25, 54, 18, .18), 0 3px 10px rgba(25, 54, 18, .08);
    overflow-x: hidden;
    overflow-y: auto;
}

/* Span the full HPD search control, including the gold submit button. */
.commercekit-wrapper .commercekit-ajs-results,
.commercekit-wrapper .commercekit-ajs-suggestions {
    width: 100% !important;
}

.commercekit-wrapper .commercekit-ajs-suggestions {
    border: 0 !important;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

/* Product results */
.commercekit-wrapper .commercekit-ajs-suggestions > .autocomplete-suggestion {
    border: 0 !important;
    border-bottom: 1px solid var(--hpd-search-line) !important;
    background: #fff;
    transition: background-color .15s ease, transform .15s ease;
}

.commercekit-wrapper .commercekit-ajs-suggestions > .autocomplete-suggestion:hover,
.commercekit-wrapper .commercekit-ajs-suggestions > .autocomplete-suggestion.active,
.commercekit-wrapper .commercekit-ajs-suggestions > .autocomplete-suggestion.autocomplete-selected {
    background: var(--hpd-search-green-soft) !important;
}

.commercekit-wrapper .autocomplete-suggestion > a.commercekit-ajs-product {
    min-height: 76px;
    padding: 10px 13px !important;
    gap: 12px;
    align-items: center;
    text-decoration: none !important;
}

.commercekit-wrapper .commercekit-ajs-product .commercekit-ajs-product-image {
    width: 58px;
    min-width: 58px;
    max-width: 58px;
    height: 58px;
    align-self: center;
    overflow: hidden;
    border-radius: 8px;
    background: #f1f3ef;
    box-shadow: inset 0 0 0 1px rgba(30, 73, 18, .08);
}

.commercekit-wrapper .commercekit-ajs-product .commercekit-ajs-product-image img {
    width: 58px !important;
    height: 58px !important;
    object-fit: cover;
    display: block;
    padding: 0 !important;
    margin: 0 !important;
}

.commercekit-wrapper .commercekit-ajs-product-desc {
    padding: 0 !important;
    gap: 3px;
}

.commercekit-wrapper .commercekit-ajs-product-title {
    color: var(--hpd-search-ink);
    font-size: 13.5px;
    line-height: 1.3;
    font-weight: 750;
    letter-spacing: -.01em;
}

.commercekit-wrapper .hpd-search-match {
    color: #55704b;
    font-size: 9.5px;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: .015em;
}

.commercekit-wrapper .commercekit-ajs-product-price,
.commercekit-wrapper .commercekit-ajs-product-price ins {
    color: #c98500 !important;
    font-size: 12.5px;
    line-height: 1.25;
    font-weight: 700;
    text-decoration: none;
}

.commercekit-wrapper .commercekit-ajs-product-price del {
    color: #8c9389 !important;
    font-weight: 500;
}

.commercekit-wrapper .commercekit-ajs-results span.match-text {
    text-decoration: none !important;
    font-weight: inherit;
    color: inherit;
}

/* HPD category result */
.commercekit-wrapper .autocomplete-suggestion > a.hpd-search-category {
    min-height: 68px;
    padding: 10px 13px !important;
    display: flex;
    align-items: center;
    gap: 11px;
    background: linear-gradient(90deg, #f4f8f1 0%, #fbfcfa 100%);
    color: var(--hpd-search-green) !important;
    text-decoration: none !important;
}

.commercekit-wrapper .hpd-search-category-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--hpd-search-green);
    box-shadow: 0 4px 10px rgba(33, 77, 18, .14);
}

.commercekit-wrapper .hpd-search-category-icon svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

.commercekit-wrapper .hpd-search-category-copy {
    min-width: 0;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 1px;
}

.commercekit-wrapper .hpd-search-eyebrow {
    color: var(--hpd-search-green-2);
    font-size: 9.5px;
    line-height: 1.25;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.commercekit-wrapper .hpd-search-category-title {
    color: var(--hpd-search-ink);
    font-size: 13.5px;
    line-height: 1.3;
    font-weight: 750;
}

.commercekit-wrapper .hpd-search-row-arrow {
    margin-left: auto;
    color: var(--hpd-search-green);
    font-size: 20px;
    line-height: 1;
    font-weight: 500;
    transition: transform .15s ease;
}

.commercekit-wrapper .hpd-search-category:hover .hpd-search-row-arrow,
.commercekit-wrapper .hpd-search-other:hover .hpd-search-row-arrow {
    transform: translateX(3px);
}

/* View-all CTAs — remove the generic black CommerceKit bars */
.commercekit-wrapper .commercekit-ajs-view-all-holder {
    width: 100% !important;
    background: #fff;
}

.commercekit-wrapper .commercekit-ajs-view-all-holder > a {
    position: relative;
    height: auto !important;
    min-height: 45px;
    line-height: 1.25 !important;
    padding: 14px 42px 14px 14px;
    background: var(--hpd-search-cream) !important;
    color: var(--hpd-search-green) !important;
    text-align: left;
    text-transform: none !important;
    font-size: 12px !important;
    font-weight: 750 !important;
    letter-spacing: 0 !important;
    text-decoration: none !important;
    border-bottom: 1px solid var(--hpd-search-line);
}

.commercekit-wrapper .commercekit-ajs-view-all-holder > a::after {
    content: "→";
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-52%);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--hpd-search-yellow);
    color: #172015;
    font-size: 14px;
    transition: transform .15s ease;
}

.commercekit-wrapper .commercekit-ajs-view-all-holder > a:hover {
    background: #fff8e8 !important;
}

.commercekit-wrapper .commercekit-ajs-view-all-holder > a:hover::after {
    transform: translate(3px, -52%);
}

/* Advice section */
.commercekit-wrapper .commercekit-ajs-other-result {
    height: auto !important;
    line-height: 1.2 !important;
    padding: 12px 14px 9px !important;
    background: #fff !important;
    color: var(--hpd-search-green) !important;
    font-size: 10px !important;
    font-weight: 800;
    letter-spacing: .09em !important;
    text-transform: uppercase;
    border-bottom: 1px solid var(--hpd-search-line);
}

.commercekit-wrapper .autocomplete-suggestion > a.hpd-search-other {
    min-height: 49px;
    padding: 9px 13px !important;
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--hpd-search-ink) !important;
    text-decoration: none !important;
}

.commercekit-wrapper .hpd-search-other-title {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12.5px;
    line-height: 1.35;
    font-weight: 600;
}

.commercekit-wrapper .hpd-search-type {
    flex: 0 0 auto;
    padding: 4px 7px;
    border: 1px solid #d8e3d2;
    border-radius: 999px;
    background: #f5f8f3;
    color: #56704c;
    font-size: 8.5px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.commercekit-wrapper .hpd-search-type-hpd_care_guide {
    background: #eef6ea;
    border-color: #d2e5ca;
    color: #3e6c31;
}

.commercekit-wrapper .hpd-search-type-hpd_qa {
    background: #fff7e4;
    border-color: #f1dfb1;
    color: #8a650b;
}

.commercekit-wrapper .hpd-search-other .hpd-search-row-arrow {
    color: #9aa296;
    font-size: 18px;
}

/* Empty state */
.commercekit-wrapper .autocomplete-no-suggestion {
    padding: 22px 16px;
    line-height: 1.4 !important;
    color: var(--hpd-search-muted);
    font-size: 12.5px !important;
    background: #fff;
}

/* Scrollbar */
.commercekit-wrapper .commercekit-ajs-results::-webkit-scrollbar {
    width: 7px;
}
.commercekit-wrapper .commercekit-ajs-results::-webkit-scrollbar-track {
    background: transparent;
}
.commercekit-wrapper .commercekit-ajs-results::-webkit-scrollbar-thumb {
    background: #c9d2c4;
    border: 2px solid #fff;
    border-radius: 999px;
}

/* Mobile: keep the same visual language but save vertical space. */
@media (max-width: 767px) {
    .commercekit-wrapper .commercekit-ajs-results {
        margin-top: 5px !important;
        max-height: calc(100dvh - 150px) !important;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        border-radius: 10px;
        box-shadow: 0 14px 34px rgba(25, 54, 18, .2);
    }

    .commercekit-wrapper .autocomplete-suggestion > a.commercekit-ajs-product {
        min-height: 66px;
        padding: 8px 10px !important;
        gap: 10px;
    }

    .commercekit-wrapper .commercekit-ajs-product .commercekit-ajs-product-image,
    .commercekit-wrapper .commercekit-ajs-product .commercekit-ajs-product-image img {
        width: 50px !important;
        min-width: 50px;
        max-width: 50px;
        height: 50px !important;
    }

    .commercekit-wrapper .autocomplete-suggestion > a.hpd-search-category {
        min-height: 60px;
        padding: 8px 10px !important;
    }

    .commercekit-wrapper .hpd-search-category-icon {
        width: 34px;
        height: 34px;
        min-width: 34px;
    }

    .commercekit-wrapper .hpd-search-type {
        display: none;
    }

    .commercekit-wrapper .hpd-search-other-title {
        font-size: 12px;
    }

    .commercekit-wrapper .hpd-search-match {
        font-size: 9px;
    }
}

/* ==========================================================
   HPD full search results page
   ========================================================== */

/* Shoptimizer outputs its own WooCommerce breadcrumb above our custom search
 * template. Hide that duplicate on search-result pages so the HPD breadcrumb
 * starts directly beneath the navigation instead of leaving a large dead gap.
 */
body.search.search-results .woocommerce-breadcrumb {
    display: none !important;
}

.hpd-search-page {
    --hpd-search-green: #214d12;
    --hpd-search-green-2: #376f2b;
    --hpd-search-green-soft: #f2f7ef;
    --hpd-search-yellow: #f6bd3c;
    --hpd-search-ink: #172015;
    --hpd-search-muted: #667061;
    --hpd-search-line: #e2e8de;
    --hpd-search-cream: #fbfaf6;
    margin: 0 !important;
    padding: 0 18px 64px;
    background: #fff;
    color: var(--hpd-search-ink);
}

.hpd-search-page__inner {
    width: min(1120px, 100%);
    margin: 0 auto;
}

.hpd-search-page__crumbs {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 14px 0 10px;
    font-size: 13px;
    line-height: 1.3;
    color: #7a8377;
}

.hpd-search-page__crumbs a {
    color: var(--hpd-search-green);
    text-decoration: none;
}

.hpd-search-page__crumbs a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.hpd-search-page__hero {
    padding: 24px 26px 26px;
    border: 1px solid #dfe8db;
    border-radius: 16px;
    background: linear-gradient(120deg, #f4f8f1 0%, #fbfcfa 58%, #fffaf0 100%);
}

.hpd-search-page__eyebrow,
.hpd-search-page__section-kicker {
    display: block;
    margin-bottom: 6px;
    color: var(--hpd-search-green-2);
    font-size: 11px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.hpd-search-page__hero h1 {
    margin: 0 0 8px;
    color: var(--hpd-search-green);
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1.05;
    letter-spacing: -.035em;
}

.hpd-search-page__hero p {
    margin: 0;
    max-width: 700px;
    color: var(--hpd-search-muted);
    font-size: 15px;
    line-height: 1.55;
}

.hpd-search-page__section {
    padding: 30px 0 0;
}

.hpd-search-page__section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.hpd-search-page__section-head h2 {
    margin: 0;
    color: var(--hpd-search-green);
    font-size: clamp(23px, 2.7vw, 31px);
    line-height: 1.15;
    letter-spacing: -.025em;
}

.hpd-search-page__count {
    flex: 0 0 auto;
    padding: 7px 11px;
    border: 1px solid #dce8d6;
    border-radius: 999px;
    background: var(--hpd-search-green-soft);
    color: var(--hpd-search-green);
    font-size: 12px;
    font-weight: 750;
}

.hpd-search-page__range-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 420px));
    gap: 12px;
}

.hpd-search-page__range-card {
    min-height: 84px;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 15px 16px;
    border: 1px solid #dbe5d7;
    border-radius: 13px;
    background: linear-gradient(100deg, #f2f7ef 0%, #fbfcfa 100%);
    color: var(--hpd-search-ink);
    text-decoration: none !important;
    box-shadow: 0 3px 12px rgba(33, 77, 18, .05);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.hpd-search-page__range-card:hover {
    transform: translateY(-2px);
    border-color: #bfd0b8;
    box-shadow: 0 10px 24px rgba(33, 77, 18, .10);
}

.hpd-search-page__range-icon {
    width: 46px;
    height: 46px;
    min-width: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--hpd-search-green);
}

.hpd-search-page__range-icon svg {
    width: 21px;
    height: 21px;
    fill: #fff;
}

.hpd-search-page__range-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hpd-search-page__range-copy > span {
    color: var(--hpd-search-green-2);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.hpd-search-page__range-copy strong {
    color: var(--hpd-search-ink);
    font-size: 16px;
    line-height: 1.25;
}

.hpd-search-page__range-arrow {
    margin-left: auto;
    color: var(--hpd-search-green);
    font-size: 24px;
    transition: transform .15s ease;
}

.hpd-search-page__range-card:hover .hpd-search-page__range-arrow {
    transform: translateX(3px);
}

/* Two roomy horizontal product cards per row matches HPD's catalogue language
 * better than squeezing three narrow cards across the page.
 */
.hpd-search-page__product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.hpd-search-page__product-card {
    min-width: 0;
    height: 190px;
    min-height: 190px;
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid var(--hpd-search-line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(27, 54, 20, .06);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.hpd-search-page__product-card:hover {
    transform: translateY(-3px);
    border-color: #cfddca;
    box-shadow: 0 12px 28px rgba(27, 54, 20, .12);
}

.hpd-search-page__product-image {
    display: block;
    width: 190px;
    height: 190px;
    min-width: 190px;
    min-height: 190px;
    overflow: hidden;
    background: #f2f4f0;
}

.hpd-search-page__product-image img {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    object-fit: cover !important;
    object-position: center center;
    display: block;
    transition: transform .25s ease;
}

.hpd-search-page__product-card:hover .hpd-search-page__product-image img {
    transform: scale(1.025);
}

.hpd-search-page__product-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 18px;
}

.hpd-search-page__match-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 9px;
}

.hpd-search-page__match-row span {
    padding: 4px 7px;
    border: 1px solid #d4e4ce;
    border-radius: 999px;
    background: #eef6ea;
    color: #476e3d;
    font-size: 9px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: .035em;
}

.hpd-search-page__product-body h3 {
    margin: 0 0 7px;
    font-size: 18px;
    line-height: 1.25;
    letter-spacing: -.015em;
}

.hpd-search-page__product-body h3 a {
    color: var(--hpd-search-ink);
    text-decoration: none;
}

.hpd-search-page__product-body h3 a:hover {
    color: var(--hpd-search-green);
}

.hpd-search-page__price {
    min-height: 24px;
    margin-bottom: 14px;
    color: #c98500;
    font-size: 16px;
    font-weight: 800;
}

.hpd-search-page__price ins {
    color: inherit;
    text-decoration: none;
}

.hpd-search-page__price del {
    color: #8a9187;
    font-weight: 500;
}

.hpd-search-page__product-cta {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 8px;
    color: var(--hpd-search-green) !important;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none !important;
}

.hpd-search-page__product-cta span {
    width: 25px;
    height: 25px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--hpd-search-yellow);
    color: #172015;
    transition: transform .15s ease;
}

.hpd-search-page__product-cta:hover span {
    transform: translateX(3px);
}

.hpd-search-page__advice {
    margin-top: 2px;
    padding-top: 30px;
    border-top: 1px solid var(--hpd-search-line);
}

.hpd-search-page__advice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.hpd-search-page__advice-card {
    position: relative;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding: 15px 52px 15px 16px;
    border: 1px solid var(--hpd-search-line);
    border-radius: 12px;
    background: var(--hpd-search-cream);
    color: var(--hpd-search-ink) !important;
    text-decoration: none !important;
    transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}

.hpd-search-page__advice-card:hover {
    transform: translateY(-1px);
    background: #fff8e8;
    border-color: #ead79e;
}

.hpd-search-page__advice-type {
    color: var(--hpd-search-green-2);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.hpd-search-page__advice-card strong {
    font-size: 14px;
    line-height: 1.35;
}

.hpd-search-page__advice-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--hpd-search-yellow);
    color: #172015;
}

.hpd-search-page__pagination {
    margin-top: 28px;
}

.hpd-search-page__pagination ul {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    justify-content: center;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hpd-search-page__pagination a,
.hpd-search-page__pagination span {
    min-width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 11px;
    border: 1px solid var(--hpd-search-line);
    border-radius: 9px;
    background: #fff;
    color: var(--hpd-search-green);
    text-decoration: none;
    font-size: 12px;
    font-weight: 750;
}

.hpd-search-page__pagination .current {
    background: var(--hpd-search-green);
    border-color: var(--hpd-search-green);
    color: #fff;
}

.hpd-search-page__empty {
    padding: 24px;
    border: 1px solid var(--hpd-search-line);
    border-radius: 13px;
    background: var(--hpd-search-cream);
}

.hpd-search-page__empty h3 {
    margin: 0 0 7px;
    color: var(--hpd-search-green);
}

.hpd-search-page__empty p {
    margin: 0;
    color: var(--hpd-search-muted);
}

@media (max-width: 900px) {
    .hpd-search-page__product-grid,
    .hpd-search-page__range-grid {
        grid-template-columns: 1fr;
    }

    .hpd-search-page__range-card {
        max-width: 520px;
    }
}

@media (max-width: 640px) {
    .hpd-search-page {
        padding: 0 12px 48px;
    }

    .hpd-search-page__crumbs {
        padding: 10px 2px 8px;
        font-size: 12px;
    }

    .hpd-search-page__hero {
        padding: 19px 18px 21px;
        border-radius: 13px;
    }

    .hpd-search-page__hero h1 {
        font-size: 30px;
    }

    .hpd-search-page__hero p {
        font-size: 14px;
    }

    .hpd-search-page__section {
        padding-top: 25px;
    }

    .hpd-search-page__section-head {
        align-items: center;
        gap: 10px;
        margin-bottom: 13px;
    }

    .hpd-search-page__section-head h2 {
        font-size: 24px;
    }

    .hpd-search-page__count {
        padding: 6px 9px;
        font-size: 11px;
    }

    .hpd-search-page__range-grid,
    .hpd-search-page__product-grid,
    .hpd-search-page__advice-grid {
        grid-template-columns: 1fr;
    }

    .hpd-search-page__product-card {
        height: 148px;
        min-height: 148px;
        grid-template-columns: 108px minmax(0, 1fr);
    }

    .hpd-search-page__product-image {
        width: 108px;
        height: 148px;
        min-width: 108px;
        min-height: 148px;
    }

    .hpd-search-page__product-body {
        padding: 13px 14px;
    }

    .hpd-search-page__product-body h3 {
        font-size: 16px;
        line-height: 1.22;
    }

    .hpd-search-page__price {
        min-height: 0;
        margin-bottom: 9px;
        font-size: 14px;
    }

    .hpd-search-page__product-cta {
        font-size: 12px;
    }

    .hpd-search-page__match-row {
        margin-bottom: 6px;
    }

    .hpd-search-page__advice {
        padding-top: 25px;
    }
}
