.brcode-qf-product-search,
.brcode-qf-product-search__mobile-layer {
    --brcode-qf-search-primary: #1f2937;
    --brcode-qf-search-accent: #1f2937;
    --brcode-qf-search-text: #111827;
    --brcode-qf-search-muted: #6b7280;
    --brcode-qf-search-background: #ffffff;
    --brcode-qf-search-border: #d1d5db;
    --brcode-qf-search-soft: #f3f4f6;
    --brcode-qf-search-hover: #f3f4f6;
}

.brcode-qf-product-search,
.brcode-qf-product-search *,
.brcode-qf-product-search *::before,
.brcode-qf-product-search *::after,
.brcode-qf-product-search__mobile-layer,
.brcode-qf-product-search__mobile-layer *,
.brcode-qf-product-search__mobile-layer *::before,
.brcode-qf-product-search__mobile-layer *::after {
    box-sizing: border-box;
}

.brcode-qf-product-search {
    position: relative;
    z-index: 20;
    width: clamp(245px, 25vw, 360px);
    color: var(--brcode-qf-search-text);
    font-family: inherit;
}

/* QuoteFlow component contract: these scoped rules intentionally win over
 * Elementor, block themes and WooCommerce utility classes. */
.brcode-qf-product-search .brcode-qf-product-search__input,
.brcode-qf-product-search .brcode-qf-product-search__input:hover,
.brcode-qf-product-search .brcode-qf-product-search__input:focus {
    box-sizing: border-box !important;
    border-radius: 8px !important;
    font-family: var(--brcode-qf-search-font, inherit) !important;
    line-height: 1 !important;
}

.brcode-qf-product-search .brcode-qf-product-search__result,
.brcode-qf-product-search .brcode-qf-product-search__result:hover,
.brcode-qf-product-search .brcode-qf-product-search__result:focus-visible,
.brcode-qf-product-search .brcode-qf-product-search__all {
    text-decoration: none !important;
}

.brcode-qf-product-search button,
.brcode-qf-product-search input,
.brcode-qf-product-search__mobile-layer button,
.brcode-qf-product-search__mobile-layer input {
    font: inherit;
}

.brcode-qf-product-search__sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.brcode-qf-product-search__desktop,
.brcode-qf-product-search__field,
.brcode-qf-product-search__mobile-field {
    position: relative;
    width: 100%;
}

.brcode-qf-product-search__field,
.brcode-qf-product-search__mobile-field {
    display: flex;
    align-items: center;
}

.brcode-qf-product-search__search-icon {
    position: absolute;
    left: 13px;
    z-index: 2;
    width: 19px;
    height: 19px;
    fill: none;
    stroke: var(--brcode-qf-search-muted);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.brcode-qf-product-search__mobile-trigger > svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.brcode-qf-product-search__input {
    width: 100%;
    min-width: 0;
    height: 46px;
    padding: 0 42px !important;
    margin: 0 !important;
    border: 1px solid var(--brcode-qf-search-border) !important;
    border-radius: 8px !important;
    background: var(--brcode-qf-search-background) !important;
    color: var(--brcode-qf-search-text) !important;
    font-size: 14px !important;
    line-height: 1 !important;
    font-weight: 400 !important;
    outline: none !important;
    box-shadow: none !important;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.brcode-qf-product-search__input::placeholder {
    color: var(--brcode-qf-search-muted);
    opacity: .9;
}

.brcode-qf-product-search__input:hover {
    border-color: var(--brcode-qf-search-accent) !important;
}

.brcode-qf-product-search__input:focus {
    border-color: var(--brcode-qf-search-primary) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brcode-qf-search-primary) 12%, transparent) !important;
}

.brcode-qf-product-search__input::-webkit-search-cancel-button {
    display: none;
}

.brcode-qf-product-search__input-clear,
.brcode-qf-product-search__mobile-close {
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--brcode-qf-search-muted);
    cursor: pointer;
}

.brcode-qf-product-search__input-clear {
    position: absolute;
    right: 8px;
    z-index: 3;
    width: 30px;
    height: 30px;
}

.brcode-qf-product-search__input-clear:hover,
.brcode-qf-product-search__input-clear:focus-visible,
.brcode-qf-product-search__mobile-close:hover,
.brcode-qf-product-search__mobile-close:focus-visible {
    background: var(--brcode-qf-search-soft);
    color: var(--brcode-qf-search-text);
}

.brcode-qf-product-search__input-clear svg,
.brcode-qf-product-search__mobile-close svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
}

.brcode-qf-product-search__loader {
    position: absolute;
    right: 14px;
    z-index: 4;
    display: none;
    width: 17px;
    height: 17px;
    border: 2px solid var(--brcode-qf-search-border);
    border-top-color: var(--brcode-qf-search-primary);
    border-radius: 999px;
    animation: brcode-qf-product-search-spin .7s linear infinite;
}

.brcode-qf-product-search__loader.is-active {
    display: block;
}

.brcode-qf-product-search__dropdown,
.brcode-qf-product-search__mobile-results {
    width: 100%;
    max-height: min(560px, calc(100vh - 110px));
    padding: 8px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--brcode-qf-search-background);
}

.brcode-qf-product-search__dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 30;
    width: min(440px, calc(100vw - 32px));
    border: 1px solid var(--brcode-qf-search-border);
    border-radius: 12px;
    box-shadow: 0 18px 48px rgb(17 24 39 / .14);
}

.brcode-qf-product-search__results-label {
    padding: 8px 10px 6px;
    color: var(--brcode-qf-search-muted);
    font-size: 11px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.brcode-qf-product-search__result {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) 22px;
    align-items: center;
    gap: 12px;
    min-height: 74px;
    padding: 8px 10px;
    border-radius: 9px;
    color: var(--brcode-qf-search-text) !important;
    text-decoration: none !important;
    outline: none;
    transition: background-color .15s ease;
}

.brcode-qf-product-search__result:hover,
.brcode-qf-product-search__result.is-active,
.brcode-qf-product-search__result:focus-visible {
    background: var(--brcode-qf-search-hover);
}

.brcode-qf-product-search__result:focus-visible,
.brcode-qf-product-search__mobile-trigger:focus-visible,
.brcode-qf-product-search__backdrop:focus-visible,
.brcode-qf-product-search__mobile-close:focus-visible,
.brcode-qf-product-search__input-clear:focus-visible {
    outline: 2px solid var(--brcode-qf-search-primary);
    outline-offset: 3px;
}

.brcode-qf-product-search__thumb {
    display: block;
    width: 58px;
    height: 58px;
    border: 1px solid var(--brcode-qf-search-border);
    border-radius: 8px;
    background: var(--brcode-qf-search-soft);
    object-fit: contain;
}

.brcode-qf-product-search__thumb--placeholder {
    display: grid;
    place-items: center;
    color: var(--brcode-qf-search-muted);
    font-size: 16px;
}

.brcode-qf-product-search__result-body {
    min-width: 0;
}

.brcode-qf-product-search__result-name,
.brcode-qf-product-search__result-price,
.brcode-qf-product-search__result-meta {
    display: block;
    overflow-wrap: anywhere;
}

.brcode-qf-product-search__result-name {
    display: -webkit-box;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.35;
    font-weight: 600;
    letter-spacing: -.01em;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.brcode-qf-product-search__result-price {
    margin-top: 4px;
    color: var(--brcode-qf-search-accent);
    font-size: 13px;
    line-height: 1.3;
    font-weight: 700;
}

.brcode-qf-product-search__result-meta {
    margin-top: 4px;
    color: var(--brcode-qf-search-muted);
    font-size: 12px;
    line-height: 1.3;
}

.brcode-qf-product-search__result-arrow,
.brcode-qf-product-search__all-results-arrow {
    display: inline-grid;
    place-items: center;
    color: var(--brcode-qf-search-accent);
}

.brcode-qf-product-search__result-arrow svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.brcode-qf-product-search__all-results {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 46px;
    margin-top: 4px;
    padding: 9px 12px;
    border-top: 1px solid var(--brcode-qf-search-border);
    color: var(--brcode-qf-search-primary) !important;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 650;
    text-decoration: none !important;
}

.brcode-qf-product-search__all-results:hover {
    text-decoration: underline !important;
    text-underline-offset: 3px;
}

.brcode-qf-product-search__all-results-arrow svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.brcode-qf-product-search__state,
.brcode-qf-product-search__empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 150px;
    padding: 26px 20px;
    color: var(--brcode-qf-search-muted);
    text-align: center;
}

.brcode-qf-product-search__state strong,
.brcode-qf-product-search__empty-state strong {
    color: var(--brcode-qf-search-text);
    font-size: 15px;
    line-height: 1.35;
    font-weight: 650;
}

.brcode-qf-product-search__state span,
.brcode-qf-product-search__empty-state span {
    max-width: 330px;
    font-size: 13px;
    line-height: 1.5;
}

.brcode-qf-product-search__empty-icon {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin-bottom: 3px;
    border-radius: 999px;
    background: var(--brcode-qf-search-soft);
    color: var(--brcode-qf-search-accent);
}

.brcode-qf-product-search__empty-icon svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.brcode-qf-product-search__mobile-trigger {
    display: none;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--brcode-qf-search-text);
    cursor: pointer;
}

.brcode-qf-product-search__mobile-trigger:hover {
    background: var(--brcode-qf-search-soft);
}

.brcode-qf-product-search__mobile-layer {
    position: fixed;
    inset: 0;
    z-index: 999998;
    visibility: hidden;
    pointer-events: none;
    color: var(--brcode-qf-search-text);
}

.brcode-qf-product-search__mobile-layer.is-open {
    visibility: visible;
    pointer-events: auto;
}

.brcode-qf-product-search__backdrop {
    position: fixed;
    top: var(--brcode-qf-search-header-bottom, 72px);
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 0;
    border: 0;
    background: color-mix(in srgb, var(--brcode-qf-search-text) 43%, transparent);
    opacity: 0;
    cursor: pointer;
    transition: opacity .22s ease;
    backdrop-filter: blur(2px);
}

.brcode-qf-product-search__mobile-layer.is-open .brcode-qf-product-search__backdrop {
    opacity: 1;
}

.brcode-qf-product-search__mobile-panel {
    position: fixed;
    top: var(--brcode-qf-search-header-bottom, 72px);
    right: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    height: calc(100dvh - var(--brcode-qf-search-header-bottom, 72px));
    overflow: hidden;
    background: var(--brcode-qf-search-background);
    opacity: 0;
    transform: translateY(-12px);
    transition: transform .22s ease, opacity .22s ease;
}

.brcode-qf-product-search__mobile-layer.is-open .brcode-qf-product-search__mobile-panel {
    opacity: 1;
    transform: translateY(0);
}

.brcode-qf-product-search__mobile-head {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 9px;
    padding: 12px max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
    border-bottom: 1px solid var(--brcode-qf-search-border);
    background: var(--brcode-qf-search-background);
}

.brcode-qf-product-search__mobile-field {
    flex: 1 1 auto;
    min-width: 0;
}

.brcode-qf-product-search__input--mobile {
    height: 48px;
    background: var(--brcode-qf-search-soft) !important;
    border-color: transparent !important;
}

.brcode-qf-product-search__mobile-close {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    color: var(--brcode-qf-search-text);
}

.brcode-qf-product-search__mobile-results {
    flex: 1 1 auto;
    min-height: 0;
    width: auto;
    max-height: none;
    padding: 10px max(12px, env(safe-area-inset-right)) calc(18px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}

.brcode-qf-product-search__mobile-results .brcode-qf-product-search__result {
    grid-template-columns: 64px minmax(0, 1fr) 22px;
    min-height: 82px;
    padding: 9px 8px;
    border-bottom: 1px solid var(--brcode-qf-search-border);
    border-radius: 0;
}

.brcode-qf-product-search__mobile-results .brcode-qf-product-search__thumb {
    width: 64px;
    height: 64px;
}

.brcode-qf-product-search__mobile-results .brcode-qf-product-search__all-results {
    margin-top: 8px;
    border: 1px solid var(--brcode-qf-search-border);
    border-radius: 8px;
}

body.brcode-qf-product-search-open {
    overflow: hidden;
}

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

@media (max-width: 1024px) {
    .brcode-qf-product-search {
        width: 44px;
        max-width: 44px;
    }

    .brcode-qf-product-search__desktop {
        display: none;
    }

    .brcode-qf-product-search__mobile-trigger {
        display: grid;
    }
}

@media (min-width: 1025px) {
    .brcode-qf-product-search__mobile-layer {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .brcode-qf-product-search__mobile-head {
        padding-right: max(12px, env(safe-area-inset-right));
        padding-left: max(12px, env(safe-area-inset-left));
    }
}

@media (prefers-reduced-motion: reduce) {
    .brcode-qf-product-search__input,
    .brcode-qf-product-search__result,
    .brcode-qf-product-search__backdrop,
    .brcode-qf-product-search__mobile-panel {
        transition: none;
    }

    .brcode-qf-product-search__loader {
        animation: none;
    }
}
