/* Search Popup Styles - Compact & Beautiful */
.search-popup-overlays {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 10px;
    backdrop-filter: blur(5px);
}

.search-popups {
    background: white;
    border-radius: 12px;
    width: 95%;
    max-width: 500px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: popupSlideIn 0.3s ease-out;
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.search-popup-headers {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
}

.search-popup-headers h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
}

.close-popups {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #7f8c8d;
    padding: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-popups:hover {
    color: #e74c3c;
    background: #f8f9fa;
}

.search-input-groups {
    display: flex;
    padding: 16px;
    gap: 8px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.search-popup-inputs {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    background: white;
    transition: all 0.2s ease;
}

.search-popup-inputs:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-popup-buttons {
    background: #3498db;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    min-width: 44px;
}

.search-popup-buttons:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.search-results-containers {
    height: 96%;
    overflow-y: auto;
    padding: 0;
}

/* Compact Search Results Styles */
.search-results-headers {
    padding: 12px 16px 8px;
    background: #fafbfc;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 10;
}

.search-results-headers h4 {
    margin: 0;
    color: #7f8c8d;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.products-grids {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
}

/* Ultra Compact Product Cards */
.product-cards {
    display: flex;
    gap: 12px;
    padding: 10px;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    background: white;
    position: relative;
}

.product-cards:hover {
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.15);
    transform: translateY(-1px);
}

.product-imagess {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background: #f8f9fa;
    border: 1px solid #eee;
}

.product-imagess img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.product-cards:hover .product-image img {
    transform: scale(1.05);
}

.product-infos {
    flex: 1;
    min-width: 0; /* Important for text truncation */
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.product-names {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-names mark {
    background: #fff3cd;
    color: #856404;
    padding: 1px 2px;
    border-radius: 2px;
    font-weight: 700;
}

.product-metas {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 2px;
}

.product-brands {
    font-size: 11px;
    color: #7f8c8d;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.product-prices {
    font-size: 13px;
    font-weight: 700;
    color: #27ae60;
}

.product-stocks {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.in-stocks {
    background: #d4edda;
    color: #155724;
}

.out-of-stocks {
    background: #f8d7da;
    color: #721c24;
}

.product-skus {
    font-size: 10px;
    color: #95a5a6;
    margin-top: auto;
}

/* Compact No Results & Error States */
.no-resultss, .search-errors {
    text-align: center;
    padding: 40px 20px;
    color: #7f8c8d;
}

.no-resultss {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.no-results-icons {
    font-size: 48px;
    color: #bdc3c7;
    margin-bottom: 8px;
}

.no-resultss h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 14px;
}

.no-resultss p {
    margin: 0;
    font-size: 12px;
    color: #7f8c8d;
}

.search-errors {
    background: #f8d7da;
    color: #721c24;
    border-radius: 6px;
    margin: 8px;
    padding: 16px;
    font-size: 13px;
}

/* Scrollbar Styling */
.search-results-containers::-webkit-scrollbar {
    width: 4px;
}

.search-results-containers::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.search-results-containers::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.search-results-containers::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Loading Animation */
.search-loadings {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.loading-spinners {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .search-popup-overlays {
        padding: 5px;
    }
    
    .search-popups {
        width: 100%;
        max-height: 90vh;
        border-radius: 12px 12px 0 0;
        margin-top: auto;
    }
    
    .search-input-groups {
        padding: 12px;
    }
    
   
    
    .product-cards {
        padding: 8px;
        gap: 10px;
    }
    
    .product-imagess {
        width: 50px;
        height: 50px;
    }
    
    .product-names {
        font-size: 12px;
        -webkit-line-clamp: 2;
    }
    
    .product-metas {
        gap: 6px;
    }
    
    .product-brands {
        font-size: 10px;
    }
    
    .product-prices {
        font-size: 12px;
    }
}

/* Desktop Enhancements */
@media (min-width: 769px) {
    .search-popups {
        margin-top: 40px;
    }
    
    .products-grids {
        padding: 12px;
    }
}

/* High-density product layout for many results */
.high-densitys .products-grids {
    gap: 6px;
}

.high-densitys .product-cards {
    padding: 8px;
}

.high-densitys .product-imagess {
    width: 50px;
    height: 50px;
}

.high-densitys .product-names {
    font-size: 12px;
    -webkit-line-clamp: 1;
}

/* Quick actions on product hover */
.product-actionss {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.product-cards:hover .product-actionss {
    opacity: 1;
}

.quick-view-btns {
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-view-btns:hover {
    background: #2980b9;
}