﻿/* ================================
   SEARCH DROPDOWN (Autocomplete)
   ================================ */

.search-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-height: 500px;
    overflow-y: auto;
    z-index: 1000;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar */
.search-dropdown::-webkit-scrollbar {
    width: 8px;
}

.search-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0 12px 12px 0;
}

.search-dropdown::-webkit-scrollbar-thumb {
    background: #4CAF50;
    border-radius: 4px;
}

/* Loading */
.search-dropdown-loading,
.search-dropdown-empty,
.search-dropdown-error {
    padding: 40px 20px;
    text-align: center;
    color: #7f8c8d;
}

    .search-dropdown-loading i,
    .search-dropdown-empty i,
    .search-dropdown-error i {
        font-size: 2rem;
        margin-bottom: 10px;
        display: block;
    }

.search-dropdown-loading {
    color: #4CAF50;
}

.search-dropdown-error {
    color: #e74c3c;
}

/* Result Item */
.search-result-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    border-bottom: 1px solid #ecf0f1;
}

    .search-result-item:last-of-type {
        border-bottom: none;
    }

    .search-result-item:hover,
    .search-result-item.selected {
        background: #f8f9fa;
        padding-left: 20px;
    }

/* Image */
.result-image {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #ecf0f1;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .result-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .result-image .no-image {
        color: #bdc3c7;
        font-size: 1.5rem;
    }

/* Content */
.result-content {
    flex: 1;
    min-width: 0;
}

.result-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

    .result-name strong {
        color: #4CAF50;
        background: rgba(76, 175, 80, 0.1);
        padding: 2px 4px;
        border-radius: 3px;
    }

.result-category {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-bottom: 4px;
}

    .result-category i {
        margin-right: 3px;
    }

.result-price {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

    .result-price .price {
        font-weight: 700;
        color: #4CAF50;
        font-size: 1.1rem;
    }

    .result-price .price-variable {
        font-size: 0.85rem;
        color: #7f8c8d;
    }

    .result-price .badge-stock-out {
        background: #e74c3c;
        color: white;
        font-size: 0.7rem;
        padding: 3px 8px;
        border-radius: 12px;
        font-weight: 600;
    }

    .result-price .badge-new {
        background: #3498db;
        color: white;
        font-size: 0.7rem;
        padding: 3px 8px;
        border-radius: 12px;
        font-weight: 600;
    }

/* Footer */
.search-dropdown-footer {
    padding: 12px 15px;
    background: #f8f9fa;
    border-top: 1px solid #ecf0f1;
}

.view-all-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #4CAF50;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

    .view-all-link:hover {
        color: #45a049;
        gap: 12px;
    }

/* Mobile Responsive */
@media (max-width: 768px) {
    .search-dropdown {
        max-height: 400px;
    }

    .result-image {
        width: 50px;
        height: 50px;
    }

    .result-name {
        font-size: 0.9rem;
    }

    .result-category {
        font-size: 0.75rem;
    }

    .result-price .price {
        font-size: 0.95rem;
    }
}
