/* The original .hdr-search and its input/button styling stay unchanged. */
.hdr-main-center .hdr-search-autocomplete {
    position: relative;
    width: 100%;
    min-width: 0;
}

    .hdr-main-center .hdr-search-autocomplete .hdr-search {
        width: 100%;
    }

.stock-autocomplete-floating[hidden] {
    display: none !important;
}

.stock-autocomplete-floating {
    position: fixed !important;
    top: 0;
    left: 0;
    right: auto;
    z-index: 2147483000 !important;
    max-height: min(70vh, 560px);
    overflow-y: auto;
    overflow-x: hidden;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, .14);
    overscroll-behavior: contain;
}

    .stock-autocomplete-floating .stock-autocomplete-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 12px;
        color: #222;
        text-decoration: none;
        border-bottom: 1px solid #f0f0f0;
    }

        .stock-autocomplete-floating .stock-autocomplete-item:hover,
        .stock-autocomplete-floating .stock-autocomplete-item.is-active {
            background: #f4f6f8;
            text-decoration: none;
        }

    .stock-autocomplete-floating .stock-autocomplete-image {
        width: 62px;
        height: 62px;
        min-width: 62px;
        object-fit: contain;
        border-radius: 6px;
        background: #f9fafb;
    }

    .stock-autocomplete-floating .stock-autocomplete-main {
        display: flex;
        flex: 1;
        flex-direction: column;
        gap: 3px;
        min-width: 0;
        line-height: 1.3;
    }

    .stock-autocomplete-floating .stock-autocomplete-name {
        font-weight: 600;
        font-size: 13px;
        overflow-wrap: anywhere;
    }

    .stock-autocomplete-floating .stock-autocomplete-brand,
    .stock-autocomplete-floating .stock-autocomplete-code {
        color: #64748b;
        font-size: 11px;
    }

    .stock-autocomplete-floating .stock-autocomplete-prices {
        display: flex;
        flex: 0 0 auto;
        flex-direction: column;
        text-align: right;
        gap: 3px;
        white-space: nowrap;
    }

    .stock-autocomplete-floating .stock-autocomplete-old-price {
        font-size: 11px;
        color: #9ca3af;
    }

    .stock-autocomplete-floating .stock-autocomplete-net-price {
        font-size: 13px;
        color: #111827;
    }

    .stock-autocomplete-floating .stock-autocomplete-all {
        display: block;
        width: 100%;
        padding: 12px;
        text-align: center;
        border: 0;
        background: #f8fafc;
        color: #111827;
        font-weight: 600;
        cursor: pointer;
    }

        .stock-autocomplete-floating .stock-autocomplete-all:hover {
            background: #e9eef5;
        }

@media (max-width: 600px) {
    .stock-autocomplete-floating .stock-autocomplete-item {
        gap: 8px;
        padding: 8px;
    }

    .stock-autocomplete-floating .stock-autocomplete-image {
        width: 48px;
        height: 48px;
        min-width: 48px;
    }

    .stock-autocomplete-floating .stock-autocomplete-prices {
        max-width: 110px;
    }
}

/* Isolated overlay: avoids the header's nested stacking contexts. */
.stock-autocomplete-floating[hidden] {
    display: none !important;
}

.stock-autocomplete-floating {
    box-sizing: border-box;
    overscroll-behavior: contain;
}

/* Mobile search form keeps its original space in the menu. */
@media (max-width: 991.98px) {
    .mobile-nav .hdr-search-autocomplete {
        position: relative;
        width: 100%;
        min-width: 0;
        margin: 12px 0;
    }

    .mobile-nav .hdr-search {
        display: flex;
        width: 100%;
        align-items: stretch;
        gap: 6px;
    }

        .mobile-nav .hdr-search input {
            flex: 1;
            min-width: 0;
            width: 100%;
            height: 44px;
            padding: 10px 12px;
            border: 1px solid #dce1e7;
            border-radius: 7px;
            font-size: 16px;
            background: #fff;
            color: #222;
        }

        .mobile-nav .hdr-search button {
            flex-shrink: 0;
            padding: 0 14px;
            border-radius: 7px;
        }
}
