/* ========================================
   SM Price Formatter Styles - v2.9.3
   با قابلیت scale factor
   ======================================== */

/* متغیر پیش‌فرض برای scale factor */
.sm-price-shortcode {
    --sm-price-scale: 1;
}

.sm-custom-price-wrap {
    text-align: left;
}

/* قیمت اصلی */
.sm-price {
    color: gray;
    font-size: calc(0.75rem * var(--sm-price-scale));
    font-weight: 600;
    display: inline-block;
    text-align: left;
}

/* بازه قیمت محصولات متغیر */
.sm-price-range {
    font-size: calc(0.75rem * var(--sm-price-scale));
    font-weight: 500;
    color: #34495e;
    display: inline-block;
    text-align: left;
}

/* قیمت رایگان */
.sm-free-price {
    font-size: calc(0.75rem * var(--sm-price-scale));
    font-weight: 600;
    color: #27ae60;
    background: #d5f4e6;
    padding: calc(5px * var(--sm-price-scale)) calc(15px * var(--sm-price-scale));
    border-radius: calc(20px * var(--sm-price-scale));
    display: inline-block;
}

/* ========================================
   قیمت تخفیف‌دار
   ======================================== */
.sm-sale-wrapper {
    display: inline-flex;
    align-items: center;
    gap: calc(15px * var(--sm-price-scale));
    flex-wrap: wrap;
    text-align: left;
}

.sm-discount-badge {
    background: #DB0F40;
    color: #fff;
    border-radius: 0px;
    padding: 0px calc(4px * var(--sm-price-scale));
    margin-right: calc(8px * var(--sm-price-scale));
    font-size: calc(13px * var(--sm-price-scale));
}

.sm-prices {
    display: inline-flex;
    flex-direction: column;
    gap: calc(5px * var(--sm-price-scale));
    text-align: left;
}

.sm-old-price {
    text-decoration: line-through;
    color: #95a5a6;
    font-size: calc(0.9em * var(--sm-price-scale));
    display: block;
}

.sm-new-price {
    font-size: calc(1.3em * var(--sm-price-scale));
    font-weight: 700;
    color: #e74c3c;
    display: block;
}

/* ========================================
   کلاس‌های انواع قیمت
   ======================================== */

/* قیمت عادی (بدون تخفیف) */
.sm-price-regular {
    font-size: calc(1.2rem * var(--sm-price-scale));
    color: #0066ff;
    font-weight: 600;
}

/* قیمت فروش (بعد از تخفیف) */
.sm-price-sale {
    font-size: calc(1.2rem * var(--sm-price-scale));
    color: #db0054;
    font-weight: 700;
}

/* قیمت خط‌خورده (قبل از تخفیف) */
.sm-price-old {
    font-size: calc(1rem * var(--sm-price-scale));
    color: #999;
    text-decoration: line-through;
    font-weight: 400;
}

/* واحد پولی */
.sm-price-unit {
    color: gray;
    font-size: calc(0.75rem * var(--sm-price-scale));
    font-weight: 500;
}

del.sm-regular-price-amount {
    color: #9d9d9d;
}

.sm-sale-price {
    margin-top: calc(-4px * var(--sm-price-scale));
}

/* ✅ مخفی کردن واحد پولی در قیمت خط‌خورده */
.sm-regular-price-amount .sm-price-unit,
.sm-old-price .sm-price-unit,
del .sm-price-unit {
    display: none;
}

/* ========================================
   پیام‌های موجودی
   ======================================== */
.sm-stock-icon {
    margin-left: 5px;
}

.sm-out-of-stock {
    color: #db0054;
    font-weight: 600;
    font-size: calc(0.9rem * var(--sm-price-scale));
}

.sm-on-backorder {
    color: #0066ff;
    font-weight: 600;
    font-size: calc(0.9rem * var(--sm-price-scale));
}

.sm-in-stock {
    color: #00b54b;
    font-weight: 600;
    font-size: calc(0.9rem * var(--sm-price-scale));
}

/* ========================================
   پیام‌های سفارشی محصول ناموجود
   ======================================== */
.sm-stock-message {
    display: inline-block;
    padding: calc(8px * var(--sm-price-scale)) calc(16px * var(--sm-price-scale));
    font-weight: 600;
    font-size: calc(0.8rem * var(--sm-price-scale));
    text-align: center;
    border: none;
}

.sm-message-outofstock {
    background: #ffeaf2;
    color: #ea0059;
    border: none;
}

.sm-message-contact {
    color: #0066ff;
    border: none;
}

.sm-message-sold {
    background: #ffeaf2;
    color: #ea0059;
    border: none;
}

/* ========================================
   انتخابگر محصولات متغیر
   ======================================== */
.sm-variation-selector-wrapper,
.sm-variation-selector {
    width: 100%;
    text-align: right;
}

.sm-attribute-group {
    margin-bottom: 0px;
    width: 100%;
}

.sm-attribute-label {
    display: block;
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 10px;
    color: black;
}

.sm-attribute-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* مخفی کردن radio button */
.sm-variation-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

/* استایل کارت */
.sm-variation-card {
    cursor: pointer;
    border: 2px solid #ddd;
    border-radius: 0px;
    padding: 8px 12px;
    transition: all 0.3s ease;
    background: white;
    user-select: none;
    display: inline-block;
}

.sm-variation-card:hover {
    border-color: black;
    color: black;
}

/* حالت انتخاب شده - با کلاس .checked که توسط JS مدیریت می‌شود */
.sm-variation-card.checked {
    border: 2px solid #000;
    background: #f5f5f5;
    font-weight: 600;
    font-size: 0.875rem;
    color: black;
}

.sm-variation-label {
    display: block;
    text-align: center;
    font-size: 0.875rem;
}

/* ========================================
   ریسپانسیو
   ======================================== */
@media (max-width: 768px) {
    .sm-sale-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }
    .sm-attribute-options {
        flex-direction: column;
    }
    .sm-variation-card {
        width: 100%;
    }
}