/* Real Product Search Styles */

/* Autocomplete Container */
.real-autocomplete-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 12px 12px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    backdrop-filter: blur(10px);
}

/* Autocomplete Items */
.real-autocomplete-container .autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.real-autocomplete-container .autocomplete-item:hover {
    background-color: #f8f9fa;
    transform: translateX(2px);
}

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

/* Product Image in Suggestions */
.product-image-container {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Product Details */
.product-details {
    flex: 1;
    min-width: 0;
}

.product-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
}

.product-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
}

.product-category {
    color: #666;
}

.product-price {
    font-weight: 600;
    color: #4a7c59;
}

/* Highlight Matched Text */
.product-name mark {
    background: linear-gradient(120deg, #fff3cd 0%, #fff3cd 100%);
    background-size: 100% 0.3em;
    background-repeat: no-repeat;
    background-position: 0 85%;
    font-weight: 600;
    color: #333;
    padding: 0;
}

/* Loading State */
.autocomplete-loading {
    padding: 24px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #4a7c59;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 12px;
}

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

/* No Results State */
.autocomplete-no-results {
    padding: 24px;
    text-align: center;
    color: #666;
}

.no-results-icon {
    font-size: 32px;
    margin-bottom: 8px;
    display: block;
}

.suggestion-text {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

/* View All Results Item */
.view-all-item {
    background: #f8f9fa !important;
    border-top: 1px solid #e0e0e0 !important;
    font-weight: 500;
    color: #4a7c59 !important;
}

.view-all-item:hover {
    background: #e9ecef !important;
    color: #2e5d3e !important;
}

.view-all-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    font-size: 14px;
}

.arrow {
    font-weight: bold;
    transition: transform 0.2s ease;
}

.view-all-item:hover .arrow {
    transform: translateX(4px);
}
/* Search Results Page */
.search-results-count {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 16px 20px;
    margin-bottom: 24px;
    border-radius: 12px;
    font-size: 14px;
    color: #666;
    border-left: 4px solid #4a7c59;
}

.no-search-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

.no-search-results .no-results-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    display: block;
}

.no-search-results h3 {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.5rem;
}

.no-search-results p {
    margin-bottom: 2rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* Product Card Enhancements */
.product-card[data-product-id] {
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.out-of-stock-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #dc3545;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Highlight Animation */
@keyframes highlight {
    0%, 100% { 
        background-color: transparent; 
        transform: scale(1);
    }
    50% { 
        background-color: rgba(74, 124, 89, 0.1); 
        transform: scale(1.02);
    }
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    z-index: 10000;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideInRight 0.3s ease-out;
    max-width: 300px;
}

.toast.info {
    background: #17a2b8;
    color: white;
}

.toast.error {
    background: #dc3545;
    color: white;
}

.toast.success {
    background: #28a745;
    color: white;
}

.toast.warning {
    background: #ffc107;
    color: #333;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .real-autocomplete-container {
        max-height: 320px;
        border-radius: 0 0 8px 8px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    }
    
    .autocomplete-item {
        padding: 10px 14px;
        gap: 10px;
    }
    
    .product-image-container {
        width: 40px;
        height: 40px;
    }
    
    .product-name {
        font-size: 13px;
    }
    
    .product-meta {
        font-size: 11px;
    }
    
    .search-results-count {
        padding: 12px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .real-autocomplete-container {
        max-height: 280px;
        left: -8px;
        right: -8px;
    }
    
    .autocomplete-item {
        padding: 8px 12px;
        gap: 8px;
    }
    
    .product-image-container {
        width: 36px;
        height: 36px;
        border-radius: 6px;
    }
    
    .product-name {
        font-size: 12px;
    }
    
    .product-meta {
        font-size: 10px;
    }
    
    .toast {
        left: 10px;
        right: 10px;
        top: 10px;
    }
    
    .no-search-results {
        padding: 2rem 1rem;
    }
    
    .no-search-results .no-results-icon {
        font-size: 3rem;
    }
    
    .no-search-results h3 {
        font-size: 1.2rem;
    }
}

/* Scrollbar Styling */
.real-autocomplete-container::-webkit-scrollbar {
    width: 6px;
}

.real-autocomplete-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.real-autocomplete-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.real-autocomplete-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Animation for showing autocomplete */
.real-autocomplete-container.show {
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Search Input Focus Enhancement */
.main-search-bar:focus {
    outline: none;
    border-color: #4a7c59;
    box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.1);
}

/* Search Button Enhancement */
.search-btn:hover {
    background-color: #2e5d3e;
    transform: translateY(-1px);
}

.search-btn:active {
    transform: translateY(0);
}
/* Enhanced Search Results Page Styles */
.search-results-count {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 16px 20px;
    margin-bottom: 24px;
    border-radius: 12px;
    border-left: 4px solid #4a7c59;
}

.results-text {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.clear-search-btn {
    background: #4a7c59;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-search-btn:hover {
    background: #2e5d3e;
    transform: translateY(-1px);
}

/* Search Suggestions */
.search-suggestions {
    margin: 2rem 0;
    text-align: center;
}

.search-suggestions h4 {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1rem;
}

.suggestion-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.suggestion-tag {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestion-tag:hover {
    background: #4a7c59;
    color: white;
    border-color: #4a7c59;
    transform: translateY(-1px);
}

/* Product Card Enhancements */
.product-pricing {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.original-price {
    text-decoration: line-through;
    color: #999;
    font-size: 12px;
    margin: 0;
}

.discount-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Mobile Responsive Enhancements */
@media (max-width: 768px) {
    .search-results-count {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .suggestion-tags {
        gap: 6px;
    }
    
    .suggestion-tag {
        font-size: 11px;
        padding: 4px 8px;
    }
}

@media (max-width: 480px) {
    .search-results-count {
        padding: 12px 16px;
    }
    
    .results-text {
        font-size: 13px;
    }
    
    .clear-search-btn {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    .no-search-results {
        padding: 2rem 1rem;
    }
    
    .search-suggestions h4 {
        font-size: 0.9rem;
    }
}