/* Custom AJAX Search Filter Popup */
.search-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.search-popup-overlay.active {
    display: flex;
    opacity: 1;
    visibility: visible;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
}

.search-popup-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    transform: scale(0.95) translateY(-20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    margin-top: 60px;
}

.search-popup-overlay.active .search-popup-container {
    transform: scale(1) translateY(0);
}

/* Search Header */
.search-popup-header {
    padding: 24px 30px;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
}

.search-popup-title {
    font-size: 24px;
    font-weight: 700;
    color: #212529;
    margin: 0;
    font-family: "Poppins", sans-serif;
}

.search-popup-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.search-popup-close:hover {
    background: #f5f5f5;
    color: #212529;
}

/* Search Input */
.search-popup-body {
    padding: 30px;
    flex: 1;
    overflow-y: auto;
}

.search-input-wrapper {
    position: relative;
    margin-bottom: 30px;
}

.search-input {
    width: 100%;
    padding: 16px 50px 16px 20px;
    font-size: 16px;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    outline: none;
    transition: all 0.3s ease;
    font-family: "Poppins", sans-serif;
}

.search-input:focus {
    border-color: #8bc633;
    box-shadow: 0 0 0 3px rgba(139, 198, 51, 0.1);
}

.search-input-icon {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 20px;
    pointer-events: none;
}

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

.search-loading.active {
    display: block;
}

.search-loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #8bc633;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

/* Search Results */
.search-results {
    display: none;
}

.search-results.active {
    display: block;
}

.search-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    display: none;
}

.search-empty.active {
    display: block;
}

.search-empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Categories Section */
.search-categories {
    margin-bottom: 30px;
}

.search-section-title {
    font-size: 18px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    font-family: "Poppins", sans-serif;
}

.category-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.category-item:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.category-name {
    font-size: 16px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 15px;
    font-family: "Poppins", sans-serif;
}

.category-name a {
    color: #212529;
    text-decoration: none;
    transition: color 0.2s ease;
}

.category-name a:hover {
    color: #8bc633;
}

.category-products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

/* Products Section */
.search-products {
    margin-top: 30px;
}

.product-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    text-decoration: none;
    color: inherit;
}

.product-item:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateX(5px);
}

.product-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 15px;
    background: #e9ecef;
    flex-shrink: 0;
}

.product-info {
    flex: 1;
    min-width: 0;
}

.product-title {
    font-size: 15px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 8px;
    font-family: "Poppins", sans-serif;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-category {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 10px;
}

.product-sale-price {
    font-size: 16px;
    font-weight: 700;
    color: #8bc633;
    font-family: "Poppins", sans-serif;
}

.product-regular-price {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
}

/* Category Product Item (smaller) */
.category-product-item {
    background: #fff;
    border-radius: 6px;
    padding: 10px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    border: 1px solid #e9ecef;
}

.category-product-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.category-product-image {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 8px;
    background: #f0f0f0;
}

.category-product-title {
    font-size: 13px;
    font-weight: 500;
    color: #212529;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    font-family: "Poppins", sans-serif;
}

.category-product-price {
    font-size: 14px;
    font-weight: 600;
    color: #8bc633;
    font-family: "Poppins", sans-serif;
}

/* Responsive */
@media (max-width: 768px) {
    .search-popup-overlay.active {
        padding: 20px 10px;
    }
    
    .search-popup-container {
        margin-top: 20px;
        max-height: 95vh;
    }
    
    .search-popup-header {
        padding: 20px;
    }
    
    .search-popup-title {
        font-size: 20px;
    }
    
    .search-popup-body {
        padding: 20px;
    }
    
    .category-products {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .product-item {
        padding: 12px;
    }
    
    .product-image {
        width: 60px;
        height: 60px;
    }
}

