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


/*
 * Product Grid Pixel-Perfect Alignment Overrides
 * Centered square product images and aligned product titles/categories/prices
 */

/* 1. Force the image wrapper to be a perfectly square box */
.product-grid-item .product-element-top {
    position: relative !important;
    overflow: hidden !important;
    aspect-ratio: 1 / 1 !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: transparent !important;
}

/* 2. Style both the default and hover images to fit cleanly within the square */
.product-grid-item .product-image-link,
.product-grid-item .hover-img {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
}

.product-grid-item .hover-img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
}

.product-grid-item .product-image-link img,
.product-grid-item .hover-img img {
    max-width: 92% !important;
    max-height: 92% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    margin: auto !important;
}

/* 3. Align the product titles so the content underneath (cats, price) starts at the exact same vertical line */
.product-grid-item .wd-entities-title {
    font-size: 15px !important;
    line-height: 1.3 !important;
    min-height: 39px !important;
    /* Perfectly fits up to 2 lines of text */
    margin-top: 12px !important;
    margin-bottom: 6px !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* 4. Tweak margin for categories and price for a modern, balanced look */
.product-grid-item .wd-product-cats {
    margin-bottom: 6px !important;
}

.product-grid-item .price {
    margin-top: 4px !important;
}

/* 
 * Hide Category Titles and Count Badges inside "What Is Popular Now" Section 
 * Targets the specific Elementor tabs wrapper ID (.elementor-element-4dcec45) 
 * and also provides a reusable class (.hide-cat-details) for safety and portability.
 */
.elementor-element-4dcec45 .wd-cat .wd-entities-title,
.elementor-element-4dcec45 .wd-cat .wd-cat-count,
.hide-cat-details .wd-cat .wd-entities-title,
.hide-cat-details .wd-cat .wd-cat-count {
    display: none !important;
}