/*
 Theme Name:   Woodmart Child
 Description:  Woodmart Child Theme
 Author:       XTemos
 Author URI:   http://xtemos.com
 Template:     woodmart
 Version:      1.0.0
 Text Domain:  woodmart
*/

/* === Category image: darken for text readability === */
.cat-design-center .wd-cat-image img,
.cat-design-center .wd-cat-image {
    filter: brightness(0.58);
    transition: filter 0.3s ease;
    display: block;
}
.cat-design-center .product-category:hover .wd-cat-image img,
.cat-design-center .product-category:hover .wd-cat-image {
    filter: brightness(0.46);
}



/* ==========================================================
   v6.0: Product Gallery — Uniform Image Display
   Fixes mixed portrait/landscape images in WooCommerce gallery
   ========================================================== */

/* --- MAIN IMAGE GALLERY: fixed-height container --- */
/* Use max-height + overflow:hidden as the primary constraint;
   height:520px !important handles the JS autoheight override */
.woocommerce-product-gallery .wd-gallery-images figure.wd-carousel,
.woocommerce-product-gallery .wd-gallery-images .wd-carousel-wrap {
    height: 520px !important;
    max-height: 520px !important;
    overflow: hidden !important;
    min-height: unset !important;
}

/* Each slide: flex-centred so any-ratio image sits in middle */
.woocommerce-product-gallery .wd-gallery-images .wd-carousel-item {
    height: 520px !important;
    max-height: 520px !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #f9f8f5 !important;
    border-radius: 8px !important;
}

/* Inner figure and link wrapper */
.woocommerce-product-gallery .wd-gallery-images .woocommerce-product-gallery__image,
.woocommerce-product-gallery .wd-gallery-images .woocommerce-product-gallery__image > a {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    box-sizing: border-box !important;
}

/* Product image: object-fit contain keeps the full image visible */
.woocommerce-product-gallery .wd-gallery-images .woocommerce-product-gallery__image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    display: block !important;
}

/* Clip the outer container wrapper too */
.woocommerce-product-gallery .wd-gallery-images,
.woocommerce-product-gallery .wd-gallery-images .wd-carousel-inner {
    overflow: hidden !important;
    max-height: 520px !important;
}

/* --- THUMBNAILS: uniform 90 px height --- */
.woocommerce-product-gallery .wd-gallery-thumb .wd-carousel-item {
    height: 90px !important;
    max-height: 90px !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #f9f8f5 !important;
    border-radius: 6px !important;
    border: 2px solid transparent !important;
    box-sizing: border-box !important;
    cursor: pointer !important;
    transition: border-color 0.25s ease !important;
    padding: 4px !important;
}

.woocommerce-product-gallery .wd-gallery-thumb .wd-carousel-item.wd-active,
.woocommerce-product-gallery .wd-gallery-thumb .wd-carousel-item:hover {
    border-color: #c8a97e !important;
}

.woocommerce-product-gallery .wd-gallery-thumb .wd-carousel-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    display: block !important;
}

/* --- RESPONSIVE --- */
@media (max-width: 991px) {
    .woocommerce-product-gallery .wd-gallery-images,
    .woocommerce-product-gallery .wd-gallery-images .wd-carousel-inner,
    .woocommerce-product-gallery .wd-gallery-images figure.wd-carousel,
    .woocommerce-product-gallery .wd-gallery-images .wd-carousel-wrap,
    .woocommerce-product-gallery .wd-gallery-images .wd-carousel-item,
    .woocommerce-product-gallery .wd-gallery-images .woocommerce-product-gallery__image,
    .woocommerce-product-gallery .wd-gallery-images .woocommerce-product-gallery__image > a {
        height: 420px !important;
        max-height: 420px !important;
    }
}

@media (max-width: 575px) {
    .woocommerce-product-gallery .wd-gallery-images,
    .woocommerce-product-gallery .wd-gallery-images .wd-carousel-inner,
    .woocommerce-product-gallery .wd-gallery-images figure.wd-carousel,
    .woocommerce-product-gallery .wd-gallery-images .wd-carousel-wrap,
    .woocommerce-product-gallery .wd-gallery-images .wd-carousel-item,
    .woocommerce-product-gallery .wd-gallery-images .woocommerce-product-gallery__image,
    .woocommerce-product-gallery .wd-gallery-images .woocommerce-product-gallery__image > a {
        height: 340px !important;
        max-height: 340px !important;
    }
    .woocommerce-product-gallery .wd-gallery-thumb .wd-carousel-item {
        height: 72px !important;
        max-height: 72px !important;
    }
}
