/* Core — uniform Digiland/WooCommerce product cards on single-product pages.
   v1.2.3 supports Digiland desktop `.item-area.product` AND mobile
   `.item-area.item_general.general_mobile` templates. */

body.single-product.mhr-core-product-cards-enabled .mhr-core-product-slide {
    height: auto !important;
    align-self: stretch !important;
}

body.single-product.mhr-core-product-cards-enabled .mhr-core-product-slide > .item,
body.single-product.mhr-core-product-cards-enabled .mhr-core-product-slide .mhr-core-product-card {
    height: 100% !important;
    min-height: 100% !important;
}

body.single-product.mhr-core-product-cards-enabled .mhr-core-product-slide .mhr-core-product-card {
    display: flex !important;
    flex-direction: column !important;
}

/* Fixed media frame so portrait, square and short images never move card content up/down. */
body.single-product.mhr-core-product-cards-enabled .mhr-core-product-slide .product-image-area {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    aspect-ratio: 4 / 5 !important;
    min-height: 0 !important;
    overflow: hidden !important;
    border-radius: 12px !important;
    background: #fff !important;
}

body.single-product.mhr-core-product-cards-enabled .mhr-core-product-slide .product-image-area > a.product-image {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
    border-radius: inherit !important;
}

/* Fill the standard frame. A small crop is intentional: it removes the empty side bands
   caused by mixed source aspect ratios and makes every product card visually consistent. */
body.single-product.mhr-core-product-cards-enabled .mhr-core-product-slide .product-image-area img {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    max-height: none !important;
    margin: 0 !important;
    object-fit: cover !important;
    object-position: center center !important;
    border-radius: inherit !important;
}

body.single-product.mhr-core-product-cards-enabled .mhr-core-product-slide .product-detail-area {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-direction: column !important;
    min-height: 0 !important;
    padding-top: 8px !important;
}

body.single-product.mhr-core-product-cards-enabled .mhr-core-product-slide .woocommerce-loop-product__title,
body.single-product.mhr-core-product-cards-enabled .mhr-core-product-slide .product-name {
    min-height: 3.15em !important;
    max-height: 3.15em !important;
    margin: 0 0 6px !important;
    overflow: hidden !important;
}

body.single-product.mhr-core-product-cards-enabled .mhr-core-product-slide .woocommerce-loop-product__title > a,
body.single-product.mhr-core-product-cards-enabled .mhr-core-product-slide .product-name > a {
    display: -webkit-box !important;
    overflow: hidden !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
}

/* Hide the OUTER real Swiper slide. */
body.single-product.mhr-core-product-cards-enabled .mhr-core-product-slide.mhr-core-stock-hidden {
    display: none !important;
}

@media (max-width: 767px) {
    body.single-product.mhr-core-product-cards-enabled .mhr-core-product-slide .product-image-area {
        aspect-ratio: 4 / 5 !important;
        border-radius: 10px !important;
    }

    body.single-product.mhr-core-product-cards-enabled .mhr-core-product-slide .product-detail-area {
        min-height: 90px !important;
        padding-top: 7px !important;
    }

    body.single-product.mhr-core-product-cards-enabled .mhr-core-product-slide .product-name,
    body.single-product.mhr-core-product-cards-enabled .mhr-core-product-slide .woocommerce-loop-product__title {
        min-height: 3em !important;
        max-height: 3em !important;
        margin-bottom: 5px !important;
    }

    /* The mobile template originally nests `.price` inside `.actions`. JS moves the real
       price into normal flow after the title. These rules also beat Digiland's hide rules. */
    body.single-product.mhr-core-product-cards-enabled.mhr-core-mobile-card-price .mhr-core-product-slide .mhr-core-product-card .product-detail-area > .price,
    body.single-product.mhr-core-product-cards-enabled.mhr-core-mobile-card-price .mhr-core-product-slide .price.mhr-core-price-inline-forced,
    body.single-product.mhr-core-product-cards-enabled.mhr-core-mobile-card-price .mhr-core-product-slide .price.mhr-core-mobile-price-relocated {
        display: flex !important;
        align-items: baseline !important;
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
        gap: 3px !important;
        width: 100% !important;
        height: auto !important;
        min-height: 24px !important;
        max-height: none !important;
        margin: 1px 0 6px !important;
        padding: 0 !important;
        opacity: 1 !important;
        visibility: visible !important;
        overflow: visible !important;
        position: relative !important;
        inset: auto !important;
        transform: none !important;
        clip: auto !important;
        clip-path: none !important;
        white-space: normal !important;
        font-size: 13px !important;
        line-height: 1.55 !important;
        z-index: 2 !important;
        float: none !important;
        clear: both !important;
    }

    body.single-product.mhr-core-product-cards-enabled.mhr-core-mobile-card-price .mhr-core-product-slide .price *,
    body.single-product.mhr-core-product-cards-enabled.mhr-core-mobile-card-price .mhr-core-product-slide .price .amount,
    body.single-product.mhr-core-product-cards-enabled.mhr-core-mobile-card-price .mhr-core-product-slide .price bdi {
        display: inline !important;
        opacity: 1 !important;
        visibility: visible !important;
        white-space: nowrap !important;
    }

    body.single-product.mhr-core-product-cards-enabled.mhr-core-mobile-card-price .mhr-core-product-slide .price-from {
        font-size: 11px !important;
        white-space: nowrap !important;
    }

    /* Keep add-to-cart actions below the now-visible price and prevent overlap. */
    body.single-product.mhr-core-product-cards-enabled .mhr-core-product-slide .general_mobile .actions {
        position: relative !important;
        overflow: visible !important;
        min-height: 34px !important;
    }
}
