/**
 * Bull Search - Modern Search Modal
 * @author Bullmade
 */

/* ============================================
   CSS Variables
   ============================================ */
.bm-search-container {
    --bm-primary: var(--bs-primary, #000);
    --bm-primary-rgb: var(--bs-primary-rgb, 13, 110, 253);
    --bm-body-color: var(--bs-body-color, #212529);
    --bm-highlight: var(--bm-primary);
    --bm-gray-100: var(--bs-gray-100, #f8f9fa);
    --bm-gray-200: var(--bs-gray-200, #e9ecef);
    --bm-gray-300: var(--bs-gray-300, #dee2e6);
    --bm-gray-400: var(--bs-gray-400, #ced4da);
    --bm-gray-500: var(--bs-gray-500, #6c757d);
    --bm-gray-600: var(--bs-gray-600, #6c757d);
    --bm-white: var(--bs-white, #fff);
    --bm-radius: 0;
    --bm-radius-sm: 0.5rem;
    --bm-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --bm-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    /* Configurable color overrides - fallback to gray values */
    --bm-hover: var(--bm-gray-100);
    --bm-border: var(--bm-gray-200);
    --bm-secondary: var(--bm-gray-500);
    --bm-overlay: #000;
    --bm-overlay-rgb: 0, 0, 0;
}

/* ============================================
   Search Trigger
   ============================================ */
.bm-search-trigger {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.5rem 0.5rem;
    border: unset;
    background: unset;
    cursor: pointer;
    transition: all var(--bm-transition);
    text-align: left;
}

.bm-search-trigger svg {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--bm-secondary);
}

.bm-search-trigger-text {
    flex: 1;
    font-size: 0.875rem;
    color: var(--bm-secondary);
    font-family: inherit;
    font-weight: 400;
}

/* Mock Input Trigger */
.bm-search-trigger-mock {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.625rem 1rem;
    background: var(--bm-white);
    border: 1px solid var(--bm-border);
    border-radius: 100vmax;
    cursor: text;
}

.bm-search-trigger-mock:hover {
    border-color: var(--bm-secondary);
}

.bm-search-trigger-mock:focus {
    border-color: var(--bm-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--bm-primary-rgb), 0.1);
}

.bm-search-mock-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bm-secondary);
    flex-shrink: 0;
}

.bm-search-mock-icon svg {
    width: 1.125rem;
    height: 1.125rem;
}

.bm-search-mock-placeholder {
    flex: 1;
    font-size: 0.875rem;
    color: var(--bm-secondary);
    font-family: inherit;
    font-weight: 400;
    text-align: left;
}

/* Mock input on mobile */
@media (max-width: 992px) {
    .bm-search-trigger-mock {
        max-width: none;
    }
}

/* ============================================
   Overlay
   ============================================ */
.bm-search-overlay {
    display: none;
    position: fixed;
    inset: 0;
    /* background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px); */
    z-index: 1050;
}

body.bm-search-overlay-active .bm-search-overlay {
    display: block;
    animation: bm-overlayIn 0.3s ease-out;
}

@keyframes bm-overlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================
   Modal Popover
   ============================================ */
.bm-search-popover {
    display: none;
    position: fixed;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 2rem);
    max-width: 640px;
    background: var(--bm-white);
    border-radius: var(--bm-radius);
    box-shadow: var(--bm-shadow), 0 0 100vw 100vw rgba(var(--bm-overlay-rgb), 0.2);
    z-index: 1055;
    max-height: 80vh;
    overflow: hidden;
    flex-direction: column;
}

/* Wider modal on desktop when sidebar is present */
@media (min-width: 993px) {
    .bm-search-container.bm-search-has-sidebar .bm-search-popover {
        max-width: 900px;
    }
}

.bm-search-container.bm-search-active .bm-search-popover {
    display: flex;
    animation: bm-modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bm-modalIn {
    from {
        opacity: 0;
        transform: translateX(-50%) scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) scale(1) translateY(0);
    }
}

/* ============================================
   Search Header / Input Area
   ============================================ */
.bm-search-header {
    flex-shrink: 0;
    border-bottom: 1px solid var(--bm-border);
}

.bm-search-form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.bm-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    background: var(--bm-white);
    border: unset;
    transition: all var(--bm-transition);
    overflow: hidden;
}

.bm-search-input-wrapper:focus-within {
    border-color: var(--bm-primary);
    /* box-shadow: 0 0 0 4px rgba(var(--bm-primary-rgb), 0.1); */
}

.bm-search-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 0 0.875rem 1.25rem;
    color: var(--bm-secondary);
    transition: color var(--bm-transition);
}

.bm-search-input-wrapper:focus-within .bm-search-icon {
    color: var(--bm-primary);
}

.bm-search-icon svg {
    width: 1.5rem;
    height: 1.5rem;
}

.bm-search-input {
    flex: 1;
    border: none;
    padding: 0.875rem 1rem;
    font-size: 1.125rem;
    font-family: inherit;
    font-weight: 400;
    background: transparent;
    outline: none;
    min-width: 0;
    border-radius: 0;
    color: var(--bm-body-color);
}

.bm-search-input::placeholder {
    color: var(--bm-secondary);
}

/* Search Submit Button - Hidden */
.bm-search-btn {
    display: none;
}

/* Clear Button */
.bm-search-clear {
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--bm-hover);
    border: none;
    width: 1.75rem;
    height: 1.75rem;
    margin-right: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--bm-transition);
    color: var(--bm-secondary);
}

.bm-search-clear:hover {
    background: var(--bm-border);
    color: var(--bm-body-color);
}

.bm-search-clear svg {
    width: 1rem;
    height: 1rem;
}

.bm-search-container.bm-search-has-value .bm-search-clear {
    display: flex;
}

/* Close Button */
.bm-search-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--bm-secondary);
    transition: all var(--bm-transition);
    margin-inline: 0.5rem;
    flex-shrink: 0;
}

.bm-search-close:hover {
    background: var(--bm-hover);
    color: var(--bm-body-color);
}

.bm-search-close svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* ============================================
   Search Body - Scrollable Results Area
   ============================================ */
.bm-search-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 200px;
    max-height: calc(80vh - 160px);
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
.bm-search-body::-webkit-scrollbar {
    width: 6px;
}

.bm-search-body::-webkit-scrollbar-track {
    background: transparent;
}

.bm-search-body::-webkit-scrollbar-thumb {
    background: var(--bm-border);
    border-radius: 3px;
}

.bm-search-body::-webkit-scrollbar-thumb:hover {
    background: var(--bm-secondary);
}

/* ============================================
   Initial State
   ============================================ */
.bm-search-initial-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3.5rem 2rem;
    text-align: center;
}

.bm-search-initial-state svg {
    width: 3.5rem;
    height: 3.5rem;
    color: var(--bm-gray-300);
    margin-bottom: 1rem;
    opacity: 0.7;
}

.bm-search-initial-state p {
    margin: 0;
    font-size: 0.9375rem;
    color: var(--bm-secondary);
    font-weight: 500;
}

.bm-search-container.bm-search-is-loading .bm-search-initial-state,
.bm-search-container.bm-search-has-results .bm-search-initial-state,
.bm-search-container.bm-search-no-results .bm-search-initial-state {
    display: none;
}

/* ============================================
   Loading State
   ============================================ */
.bm-search-loading {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3.5rem 2rem;
    text-align: center;
}

.bm-search-container.bm-search-is-loading .bm-search-loading {
    display: flex;
}

.bm-search-loading-spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid var(--bm-border);
    border-top-color: var(--bm-primary);
    border-radius: 50%;
    animation: bm-spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

@keyframes bm-spin {
    to { transform: rotate(360deg); }
}

.bm-search-loading p {
    margin: 0;
    font-size: 0.9375rem;
    color: var(--bm-secondary);
    font-weight: 500;
}

/* ============================================
   No Results State
   ============================================ */
.bm-search-no-results-msg {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3.5rem 2rem;
    text-align: center;
}

.bm-search-no-results-msg svg {
    width: 3.5rem;
    height: 3.5rem;
    color: var(--bm-gray-300);
    margin-bottom: 1rem;
    opacity: 0.7;
}

.bm-search-no-results-msg p {
    margin: 0;
    font-size: 0.9375rem;
    color: var(--bm-secondary);
    font-weight: 500;
}

.bm-search-container.bm-search-no-results .bm-search-no-results-msg {
    display: flex;
    padding: 1.5rem 2rem;
}

/* More compact no-results when showing with default products */
.bm-search-container.bm-search-no-results.bm-search-has-defaults .bm-search-no-results-msg {
    padding: 1rem 1.25rem;
    flex-direction: row;
    gap: 0.75rem;
    justify-content: flex-start;
    border-bottom: 1px solid var(--bm-border);
}

.bm-search-container.bm-search-no-results.bm-search-has-defaults .bm-search-no-results-msg svg {
    width: 1.5rem;
    height: 1.5rem;
    margin-bottom: 0;
}

.bm-search-container.bm-search-no-results.bm-search-has-defaults .bm-search-no-results-msg p {
    font-size: 0.875rem;
}

/* ============================================
   Default Products (shown when input is empty)
   ============================================ */
.bm-search-default-products {
    display: none;
}

.bm-search-container.bm-search-has-defaults .bm-search-default-products {
    display: block;
}

/* Hide default products when has results or is loading */
.bm-search-container.bm-search-has-results .bm-search-default-products,
.bm-search-container.bm-search-is-loading .bm-search-default-products {
    display: none;
}

/* Show default products when no results */
.bm-search-container.bm-search-no-results.bm-search-has-defaults .bm-search-default-products {
    display: block;
}

/* Hide initial state when showing defaults */
.bm-search-container.bm-search-has-defaults .bm-search-initial-state {
    display: none;
}

.bm-search-default-products-loading {
    display: none;
    justify-content: center;
    padding: 2rem;
}

.bm-search-container.bm-search-loading-defaults .bm-search-default-products-loading {
    display: flex;
}

.bm-search-container.bm-search-loading-defaults .bm-search-default-products-list {
    display: none;
}

/* Popular Searches */
.bm-search-popular-searches {
    display: none;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--bm-border);
}

/* Show popular searches when has defaults or no results */
.bm-search-container.bm-search-has-defaults .bm-search-popular-searches.has-content,
.bm-search-container.bm-search-no-results .bm-search-popular-searches.has-content {
    display: block;
}

/* Hide popular searches when has results or is loading or is searching */
.bm-search-container.bm-search-has-results .bm-search-popular-searches,
.bm-search-container.bm-search-is-loading .bm-search-popular-searches,
.bm-search-container.bm-search-is-searching .bm-search-popular-searches {
    display: none;
}

/* But show in no-results state even after searching */
.bm-search-container.bm-search-no-results .bm-search-popular-searches.has-content {
    display: block;
}

.bm-search-popular-title {
    display: block;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--bm-secondary);
    margin-bottom: 0.75rem;
}

.bm-search-popular-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.bm-search-popular-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    background: var(--bm-hover);
    border: 1px solid var(--bm-border);
    border-radius: 50px;
    font-size: 0.8125rem;
    color: var(--bm-body-color);
    text-decoration: none;
    transition: all var(--bm-transition);
    cursor: pointer;
}

.bm-search-popular-tag:hover {
    background: var(--bm-primary);
    border-color: var(--bm-primary);
    color: var(--bm-white);
    text-decoration: none;
}

/* Default Products Carousel Header */
.bm-search-default-products-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem 0.5rem;
}

.bm-search-container.bm-search-has-defaults .bm-search-default-products-header,
.bm-search-container.bm-search-no-results.bm-search-has-defaults .bm-search-default-products-header {
    display: flex;
}

.bm-search-default-products-title {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--bm-secondary);
}

.bm-search-carousel-nav {
    display: flex;
    gap: 0.25rem;
}

.bm-search-carousel-prev,
.bm-search-carousel-next {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: var(--bm-hover);
    border: 1px solid var(--bm-border);
    border-radius: 50%;
    cursor: pointer;
    color: var(--bm-secondary);
    transition: all var(--bm-transition);
}

.bm-search-carousel-prev:hover,
.bm-search-carousel-next:hover {
    background: var(--bm-primary);
    border-color: var(--bm-primary);
    color: var(--bm-white);
}

.bm-search-carousel-prev:disabled,
.bm-search-carousel-next:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.bm-search-carousel-prev:disabled:hover,
.bm-search-carousel-next:disabled:hover {
    background: var(--bm-hover);
    border-color: var(--bm-border);
    color: var(--bm-secondary);
}

.bm-search-carousel-prev svg,
.bm-search-carousel-next svg {
    width: 1rem;
    height: 1rem;
}

/* Carousel Wrapper */
.bm-search-carousel-wrapper {
    overflow: hidden;
    padding: 0 1.25rem 1rem;
}

.bm-search-default-products-list {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: x mandatory;
}

.bm-search-default-products-list::-webkit-scrollbar {
    display: none;
}

/* Carousel Product Card */
.bm-search-carousel-item {
    flex: 0 0 140px;
    scroll-snap-align: start;
}

.bm-search-carousel-item a {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--bm-body-color);
    transition: all var(--bm-transition);
}

.bm-search-carousel-item a:hover {
    text-decoration: none;
}

.bm-search-carousel-item-image {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--bm-radius-sm);
    overflow: hidden;
    background: var(--bm-hover);
    border: 1px solid var(--bm-border);
    margin-bottom: 0.5rem;
}

.bm-search-carousel-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--bm-transition);
}

.bm-search-carousel-item a:hover .bm-search-carousel-item-image img {
    transform: scale(1.05);
}

.bm-search-carousel-item-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--bm-body-color);
    margin: 0 0 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.bm-search-carousel-item-price {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--bm-body-color);
    margin: 0;
}

/* Did You Mean Section */
.bm-search-did-you-mean {
    display: none;
    padding: 1rem 1.25rem;
    background: var(--bm-hover);
    border-bottom: 1px solid var(--bm-border);
}

/* Show did you mean when has content and (no results or has results with few items) */
.bm-search-container.bm-search-no-results .bm-search-did-you-mean.has-content,
.bm-search-container.bm-search-has-results .bm-search-did-you-mean.has-content {
    display: block;
}

/* Hide did you mean when loading */
.bm-search-container.bm-search-is-loading .bm-search-did-you-mean {
    display: none;
}

.bm-search-did-you-mean-title {
    display: block;
    font-size: 0.8125rem;
    color: var(--bm-secondary);
    margin-bottom: 0.5rem;
}

.bm-search-did-you-mean-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.bm-search-suggestion {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    background: var(--bm-white);
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--bm-primary);
    text-decoration: none;
    transition: all var(--bm-transition);
    cursor: pointer;
}

.bm-search-suggestion:hover {
    background: var(--bm-primary);
    border-color: var(--bm-primary);
    color: var(--bm-white);
    text-decoration: none;
}

/* Hide did you mean when showing defaults (no search active) */
.bm-search-container.bm-search-has-defaults:not(.bm-search-no-results):not(.bm-search-has-results) .bm-search-did-you-mean {
    display: none;
}

/* ============================================
   Results
   ============================================ */
.bm-search-results-wrapper {
    display: none;
}

.bm-search-container.bm-search-has-results .bm-search-results-wrapper {
    display: flex;
    flex-direction: column;
}

.bm-search-results {
    display: block;
}

.bm-search-results:empty {
    display: none;
}

/* Desktop: Two-column layout with sidebar */
@media (min-width: 993px) {
    .bm-search-container.bm-search-has-sidebar .bm-search-results-wrapper {
        flex-direction: row;
    }

    .bm-search-container.bm-search-has-sidebar .bm-search-results-main {
        flex: 1;
        min-width: 0;
        border-right: 1px solid var(--bm-border);
    }

    .bm-search-container.bm-search-has-sidebar .bm-search-results-sidebar {
        width: 280px;
        flex-shrink: 0;
        background: var(--bm-hover);
    }

    .bm-search-container.bm-search-has-sidebar .bm-search-results-sidebar .bm-search-section {
        padding: 0.25rem 0;
    }

    .bm-search-container.bm-search-has-sidebar .bm-search-results-sidebar .bm-search-section:not(:last-child) {
        border-bottom: 1px solid var(--bm-border);
    }

    .bm-search-container.bm-search-has-sidebar .bm-search-results-sidebar .bm-search-section-title {
        padding: 0.5rem 1rem;
        font-size: 0.625rem;
        background: var(--bm-hover);
    }

    .bm-search-container.bm-search-has-sidebar .bm-search-results-sidebar .bm-search-items {
        padding: 0 0.375rem;
    }

    .bm-search-container.bm-search-has-sidebar .bm-search-results-sidebar .bm-search-item a {
        padding: 0.5rem 0.625rem;
        gap: 0.625rem;
    }

    .bm-search-container.bm-search-has-sidebar .bm-search-results-sidebar .bm-search-item-icon {
        width: 2rem;
        height: 2rem;
    }

    .bm-search-container.bm-search-has-sidebar .bm-search-results-sidebar .bm-search-item-icon svg {
        width: 1rem;
        height: 1rem;
    }

    .bm-search-container.bm-search-has-sidebar .bm-search-results-sidebar .bm-search-item-name {
        font-size: 0.8125rem;
        font-weight: 500;
    }

    .bm-search-container.bm-search-has-sidebar .bm-search-results-sidebar .bm-search-item-meta {
        font-size: 0.6875rem;
    }
}

/* Result Section */
.bm-search-section {
    padding: 0.5rem 0;
}

.bm-search-section:not(:last-child) {
    border-bottom: 1px solid var(--bm-border);
}

.bm-search-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--bm-secondary);
    margin: 0;
    position: sticky;
    top: 0;
    background: var(--bm-white);
    z-index: 1;
}

.bm-search-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--bm-border);
}

/* Result Items */
.bm-search-items {
    list-style: none;
    margin: 0;
    padding: 0 0.5rem;
}

.bm-search-item {
    margin: 0;
    padding: 0;
}

.bm-search-item a {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    text-decoration: none;
    color: var(--bm-body-color);
    border-radius: var(--bm-radius-sm);
    transition: all var(--bm-transition);
    gap: 1rem;
}

.bm-search-item a:hover,
.bm-search-item a:focus {
    background: var(--bm-hover);
    text-decoration: none;
    color: var(--bm-body-color);
    transform: translateX(4px);
}

.bm-search-item a:focus {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--bm-primary);
}

/* Item Image */
.bm-search-item-image {
    width: 3.5rem;
    height: 3.5rem;
    flex-shrink: 0;
    border-radius: var(--bm-radius-sm);
    overflow: hidden;
    background: var(--bm-hover);
    border: 1px solid var(--bm-border);
}

.bm-search-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--bm-transition);
}

.bm-search-item a:hover .bm-search-item-image img {
    transform: scale(1.05);
}

/* Item Icon */
.bm-search-item-icon {
    width: 2.75rem;
    height: 2.75rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bm-hover), var(--bm-border));
    border-radius: var(--bm-radius-sm);
    color: var(--bm-secondary);
    transition: all var(--bm-transition);
}

.bm-search-item a:hover .bm-search-item-icon {
    background: linear-gradient(135deg, rgba(var(--bm-primary-rgb), 0.1), rgba(var(--bm-primary-rgb), 0.2));
    color: var(--bm-primary);
}

.bm-search-item-icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Item Content */
.bm-search-item-content {
    flex: 1;
    min-width: 0;
}

.bm-search-item-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--bm-body-color);
    margin: 0 0 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.bm-search-item-meta {
    font-size: 0.8125rem;
    color: var(--bm-secondary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Item Price */
.bm-search-item-price {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--bm-body-color);
    flex-shrink: 0;
    padding: 0.25rem 0.75rem;
    background: rgba(var(--bm-primary-rgb), 0.5);
    border-radius: 50px;
}

/* Color Swatch */
.bm-search-item-color {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    border: 2px solid var(--bm-white);
    box-shadow: 0 0 0 1px var(--bm-gray-300), 0 2px 4px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

/* Highlight */
.bm-search-highlight {
    background: color-mix(in srgb, var(--bm-highlight) 25%, transparent);
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-weight: 600;
}

/* Fallback for browsers without color-mix */
@supports not (background: color-mix(in srgb, red 50%, blue)) {
    .bm-search-highlight {
        background: linear-gradient(120deg, rgba(var(--bm-primary-rgb), 0.2), rgba(var(--bm-primary-rgb), 0.3));
    }
}

/* Boosted/Promoted Items */
.bm-search-item-boosted {
    position: relative;
}

.bm-search-item-boosted a {
    background: linear-gradient(135deg, rgba(var(--bm-primary-rgb), 0.03), rgba(var(--bm-primary-rgb), 0.08));
    border-left: 3px solid var(--bm-primary);
}

.bm-search-item-boosted a:hover {
    background: linear-gradient(135deg, rgba(var(--bm-primary-rgb), 0.08), rgba(var(--bm-primary-rgb), 0.12));
}

/* ============================================
   View All Link
   ============================================ */
.bm-search-view-all {
    display: none;
    padding: 1rem 1.25rem;
    text-align: center;
    background: var(--bm-hover);
    color: var(--bm-primary);
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    transition: all var(--bm-transition);
    flex-shrink: 0;
    border-top: 1px solid var(--bm-border);
}

.bm-search-container.bm-search-has-results .bm-search-view-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.bm-search-view-all::after {
    content: '→';
    transition: transform var(--bm-transition);
}

.bm-search-view-all:hover,
.bm-search-view-all:focus {
    background: var(--bm-primary);
    color: var(--bm-white);
    text-decoration: none;
}

.bm-search-view-all:hover::after {
    transform: translateX(4px);
}

/* ============================================
   Mobile Styles
   ============================================ */
@media (max-width: 992px) {
    .bm-search-popover {
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        transform: none;
        width: 100%;
        max-width: none;
        max-height: none;
        border-radius: 0;
    }

    .bm-search-container.bm-search-active .bm-search-popover {
        animation: bm-modalInMobile 0.3s ease-out;
    }

    @keyframes bm-modalInMobile {
        from {
            opacity: 0;
            transform: translateY(-100%);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .bm-search-body {
        max-height: calc(100vh - 160px);
        max-height: calc(100dvh - 160px);
    }

    .bm-search-trigger-text {
        display: none;
    }

    .bm-search-trigger:not(.bm-search-trigger-mock) {
        width: auto;
        max-width: none;
        padding: 0.625rem;
        border-radius: 50%;
        background: unset;
    }

}

/* ============================================
   Keyboard Navigation Focus Styles
   ============================================ */
.bm-search-item a:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--bm-primary);
}

.bm-search-view-all:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--bm-white);
}

/* ============================================
   Hide Legacy Elements
   ============================================ */
.bm-search-mobile-close {
    display: none !important;
}

/* ============================================
   Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .bm-search-container,
    .bm-search-container * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
