﻿body.bm-live-search-open {
    overflow: hidden;
}

body.bm-live-search-open::before {
    content: "";
    position: fixed;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    z-index: 389;
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.12), transparent 36%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.68), rgba(0, 0, 0, 0.88));
    transition: opacity 180ms ease;
}

.bm-live-search-backdrop-layer {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
    z-index: 390;
}

.bm-live-search-backdrop-layer--viewport {
    position: fixed;
    inset: 0;
}

[class*="wd-header-search-form"] {
    z-index: 500 !important;
}

.bm-live-search-backdrop-layer.is-active {
    opacity: 1;
    pointer-events: auto;
}

body.bm-live-search-open .bm-live-search-backdrop-layer--viewport {
    opacity: 1;
    pointer-events: auto;
}

.bm-live-search-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.12), transparent 36%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.68), rgba(0, 0, 0, 0.88));
}

.bm-live-search,
.bm-live-search-root-active {
    position: relative;
    z-index: 410;
    width: 100%;
    max-width: 100%;
}

.bm-live-search,
.bm-live-search * {
    box-sizing: border-box;
}

.wd-search-full-screen,
.wd-search-full-screen-2,
.wd-search-dropdown,
.wd-header-search {
    z-index: 400;
}

.bm-live-search__shell {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    grid-template-areas: "icon input submit close";
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 8px 10px 8px 16px;
    border-radius: 30px;
    background: rgb(248 248 248);
    width: 100%;
    max-width: 100%;
}

.bm-live-search__icon {
    grid-area: icon;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: #111827;
    flex: 0 0 auto;
}

.bm-live-search__icon svg {
    width: 100%;
    height: 100%;
}

.bm-live-search__icon-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(17, 24, 39, 0.18);
    border-top-color: #111827;
    border-radius: 999px;
    animation: bm-live-search-spin 0.7s linear infinite;
}

.bm-live-search__icon-spinner[hidden] {
    display: none !important;
}

.bm-live-search__input {
    grid-area: input;
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
    font-size: 16px;
    color: #0f172a;
}

.bm-live-search__load-more:hover {
    color: white !important;
}

.bm-live-search__input:focus {
    outline: none;
}

.bm-live-search--is-loading .bm-live-search__submit {
    visibility: hidden;
    pointer-events: none;
}

.bm-live-search--is-loading .bm-live-search__icon-svg {
    display: none;
}

.bm-live-search__submit,
.bm-live-search__load-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 40px;
    border: 0;
    border-radius: 999px;
    background: #b39d7c;
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 160ms ease, opacity 160ms ease;
}

.bm-live-search__load-more[disabled] {
    cursor: wait;
}

.bm-live-search__load-more-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 999px;
    animation: bm-live-search-spin 0.7s linear infinite;
}

.bm-live-search__load-more-spinner[hidden] {
    display: none !important;
}

.bm-live-search__submit {
    grid-area: submit;
}

.bm-live-search__close {
    grid-area: close;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 42px;
    min-width: 42px;
    height: 42px;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: transparent !important;
    color: #64748b !important;
    cursor: pointer !important;
    transition: background-color 160ms ease, color 160ms ease !important;
}

.bm-live-search__close[hidden] {
    display: none !important;
}

.bm-live-search__close:hover {
    background: rgba(15, 23, 42, 0.06);
    color: #0f172a;
}

.bm-live-search__close span {
    font-size: 24px;
    line-height: 1;
}

.bm-live-search__submit:hover,
.bm-live-search__load-more:hover {
    font-weight: bold;
}

@keyframes bm-live-search-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Dropdown layout: sidebar on the left, products on the right. */
.bm-live-search__dropdown {
    --bm-live-search-dropdown-shift: 0px;
    position: absolute;
    top: calc(100% + 14px);
    left: 50%;
    width: min(1500px, calc(100vw - 40px));
    max-width: calc(100vw - 40px);
    max-height: min(80vh, calc(100vh - 120px));
    display: flex;
    flex-direction: column;
    transform: translateX(calc(-50% + var(--bm-live-search-dropdown-shift)));
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 248, 251, 0.97));
    box-shadow: 0 40px 80px rgba(15, 23, 42, 0.28);
    overflow: hidden;
    z-index: 420;
    border-radius: 10px;
}

.bm-live-search__dropdown[hidden] {
    display: none !important;
}

.bm-live-search__dropdown-inner {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    min-height: 0;
    height: 100%;
    flex: 1 1 auto;
}

.bm-live-search__dropdown-inner--no-sidebar {
    grid-template-columns: minmax(0, 1fr);
}

/* Sidebar lists related categories and pages as compact rows. */
.bm-live-search__sidebar {
    padding: 20px 15px 15px 15px;
    background: #f1f1f1;
    border-right: 1px solid rgba(148, 163, 184, 0.22);
    overflow-y: auto;
    min-height: 0;
}

.bm-live-search__sidebar[hidden] {
    display: none !important;
}

.bm-live-search__sidebar-section + .bm-live-search__sidebar-section {
    margin-top: 28px;
}

.bm-live-search__sidebar-section h4,
.bm-live-search__products-header h4 {
    margin: 0 0 12px;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #334155;
}

.bm-live-search__sidebar-section h4,
.bm-live-search__products-header h4 {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.bm-live-search__section-summary {
    margin-left: auto;
    text-align: right;
    font-weight: 400;
    color: #95999f;
    font-size: 14px;
    letter-spacing: normal;
    text-transform: none;
}

.bm-live-search__sidebar-list {
    display: grid;
    gap: 5px;
}

.bm-live-search__sidebar-item {
    display: block;
    padding: 12px 14px;
    border-radius: 10px;
    background: white;
    color: #0f172a;
    text-decoration: none;
}

.bm-live-search__sidebar-item span,
.bm-live-search__sidebar-item small {
    display: block;
    font-size: 13px;
}

.bm-live-search__sidebar-item-row {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.bm-live-search__sidebar-item-title {
    min-width: 0;
}

/*.bm-live-search__sidebar-page-title {*/
/*    font-weight: 700;*/
/*}*/

.bm-live-search__sidebar-item small {
    margin-top: 4px;
    color: #475569;
}

.bm-live-search__sidebar-item-count {
    flex: 0 0 auto;
    margin-top: 0 !important;
    color: #c4c4c4 !important;
    font-size: 12px;
    text-align: right;
}

/* Product grid and cards inside the dropdown body. */
.bm-live-search__products {
    position: relative;
    padding: 20px 15px 15px 15px;
    overflow-y: auto;
    min-height: 0;
    background: #f1f1f1;
}

.bm-live-search__products--with-results {
    padding-bottom: 100px;
}

button.bm-live-search__load-more, button.bm-live-search__load-more:hover {
    background: rgb(179, 157, 124);
    --background-color: #b39d7c;
    color: white;
    border-radius: 30px;
    padding-left: 30px;
    padding-right: 30px;
}

.bm-live-search__products-header {
    position: sticky;
    top: -20px;
    z-index: 3;
    margin: -20px -15px 0px;
    padding: 20px 15px 0px;
    background: #f1f1f1;
}

.bm-live-search__product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
    gap: 6px;
}

.bm-live-search__product-card {
    display: grid;
    grid-template-rows: minmax(160px, 190px) auto;
    overflow: hidden;
    border-radius: 10px;
    background: #fff;
    border: 0 solid rgba(226, 232, 240, 0.95);
    text-decoration: none;
    color: #0f172a;
}

.bm-live-search__product-media {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: clamp(160px, 18vw, 190px);
    overflow: hidden;
    padding: 10px;
}

.bm-live-search__dropdown-inner h4 {
    margin-top: 3px;
    font-size: 15px !important;
    margin-bottom: 11px;
    color: #1a1a1a;
}

.bm-live-search__product-media img {
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
}

.bm-live-search__product-placeholder {
    width: 72px;
    height: 72px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.25);
}

.bm-live-search__product-copy {
    display: grid;
    gap: 8px;
    padding: 16px 18px 18px;
    text-align: center;
    min-width: 0;
}

.bm-live-search__product-title {
    font-weight: 400;
    line-height: 1.4;
    font-size: 13px;
}

.bm-live-search__product-price {
    font-weight: 700;
    color: #0f172a;
}

.bm-live-search__product-prices {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    flex-wrap: wrap;
}

.bm-live-search__product-prices--sale .bm-live-search__product-price--regular {
    font-size: 12px;
    color: #94a3b8;
    text-decoration: line-through;
    font-weight: 500;
}

.bm-live-search__product-prices--sale .bm-live-search__product-price--sale {
    color: #0f172a;
    font-weight: 700;
}

/* Product status line supports stock dots, preorder text and out-of-stock styling. */
.bm-live-search__product-meta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    color: #475569;
}

.bm-live-search__product-meta.is-preorder:before {
    background: #cfb52d;
}

span.bm-live-search__product-meta.is-in-stock::before {
    background: #21a701;
}

.bm-live-search__product-meta::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #333;
    flex: 0 0 9px;
}

.bm-live-search__product-meta.is-in-stock {
    color: #333;
}

.bm-live-search__product-meta.is-supplier-stock {
    color: #333;
}

.bm-live-search__product-meta.is-preorder {
    color: #333;
}

.bm-live-search__product-meta.is-out-of-stock {
    color: #333;
}

/* Footer overlays the bottom of the product list with a soft gradient and the load-more CTA on top. */
.bm-live-search__footer {
    position: absolute;
    right: 0;
    bottom: 0;
    z-index: 6;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    width: calc(100% - 320px);
    padding: 72px 24px 24px;
    pointer-events: none;
}

.bm-live-search__footer--full-width {
    width: 100%;
}

.bm-live-search__footer .bm-live-search__load-more {
    position: relative;
    z-index: 1;
    pointer-events: auto;
}

.bm-live-search__footer[hidden] {
    display: none !important;
}

.bm-live-search__empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    text-align: center;
    color: #475569;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 20px;
}

/* Search-page summary styles for related categories/pages above WooCommerce results. */
.bm-search-page-summary {
    margin-bottom: 32px;
}

.bm-search-page-summary__inner {
    padding: 28px;
    border-radius: 24px;
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
}

.bm-search-page-summary__header h2,
.bm-search-page-summary__group h3 {
    margin: 0 0 10px;
}

.bm-search-page-summary__header p {
    margin: 0 0 22px;
    color: #475569;
}

.bm-search-page-summary__group + .bm-search-page-summary__group {
    margin-top: 18px;
}

.bm-search-page-summary__chips,
.bm-search-page-summary__links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.bm-search-page-summary__chip,
.bm-search-page-summary__link {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #0f172a;
    text-decoration: none;
}

@media (max-width: 1024px) {
    .bm-live-search__dropdown {
        width: min(100vw - 24px, 900px);
        max-width: calc(100vw - 24px);
        top: calc(100% + 4px);
    }

    .bm-live-search__dropdown-inner {
        grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    }

    .bm-live-search__product-card {
        grid-template-rows: minmax(96px, 114px) auto;
    }

    .bm-live-search__product-media {
        height: clamp(96px, 10.8vw, 114px);
    }

    .bm-live-search__product-grid {
        grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr));
    }
}

@media (min-width: 768px) and (max-width: 900px) {
    .bm-live-search__dropdown {
        width: 100vw;
        max-width: 100vw;
    }
}

@media (max-width: 767px) {
    body.bm-live-search-open::before {
        opacity: 1;
    }

    .bm-live-search-backdrop-layer--viewport .bm-live-search-backdrop {
        background: transparent;
    }

    .bm-live-search__products-header > h4,
    .bm-live-search__products-header > h4 > span,
    section.bm-live-search__sidebar-section > h4,
    section.bm-live-search__sidebar-section > h4 > span {
        font-size: 85% !important;
    }

    .bm-live-search__sidebar-item span,
    .bm-live-search__sidebar-item small {
        display: block;
        font-size: 12px;
    }

    .bm-live-search__footer {
        width: 100%;
        padding: 56px 12px 12px;
    }

    .bm-live-search-backdrop-layer--viewport {
        width: 100vw !important;
        height: 100dvh !important;
    }

    .bm-live-search__shell {
        min-height: 52px;
        gap: 0;
        padding: 8px 8px 8px 14px;
    }

    .bm-live-search__submit {
        min-height: 38px;
        padding: 0 16px;
        font-size: 14px;
    }

    .bm-live-search__dropdown {
        position: absolute;
        left: 50%;
        right: auto;
        top: calc(100% + 2px);
        bottom: auto;
        width: 100vw;
        max-width: 100vw;
        height: calc(100dvh - var(--bm-live-search-dropdown-viewport-top, 140px));
        max-height: calc(100dvh - var(--bm-live-search-dropdown-viewport-top, 140px));
        border-radius: 0px 0px 8px 8px;
        transform: translateX(calc(-50% + var(--bm-live-search-dropdown-shift)));
    }

    .bm-live-search__dropdown-inner {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(0, 1fr);
        height: 100%;
    }

    .bm-live-search__dropdown-inner--no-sidebar {
        grid-template-rows: minmax(0, 1fr);
    }

    .bm-live-search__sidebar {
        max-height: 220px;
        border-right: 0;
        border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    }

    .bm-live-search__products,
    .bm-live-search__sidebar {
        padding: 18px;
    }

    .bm-live-search__products-header {
        top: -18px;
        margin: -18px -18px 0;
        padding: 14px 18px 1px;
    }

    .bm-live-search__product-card {
        grid-template-rows: minmax(115px, 115px) auto;
    }

    .bm-live-search__product-media {
        height: clamp(120px, 24vw, 125px);
        padding: 8px;
    }

    .bm-live-search__product-copy {
        gap: 6px;
        padding: 12px 12px 14px;
    }

    .bm-live-search__product-title,
    .bm-live-search__product-meta {
        font-size: 11px;
    }

    .bm-search-page-summary__inner {
        padding: 20px;
    }
}

@media (min-width: 500px) and (max-width: 767px) {
    .bm-live-search__sidebar-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
}

@media (max-width: 560px) {
    .bm-live-search__sidebar {
        max-height: 193px;
    }

    .bm-live-search__products,
    .bm-live-search__sidebar {
        padding: 12px 12px 15px 15px;
    }

    .bm-live-search__product-price {
        font-size: 13px;
    }

    .bm-live-search__shell {
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas: "icon input close";
        min-height: 48px;
        gap: 8px;
    }

    .bm-live-search__submit {
        display: none !important;
    }

    .bm-live-search__close {
        justify-self: auto;
    }

    .bm-live-search__product-grid {
        grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr));
        gap: 10px;
    }
}

@media (max-width: 450px) {
    .bm-live-search__submit, .bm-live-search__load-more {
        width: 100%;
    }

    .bm-live-search__product-grid {
        gap: 8px;
    }

    .bm-live-search__product-card {
        grid-template-rows: minmax(96px, 116px) auto;
    }

    .bm-live-search__product-media {
        height: clamp(96px, 26vw, 116px);
        padding: 6px;
    }

    .bm-live-search__product-copy {
        gap: 5px;
        padding: 10px 10px 12px;
    }
}

@media (max-width: 420px) {
    .bm-live-search__sidebar {
        max-height: 200px;
    }

    .bm-live-search__shell {
        padding: 10px 10px 10px 12px;
    }

    .bm-live-search__dropdown {
        width: 100vw;
        max-width: 100vw;
    }

    .bm-live-search__products,
    .bm-live-search__sidebar,
    .bm-live-search__footer {
        padding-left: 14px;
        padding-right: 14px;
    }

    .bm-live-search__products-header {
        margin-left: -14px;
        margin-right: -14px;
        padding-left: 14px;
        padding-right: 14px;
    }

    .bm-live-search__product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bm-live-search__product-media {
        height: clamp(110px, 32vw, 135px);
    }
}
