/* Products Page Enhancement CSS */
/* This file ensures proper image display in product cards */

/* Product Image Container */
.products-page .product-card .product-image {
    width: 100% !important;
    height: 200px !important;
    background: var(--white) !important;
    border-radius: 20px 20px 0 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    padding: 15px !important;
    position: relative !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}

/* Product Images */
.products-page .product-card .product-image .product-icon-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
    border-radius: 12px !important;
    transition: all 0.3s ease !important;
    max-width: 100% !important;
    max-height: 100% !important;
}

/* Hover Effects */
.products-page .product-card:hover .product-image .product-icon-image {
    transform: scale(1.05) !important;
}

.products-page .product-card:hover .product-image {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
}

/* Product Card Content */
.products-page .product-card .product-content {
    padding: 1.5rem !important;
    background: var(--white) !important;
    border-radius: 0 0 20px 20px !important;
    position: relative !important;
    overflow: visible !important;
    min-height: 0 !important;
}

.products-page .product-card .product-content h4 {
    font-size: 1.4rem !important;
    font-weight: 700 !important;
    color: var(--dark-gray) !important;
    margin-bottom: 1rem !important;
    line-height: 1.3 !important;
}

.products-page .product-card .product-content p {
    color: var(--medium-gray) !important;
    line-height: 1.6 !important;
    margin-bottom: 1.5rem !important;
    font-size: 0.95rem !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

/* Product Content Elements - Prevent Overflow */
.products-page .product-card .product-suitable-for {
    overflow: hidden !important;
    margin-bottom: 0.75rem !important;
    background: rgba(0, 183, 255, 0.1) !important;
    padding: 0.5rem 0.75rem !important;
    border-radius: 8px !important;
    border-left: 3px solid #00b7ff !important;
}

.products-page .product-card .product-suitable-for small {
    display: block !important;
    line-height: 1.4 !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

.products-page .product-card .product-tags {
    overflow: hidden !important;
    margin-bottom: 0.75rem !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.25rem !important;
}

.products-page .product-card .product-tags .tag {
    background: rgba(102, 0, 153, 0.1) !important;
    color: #660099 !important;
    padding: 0.25rem 0.5rem !important;
    border-radius: 12px !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    border: 1px solid rgba(102, 0, 153, 0.2) !important;
}

.products-page .product-card .product-warranty {
    overflow: hidden !important;
    margin-bottom: 0.75rem !important;
    background: rgba(40, 167, 69, 0.1) !important;
    padding: 0.4rem 0.6rem !important;
    border-radius: 6px !important;
    border-left: 3px solid #28a745 !important;
}

.products-page .product-card .product-warranty small {
    display: block !important;
    line-height: 1.4 !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

.products-page .product-card .specifications-summary {
    overflow: hidden !important;
    margin-bottom: 0.75rem !important;
}

.products-page .product-card .specifications-summary h6 {
    margin-bottom: 0.5rem !important;
    font-size: 0.9rem !important;
}

.products-page .product-card .specifications-summary .spec-list {
    margin-bottom: 0 !important;
    padding-left: 1.2rem !important;
}

.products-page .product-card .specifications-summary .spec-list li {
    font-size: 0.85rem !important;
    margin-bottom: 0.25rem !important;
    line-height: 1.4 !important;
}

/* Ensure features text is fully visible */
.products-page .product-card .product-content small.text-muted {
    display: block !important;
    line-height: 1.5 !important;
    margin-bottom: 0.5rem !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    overflow: visible !important;
}

/* Product Card Buttons */
.products-page .product-card .btn {
    padding: 0.75rem 1.5rem !important;
    font-weight: 600 !important;
    border-radius: 12px !important;
    transition: all 0.3s ease !important;
    font-size: 0.9rem !important;
}

.products-page .product-card .btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .products-page .product-card .product-image {
        height: 180px !important;
        padding: 12px !important;
    }
    
    .products-page .product-card .product-content {
        padding: 1.25rem !important;
    }
    
    .products-page .product-card .product-content h4 {
        font-size: 1.3rem !important;
    }
}

@media (max-width: 767.98px) {
    .products-page .product-card .product-image {
        height: 160px !important;
        padding: 10px !important;
    }
    
    .products-page .product-card .product-content {
        padding: 1rem !important;
    }
    
    .products-page .product-card .product-content h4 {
        font-size: 1.2rem !important;
    }
    
    .products-page .product-card .product-content p {
        font-size: 0.9rem !important;
    }
}

/* Ensure proper spacing in products grid */
.products-page .products-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
    gap: 2rem !important;
    margin-top: 2rem !important;
    align-items: stretch !important;
}

.products-page .products-grid .product-card {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    min-height: 100% !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    overflow: visible !important;
}

/* Ensure product content area has proper height constraints */
.products-page .product-card .product-content {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: auto !important;
    overflow: visible !important;
    padding-bottom: 1rem !important;
}

/* Override any conflicting styles */
.products-page .product-card .product-image i {
    display: none !important;
}

.products-page .product-card .product-image .water-pump-placeholder,
.products-page .product-card .product-image .solar-panel-placeholder {
    display: none !important;
}

/* Filter Buttons Styling */
.filter-section {
    margin-bottom: 3rem;
}

.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--white);
    border: 2px solid var(--dark-gray);
    color: var(--dark-gray);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    z-index: 10;
}

.filter-btn:hover {
    background: var(--primary-purple);
    border-color: var(--primary-purple);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 0, 153, 0.3);
}

.filter-btn.active {
    background: var(--primary-purple);
    border-color: var(--primary-purple);
    color: var(--white);
    box-shadow: 0 8px 25px rgba(102, 0, 153, 0.3);
}

.filter-btn.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-green);
    border-radius: 2px;
}

/* Ensure product items can be hidden/shown */
.product-item {
    transition: all 0.3s ease;
}

.product-item[style*="display: none"] {
    display: none !important;
}

/* Force hide products with display: none style */
.product-item[style*="display: none"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Ensure grid layout respects hidden items */
.products-grid .product-item[style*="display: none"] {
    display: none !important;
    grid-column: unset !important;
    grid-row: unset !important;
}

/* FadeIn Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design for Filter Buttons */
@media (max-width: 767.98px) {
    .filter-buttons {
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}
