/* Make the product card relative to hold the absolute title */
.elementor-widget-woocommerce-product-related ul.products li.product {
    position: relative;
    overflow: hidden;
}

/* Hide extra elements to maintain the clean image look */
.elementor-widget-woocommerce-product-related ul.products li.product .price,
.elementor-widget-woocommerce-product-related ul.products li.product .button,
.elementor-widget-woocommerce-product-related ul.products li.product .add_to_cart_button,
.elementor-widget-woocommerce-product-related ul.products li.product .star-rating {
    display: none !important;
}

/* Style the title to be an overlay */
.elementor-widget-woocommerce-product-related ul.products li.product .woocommerce-loop-product__title {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    margin: 0;
    background: rgba(0, 0, 0, 0.5); /* Dark overlay */
    color: #ffffff !important;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    z-index: 10;
    box-sizing: border-box;
    font-size: 24px;
}

/* Show title on hover */
.elementor-widget-woocommerce-product-related ul.products li.product:hover .woocommerce-loop-product__title {
    opacity: 1;
}

/* Ensure the image takes full space */
.elementor-widget-woocommerce-product-related ul.products li.product img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.5s ease;
}

/* Optional: Slight zoom effect on image during hover */
.elementor-widget-woocommerce-product-related ul.products li.product:hover img {
    transform: scale(1.05);
}
