/*
 Theme Name:   Vazhi Child
 Theme URI:    https://vazhi.wpengine.com/
 Description:  Vazhi Child Theme
 Author:       the WeDesignTech team
 Author URI:   https://wedesignthemes.com/
 Template:     vazhi
 Text Domain:  vazhi-child
 Version:      1.0.0
 Tested up to: 6.7
 Requires PHP: 7.4
 Tags: Blog, e-commerce, portfolio
 License: GNU General Public License v2 or later 
 License URI: https: //www.gnu.org/licenses/gpl-2.0.html
 Copyright (C) 2025 buddhathemes. All rights reserved.
*/

/* =============================================================
   Search Category — icon_image support for wdt-custom-category-icon layout
   The parent theme hides the icon area unless it contains a
   .dtdr-listing-taxonomy-icon span (SVG inline mode). These rules
   un-hide it when an <img> is present (Icon Image mode) and apply
   the same circle styling used by the SVG span.
   ============================================================= */

.wdt-custom-category-icon[class*="-df-listings-taxonomy"]
.dtdr-listing-taxonomy-item
.dtdr-listing-taxonomy-icon-image:not(:has(.dtdr-listing-taxonomy-icon)):has(img) {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: var(--wdtRadius_Full);
    margin-right: 12px;
    flex-shrink: 0;
    box-shadow: 0 0 7px var(--wdtPrimaryColor) inset;
}

.wdt-custom-category-icon[class*="-df-listings-taxonomy"]
.dtdr-listing-taxonomy-item
.dtdr-listing-taxonomy-icon-image:not(:has(.dtdr-listing-taxonomy-icon)):has(img) img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 7px;
}

/* =============================================================
   Products widget (vazhi-pro) — card design matching Products Listing
   Scoped to .wdt-products-container so no other WooCommerce loop is affected.
   ============================================================= */

/* Flex column so image stacks above content */
.wdt-products-container ul.products li.product .product-wrapper {
    display: flex !important;
    flex-direction: column !important;
    float: none !important;
    align-items: stretch;
    margin: 0 !important;
    height: 100%;
}

/* 16:9 image area */
.wdt-products-container ul.products li.product .product-thumb {
    position: relative;
    overflow: hidden;
    flex: 0 0 auto;
    width: 100%;
}
.wdt-products-container ul.products li.product .product-thumb::before {
    padding-top: 56.25% !important;
}
.wdt-products-container ul.products li.product .product-thumb::after {
    padding-bottom: 0 !important;
}

/* Fill the 16:9 box */
.wdt-products-container ul.products li.product .product-thumb a.image {
    position: absolute !important;
    top: 0 !important; left: 0 !important;
    right: 0 !important; bottom: 0 !important;
    width: 100% !important; height: 100% !important;
    display: block !important;
}
.wdt-products-container ul.products li.product .product-thumb .primary-image {
    position: absolute !important;
    top: 0 !important; left: 0 !important;
    right: 0 !important; bottom: 0 !important;
    width: 100% !important; height: 100% !important;
}

/* img: contained with padding */
.wdt-products-container ul.products li.product .product-thumb .primary-image img {
    position: absolute !important;
    top: 0 !important; left: 0 !important;
    width: 100% !important; height: 100% !important;
    object-fit: contain !important;
    float: none !important;
    background-color: #fff;
    padding: 8px;
    box-sizing: border-box;
}

/* Content area */
.wdt-products-container ul.products li.product .wdt-product-card-content {
    flex: 1;
    display: flex !important;
    flex-direction: column !important;
    padding: 15px 20px !important;
    min-width: 0;
}

/* Title: 2-line clamp */
.wdt-products-container ul.products li.product .wdt-product-card-content .woocommerce-loop-product__title {
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: inherit;
    margin: 0 0 8px;
}

/* Bottom row: price left, button right, separator line */
.wdt-products-container ul.products li.product .wdt-product-card-bottom {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--wdtBorderColor, #e5e5e5);
}

/* Reset Vazhi block-button defaults and apply underline animation */
.wdt-products-container ul.products li.product .wdt-product-card-bottom a.custom-button-style.dtdr-listing-view-details {
    display: inline !important;
    margin: 0 !important;
    padding: 0 !important;
    color: var(--wdtHeadAltColor);
    background-image: linear-gradient(0deg, currentColor, currentColor);
    background-repeat: no-repeat;
    background-size: 100% 1px;
    background-position: bottom left;
    transition: background-size 0.3s ease;
}
.wdt-products-container ul.products li.product .wdt-product-card-bottom a.custom-button-style.dtdr-listing-view-details:hover {
    color: var(--wdtHeadAltColor) !important;
    background-size: 0 1px;
    background-position: bottom right;
}

/* Gap between Isotope cards — padding on the absolutely-positioned column */
.wdt-products-container ul.products li.product:not(.isotope-grid-sizer) .wdt-col {
    padding: 8px;
    box-sizing: border-box;
    height: 530px;
    overflow: hidden;
}

/* Force 4-column layout on wdt-shop-product-cat widget */
.elementor-widget-wdt-shop-product-cat .elementor-widget-container {
    display: flex !important;
    flex-wrap: wrap !important;
}
.elementor-widget-wdt-shop-product-cat .wdt-shop-category-listing-item.wdt-one-third {
    width: 25% !important;
    float: none !important;
    clear: none !important;
}