/*
 * Autocomplete Dropdown Styles
 */
#searchForm .input-group {
    position: relative; /* Ensure absolute dropdown positions correctly */
}

.ts-autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 5px); /* Position right below the input group */
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1050; /* Ensure it stays above other elements like navbars */
    overflow: hidden;
    min-width: 300px;
}

.ts-autocomplete-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #f1f3f5;
    text-decoration: none;
    color: #212529;
    transition: background-color 0.15s ease-in-out;
}

.ts-autocomplete-item:last-child {
    border-bottom: none;
}

.ts-autocomplete-item:hover,
.ts-autocomplete-item:focus,
.ts-autocomplete-item.ts-autocomplete-selected {
    background-color: #f8f9fa;
    text-decoration: none;
    color: #212529;
}

.ts-autocomplete-img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    margin-right: 15px;
    border-radius: 2px;
}

.ts-autocomplete-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ts-autocomplete-title {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px; /* Adjust based on container width */
}

.ts-autocomplete-price {
    font-size: 0.85rem;
    color: #495057;
    font-weight: 600;
}

.ts-autocomplete-footer {
    display: block;
    padding: 8px 15px;
    background-color: #f8f9fa;
    text-align: center;
    font-size: 0.85rem;
    color: #0d6efd;
    cursor: pointer;
    font-weight: 500;
    border-top: 1px solid #dee2e6;
}

.ts-autocomplete-footer:hover,
.ts-autocomplete-footer.ts-autocomplete-selected {
    text-decoration: underline;
    background-color: #e9ecef;
}
