/**
 * Product Card — Shared Styles (Mobile + Desktop)
 * فقط استایل‌هایی که روی هر دو دستگاه نیاز است
 */

/* ── Container ── */
.product-card {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.product-card__inner {
    position: relative;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    overflow: visible;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Swiper overflow */
.swiper-wrapper {
    overflow: visible !important;
}
.mattress-swiper.swiper {
    overflow: visible;
}

/* ── Image Area ── */
.product-card__image-wrapper {
    position: relative;
    overflow: hidden;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 20px 20px 0 0;
    width: 100%;
    padding-bottom: 65%;
}

.product-card__image-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card__image-link img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    border-radius: 0;
}

/* ── سایه زیر کارت (موبایل + دسکتاپ) ── */
.product-card__inner::after {
    content: '';
    position: absolute;
    width: 90%;
    height: 8px;
    left: 0;
    right: 0;
    bottom: -8px;
    margin: 0 auto;
    background: #e8e8e8;
    border-radius: 0 0 20px 20px;
    transition: background 0.3s ease;
    z-index: -1;
}

/* ── Brand Icon ── */
.product-card__brand {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 30px;
    height: 30px;
    background: #000000;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    z-index: 3;
}

.product-card__brand:hover {
    background: #e8f5f3;
}

.product-card__brand img {
    max-width: 30px;
    max-height: 30px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    transition: filter 0.3s ease;
}

.product-card__brand:hover img {
    filter: brightness(0) saturate(100%) invert(23%) sepia(28%) saturate(1847%) hue-rotate(145deg) brightness(95%) contrast(93%);
}

/* ── Wishlist Button ── */
.product-card__wishlist {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 30px;
    height: 30px;
    background: #ffffff;
    border: 1px solid #0f4f59;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    z-index: 3;
    color: #95a5a6;
}

.product-card__wishlist:hover {
    background: #f8f9fa;
}

.product-card__wishlist.active {
    background: #ffffff;
    border-color: #0f4f59;
}

.product-card__wishlist.active svg {
    color: #ff4757;
    fill: #ff4757;
}

.product-card__wishlist svg {
    transition: color 0.3s ease, fill 0.3s ease;
    width: 20px;
    height: 20px;
    stroke-width: 1.6; /* روی مانیتور دسکتاپ (96dpi) خط نازک‌تر کم‌رنگ دیده می‌شد */
}

/* ── Out of Stock Badge ── */
.product-card__badge--out-of-stock {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: #95a5a6;
    color: #ffffff;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 2;
}

/* ── Meta (Colors + Discount) ── */
.product-card__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    min-height: 48px;
}

.product-card__colors {
    display: flex;
    align-items: center;
    gap: 6px;
}

.product-card__color {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.product-card__color:hover {
    transform: scale(1.1);
}

.product-card__color.selected {
    border-color: #0f4f59;
    box-shadow: 0 0 0 2px rgba(15, 79, 89, 0.2);
}

.product-card__color-more {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
}

.product-card__discount-badge {
    background: #ff4757;
    color: #ffffff;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Content ── */
.product-card__content {
    padding: 15px 10px 0 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.product-card__title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    color: #2c3e50;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 42px;
}

.product-card__title a {
    color: #242424;
    line-height: normal;
    text-decoration: none;
    transition: color 0.2s ease;
}

.product-card__title a:hover {
    color: #0f4f59;
}

/* ── Footer: Price + Quick View ── */
.product-card__footer {
    display: flex;
    flex-direction: row-reverse;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 2rem;
}

.product-card__price {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-card__price .price {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-card__price-del {
    display: flex;
    align-items: center;
    gap: 6px;
    direction: rtl;
}

.product-card__price del,
.product-card__price del .woocommerce-Price-amount {
    font-size: 15px;
    color: #535353;
    font-weight: 400;
    text-decoration: none;
    opacity: 0.7;
    display: inline-block;
}

.product-card__price del {
    position: relative;
}

.product-card__price del .woocommerce-Price-amount {
    position: relative;
}

.product-card__price del .woocommerce-Price-amount::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1.5px;
    background: #e74c3c;
    transform: translateY(-50%) rotate(-5deg);
    pointer-events: none;
}

.product-card__price del .woocommerce-Price-currencySymbol {
    display: none !important;
}

.product-card__price ins,
.product-card__price ins .woocommerce-Price-amount {
    font-size: 17px;
    font-weight: 700;
    color: #2c3e50;
    text-decoration: none;
}

.product-card__price .price > .woocommerce-Price-amount:only-child {
    font-size: 17px;
    font-weight: 700;
    color: #2c3e50;
}

/* ── Quick View ── */
.product-card__quick-view {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: #0f4f59;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 0 12px 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.product-card__quick-view svg {
    background-color: #0f4f59;
    color: #e8f5f3;
    width: 36px;
    height: 24px;
    flex-shrink: 0;
    padding: 0 8px;
    border: 1.5px solid #e8f5f3;
    border-radius: 50px;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    display: flex;
    align-items: center;
}

/* ── Loading State ── */
.product-card__loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 16px;
}

.product-card__loading.active {
    display: flex;
}

.product-card__spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e0e0e0;
    border-top-color: #0f4f59;
    border-radius: 50%;
    animation: kh-spin 0.8s linear infinite;
}

@keyframes kh-spin {
    to { transform: rotate(360deg); }
}

/* ── WooCommerce Price Global ── */
.woocommerce-Price-amount {
    font-size: 18px;
}

.woocommerce-Price-currencySymbol {
    font-size: 10px;
}
