
/*
 * Funday Adventures Books — force fix for Related Products.
 * The theme/vendor grid may apply square cropping after WooCommerce renders.
 * These rules intentionally target several common related-product structures.
 */

/* Let the related area expand vertically. */
body.single-product .related,
body.single-product .related.products,
body.single-product section.related,
body.single-product .woocommerce .related,
body.single-product [class*="related-product"],
body.single-product [class*="related_product"] {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
}

/* Never crop the product card itself. */
body.single-product .related li.product,
body.single-product .related .product,
body.single-product [class*="related-product"] li.product,
body.single-product [class*="related_product"] li.product {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
}

/* Remove forced square/landscape image wrappers. */
body.single-product .related li.product a:first-child,
body.single-product .related li.product .woocommerce-LoopProduct-link,
body.single-product .related li.product .woocommerce-loop-product__link,
body.single-product [class*="related-product"] li.product a,
body.single-product [class*="related_product"] li.product a {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
}

/*
 * MAIN FIX:
 * show the entire portrait book cover.
 * No object-fit:cover, no square crop, no hidden overflow.
 */
body.single-product .related li.product img,
body.single-product .related.products li.product img,
body.single-product section.related li.product img,
body.single-product .woocommerce .related li.product img,
body.single-product [class*="related-product"] img,
body.single-product [class*="related_product"] img,
body.single-product img.funday-related-cover-fixed {
    display: block !important;
    width: auto !important;
    max-width: 100% !important;
    height: 250px !important;
    max-height: 250px !important;
    min-height: 0 !important;
    margin: 0 auto 12px !important;
    padding: 0 !important;
    object-fit: contain !important;
    object-position: center center !important;
    overflow: visible !important;
    clip: auto !important;
    clip-path: none !important;
    transform: none !important;
    aspect-ratio: auto !important;
    background: #fff !important;
}

/* Make sure printed product titles below the cover can wrap completely. */
body.single-product .related li.product .woocommerce-loop-product__title,
body.single-product .related li.product h2,
body.single-product .related li.product h3,
body.single-product [class*="related-product"] li.product h2,
body.single-product [class*="related_product"] li.product h2 {
    display: block !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
}

/* Tablet */
@media (max-width: 900px) {
    body.single-product .related li.product img,
    body.single-product .related.products li.product img,
    body.single-product section.related li.product img,
    body.single-product .woocommerce .related li.product img,
    body.single-product [class*="related-product"] img,
    body.single-product [class*="related_product"] img,
    body.single-product img.funday-related-cover-fixed {
        height: 235px !important;
        max-height: 235px !important;
    }
}

/* Phone */
@media (max-width: 560px) {
    body.single-product .related li.product img,
    body.single-product .related.products li.product img,
    body.single-product section.related li.product img,
    body.single-product .woocommerce .related li.product img,
    body.single-product [class*="related-product"] img,
    body.single-product [class*="related_product"] img,
    body.single-product img.funday-related-cover-fixed {
        height: 210px !important;
        max-height: 210px !important;
    }
}
