/* Custom Grid Layout for WooCommerce Categories */
.custom-category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px; /* Space between cards */
    margin: 0 auto;
    padding: 20px;
    max-width: 1200px; /* Ensure the content is not too wide */
}

.category-card {
    display: flex;
    flex-direction: column;
    background-color: #f5f5f5;
    
    overflow: hidden;
    
    position: relative;
    text-decoration: none; /* Remove underline from the link */
}

/* Category image with background and zoom effect */
.category-image {
    height: 0;
    padding-top: 70%;
    background-size: 100%; /* Set initial image size */
    background-position: center;
    transition: background-size 0.3s ease-in-out; /* Smooth transition for zoom effect */
}

/* Zoom image on hover, while keeping the container size the same */
.category-card:hover .category-image {
    background-size: 110%; /* Zoom image in by 20% */
}

.category-name {
    background-color: #fff;
    padding: 15px;
    text-align: center;
    flex-grow: 1;
}

.category-name span {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.category-card:hover .category-name span {
    color: var(--wp--preset--color--text-link); /* Change text color on hover */
}

/* Responsive Design */
@media (max-width: 768px) {
    .custom-category-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 items per row on smaller screens */
    }
}

@media (max-width: 480px) {
    .custom-category-grid {
        grid-template-columns: 1fr; /* 1 item per row on very small screens */
    }
}
