/* Search Modal Styles */
.search-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    animation: fadeIn 0.3s;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.search-modal-content {
    background-color: #ffffff;
    margin: 5% auto;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 85%;
    max-width: 700px;
    max-height: 80vh;
    transform: translateY(-30px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.search-modal-content.active {
    transform: translateY(0);
    opacity: 1;
}

.search-modal-close {
    color: #aaa;
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10;
}

.search-modal-close:hover {
    color: var(--dark-gray);
}

.search-modal h3 {
    margin: 0 0 20px 0;
    color: var(--dark-gray);
    font-size: 24px;
    font-weight: 600;
}

.search-form {
    display: flex;
    margin-bottom: 20px;
    position: relative;
}

.search-input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid var(--light-gray);
    border-radius: 8px 0 0 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

.search-input:focus {
    border-color: var(--accent-yellow);
}

.search-button {
    padding: 15px 25px;
    background-color: var(--accent-yellow);
    color: var(--dark-gray);
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

.search-button:hover {
    background-color: #e0a800;
}

.search-results {
    max-height: 400px;
    overflow-y: auto;
    margin-top: 10px;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.search-loading {
    text-align: center;
    padding: 30px;
    display: none;
    color: #666;
}

.search-loading i {
    font-size: 28px;
    color: var(--accent-yellow);
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

.search-result-count {
    padding: 10px 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
    color: #6c757d;
}

.search-result-item {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    transition: background-color 0.2s, transform 0.2s;
    cursor: pointer;
    border-radius: 8px;
}

.search-result-item:hover {
    background-color: #f8f9fa;
    transform: translateX(5px);
}

.search-result-image {
    width: 70px;
    height: 70px;
    object-fit: cover;
    margin-right: 20px;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.search-result-info {
    flex: 1;
}

.search-result-name {
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--dark-gray);
    font-size: 17px;
}

.search-result-price {
    color: #e74c3c;
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 4px;
}

.search-result-category {
    color: #7f8c8d;
    font-size: 14px;
    background-color: #f1f2f6;
    padding: 3px 8px;
    border-radius: 12px;
    display: inline-block;
}

.search-result-action {
    color: #aaa;
    font-size: 18px;
    transition: color 0.2s;
}

.search-result-item:hover .search-result-action {
    color: var(--accent-yellow);
}

.search-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #7f8c8d;
    font-size: 16px;
}

.search-error {
    color: #e74c3c;
    text-align: center;
    padding: 20px;
    background-color: #fdeded;
    border-radius: 8px;
    margin: 10px 0;
}

/* Scrollbar styling */
.search-results::-webkit-scrollbar {
    width: 8px;
}

.search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.search-results::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .search-modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }
    
    .search-result-item {
        flex-direction: column;
        text-align: center;
        padding: 15px 10px;
    }
    
    .search-result-image {
        margin-right: 0;
        margin-bottom: 15px;
        width: 100px;
        height: 100px;
    }
    
    .search-result-action {
        display: none;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .search-input {
        border-radius: 8px;
        margin-bottom: 10px;
    }
    
    .search-button {
        border-radius: 8px;
        padding: 12px;
    }
}

/* Animation for search results */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-result-item {
    animation: slideIn 0.3s ease forwards;
}

.search-result-item:nth-child(2) {
    animation-delay: 0.05s;
}

.search-result-item:nth-child(3) {
    animation-delay: 0.1s;
}

.search-result-item:nth-child(n+4) {
    animation-delay: 0.15s;
}