.bgw-search {
    position: relative;
    max-width: 720px;
    margin: 0 auto;
    font-family: inherit;
}

.bgw-search__field {
    position: relative;
}

.bgw-search__input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.75rem 2.5rem 0.75rem 0.9rem;
    border: 1px solid #c3c4c7;
    border-radius: 6px;
    font-size: 1rem;
    line-height: 1.4;
    background: #fff;
    color: #1d2327;
}

.bgw-search__input:focus {
    outline: 2px solid #2271b1;
    outline-offset: 1px;
    border-color: #2271b1;
}

.bgw-search__spinner {
    position: absolute;
    top: 50%;
    right: 0.9rem;
    width: 1rem;
    height: 1rem;
    margin-top: -0.5rem;
    border: 2px solid #c3c4c7;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: bgw-search-spin 0.8s linear infinite;
}

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

.bgw-search__status {
    min-height: 1.2em;
    padding: 0.35rem 0.15rem;
    color: #646970;
    font-size: 0.85rem;
}

.bgw-search__results {
    position: absolute;
    z-index: 9999;
    top: 100%;
    right: 0;
    left: 0;
    max-height: 28rem;
    overflow-y: auto;
    padding: 0.35rem;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.bgw-search__item {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    padding: 0.55rem;
    border-radius: 4px;
    color: inherit;
    text-decoration: none;
}

.bgw-search__item:hover,
.bgw-search__item.is-active {
    background: #f0f6fc;
}

.bgw-search__item img {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
    background: #f6f7f7;
}

.bgw-search__body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.bgw-search__title {
    overflow: hidden;
    color: #1d2327;
    font-size: 0.95rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bgw-search__price {
    color: #2271b1;
    font-size: 0.85rem;
}

.bgw-search__price del {
    color: #8c8f94;
    font-size: 0.8rem;
}

.bgw-search__mpn {
    color: #646970;
    font-size: 0.75rem;
}

.bgw-search__all {
    display: block;
    padding: 0.6rem;
    border-top: 1px solid #f0f0f1;
    color: #2271b1;
    font-size: 0.85rem;
    text-align: center;
    text-decoration: none;
}

.bgw-search-results {
    max-width: 860px;
    margin: 1.5rem auto;
}

.bgw-search-results__summary {
    color: #646970;
    font-size: 0.9rem;
}

.bgw-search-results__list {
    display: grid;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.bgw-search-results__item a {
    display: flex;
    gap: 0.85rem;
    align-items: center;
    padding: 0.65rem;
    border: 1px solid #f0f0f1;
    border-radius: 6px;
    color: inherit;
    text-decoration: none;
}

.bgw-search-results__item a:hover {
    border-color: #c3c4c7;
    background: #fafafa;
}

.bgw-search-results__item img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 4px;
}

.bgw-search-results__body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.bgw-search-results__price {
    color: #2271b1;
}

.bgw-search-results__mpn {
    color: #646970;
}

.bgw-search-results__pagination {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
    margin-top: 1rem;
}

.bgw-search-page {
    padding: 2rem 1rem;
}

.bgw-search-page__inner {
    max-width: 900px;
    margin: 0 auto;
}

.bgw-search-page__title {
    margin: 0 0 1rem;
    font-size: 1.5rem;
}

.woocommerce-product-search.bgw-search {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    max-width: 720px;
}

.woocommerce-product-search.bgw-search .bgw-search__field {
    flex: 1 1 240px;
}

.woocommerce-product-search.bgw-search .search-submit {
    flex: 0 0 auto;
    padding: 0.7rem 1rem;
    border: 0;
    border-radius: 6px;
    background: #2271b1;
    color: #fff;
    cursor: pointer;
    font-size: 0.95rem;
}

.woocommerce-product-search.bgw-search .bgw-search__status,
.woocommerce-product-search.bgw-search .bgw-search__results {
    flex: 1 0 100%;
}

.bgw-search--auto {
    position: relative;
}

.bgw-search--auto .bgw-search__status {
    display: none;
}

.bgw-search--auto .bgw-search__results {
    top: 100%;
    right: 0;
    left: 0;
    width: auto;
    min-width: 0;
    max-height: 60vh;
    overflow-y: auto;
    margin-top: 0.35rem;
}

.bgw-search__status:empty {
    display: none;
}

.bgw-search__empty {
    padding: 0.85rem 0.75rem;
    color: #646970;
    font-size: 0.9rem;
    text-align: center;
}

.bgw-search--auto .bgw-search__spinner {
    right: 0.65rem;
}

@media (max-width: 600px) {
    .bgw-search__results {
        position: static;
        max-height: none;
        margin-top: 0.35rem;
    }

    .bgw-search--auto .bgw-search__results {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        width: auto;
        min-width: 0;
        max-height: 55vh;
        overflow-y: auto;
        margin-top: 0.35rem;
    }
}
