/* Jahan Shoofazh Panel - Store cards */
.jspanel-hide-card-stock-progress .product-grid-item .stock-progress-bar,
.jspanel-hide-card-stock-progress .products .product .stock-progress-bar{
    display: none !important;
}

.jspanel-card-sales{
    margin-top: 7px;
    color: var(--jspanel-card-sales-color, #707174);
    font-size: 11px;
    line-height: 1.5;
    font-weight: 600;
}
.jspanel-card-sales--pill{
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 3px 9px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--jspanel-card-sales-color, #707174) 9%, transparent);
}

.jspanel-card-social-proof{
    margin-top: 7px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}
.jspanel-card-social-proof .jspanel-card-sales{
    margin-top: 0;
}
.jspanel-bestseller-badge{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 22px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--jspanel-bestseller-bg, #111111);
    color: var(--jspanel-bestseller-color, #ffffff);
    font-size: 10px;
    line-height: 1.4;
    font-weight: 800;
    white-space: nowrap;
}

.jspanel-card-title-lines-1 .products .product .woocommerce-loop-product__title,
.jspanel-card-title-lines-2 .products .product .woocommerce-loop-product__title,
.jspanel-card-title-lines-3 .products .product .woocommerce-loop-product__title{
    overflow: hidden !important;
    min-height: 0 !important;
    height: auto !important;
    margin-bottom: 0;
}

/* One line: use native single-line ellipsis as a hard fallback against WoodMart sizing rules. */
.jspanel-card-title-lines-1 .products .product .woocommerce-loop-product__title{
    display: block !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    line-height: 1.45 !important;
    max-height: 1.45em !important;
}
.jspanel-card-title-lines-1 .products .product .woocommerce-loop-product__title > a{
    display: block !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    line-height: inherit !important;
    max-height: inherit !important;
}

/* Two/three lines: clamp plus a physical max-height so theme CSS cannot expose another line. */
.jspanel-card-title-lines-2 .products .product .woocommerce-loop-product__title,
.jspanel-card-title-lines-3 .products .product .woocommerce-loop-product__title{
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    white-space: normal !important;
    line-height: 1.45 !important;
}
.jspanel-card-title-lines-2 .products .product .woocommerce-loop-product__title{
    -webkit-line-clamp: 2 !important;
    line-clamp: 2;
    max-height: 2.90em !important;
}
.jspanel-card-title-lines-3 .products .product .woocommerce-loop-product__title{
    -webkit-line-clamp: 3 !important;
    line-clamp: 3;
    max-height: 4.35em !important;
}

.jspanel-hide-card-rating .products .product .star-rating{ display:none !important; }



.jspanel-hide-card-sale-badge .products .product .product-label.onsale,
.jspanel-hide-card-sale-badge .products .product .onsale{ display:none !important; }

.jspanel-hide-card-cart .products .product .add_to_cart_button{ display:none !important; }





.jspanel-hide-card-quickview .product-grid-item .quick-view,
.jspanel-hide-card-quickview .products .product .quick-view{ display:none !important; }

.jspanel-card-image-ratio-1-1 .product-grid-item .product-image-link{ aspect-ratio: 1 / 1; overflow:hidden; }
.jspanel-card-image-ratio-4-5 .product-grid-item .product-image-link{ aspect-ratio: 4 / 5; overflow:hidden; }
.jspanel-card-image-ratio-3-4 .product-grid-item .product-image-link{ aspect-ratio: 3 / 4; overflow:hidden; }

.jspanel-card-image-ratio-1-1 .product-grid-item .product-image-link img,
.jspanel-card-image-ratio-4-5 .product-grid-item .product-image-link img,
.jspanel-card-image-ratio-3-4 .product-grid-item .product-image-link img{
    width:100% !important;
    height:100% !important;
}

.jspanel-card-image-fit-contain .product-grid-item .product-image-link img{ object-fit:contain !important; }
.jspanel-card-image-fit-cover .product-grid-item .product-image-link img{ object-fit:cover !important; }

.jspanel-dim-out-of-stock .product-grid-item.outofstock .product-image-link,
.jspanel-dim-out-of-stock .products .product.outofstock .product-image-link{
    opacity: var(--jspanel-outofstock-opacity, .68);
    transition: opacity .2s ease;
}
.jspanel-dim-out-of-stock .product-grid-item.outofstock:hover .product-image-link,
.jspanel-dim-out-of-stock .products .product.outofstock:hover .product-image-link{ opacity:1; }


.jspanel-bestseller-badge-media{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    flex: 0 0 auto;
}
.jspanel-bestseller-badge-media .jspanel-bestseller-badge-image{
    display: block !important;
    width: var(--jspanel-bestseller-image-width, 72px) !important;
    max-width: min(var(--jspanel-bestseller-image-width, 72px), 45vw) !important;
    height: auto !important;
    max-height: 56px;
    object-fit: contain;
}


/* Brand logo on WoodMart product cards - managed from Jahan Shoofazh Panel. */
.jspanel-show-brand-logo-on-card .product-element-top{
    position: relative;
}
.jspanel-show-brand-logo-on-card .jahan-product-brand-logo{
    position: absolute;
    right: 5px;
    top: 5px;
    display: block !important;
    width: var(--jspanel-brand-logo-width, 4rem) !important;
    max-width: calc(100% - 10px);
    height: auto !important;
    max-height: none !important;
    object-fit: contain;
    padding: 5px;
    border-radius: 7px;
    z-index: 3;
    pointer-events: none;
}


/* 1.11.5 - product card price: independent full-width row, aligned to the right in RTL. */
.product-grid-item .wrap-price,
.products .product .wrap-price{
    width:100%!important;
    min-width:0;
    display:flex!important;
    flex-wrap:wrap;
    justify-content:flex-start!important;
    direction:rtl!important;
    text-align:right!important;
}

.product-grid-item .price,
.products .product .price{
    width:100%!important;
    max-width:100%;
    display:flex!important;
    flex-wrap:wrap;
    align-items:baseline;
    justify-content:flex-start!important;
    gap:4px;
    margin-left:auto!important;
    margin-right:0!important;
    direction:rtl!important;
    text-align:right!important;
}

.product-grid-item .price del,
.product-grid-item .price ins,
.products .product .price del,
.products .product .price ins{
    float:none!important;
    text-align:right!important;
}


/* 1.12.0 correction: price belongs on the LEFT side of its own row. */
.product-grid-item .wrap-price,
.products .product .wrap-price{justify-content:flex-end!important;text-align:left!important}
.product-grid-item .price,
.products .product .price{justify-content:flex-end!important;text-align:left!important;margin-left:0!important;margin-right:auto!important}
.product-grid-item .price del,
.product-grid-item .price ins,
.products .product .price del,
.products .product .price ins{text-align:left!important}


/* 1.13.1 - equal-height product cards and bottom-pinned primary action. */
.products,
.products.elements-grid{
    align-items: stretch !important;
}

.products > .product,
.product-grid-item{
    height: 100%;
}

.product-grid-item .product-wrapper,
.products .product .product-wrapper{
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    min-height: 100%;
}

.product-grid-item .product-element-bottom,
.products .product .product-element-bottom{
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0;
}

/* Keep the final product action at the visual bottom regardless of title/spec length. */
.product-grid-item .product-element-bottom > .add_to_cart_button,
.products .product .product-element-bottom > .add_to_cart_button{
    margin-top: auto !important;
}



.products .product .add_to_cart_button{
    width: 100%;
}
