/* =========================================================
   Product Card Pro — shared card design for carousel + grid
   Path: assets/css/widgets/woocommerce/product-card-pro.css
   ========================================================= */

.product-card-pro {
    --pcp-radius: var(--mrpsn-radius-md);
    --pcp-bg: var(--mrpsn-bg);
    --pcp-border: var(--mrpsn-line);
    --pcp-primary-rgb: var(--mrpsn-blue-rgb);
    --pcp-sale-rgb: var(--mrpsn-sale-rgb);
    --pcp-text: var(--mrpsn-ink);
    --pcp-text-muted: var(--mrpsn-muted);

    position: relative;
    overflow: hidden;
    background: var(--pcp-bg);
    border-radius: var(--pcp-radius);
    border: 1px solid var(--pcp-border);
    box-shadow: none;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    transition:
        transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
        border-color 0.25s ease;
}

/* FIX: Remove extra margin/padding from theme classes */
.product-card.product-card-pro {
    margin: 0 !important;
    padding-bottom: 0 !important;
    box-shadow: none !important;
}

.product-card.product-card-pro:hover {
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.07) !important;
}

body:not(.elementor-editor-active) .product-card-pro:hover {
    transform: translateY(-2px);
}

.product-card-pro:hover {
    border-color: rgba(var(--pcp-primary-rgb), .35);
}

.product-card-pro.has-sale:hover {
    border-color: rgba(var(--pcp-sale-rgb), .35);
}

/* Image */
.product-card-pro .product-card-image {
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    aspect-ratio: 1 / 1;
    background: var(--mrpsn-soft);
    border-radius: var(--pcp-radius);
}

.product-card-pro .product-card-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.product-card-pro .product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    margin: 0 !important;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.product-card-pro:hover .product-card-image img {
    transform: scale(1.04);
}

.product-card-pro .product-card-image::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 44%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.06) 100%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.product-card-pro:hover .product-card-image::after {
    opacity: 1;
}

/* Content */
.product-card-pro .product-card-content {
    padding: 14px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

/* Title */
.product-card-pro .title {
    margin: 0;
}

.product-card-pro .title,
.product-card-pro .title a {
    color: var(--pcp-text);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
    text-decoration: none;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: calc(1.45em * 3) !important;
    white-space: normal;
    transition: color 0.25s ease;
}

.product-card-pro:hover .title,
.product-card-pro:hover .title a {
    color: var(--pcp-text);
}

/* Sale badge */
.product-card-pro.has-sale::before {
    content: "قیمت ویژه";
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    min-height: 34px;
    background: linear-gradient(135deg, rgb(var(--pcp-sale-rgb)), rgba(var(--pcp-sale-rgb), .85));
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(var(--pcp-sale-rgb), .25);
    pointer-events: none;
}

/* Price button */
.product-card-pro .product-price-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 50px;
    text-align: center;
    text-decoration: none !important;
    margin-top: auto;
    padding: 10px 16px;
    border-radius: var(--mrpsn-radius-sm);
    background: rgb(var(--pcp-primary-rgb)) !important;
    border: none;
    box-sizing: border-box;
    transition: filter .2s ease;
}

.product-card-pro .product-price-button:hover {
    filter: brightness(1.1);
}

.product-card-pro .product-price-button .price-old {
    font-size: 11.5px;
    font-weight: 400;
    color: rgba(255,255,255,.55);
    text-decoration: line-through;
    line-height: 1.3;
    order: -1;
}

.product-card-pro .product-price-button .price-current {
    font-size: 15px;
    font-weight: 700;
    color: #fff !important;
    line-height: 1.3;
}

.product-card-pro .product-price-button.sale {
    background: rgb(var(--pcp-sale-rgb)) !important;
}

.product-card-pro .product-price-button.out-of-stock {
    background: var(--mrpsn-soft) !important;
    border: 1px solid var(--mrpsn-line);
    cursor: default;
    pointer-events: none;
    color: var(--pcp-text-muted) !important;
    font-weight: 600;
    filter: none;
}

.product-card-pro::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(var(--pcp-primary-rgb), .15), transparent 35%);
    pointer-events: none;
    opacity: 0;
    transition: opacity .25s ease;
}

.product-card-pro.has-sale::after {
    background: linear-gradient(135deg, rgba(var(--pcp-sale-rgb), .18), transparent 35%);
}

.product-card-pro:hover::after {
    opacity: 1;
}

/* Ratings */
.product-card-pro .star-rating {
    margin-left: auto;
    margin-right: auto;
}

/* Focus */
.product-card-pro .product-card-image a:focus-visible,
.product-card-pro .title a:focus-visible {
    outline: 2px solid rgb(var(--pcp-primary-rgb));
    outline-offset: 2px;
    border-radius: 4px;
}

.product-card-pro .product-price-button:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -4px;
    box-shadow: 0 0 0 3px rgb(var(--pcp-primary-rgb));
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .product-card-pro,
    .product-card-pro .product-card-image img,
    .product-card-pro .product-price-button,
    .product-card-pro::after {
        transition: none !important;
    }

    .product-card-pro:hover .product-card-image img {
        transform: none;
    }
}

/* Mobile */
@media (max-width: 576px) {
    .product-card-pro.has-sale::before {
        top: 8px;
        right: 8px;
        padding: 6px 10px;
        min-height: 28px;
        font-size: 10px;
        border-radius: 6px;
    }

    .product-card-pro .product-card-content {
        padding: 12px;
        gap: 9px;
    }

    .product-card-pro .product-price-button {
        min-height: 48px;
        padding: 9px 14px;
    }

    .product-card-pro .product-price-button .price-current {
        font-size: 14px;
    }

    .product-card-pro .title,
    .product-card-pro .title a {
        font-size: 13.5px;
        max-height: calc(1.45em * 3) !important;
    }
}