/*
 * Lili Gallery - final spacing + fixed CTA polish.
 * Version 2.4.3
 * Native WoodMart hover mechanics are intentionally untouched.
 */

:root {
    --lili-card-x: 18px;
    --lili-card-y: 16px;
    --lili-card-gap: 10px;
    --lili-card-radius: var(--lili-ui-radius, 9px);
    --lili-card-accent: var(--wd-primary-color, #8f1b86);
    --lili-card-line: #edf0f4;
}

/* Shared secondary product surfaces only. */
:where(.elementor-widget-wd_products_tabs,.wd-products-tabs,.related-products,.upsells-products,.cross-sells,.wd-wishlist-content,body.woocommerce-shop,body.tax-product_cat,body.tax-product_tag,body.post-type-archive-product) .product-grid-item .product-wrapper {
    box-sizing: border-box;
}

/* Templates with an explicit lower content wrapper. */
:where(.elementor-widget-wd_products_tabs,.wd-products-tabs,.related-products,.upsells-products,.cross-sells,.wd-wishlist-content,body.woocommerce-shop,body.tax-product_cat,body.tax-product_tag,body.post-type-archive-product) .product-grid-item :is(.product-element-bottom,.product-information) {
    padding-inline: var(--lili-card-x) !important;
    padding-top: 14px !important;
    padding-bottom: var(--lili-card-y) !important;
}

/* Some native templates output title/price/button directly under product-wrapper.
   Give those the same safe horizontal gutters so text never hugs the card edge. */
:where(.elementor-widget-wd_products_tabs,.wd-products-tabs,.related-products,.upsells-products,.cross-sells,.wd-wishlist-content,body.woocommerce-shop,body.tax-product_cat,body.tax-product_tag,body.post-type-archive-product) .product-grid-item > .product-wrapper > .wd-entities-title,
:where(.elementor-widget-wd_products_tabs,.wd-products-tabs,.related-products,.upsells-products,.cross-sells,.wd-wishlist-content,body.woocommerce-shop,body.tax-product_cat,body.tax-product_tag,body.post-type-archive-product) .product-grid-item > .product-wrapper > .price,
:where(.elementor-widget-wd_products_tabs,.wd-products-tabs,.related-products,.upsells-products,.cross-sells,.wd-wishlist-content,body.woocommerce-shop,body.tax-product_cat,body.tax-product_tag,body.post-type-archive-product) .product-grid-item > .product-wrapper > .wd-swatches-product,
:where(.elementor-widget-wd_products_tabs,.wd-products-tabs,.related-products,.upsells-products,.cross-sells,.wd-wishlist-content,body.woocommerce-shop,body.tax-product_cat,body.tax-product_tag,body.post-type-archive-product) .product-grid-item > .product-wrapper > .wd-product-stock {
    margin-inline: var(--lili-card-x) !important;
}

:where(.elementor-widget-wd_products_tabs,.wd-products-tabs,.related-products,.upsells-products,.cross-sells,.wd-wishlist-content,body.woocommerce-shop,body.tax-product_cat,body.tax-product_tag,body.post-type-archive-product) .product-grid-item > .product-wrapper > .wd-entities-title {
    margin-top: 14px !important;
    margin-bottom: 8px !important;
}

:where(.elementor-widget-wd_products_tabs,.wd-products-tabs,.related-products,.upsells-products,.cross-sells,.wd-wishlist-content,body.woocommerce-shop,body.tax-product_cat,body.tax-product_tag,body.post-type-archive-product) .product-grid-item .wd-entities-title {
    padding-inline: 0 !important;
}

/* Price should have a little air but stay visually tied to the title. */
:where(.elementor-widget-wd_products_tabs,.wd-products-tabs,.related-products,.upsells-products,.cross-sells,.wd-wishlist-content,body.woocommerce-shop,body.tax-product_cat,body.tax-product_tag,body.post-type-archive-product) .product-grid-item .price {
    margin-top: 8px !important;
    margin-bottom: 0 !important;
}

/* Fixed CTA variants: full width inside the content area, not a small floating pill. */
:where(.elementor-widget-wd_products_tabs,.wd-products-tabs,.related-products,.upsells-products,.cross-sells,.wd-wishlist-content,body.woocommerce-shop,body.tax-product_cat,body.tax-product_tag,body.post-type-archive-product) .wd-product.wd-hover-fw-button .wd-add-btn,
:where(.elementor-widget-wd_products_tabs,.wd-products-tabs,.related-products,.upsells-products,.cross-sells,.wd-wishlist-content,body.woocommerce-shop,body.tax-product_cat,body.tax-product_tag,body.post-type-archive-product) .wd-product.wd-hover-standard .wd-add-btn {
    width: 100% !important;
    max-width: none !important;
    margin-top: 12px !important;
    margin-inline: 0 !important;
    margin-bottom: 0 !important;
}

:where(.elementor-widget-wd_products_tabs,.wd-products-tabs,.related-products,.upsells-products,.cross-sells,.wd-wishlist-content,body.woocommerce-shop,body.tax-product_cat,body.tax-product_tag,body.post-type-archive-product) .wd-product.wd-hover-fw-button .wd-add-btn > a,
:where(.elementor-widget-wd_products_tabs,.wd-products-tabs,.related-products,.upsells-products,.cross-sells,.wd-wishlist-content,body.woocommerce-shop,body.tax-product_cat,body.tax-product_tag,body.post-type-archive-product) .wd-product.wd-hover-standard .wd-add-btn > a {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    max-width: none !important;
    min-height: 44px !important;
    padding: 8px 14px !important;
    border-radius: var(--lili-card-radius) !important;
    box-sizing: border-box;
}

/* Standard can render the fixed CTA as a direct child of product-wrapper.
   Give it the same side/bottom safe area. */
:where(.elementor-widget-wd_products_tabs,.wd-products-tabs,.related-products,.upsells-products,.cross-sells,.wd-wishlist-content,body.woocommerce-shop,body.tax-product_cat,body.tax-product_tag,body.post-type-archive-product) .wd-product.wd-hover-standard > .product-wrapper > .wd-add-btn {
    width: calc(100% - (var(--lili-card-x) * 2)) !important;
    margin-inline: var(--lili-card-x) !important;
    margin-bottom: var(--lili-card-y) !important;
}

/* If standard content is wrapped, retain bottom breathing room without double-padding. */
:where(.elementor-widget-wd_products_tabs,.wd-products-tabs,.related-products,.upsells-products,.cross-sells,.wd-wishlist-content,body.woocommerce-shop,body.tax-product_cat,body.tax-product_tag,body.post-type-archive-product) .wd-product.wd-hover-standard .product-element-bottom > .wd-add-btn,
:where(.elementor-widget-wd_products_tabs,.wd-products-tabs,.related-products,.upsells-products,.cross-sells,.wd-wishlist-content,body.woocommerce-shop,body.tax-product_cat,body.tax-product_tag,body.post-type-archive-product) .wd-product.wd-hover-fw-button .product-element-bottom > .wd-add-btn {
    margin-bottom: 0 !important;
}

/* Keep native hover-only/button-overlay types untouched: no static full-width conversion. */
@media (min-width: 1025px) {
    :where(.elementor-widget-wd_products_tabs,.wd-products-tabs,.related-products,.upsells-products,.cross-sells,.wd-wishlist-content,body.woocommerce-shop,body.tax-product_cat,body.tax-product_tag,body.post-type-archive-product) .wd-product.wd-hover-button .wd-add-btn,
    :where(.elementor-widget-wd_products_tabs,.wd-products-tabs,.related-products,.upsells-products,.cross-sells,.wd-wishlist-content,body.woocommerce-shop,body.tax-product_cat,body.tax-product_tag,body.post-type-archive-product) .wd-product.wd-hover-button .wd-add-btn-replace {
        width: auto !important;
        margin: 0 !important;
    }
}

/* FW content spacing and separator: compact, consistent, not glued to card bottom. */
:where(.elementor-widget-wd_products_tabs,.wd-products-tabs,.related-products,.upsells-products,.cross-sells,.wd-wishlist-content,body.woocommerce-shop,body.tax-product_cat,body.tax-product_tag,body.post-type-archive-product) .wd-product.wd-hover-fw-button .wrap-price {
    margin-top: 8px;
}

/* Product tabs navigation breathing room. */
:where(.elementor-widget-wd_products_tabs,.wd-products-tabs) .wd-tabs-header {
    margin-bottom: 18px;
}

:where(.elementor-widget-wd_products_tabs,.wd-products-tabs) .wd-nav-tabs {
    gap: 9px;
    row-gap: 9px;
}

/* Mobile */
@media (max-width: 1024px) {
    :root {
        --lili-card-x: 14px;
        --lili-card-y: 14px;
    }

    :where(.elementor-widget-wd_products_tabs,.wd-products-tabs,.related-products,.upsells-products,.cross-sells,.wd-wishlist-content,body.woocommerce-shop,body.tax-product_cat,body.tax-product_tag,body.post-type-archive-product) .wd-product.wd-hover-fw-button .wd-add-btn > a,
    :where(.elementor-widget-wd_products_tabs,.wd-products-tabs,.related-products,.upsells-products,.cross-sells,.wd-wishlist-content,body.woocommerce-shop,body.tax-product_cat,body.tax-product_tag,body.post-type-archive-product) .wd-product.wd-hover-standard .wd-add-btn > a {
        min-height: 42px !important;
    }
}

@media (max-width: 767px) {
    :root {
        --lili-card-x: 11px;
        --lili-card-y: 12px;
    }

    :where(.elementor-widget-wd_products_tabs,.wd-products-tabs,.related-products,.upsells-products,.cross-sells,.wd-wishlist-content,body.woocommerce-shop,body.tax-product_cat,body.tax-product_tag,body.post-type-archive-product) .product-grid-item :is(.product-element-bottom,.product-information) {
        padding-top: 10px !important;
    }

    :where(.elementor-widget-wd_products_tabs,.wd-products-tabs,.related-products,.upsells-products,.cross-sells,.wd-wishlist-content,body.woocommerce-shop,body.tax-product_cat,body.tax-product_tag,body.post-type-archive-product) .product-grid-item > .product-wrapper > .wd-entities-title {
        margin-top: 10px !important;
        margin-bottom: 6px !important;
    }

    :where(.elementor-widget-wd_products_tabs,.wd-products-tabs,.related-products,.upsells-products,.cross-sells,.wd-wishlist-content,body.woocommerce-shop,body.tax-product_cat,body.tax-product_tag,body.post-type-archive-product) .wd-product.wd-hover-fw-button .wd-add-btn,
    :where(.elementor-widget-wd_products_tabs,.wd-products-tabs,.related-products,.upsells-products,.cross-sells,.wd-wishlist-content,body.woocommerce-shop,body.tax-product_cat,body.tax-product_tag,body.post-type-archive-product) .wd-product.wd-hover-standard .wd-add-btn {
        margin-top: 10px !important;
    }

    :where(.elementor-widget-wd_products_tabs,.wd-products-tabs,.related-products,.upsells-products,.cross-sells,.wd-wishlist-content,body.woocommerce-shop,body.tax-product_cat,body.tax-product_tag,body.post-type-archive-product) .wd-product.wd-hover-fw-button .wd-add-btn > a,
    :where(.elementor-widget-wd_products_tabs,.wd-products-tabs,.related-products,.upsells-products,.cross-sells,.wd-wishlist-content,body.woocommerce-shop,body.tax-product_cat,body.tax-product_tag,body.post-type-archive-product) .wd-product.wd-hover-standard .wd-add-btn > a {
        min-height: 40px !important;
        font-size: 11.5px !important;
    }
}


/* ========================================================================== 
   2.4.3 - ALL PRODUCT WIDGETS / CAROUSEL UX FIXES
   ========================================================================== */

/* Some WoodMart product widgets use a different wrapper than Products Tabs.
   Apply only spacing/shape here; native hover positioning stays untouched. */
:where(.wd-products,.products,.wd-carousel,.wd-products-element) .wd-product:not(.product-list-item) .product-wrapper {
    border-radius: var(--lili-ui-radius, 9px) !important;
}

:where(.wd-products,.products,.wd-carousel,.wd-products-element) .wd-product:not(.product-list-item) :is(.product-element-bottom,.product-information) {
    padding-inline: 16px !important;
}

/* Native templates such as STANDARD may render title/price directly below the image. */
:where(.wd-products,.products,.wd-carousel,.wd-products-element) .wd-product:not(.product-list-item) > .product-wrapper > .wd-entities-title,
:where(.wd-products,.products,.wd-carousel,.wd-products-element) .wd-product:not(.product-list-item) > .product-wrapper > .price,
:where(.wd-products,.products,.wd-carousel,.wd-products-element) .wd-product:not(.product-list-item) > .product-wrapper > .wd-swatches-product,
:where(.wd-products,.products,.wd-carousel,.wd-products-element) .wd-product:not(.product-list-item) > .product-wrapper > .wd-product-stock {
    margin-inline: 16px !important;
}

:where(.wd-products,.products,.wd-carousel,.wd-products-element) .wd-product:not(.product-list-item) > .product-wrapper > .wd-entities-title {
    margin-top: 14px !important;
    margin-bottom: 8px !important;
}

:where(.wd-products,.products,.wd-carousel,.wd-products-element) .wd-product:not(.product-list-item) > .product-wrapper > .price {
    margin-top: 8px !important;
    margin-bottom: 14px !important;
}

/* Ratings are moved by JS into the thumbnail for EVERY WoodMart grid/card. */
.wd-product:not(.product-list-item) .product-element-top {
    position: relative;
}

/* Separate carousel arrows: keep them fully inside the visible carousel area so
   both controls are easy to see and click after hover. */
:is(.elementor-widget-wd_products,.elementor-widget-wd_products_tabs,.wd-products-tabs,.wd-products-element) .wd-nav-arrows.wd-pos-sep {
    --wd-arrow-width: 42px;
    --wd-arrow-height: 42px;
    --wd-arrow-size: 42px;
    --wd-arrow-offset-h: -50px !important;
}

:is(.elementor-widget-wd_products,.elementor-widget-wd_products_tabs,.wd-products-tabs,.wd-products-element) .wd-nav-arrows.wd-pos-sep .wd-btn-arrow {
    z-index: 300;
}

:is(.elementor-widget-wd_products,.elementor-widget-wd_products_tabs,.wd-products-tabs,.wd-products-element) .wd-nav-arrows.wd-pos-sep .wd-arrow-inner {
    border: 1px solid #e4e7ec !important;
    border-radius: 50% !important;
    background: rgba(255,255,255,.98) !important;
    box-shadow: 0 7px 18px rgba(25,29,45,.12) !important;
}

/* QUICK hover (the full-width slide-up CTA shown on the product image):
   retain WoodMart's animation but leave visible gutters around the CTA. */
@media (min-width: 1025px) {
    .wd-product.wd-hover-quick .product-element-top {
        overflow: hidden;
    }

    .wd-product.wd-hover-quick .wd-add-btn {
        inset-inline: 12px !important;
        bottom: 12px !important;
        width: auto !important;
    }

    .wd-product.wd-hover-quick .wd-add-btn > a {
        border-radius: var(--lili-ui-radius, 9px) !important;
        overflow: hidden;
        box-shadow: 0 8px 22px rgba(74,24,76,.16) !important;
    }

    .wd-product.wd-hover-quick .wd-add-btn .wd-action-text,
    .wd-product.wd-hover-quick .wd-add-btn > a span {
        padding-inline: 16px !important;
    }
}

@media (max-width: 1024px) {
    :is(.elementor-widget-wd_products,.elementor-widget-wd_products_tabs,.wd-products-tabs,.wd-products-element) .wd-nav-arrows.wd-pos-sep {
        --wd-arrow-offset-h: -38px !important;
    }
}

@media (max-width: 767px) {
    :where(.wd-products,.products,.wd-carousel,.wd-products-element) .wd-product:not(.product-list-item) :is(.product-element-bottom,.product-information) {
        padding-inline: 11px !important;
    }

    :where(.wd-products,.products,.wd-carousel,.wd-products-element) .wd-product:not(.product-list-item) > .product-wrapper > .wd-entities-title,
    :where(.wd-products,.products,.wd-carousel,.wd-products-element) .wd-product:not(.product-list-item) > .product-wrapper > .price,
    :where(.wd-products,.products,.wd-carousel,.wd-products-element) .wd-product:not(.product-list-item) > .product-wrapper > .wd-swatches-product,
    :where(.wd-products,.products,.wd-carousel,.wd-products-element) .wd-product:not(.product-list-item) > .product-wrapper > .wd-product-stock {
        margin-inline: 11px !important;
    }
}
