/* ============================================
   BrassWorks Search Overlay — Doofinder Style
   ============================================ */

.bw-search-overlay {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-top: none;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    border-radius: 0 0 8px 8px;
    z-index: 9999;
    max-height: 520px;
    overflow: hidden;
}

/* Two-column layout */
.bw-search-inner {
    display: flex;
    min-height: 200px;
}

/* Left: suggestions */
.bw-search-left {
    width: 220px;
    flex-shrink: 0;
    background: #f8f8f8;
    border-right: 1px solid #e8e8e8;
    padding: 20px 0;
}

/* Right: products */
.bw-search-right {
    flex: 1;
    padding: 20px 24px;
    overflow-y: auto;
    max-height: 520px;
}

/* Section titles */
.bw-search-section-title {
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #999;
    margin: 0 0 10px;
    padding: 0 20px;
}

/* Suggestion list */
.bw-suggest-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.bw-suggest-item {
    margin: 0;
    padding: 0;
}

.bw-suggest-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 13px;
    color: #333;
    text-decoration: none;
    transition: background 0.15s;
}

.bw-suggest-link:hover {
    background: #fff;
    color: #F0AF00;
}

.bw-suggest-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.5;
}

/* Products header */
.bw-search-products-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.bw-search-products-header .bw-search-section-title {
    margin: 0;
    padding: 0;
}

.bw-view-all {
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #F0AF00;
    text-decoration: none;
    white-space: nowrap;
}

.bw-view-all:hover {
    text-decoration: underline;
}

/* Product grid */
.bw-product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.bw-product-item {
    margin: 0;
}

.bw-product-link {
    display: block;
    text-decoration: none;
    color: inherit;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 8px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.bw-product-link:hover {
    border-color: #e8e8e8;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.bw-product-image {
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 4px;
    background: #f5f5f5;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bw-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.bw-product-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bw-product-name {
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: #333;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bw-product-price .price-box,
.bw-product-price .price-container {
    display: block;
}

.bw-product-price .price-including-tax,
.bw-product-price .price-excluding-tax {
    display: none;
}

.bw-product-price .price-including-tax {
    display: block;
}

.bw-product-price .price-including-tax::after {
    display: none;
}

.bw-product-price .price {
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 13px !important;
    font-weight: 700;
    color: #111;
}

.bw-product-price .stock-status {
    display: none;
}

/* No results */
.bw-search-no-results {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px;
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 14px;
    color: #999;
}

.bw-search-no-results svg {
    width: 24px;
    height: 24px;
}

/* Positioning — search form needs position:relative */
.block-search .form.minisearch {
    position: relative;
}

/* Hide default MageWorx styles */
#searchsuite-autocomplete.searchsuite-autocomplete {
    all: unset;
}

/* Mobile */
@media (max-width: 767px) {
    .bw-search-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 0;
        max-height: 100%;
        overflow-y: auto;
    }

    .bw-search-inner {
        flex-direction: column;
    }

    .bw-search-left {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e8e8e8;
        padding: 16px 0;
    }

    .bw-search-right {
        padding: 16px;
        max-height: none;
    }

    .bw-product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}
