/* Search Autocomplete Styles */

/* Suggestions Container - Compact */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-height: 350px;
    overflow-y: auto;
    z-index: 999999;
    margin-top: -1px;
}

/* Scrollbar styling */
.search-suggestions::-webkit-scrollbar {
    width: 8px;
}

.search-suggestions::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0 0 8px 0;
}

.search-suggestions::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.search-suggestions::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Suggestion Items - More Compact */
.suggestion-item {
    border-bottom: 1px solid #f5f5f5;
    transition: background-color 0.2s;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item a {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    text-decoration: none;
    color: #333;
    gap: 10px;
}

.suggestion-item:hover,
.suggestion-item.suggestion-active {
    background-color: #f8f8f8;
}

.suggestion-item img {
    width: 35px;
    height: 35px;
    object-fit: contain;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
    background: white;
}

/* Suggestion Details - Compact */
.suggestion-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.suggestion-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.suggestion-brand {
    font-size: 11px;
    color: #888;
}

.suggestion-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.suggestion-price {
    font-size: 13px;
    font-weight: 600;
    color: #2034ad;
}

/* Stock Badge */
.stock-badge {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    background: #f0f0f0;
    color: #666;
}

.stock-badge.in-stock {
    background: #e8f5e9;
    color: #2e7d32;
}

/* Popular Searches - Compact */
.popular-search a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
}

.popular-search .search-icon {
    color: #999;
    font-size: 12px;
}

.popular-search span {
    color: #555;
    font-size: 12px;
}

/* Did You Mean */
.did-you-mean {
    padding: 10px 15px;
    background: #fff3cd;
    border-bottom: 1px solid #ffeeba;
    font-size: 14px;
}

.did-you-mean span {
    color: #856404;
    margin-right: 5px;
}

.did-you-mean a {
    color: #2034ad;
    text-decoration: none;
    font-weight: 500;
}

.did-you-mean a:hover {
    text-decoration: underline;
}

/* Titles */
.suggestions-title {
    padding: 8px 15px;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
}

/* No Results */
.no-suggestions {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* Clear Button */
.search-clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
    transition: color 0.2s;
}

.search-clear-btn:hover {
    color: #333;
}

/* Loading Spinner */
.search-loading {
    padding: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #666;
    font-size: 14px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2034ad;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* MOBILE: Lower z-index when drawer is open */
@media (max-width: 768px) {
    body.mobile-filters-drawer-open .search-suggestions {
        z-index: 1 !important;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .search-suggestions {
        max-height: 60vh;
        border-radius: 0 0 4px 4px;
    }
    
    .suggestion-item img {
        width: 40px;
        height: 40px;
    }
    
    .suggestion-name {
        font-size: 13px;
    }
    
    .suggestion-price {
        font-size: 13px;
    }
    
    .search-clear-btn {
        right: 5px;
    }
}

/* Ensure search form has relative positioning */
#searchForm {
    position: relative;
}

/* Adjust input padding to make room for clear button */
.doresc-sa-cumpar {
    padding-right: 35px !important;
}