.db-product-search {
    position: relative;
    display: inline-flex;
    align-items: center;
}

html.db-product-search-is-open,
body.db-product-search-is-open {
    overflow: hidden !important;
}

.db-product-search-panel[hidden] {
    display: none !important;
}

.db-product-search-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.db-product-search-toggle svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.db-product-search-toggle span {
    font: inherit;
}

.db-product-search-inline {
    box-sizing: border-box;
    display: block;
    width: 100%;
    max-width: none;
}

.db-product-search-inline .db-product-search-field-toggle {
    box-sizing: border-box;
    display: flex;
    justify-content: flex-start;
    width: 100%;
    min-height: 56px;
    gap: 12px;
    padding: 0 18px;
    border: 1px solid #d7d7d7;
    border-radius: 3px;
    background: #fff;
    color: #777;
    text-align: left;
    opacity: .8;
}

.db-product-search-inline .db-product-search-field-toggle:hover {
    border-color: #ec1117;
    color: #000;
    opacity: 1;
}

.db-product-search-field-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    color: #777;
}

.db-product-search-field-icon svg {
    width: 21px;
    height: 21px;
    fill: currentColor;
}

.db-product-search-field-placeholder {
    display: block;
    min-width: 0;
    overflow: hidden;
    font-size: 16px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.db-product-search-panel {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483647 !important;
    display: block;
    width: 100vw;
    height: 100vh;
    padding: 0;
    isolation: isolate;
}

.db-product-search-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 0;
    background: rgba(0, 0, 0, .9);
    cursor: pointer;
}

.db-product-search-dialog {
    position: fixed !important;
    top: 32vh;
    left: 50%;
    z-index: 1;
    width: min(92vw, 760px);
    max-height: calc(100vh - 32vh - 32px);
    padding: 0;
    overflow: visible;
    transform: translateX(-50%);
    border: 0;
    background: transparent;
    box-shadow: none;
}

.db-product-search-close {
    position: fixed !important;
    top: 24px;
    right: 28px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    font-size: 44px;
    line-height: 1;
}

.db-product-search-close:hover {
    color: #e30613;
}

.db-product-search .db-product-search-input,
.db-product-search-panel .db-product-search-input {
    appearance: none;
    box-sizing: border-box !important;
    display: block;
    width: 100% !important;
    max-width: 100%;
    height: 58px;
    padding: 0 18px !important;
    border: 1px solid rgba(255, 255, 255, .85);
    border-radius: 3px 3px 0 0;
    background: #fff;
    color: #000;
    font-size: 19px;
    line-height: 58px;
}

.db-product-search-input::placeholder {
    color: #777;
}

.db-product-search-results {
    box-sizing: border-box;
    display: grid;
    max-height: calc(100vh - 32vh - 104px);
    gap: 0;
    margin-top: 0;
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid #eee;
    border-top: 0;
    background: #fff;
}

.db-product-search-results:empty {
    display: none;
}

.db-product-search-empty {
    padding: 14px 16px;
    color: #777;
    font-size: 14px;
    text-align: center;
}

.db-product-search .db-product-search-result,
.db-product-search-panel .db-product-search-result {
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: 64px minmax(0, 1fr) minmax(112px, 180px);
    align-items: center;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
    gap: 12px;
    padding: 10px;
    overflow: hidden;
    border: 0;
    border-top: 1px solid #eee;
    background: #fff;
    color: inherit;
    text-decoration: none;
    white-space: normal !important;
}

.db-product-search .db-product-search-result:first-child,
.db-product-search-panel .db-product-search-result:first-child {
    border-top: 0;
}

.db-product-search-result:hover {
    text-decoration: none;
}

.db-product-search-result:hover .db-product-search-title {
    color: #e30613;
}

.db-product-search-thumb {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: #f7f7f7;
}

.db-product-search-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.db-product-search-copy {
    display: grid !important;
    width: auto !important;
    max-width: 100%;
    min-width: 0;
    gap: 4px;
    overflow: hidden;
    white-space: normal !important;
}

.db-product-search-title {
    display: block !important;
    width: auto !important;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    color: #000;
    font-size: 15px;
    line-height: 1.3;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap !important;
}

.db-product-search-desc {
    display: block !important;
    width: auto !important;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    color: #777;
    font-size: 13px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap !important;
}

.db-product-search-tags {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: flex-end;
    width: auto !important;
    max-width: 180px;
    min-width: 0;
    gap: 5px;
    overflow: hidden;
    white-space: normal !important;
}

.db-product-search-tags span {
    display: inline-flex !important;
    max-width: 100%;
    padding: 3px 7px;
    overflow: hidden;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: #f6f6f6;
    color: #666;
    font-size: 11px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.db-product-search mark {
    padding: 0;
    background: transparent;
    color: inherit;
    font-weight: 700;
}

@media (max-width: 640px) {
    .db-product-search-dialog {
        top: 24vh;
        width: calc(100vw - 28px);
        max-height: calc(100vh - 24vh - 22px);
    }

    .db-product-search-close {
        top: 12px;
        right: 12px;
        width: 44px;
        height: 44px;
        font-size: 40px;
    }

    .db-product-search-input {
        height: 50px;
        font-size: 16px;
        line-height: 50px;
    }

    .db-product-search-results {
        max-height: calc(100vh - 24vh - 90px);
    }

    .db-product-search .db-product-search-result,
    .db-product-search-panel .db-product-search-result {
        grid-template-columns: 52px minmax(0, 1fr);
        gap: 10px;
    }

    .db-product-search-thumb {
        width: 52px;
        height: 52px;
    }

    .db-product-search-tags {
        grid-column: 2;
        justify-content: flex-start;
        max-width: 100%;
    }
}
