/* =========================================================
   WebVue — Woodmart Modern Product Cards
   Designed for Woodmart + WooCommerce native product grids.
   ========================================================= */

.wv-modern-product-cards {
    --wv-card-bg: #fff;
    --wv-card-border: #d8e1e7;
    --wv-card-image-bg: #f1efee;
    --wv-card-title: #172431;
    --wv-card-muted: #8aa0b3;
    --wv-card-blue: #183e55;
    --wv-card-star: #ff9f1a;
    --wv-card-pastel-blue: #9fd2f3;
    --wv-card-pink: #f06c87;
    --wv-card-radius: 18px;
}

/* Card shell */
.wv-modern-product-cards .wd-products .product-grid-item,
.wv-modern-product-cards .products .product-grid-item,
.wv-modern-product-cards .products > .product {
    position: relative;
    overflow: hidden;
    background: var(--wv-card-bg) !important;
    border: 1px solid var(--wv-card-border) !important;
    border-radius: var(--wv-card-radius) !important;
    box-shadow: none !important;
    padding: 0 !important;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.wv-modern-product-cards .wd-products .product-grid-item:hover,
.wv-modern-product-cards .products .product-grid-item:hover,
.wv-modern-product-cards .products > .product:hover {
    transform: translateY(-2px);
    border-color: #c9d5dd !important;
    box-shadow: 0 12px 28px rgba(25, 51, 68, .08) !important;
}

/* Remove Woodmart's extra inner card backgrounds/shadows */
.wv-modern-product-cards .product-grid-item .product-wrapper,
.wv-modern-product-cards .product-grid-item .product-element-top,
.wv-modern-product-cards .product-grid-item .product-information,
.wv-modern-product-cards .product-grid-item .product-element-bottom,
.wv-modern-product-cards .product-grid-item .wd-product,
.wv-modern-product-cards .products > .product .product-wrapper {
    box-shadow: none !important;
}

.wv-modern-product-cards .product-grid-item .product-wrapper,
.wv-modern-product-cards .products > .product .product-wrapper {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: transparent !important;
}

/* Image area */
.wv-modern-product-cards .product-grid-item .product-element-top,
.wv-modern-product-cards .products > .product .product-element-top,
.wv-modern-product-cards .products > .product .woocommerce-LoopProduct-link {
    position: relative;
}

.wv-modern-product-cards .product-grid-item .product-element-top {
    overflow: hidden !important;
    min-height: 0;
    aspect-ratio: 1.06 / 1;
    background: var(--wv-card-image-bg) !important;
    border-radius: calc(var(--wv-card-radius) - 1px) calc(var(--wv-card-radius) - 1px) 0 0 !important;
}

.wv-modern-product-cards .product-grid-item .product-element-top img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    transition: transform .45s cubic-bezier(.22,.61,.36,1) !important;
}

.wv-modern-product-cards .product-grid-item:hover .product-element-top img {
    transform: scale(1.018);
}

/* Hide Woodmart clutter that is not present in the reference design */
.wv-modern-product-cards .product-grid-item .wd-buttons,
.wv-modern-product-cards .product-grid-item .wd-quick-view-icon,
.wv-modern-product-cards .product-grid-item .wd-compare-btn,
.wv-modern-product-cards .product-grid-item .wd-add-btn-replace,
.wv-modern-product-cards .product-grid-item .hover-img,
.wv-modern-product-cards .product-grid-item .wd-product-cats,
.wv-modern-product-cards .product-grid-item .product-labels:not(:has(.wv-card-badge)) {
    /* Keep layout clean; the script separately preserves/moves wishlist where available. */
}

/* Native sale/new labels: hidden to prevent duplicates. Our badge is used instead. */
.wv-modern-product-cards .product-grid-item .product-labels .product-label:not(.wv-card-badge),
.wv-modern-product-cards .product-grid-item .onsale:not(.wv-card-badge) {
    display: none !important;
}

/* Content area */
.wv-modern-product-cards .product-grid-item .product-element-bottom,
.wv-modern-product-cards .product-grid-item .product-information {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    text-align: left !important;
    align-items: stretch !important;
    padding: 17px 16px 16px !important;
    background: #fff !important;
}

/* Brand */
.wv-modern-product-cards .wv-card-brand {
    order: -20;
    margin: 0 0 9px !important;
    font-size: 11px !important;
    line-height: 1.1 !important;
    font-weight: 700 !important;
    letter-spacing: .18em !important;
    text-transform: uppercase !important;
    color: #7893aa !important;
}

/* Product title */
.wv-modern-product-cards .product-grid-item .wd-entities-title,
.wv-modern-product-cards .product-grid-item .woocommerce-loop-product__title,
.wv-modern-product-cards .products > .product .woocommerce-loop-product__title {
    margin: 0 0 12px !important;
    padding: 0 !important;
    min-height: 2.7em;
    color: var(--wv-card-title) !important;
    font-size: 15px !important;
    line-height: 1.36 !important;
    font-weight: 700 !important;
    letter-spacing: 0 !important;
    text-align: left !important;
    display: -webkit-box !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.wv-modern-product-cards .product-grid-item .wd-entities-title a,
.wv-modern-product-cards .product-grid-item .woocommerce-loop-product__title a,
.wv-modern-product-cards .products > .product .woocommerce-loop-product__title a {
    color: inherit !important;
}

/* Rating */
.wv-modern-product-cards .product-grid-item .star-rating,
.wv-modern-product-cards .products > .product .star-rating {
    margin: auto 0 8px !important;
    color: var(--wv-card-star) !important;
    font-size: 13px !important;
    letter-spacing: 1px;
}

.wv-modern-product-cards .product-grid-item .star-rating::before,
.wv-modern-product-cards .product-grid-item .star-rating span::before,
.wv-modern-product-cards .products > .product .star-rating::before,
.wv-modern-product-cards .products > .product .star-rating span::before {
    color: var(--wv-card-star) !important;
}

.wv-modern-product-cards .product-grid-item .woocommerce-review-link,
.wv-modern-product-cards .product-grid-item .wd-rating-count {
    color: var(--wv-card-muted) !important;
    font-size: 11px !important;
}

/* Price */
.wv-modern-product-cards .product-grid-item .price,
.wv-modern-product-cards .products > .product .price {
    margin: 0 0 12px !important;
    color: var(--wv-card-title) !important;
    font-size: 15px !important;
    line-height: 1.2 !important;
    font-weight: 800 !important;
    text-align: left !important;
}

.wv-modern-product-cards .product-grid-item .price del,
.wv-modern-product-cards .products > .product .price del {
    margin-left: 6px;
    color: #9eacb6 !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    opacity: 1 !important;
}

.wv-modern-product-cards .product-grid-item .price ins,
.wv-modern-product-cards .products > .product .price ins {
    color: var(--wv-card-title) !important;
    text-decoration: none !important;
}

/* Button row injected by JS */
.wv-modern-product-cards .wv-card-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    margin-top: auto;
    width: 100%;
}

.wv-modern-product-cards .wv-card-actions .button,
.wv-modern-product-cards .wv-card-actions .add_to_cart_button,
.wv-modern-product-cards .wv-card-actions .product_type_simple,
.wv-modern-product-cards .wv-card-actions .product_type_variable {
    width: 100% !important;
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 18px !important;
    border: 1px solid var(--wv-card-blue) !important;
    border-radius: 9px !important;
    background: var(--wv-card-blue) !important;
    color: #fff !important;
    box-shadow: none !important;
    font-size: 12px !important;
    line-height: 1 !important;
    font-weight: 700 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    white-space: nowrap;
}

.wv-modern-product-cards .wv-card-actions .button:hover,
.wv-modern-product-cards .wv-card-actions .add_to_cart_button:hover {
    filter: brightness(.93);
}



/* Top-left badge */
.wv-modern-product-cards .wv-card-badge {
    position: absolute !important;
    top: 12px !important;
    left: 12px !important;
    z-index: 8 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-height: 25px;
    padding: 0 11px !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 999px !important;
    color: #24333d !important;
    background: rgba(255,255,255,.94) !important;
    box-shadow: none !important;
    font-size: 9px !important;
    line-height: 1 !important;
    font-weight: 800 !important;
    letter-spacing: .16em !important;
    text-transform: uppercase !important;
}

.wv-modern-product-cards .wv-card-badge--blue {
    background: var(--wv-card-pastel-blue) !important;
    color: #23445a !important;
}

.wv-modern-product-cards .wv-card-badge--pink {
    background: var(--wv-card-pink) !important;
    color: #fff !important;
    letter-spacing: .05em !important;
}

/* Wishlist button: Woodmart/YITH common selectors */
.wv-modern-product-cards .product-grid-item .wd-wishlist-btn,
.wv-modern-product-cards .product-grid-item .yith-wcwl-add-to-wishlist,
.wv-modern-product-cards .product-grid-item .wishlist-button,
.wv-modern-product-cards .product-grid-item .wd-wishlist-icon {
    position: absolute !important;
    top: 11px !important;
    right: 11px !important;
    left: auto !important;
    z-index: 10 !important;
    margin: 0 !important;
}

.wv-modern-product-cards .product-grid-item .wd-wishlist-btn > a,
.wv-modern-product-cards .product-grid-item .yith-wcwl-add-to-wishlist a,
.wv-modern-product-cards .product-grid-item .wishlist-button,
.wv-modern-product-cards .product-grid-item .wd-wishlist-icon > a {
    width: 39px !important;
    height: 39px !important;
    min-width: 39px !important;
    min-height: 39px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: rgba(255,255,255,.96) !important;
    color: #111 !important;
    box-shadow: none !important;
}

/* Disable image-area overlay buttons except wishlist */
.wv-modern-product-cards .product-grid-item .product-element-top .wd-buttons > *:not(.wd-wishlist-btn),
.wv-modern-product-cards .product-grid-item .product-element-top .wd-action-btn:not(.wd-wishlist-btn) {
    display: none !important;
}

/* If Woodmart wraps wishlist in .wd-buttons, keep only the wishlist and make wrapper transparent. */
.wv-modern-product-cards .product-grid-item .product-element-top .wd-buttons:has(.wd-wishlist-btn) {
    display: block !important;
    position: static !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* Remove various hover-reveal transforms that interfere with the fixed card structure. */
.wv-modern-product-cards .product-grid-item .product-element-bottom,
.wv-modern-product-cards .product-grid-item .wd-product-footer,
.wv-modern-product-cards .product-grid-item .wd-product-buttons {
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Responsive tuning */
@media (max-width: 1024px) {
    .wv-modern-product-cards .product-grid-item .product-element-bottom,
    .wv-modern-product-cards .product-grid-item .product-information {
        padding: 15px 14px 14px !important;
    }

    .wv-modern-product-cards .product-grid-item .wd-entities-title,
    .wv-modern-product-cards .product-grid-item .woocommerce-loop-product__title {
        font-size: 14px !important;
    }
}

@media (max-width: 767px) {
    .wv-modern-product-cards .wd-products,
    .wv-modern-product-cards ul.products {
        row-gap: 14px !important;
    }

    .wv-modern-product-cards .wd-products .product-grid-item,
    .wv-modern-product-cards .products .product-grid-item,
    .wv-modern-product-cards .products > .product {
        border-radius: 14px !important;
    }

    .wv-modern-product-cards .product-grid-item .product-element-top {
        aspect-ratio: 1 / 1;
        border-radius: 13px 13px 0 0 !important;
    }

    .wv-modern-product-cards .product-grid-item .product-element-bottom,
    .wv-modern-product-cards .product-grid-item .product-information {
        padding: 12px 11px 11px !important;
    }

    .wv-modern-product-cards .wv-card-badge {
        top: 8px !important;
        left: 8px !important;
        min-height: 22px;
        padding: 0 8px !important;
        font-size: 7.5px !important;
    }

    .wv-modern-product-cards .product-grid-item .wd-wishlist-btn,
    .wv-modern-product-cards .product-grid-item .yith-wcwl-add-to-wishlist,
    .wv-modern-product-cards .product-grid-item .wishlist-button,
    .wv-modern-product-cards .product-grid-item .wd-wishlist-icon {
        top: 7px !important;
        right: 7px !important;
    }

    .wv-modern-product-cards .product-grid-item .wd-wishlist-btn > a,
    .wv-modern-product-cards .product-grid-item .yith-wcwl-add-to-wishlist a,
    .wv-modern-product-cards .product-grid-item .wishlist-button,
    .wv-modern-product-cards .product-grid-item .wd-wishlist-icon > a {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        min-height: 34px !important;
    }

    .wv-modern-product-cards .wv-card-brand {
        margin-bottom: 7px !important;
        font-size: 9px !important;
        letter-spacing: .14em !important;
    }

    .wv-modern-product-cards .product-grid-item .wd-entities-title,
    .wv-modern-product-cards .product-grid-item .woocommerce-loop-product__title {
        min-height: 2.9em;
        margin-bottom: 9px !important;
        font-size: 13px !important;
        line-height: 1.42 !important;
    }

    .wv-modern-product-cards .product-grid-item .price {
        margin-bottom: 10px !important;
        font-size: 14px !important;
    }

    .wv-modern-product-cards .wv-card-actions {
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
    }

    .wv-modern-product-cards .wv-card-actions .button,
    .wv-modern-product-cards .wv-card-actions .add_to_cart_button,
    .wv-modern-product-cards .wv-card-plus {
        min-height: 40px !important;
        height: 40px;
    }

    .wv-modern-product-cards .wv-card-actions .button,
    .wv-modern-product-cards .wv-card-actions .add_to_cart_button {
        padding: 0 8px !important;
        font-size: 10.5px !important;
    }

    .wv-modern-product-cards .wv-card-plus {
        width: 38px;
        min-width: 38px;
        font-size: 20px;
    }
}

@media (max-width: 420px) {
    .wv-modern-product-cards .wv-card-actions {
        grid-template-columns: minmax(0, 1fr);
    }

    .wv-modern-product-cards .wv-card-actions .button,
    .wv-modern-product-cards .wv-card-actions .add_to_cart_button {
        font-size: 10px !important;
    }

    .wv-modern-product-cards .wv-card-plus {
        width: 36px;
        min-width: 36px;
    }
}


/* =========================================================
   Equal-height enforcement — v1.0.2
   Critical: every visible product card is the same height on
   desktop, tablet and mobile, including AJAX-loaded products.
   ========================================================= */
.wv-modern-product-cards .wd-products,
.wv-modern-product-cards ul.products,
.wv-modern-product-cards .products {
    align-items: stretch !important;
}

.wv-modern-product-cards .wd-products .product-grid-item,
.wv-modern-product-cards .products .product-grid-item,
.wv-modern-product-cards .products > .product {
    display: flex !important;
    flex-direction: column !important;
    align-self: stretch !important;
    height: var(--wv-equal-card-height, auto) !important;
    min-height: var(--wv-equal-card-height, 0) !important;
}

.wv-modern-product-cards .product-grid-item > .product-wrapper,
.wv-modern-product-cards .products > .product > .product-wrapper,
.wv-modern-product-cards .product-grid-item .product-wrapper {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-direction: column !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
}

.wv-modern-product-cards .product-grid-item .product-element-bottom,
.wv-modern-product-cards .product-grid-item .product-information,
.wv-modern-product-cards .products > .product .product-element-bottom,
.wv-modern-product-cards .products > .product .product-information {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-direction: column !important;
    width: 100% !important;
}

/* Reserve identical vertical slots even when optional content is absent. */
.wv-modern-product-cards .product-grid-item .price,
.wv-modern-product-cards .products > .product .price {
    min-height: 1.2em;
}

/* Actions always sit at the bottom edge of the equal-height card. */
.wv-modern-product-cards .wv-card-actions {
    margin-top: auto !important;
}

/* =========================================================
   Equal-height enforcement — v1.0.3
   Woodmart carousel/grid hard fix: stretch the carousel slide,
   card shell and inner wrapper as one continuous flex column.
   ========================================================= */
.wv-modern-product-cards .wd-carousel-item,
.wv-modern-product-cards .swiper-slide,
.wv-modern-product-cards .owl-item {
    height: auto !important;
    align-self: stretch !important;
}

.wv-modern-product-cards .wd-carousel-item > .product-grid-item,
.wv-modern-product-cards .swiper-slide > .product-grid-item,
.wv-modern-product-cards .owl-item .product-grid-item,
.wv-modern-product-cards .product-grid-item {
    height: var(--wv-equal-card-height, auto) !important;
    min-height: var(--wv-equal-card-height, 0px) !important;
}

.wv-modern-product-cards .product-grid-item > .product-wrapper,
.wv-modern-product-cards .product-grid-item > .wd-product,
.wv-modern-product-cards .product-grid-item .product-wrapper {
    height: 100% !important;
    min-height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
}

.wv-modern-product-cards .product-grid-item .product-element-bottom,
.wv-modern-product-cards .product-grid-item .product-information {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
}

.wv-modern-product-cards .product-grid-item .wv-card-actions {
    margin-top: auto !important;
}
