@import "../utils/_index";

.tax-product_cat {
    
    &.no-child-categories .categories-listing {
        display: none !important;
    }
    
    .elementor-widget-divider--view-line:first-child span {
        background: linear-gradient(90deg, #BDBDBD 0%, #F1F1F1 100%) !important;
        --divider-color: linear-gradient(90deg, #BDBDBD 0%, #F1F1F1 100%) !important;
        height: 6px !important;
        margin-bottom: 76px !important;
    }
    
    .product-card {
        &:hover{
            .product-card-top{
                &:before{
                    clip-path: polygon(0 0, 100% 0, 100% 70%, 0% 100%);
                }
            }
        }
        .product-card-top {
            height: 300px;
            position: relative;
            
            &:before{
                .pseudo();
                position:absolute;
                inset:0;
                background: #F6F6F6;
                clip-path: polygon(0 0, 100% 0%, 100% 100%, 0% 100%);
                transition: clip-path 0.5s;
            }
            
            * {
                width: 100%;
                height: 100%;
            }
            
            .product-card-top-img a {
                display: flex;
                justify-content: center;
                align-items: center;
                
                img {
                    height: auto;
                    width: auto;
                    max-width: 90%;
                    max-height: 90%;
                }
            }    
        }
        
        .product-card-bottom {
            flex-grow: 1;
            
            .product-card-bottom-title {
                flex-grow: 1;
                
                h3 a {
                    text-decoration: none;
                    display: -webkit-box;
                    -webkit-line-clamp: 2;
                    -webkit-box-orient: vertical;
                    overflow: hidden;
                    text-overflow: ellipsis;
                }
            }
            
            .product-card-bottom-btn {
                
            }
        }
    }
}

// Variables
@columns: 4;
@gap-desktop: 30px;
@gap-tablet: 20px;
@gap-mobile: 15px;

@transition-speed: 0.3s;

// Breakpoints
@screen-lg: 1024px;
@screen-md: 768px;
@screen-sm: 480px;

// Mixins
.transition(@property: all, @duration: @transition-speed, @easing: ease) {
    transition: @property @duration @easing;
}

.custom-product-categories {
    
    ul.products {
        display: grid;
        grid-template-columns: repeat(@columns, 1fr);
        gap: @gap-desktop;
        list-style: none;
        margin: 0;
        padding: 0;
        
        &:before, &:after {
            content: none;
        }
        
        .product-category {
            margin: 0;
            padding: 0;
            box-shadow: 0px 8px 50px -5px rgba(0, 0, 0, 0.06);
            border-radius: 16px;
            .transition(all);
            
            &:hover {
                box-shadow: 0px 8px 50px -5px rgba(0, 0, 0, 0.2);
            }
            
            .category-inner {
                background: #FFFFFF;
                border-radius: 16px;
                overflow: hidden;
                height: 100%;
                display: flex;
                flex-direction: column;
                gap: 20px;
                padding: 16px;
                
                .category-image {
                    position: relative;
                    overflow: hidden;
                    height: 200px;
                    width: 100%;
                    border-radius: 10px;
                    
                    a {
                        position: relative;
                        overflow: hidden;
                        
                        &:hover {
                            &:after {
                                opacity: 1;
                            }
                        }
                        
                        &:after {
                            content: '';
                            position: absolute;
                            top: 0;
                            left: 0;
                            width: 100%;
                            height: 100%;
                            background: linear-gradient(180deg, rgba(254, 246, 2, 0) 0%, rgba(241, 88, 0, 0.8) 100%);
                            opacity: 0;
                            transition: opacity 0.3s ease;
                        }
                        
                        img {
                            width: 100%;
                            height: 100%;
                            object-fit: cover;
                        }
                    }
                    
                }
                
                .category-content {
                    flex: 1;
                    display: flex;
                    flex-direction: column;
                    align-items: center;
                    
                    .woocommerce-loop-category__title {
                        padding: 0 !important;
                        margin: 0 !important;
                        font-size: 24px !important;
                        line-height: 32px !important;
                        font-weight: 500 !important;
                        text-align: center;
                        border-bottom: 1px solid rgba(189, 189, 189, 1);
                        width: 80%;
                        height: 84px;
                        display: flex;
                        justify-content: center;
                        align-items: flex-start;
                        
                        a {
                            font-size: inherit;
                            line-height: inherit;
                            font-weight: inherit;
                            color: #000000;
                            text-decoration: none;
                            display: -webkit-box;
                            -webkit-line-clamp: 2;
                            -webkit-box-orient: vertical;
                            overflow: hidden;
                            text-overflow: ellipsis;
                        }
                    }
                    
                    .category-button-wrapper {
                        margin-top: auto;
                        
                        .category-button {
                            display: inline-block;
                            width: fit-content;
                            padding: 16px 30px;
                            background: #000000;
                            color: #FFFFFF;
                            text-align: center;
                            text-decoration: none;
                            border-radius: 9999px;
                            font-weight: 500;
                            font-size: 18px;
                            line-height: 28px;
                            .transition(all);
                            
                            &:hover {
                                background: linear-gradient(90deg, #BCBCBC 0%, #F2F2F2 100%);
                                color: #000000;
                            }
                        }
                    }
                }
            }
        }
    }
    
    
    
    
    
}

// Responsive
@media (max-width: @screen-lg) {
    .custom-product-categories {
        ul.products {
            grid-template-columns: repeat(3, 1fr);
            gap: @gap-tablet;
        }
    }
}

@media (max-width: @screen-md) {
    .custom-product-categories {
        ul.products {
            grid-template-columns: repeat(2, 1fr);
            gap: @gap-mobile;
        }
    }
}

@media (max-width: @screen-sm) {
    .custom-product-categories {
        ul.products {
            grid-template-columns: 1fr;
        }
    }
}