.bn-smart-search,
.bn-smart-search * {
    box-sizing: border-box;
}


.bn-smart-search .screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    white-space: nowrap;
}

.bn-smart-search {
    position: relative;
    width: 100%;
    max-width: var(--bn-ss-max-width, 760px);
    color: var(--bn-ss-text, #222);
    font-family: inherit;
}

.bn-smart-search__form {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 46px;
    margin: 0;
    overflow: hidden;
    border: 1px solid #d8dce2;
    border-radius: var(--bn-ss-radius, 10px);
    background: #fff;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.bn-smart-search.is-open .bn-smart-search__form,
.bn-smart-search__form:focus-within {
    border-color: #b8bec7;
    box-shadow: 0 0 0 3px rgba(215, 0, 24, .08);
}

.bn-smart-search__icon {
    display: inline-flex;
    flex: 0 0 auto;
    margin-left: 14px;
    color: #6b7280;
}

.bn-smart-search__input {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 44px;
    padding: 8px 10px;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--bn-ss-text, #222);
    font: inherit;
}

.bn-smart-search__input::-webkit-search-cancel-button {
    display: none;
}

.bn-smart-search__clear {
    display: inline-grid;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    margin: 0 4px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #6b7280;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.bn-smart-search__clear:hover,
.bn-smart-search__clear:focus-visible {
    background: #f2f3f5;
    color: #111827;
}

.bn-smart-search__submit {
    align-self: stretch;
    flex: 0 0 auto;
    min-width: 92px;
    margin: 0;
    padding: 0 18px;
    border: 0;
    border-radius: 0;
    background: #d70018;
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.bn-smart-search__submit:hover,
.bn-smart-search__submit:focus-visible {
    filter: brightness(.94);
}

.bn-smart-search__dropdown {
    position: absolute;
    z-index: var(--bn-ss-z-index, 999999);
    top: var(--bn-ss-dropdown-top, calc(100% + 12px));
    left: var(--bn-ss-dropdown-left, 0px);
    width: var(--bn-ss-dropdown-width, min(calc(100vw - 24px), var(--bn-ss-max-width, 760px)));
    max-height: var(--bn-ss-dropdown-max-height, min(74vh, 680px));
    overflow: auto;
    padding: 14px;
    border: 1px solid rgba(17, 24, 39, .08);
    border-radius: var(--bn-ss-radius, 10px);
    background: var(--bn-ss-bg, #fff);
    box-shadow: var(--bn-ss-shadow, 0 14px 38px rgba(17,24,39,.16));
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
    overscroll-behavior: contain;
}

.bn-smart-search.is-open .bn-smart-search__dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.bn-smart-search__arrow {
    position: absolute;
    top: -7px;
    left: var(--bn-ss-arrow-left, 28px);
    width: 14px;
    height: 14px;
    border-top: 1px solid rgba(17, 24, 39, .08);
    border-left: 1px solid rgba(17, 24, 39, .08);
    background: var(--bn-ss-bg, #fff);
    transform: rotate(45deg);
}

.bn-smart-search__banner {
    position: relative;
    display: block;
    overflow: hidden;
    margin-bottom: 16px;
    border-radius: calc(var(--bn-ss-radius, 10px) - 2px);
    background: #f3f4f6;
}

.bn-smart-search__banner--empty {
    min-height: 84px;
    border: 1px dashed #e1e4e8;
}

.bn-smart-search__banner picture,
.bn-smart-search__banner img {
    display: block;
    width: 100%;
}

.bn-smart-search__banner img {
    height: auto;
}

.bn-smart-search__title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    color: var(--bn-ss-text, #222);
    font-size: 16px;
    line-height: 1.4;
}

.bn-smart-search__title > span {
    display: inline-grid;
    width: 25px;
    height: 25px;
    place-items: center;
    border-radius: 50%;
    background: #ffe9ec;
    color: #d70018;
    font-weight: 800;
}

.bn-smart-search__trend-grid {
    display: grid;
    grid-template-columns: repeat(var(--bn-ss-desktop-columns, 2), minmax(0, 1fr));
    gap: 8px 12px;
}

.bn-smart-search__trend-item {
    position: relative;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    min-height: 58px;
    padding: 6px 9px;
    border-radius: 8px;
    color: var(--bn-ss-text, #222);
    text-decoration: none !important;
    transition: background .15s ease, transform .15s ease;
}

.bn-smart-search__trend-item:hover,
.bn-smart-search__trend-item:focus-visible,
.bn-smart-search__trend-item[aria-selected="true"] {
    outline: none;
    background: var(--bn-ss-hover, #f5f5f5);
    color: var(--bn-ss-text, #222);
    transform: translateY(-1px);
}

.bn-smart-search__trend-thumb {
    display: grid;
    width: 48px;
    height: 48px;
    overflow: hidden;
    place-items: center;
    border: 1px solid #eef0f2;
    border-radius: 8px;
    background: #fff;
}

.bn-smart-search__trend-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    padding: 3px;
    object-fit: contain;
}

.bn-smart-search__trend-name {
    overflow: hidden;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.35;
    text-overflow: ellipsis;
}

.bn-smart-search__pin {
    color: #e7a500;
    font-size: 12px;
}

.bn-smart-search__empty,
.bn-smart-search__typing-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 110px;
    padding: 20px;
    text-align: center;
}

.bn-smart-search__empty span,
.bn-smart-search__typing-hint span {
    margin-top: 4px;
    color: #6b7280;
    font-size: 13px;
}

.bn-smart-search__typing-hint strong {
    margin-top: 5px;
    color: #d70018;
}

.bn-smart-search.is-typing .bn-smart-search__content,
.bn-smart-search.is-typing .bn-smart-search__banner {
    display: none;
}

.bn-smart-search.is-typing .bn-smart-search__typing-hint {
    display: flex !important;
}

@media (max-width: 640px) {
    .bn-smart-search__submit {
        min-width: 48px;
        padding: 0 13px;
        font-size: 0;
    }

    .bn-smart-search__submit::after {
        content: '→';
        font-size: 20px;
    }

    .bn-smart-search__dropdown {
        left: 50%;
        width: min(calc(100vw - 20px), var(--bn-ss-max-width, 760px));
        transform: translate(-50%, -6px);
    }

    .bn-smart-search.is-open .bn-smart-search__dropdown {
        transform: translate(-50%, 0);
    }

    .bn-smart-search__trend-grid {
        grid-template-columns: repeat(var(--bn-ss-mobile-columns, 1), minmax(0, 1fr));
    }

    .bn-smart-search__arrow {
        left: 50%;
        margin-left: -7px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bn-smart-search__dropdown,
    .bn-smart-search__trend-item,
    .bn-smart-search__form {
        transition: none;
    }
}

/* Stage 4: AJAX results */
.bn-smart-search.is-searching [data-bn-smart-search-banner] {
    display: none;
}

.bn-smart-search__result-group + .bn-smart-search__result-group {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #eef0f3;
}

.bn-smart-search__group-title {
    margin: 0 0 9px;
    color: var(--bn-ss-text, #222);
    font-size: 15px;
    font-weight: 750;
    line-height: 1.4;
}

.bn-smart-search__product-list,
.bn-smart-search__post-list {
    display: grid;
    gap: 4px;
}

.bn-smart-search__product-item {
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr) minmax(108px, auto);
    align-items: center;
    gap: 12px;
    min-height: 78px;
    padding: 7px 9px;
    border-radius: 9px;
    color: var(--bn-ss-text, #222) !important;
    text-decoration: none !important;
    transition: background .15s ease, transform .15s ease;
}

.bn-smart-search__product-item:hover,
.bn-smart-search__product-item:focus-visible,
.bn-smart-search__product-item[aria-selected="true"],
.bn-smart-search__compact-item:hover,
.bn-smart-search__compact-item:focus-visible,
.bn-smart-search__compact-item[aria-selected="true"],
.bn-smart-search__post-item:hover,
.bn-smart-search__post-item:focus-visible,
.bn-smart-search__post-item[aria-selected="true"],
.bn-smart-search__suggestion-item:hover,
.bn-smart-search__suggestion-item:focus-visible,
.bn-smart-search__suggestion-item[aria-selected="true"],
.bn-smart-search__view-all:hover,
.bn-smart-search__view-all:focus-visible,
.bn-smart-search__view-all[aria-selected="true"] {
    outline: 0;
    background: var(--bn-ss-hover, #f5f5f5);
    transform: translateY(-1px);
}

.bn-smart-search__result-thumb {
    display: grid;
    width: 50px;
    height: 50px;
    overflow: hidden;
    place-items: center;
    border: 1px solid #edf0f2;
    border-radius: 8px;
    background: #fff;
}

.bn-smart-search__result-thumb--product {
    width: 68px;
    height: 68px;
}

.bn-smart-search__result-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    padding: 4px;
    object-fit: contain;
}

.bn-smart-search__product-main,
.bn-smart-search__product-price,
.bn-smart-search__compact-item > span:last-child,
.bn-smart-search__post-item > span:last-child {
    min-width: 0;
}

.bn-smart-search__result-title {
    display: block;
    overflow: hidden;
    color: var(--bn-ss-text, #222);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.42;
    text-overflow: ellipsis;
}

.bn-smart-search__product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin-top: 6px;
    color: #6b7280;
    font-size: 11.5px;
}

.bn-smart-search__stock {
    font-weight: 650;
}

.bn-smart-search__stock--instock {
    color: #16813d;
}

.bn-smart-search__stock--outofstock {
    color: #b42318;
}

.bn-smart-search__stock--onbackorder {
    color: #a15c00;
}

.bn-smart-search__product-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    text-align: right;
}

.bn-smart-search__discount {
    display: inline-flex;
    padding: 2px 6px;
    border-radius: 999px;
    background: #ffe8eb;
    color: #c40016;
    font-size: 11px;
    font-weight: 800;
}

.bn-smart-search__price-html {
    color: var(--bn-ss-price, #d70018);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.4;
}

.bn-smart-search__price-html del {
    display: block;
    color: #8a9099;
    font-size: 11px;
    font-weight: 500;
    opacity: 1;
}

.bn-smart-search__price-html ins {
    color: var(--bn-ss-price, #d70018);
    text-decoration: none;
}

.bn-smart-search__compact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 10px;
}

.bn-smart-search__compact-item,
.bn-smart-search__post-item {
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 62px;
    padding: 6px 8px;
    border-radius: 8px;
    color: var(--bn-ss-text, #222) !important;
    text-decoration: none !important;
    transition: background .15s ease, transform .15s ease;
}

.bn-smart-search__compact-item small,
.bn-smart-search__post-item small {
    display: -webkit-box;
    overflow: hidden;
    margin-top: 3px;
    color: #6b7280;
    font-size: 11.5px;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.bn-smart-search__suggestion-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.bn-smart-search__suggestion-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border: 1px solid #e7e9ed;
    border-radius: 999px;
    background: #fff;
    color: var(--bn-ss-text, #222) !important;
    font-size: 12.5px;
    font-weight: 650;
    text-decoration: none !important;
    transition: background .15s ease, transform .15s ease;
}

.bn-smart-search__view-all {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 5px;
    margin-top: 14px;
    padding: 12px 13px;
    border-top: 1px solid #eef0f3;
    border-radius: 8px;
    color: var(--bn-ss-text, #222) !important;
    font-size: 13px;
    text-decoration: none !important;
    transition: background .15s ease, transform .15s ease;
}

.bn-smart-search__view-all strong {
    overflow: hidden;
    color: var(--bn-ss-price, #d70018);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bn-smart-search__empty--results,
.bn-smart-search__minimum,
.bn-smart-search__error {
    min-height: 150px;
}

.bn-smart-search__empty-icon {
    display: grid;
    width: 42px;
    height: 42px;
    margin-bottom: 9px;
    place-items: center;
    border-radius: 50%;
    background: #f2f3f5;
    color: #6b7280;
    font-size: 23px;
}

.bn-smart-search__error strong {
    color: #b42318;
}

.bn-smart-search__skeleton {
    display: grid;
    gap: 9px;
}

.bn-smart-search__skeleton-title,
.bn-smart-search__skeleton-image,
.bn-smart-search__skeleton-copy i,
.bn-smart-search__skeleton-price {
    position: relative;
    overflow: hidden;
    background: #eef0f3;
}

.bn-smart-search__skeleton-title::after,
.bn-smart-search__skeleton-image::after,
.bn-smart-search__skeleton-copy i::after,
.bn-smart-search__skeleton-price::after {
    position: absolute;
    inset: 0;
    content: '';
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.75), transparent);
    transform: translateX(-100%);
    animation: bn-ss-shimmer 1.1s infinite;
}

.bn-smart-search__skeleton-title {
    width: 110px;
    height: 16px;
    margin-bottom: 2px;
    border-radius: 5px;
}

.bn-smart-search__skeleton-row {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr) 100px;
    align-items: center;
    gap: 12px;
    min-height: 70px;
    padding: 5px 7px;
}

.bn-smart-search__skeleton-image {
    width: 62px;
    height: 62px;
    border-radius: 9px;
}

.bn-smart-search__skeleton-copy {
    display: grid;
    gap: 8px;
}

.bn-smart-search__skeleton-copy i {
    display: block;
    width: 86%;
    height: 12px;
    border-radius: 4px;
}

.bn-smart-search__skeleton-copy i:last-child {
    width: 55%;
    height: 9px;
}

.bn-smart-search__skeleton-price {
    width: 92px;
    height: 15px;
    border-radius: 4px;
}

@keyframes bn-ss-shimmer {
    100% { transform: translateX(100%); }
}

@media (max-width: 640px) {
    .bn-smart-search__product-item {
        grid-template-columns: 58px minmax(0, 1fr);
        gap: 9px;
    }

    .bn-smart-search__result-thumb--product {
        width: 58px;
        height: 58px;
    }

    .bn-smart-search__product-price {
        grid-column: 2;
        align-items: flex-start;
        margin-top: -2px;
        text-align: left;
    }

    .bn-smart-search__price-html del {
        display: inline;
        margin-left: 5px;
    }

    .bn-smart-search__compact-grid {
        grid-template-columns: 1fr;
    }

    .bn-smart-search__skeleton-row {
        grid-template-columns: 54px minmax(0, 1fr);
    }

    .bn-smart-search__skeleton-image {
        width: 54px;
        height: 54px;
    }

    .bn-smart-search__skeleton-price {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bn-smart-search__skeleton-title::after,
    .bn-smart-search__skeleton-image::after,
    .bn-smart-search__skeleton-copy i::after,
    .bn-smart-search__skeleton-price::after {
        animation: none;
    }
}

/* Stage 6: existing header inputs, sticky headers and adaptive positioning */
.bn-smart-search--attached {
    position: relative;
    width: auto;
    max-width: none;
    overflow: visible !important;
    isolation: auto;
}

.bn-smart-search--attached .bn-smart-search__dropdown {
    font-size: initial;
    line-height: normal;
    text-align: left;
}

.bn-smart-search__attached-input[aria-expanded="true"] {
    outline-offset: 2px;
}

.bn-smart-search__dropdown.bn-ss-position-fixed {
    position: fixed;
    top: var(--bn-ss-dropdown-top, 0);
    left: var(--bn-ss-dropdown-left, 0);
    width: var(--bn-ss-dropdown-width, min(calc(100vw - 20px), var(--bn-ss-max-width, 760px)));
    max-height: var(--bn-ss-dropdown-max-height, min(74vh, 680px));
    transform: translateY(-6px);
}

.bn-smart-search.is-open .bn-smart-search__dropdown.bn-ss-position-fixed {
    transform: translateY(0);
}

.bn-smart-search__dropdown.bn-ss-position-absolute {
    position: absolute;
    top: var(--bn-ss-dropdown-top, calc(100% + 10px));
    left: var(--bn-ss-dropdown-left, 0);
    width: var(--bn-ss-dropdown-width, min(calc(100vw - 20px), var(--bn-ss-max-width, 760px)));
    max-height: var(--bn-ss-dropdown-max-height, min(74vh, 680px));
    transform: translateY(-6px);
}

.bn-smart-search.is-open .bn-smart-search__dropdown.bn-ss-position-absolute {
    transform: translateY(0);
}

.bn-smart-search.is-dropup .bn-smart-search__arrow {
    top: auto;
    bottom: -7px;
    border-top: 0;
    border-left: 0;
    border-right: 1px solid rgba(17, 24, 39, .08);
    border-bottom: 1px solid rgba(17, 24, 39, .08);
}

.bn-smart-search.is-open .bn-smart-search__dropdown {
    will-change: transform, opacity;
}

.bn-smart-search:not(.is-open) .bn-smart-search__dropdown {
    pointer-events: none;
}

.bn-smart-search__dropdown {
    scrollbar-width: thin;
    scrollbar-color: rgba(107, 114, 128, .45) transparent;
}

.bn-smart-search__dropdown::-webkit-scrollbar {
    width: 8px;
}

.bn-smart-search__dropdown::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(107, 114, 128, .42);
    background-clip: padding-box;
}

.bn-smart-search [data-bn-smart-search-option]:focus-visible,
.bn-smart-search__clear:focus-visible,
.bn-smart-search__submit:focus-visible,
.bn-smart-search__attached-input:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.bn-smart-search [data-bn-smart-search-option] {
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

@media (max-width: 640px) {
    .bn-smart-search__dropdown.bn-ss-position-fixed,
    .bn-smart-search__dropdown.bn-ss-position-absolute {
        left: var(--bn-ss-dropdown-left, 10px);
        width: var(--bn-ss-dropdown-width, calc(100vw - 20px));
        transform: translateY(-6px);
    }

    .bn-smart-search.is-open .bn-smart-search__dropdown.bn-ss-position-fixed,
    .bn-smart-search.is-open .bn-smart-search__dropdown.bn-ss-position-absolute {
        transform: translateY(0);
    }

    .bn-smart-search__dropdown {
        padding: 11px;
    }

    .bn-smart-search__trend-item {
        grid-template-columns: 44px minmax(0, 1fr) auto;
        min-height: 54px;
    }

    .bn-smart-search__trend-thumb {
        width: 44px;
        height: 44px;
    }
}

@media (prefers-contrast: more) {
    .bn-smart-search__dropdown,
    .bn-smart-search__form,
    .bn-smart-search__trend-thumb,
    .bn-smart-search__result-thumb {
        border-color: currentColor;
    }
}

@media (forced-colors: active) {
    .bn-smart-search__dropdown,
    .bn-smart-search__form,
    .bn-smart-search [data-bn-smart-search-option] {
        forced-color-adjust: auto;
    }
}

.bn-smart-search--portal {
    position: static;
    width: 0;
    max-width: none;
    height: 0;
    overflow: visible;
}
