/* Search Dropdown Autocomplete Styles */

.search-container {
    position: relative;
    flex: 1;
    max-width: 800px;
}

.search-bar {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 10px 50px 10px 15px;
    border: 2px solid #ee4d2d;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
}

.search-input:focus {
    border-color: #d73211;
    box-shadow: 0 2px 8px rgba(238, 77, 45, 0.2);
}

.search-btn {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 50px;
    background: #ee4d2d;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: all 0.3s;
}

.search-btn:hover {
    background: #d73211;
}

/* Search Dropdown Results */
.search-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-dropdown.active {
    display: block;
}

/* Search Item - Text Only Layout */
.search-dropdown-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #f5f5f5;
}

.search-dropdown-item:last-child {
    border-bottom: none;
}

.search-dropdown-item:hover {
    background: #f8f8f8;
}

/* Out of stock item - grayed out */
.search-dropdown-item.out-of-stock {
    opacity: 0.6;
}

.search-dropdown-item.out-of-stock:hover {
    background: #fafafa;
}

.search-item-info {
    flex: 1;
    min-width: 0;
}

.search-item-name {
    font-size: 14px;
    color: #222;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Stock status badge */
.search-item-stock {
    font-size: 12px;
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: 500;
}

.search-item-stock.stock-available {
    background: #e8f5e9;
    color: #2e7d32;
}

.search-item-stock.stock-out {
    background: #ffebee;
    color: #c62828;
}

.search-no-results {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.search-loading {
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.search-loading i {
    margin-right: 8px;
}

/* Scrollbar untuk dropdown */
.search-dropdown::-webkit-scrollbar {
    width: 6px;
}

.search-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.search-dropdown::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.search-dropdown::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Responsive */
@media (max-width: 768px) {
    .search-container {
        max-width: 100%;
    }
    
    .search-dropdown {
        max-height: 300px;
    }
    
    .search-item-name {
        font-size: 13px;
    }
    
    .search-item-stock {
        font-size: 11px;
        padding: 2px 6px;
    }
}

/* Keyboard navigation active state */
.search-dropdown-item.active {
    background-color: #f5f5f5;
    border-left: 3px solid #ee4d2d;
}

.search-dropdown-item.active .search-item-name {
    color: #ee4d2d;
    font-weight: 500;
}