/* ================================
   Variable Plus - Frontend Weights
   وزن بالا، قیمت پایین
   ================================ */

.vp-weight-box {
    width: 100%;
    margin: 16px 0 20px;
    padding: 0;
    direction: rtl;
    box-sizing: border-box;
}

.vp-weight-box *,
.vp-weight-box *::before,
.vp-weight-box *::after {
    box-sizing: border-box;
}

.vp-weight-title {
    display: block;
    margin: 0 0 10px;
    padding: 0;

    font-size: 15px;
    font-weight: 700;
    line-height: 1.7;

    color: #222;
    text-align: right;
}

/* شبکه کارت‌ها */
.vp-weight-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;

    width: 100%;
    margin: 12px 0 18px;
    padding: 0;

    direction: rtl;
    box-sizing: border-box;
}

/* خود label کارت */
.vp-weight-card {
    display: block;
    position: relative;

    width: 100%;
    min-width: 0;

    margin: 0;
    padding: 0;

    cursor: pointer;
    box-sizing: border-box;
}

/* مخفی کردن input بدون از بین بردن عملکرد انتخاب */
.vp-weight-card input[type="radio"] {
    position: absolute;
    opacity: 0;

    width: 1px;
    height: 1px;

    margin: 0;
    padding: 0;

    overflow: hidden;
    pointer-events: none;
}

/* بدنه کارت */
.vp-weight-card-inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;

    gap: 5px;

    width: 100%;
    min-width: 0;
    min-height: 72px;

    padding: 13px 14px;

    border: 1px solid #ddd;
    border-radius: 10px;

    background: #fff;
    color: #222;

    cursor: pointer;
    box-sizing: border-box;

    transition:
        border-color 0.2s ease,
        background-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.15s ease;
}

/* وزن */
.vp-weight-label {
    display: block;

    width: 100%;
    min-width: 0;

    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;

    color: #222;
    text-align: right;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* قیمت */
.vp-weight-price {
    display: block;

    width: 100%;
    min-width: 0;

    font-size: 13px;
    font-weight: 700;
    line-height: 1.6;

    color: #444;
    text-align: right;

    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
}

/* عناصر داخلی قیمت ووکامرس */
.vp-weight-price .amount,
.vp-weight-price bdi,
.vp-weight-price .woocommerce-Price-amount,
.vp-weight-price .woocommerce-Price-currencySymbol {
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    color: inherit;
}

/* جلوگیری از شکستن بدشکل عدد و تومان، مگر در عرض خیلی کم */
.vp-weight-price .amount,
.vp-weight-price bdi {
    white-space: nowrap;
}

/* حالت انتخاب‌شده */
.vp-weight-card input[type="radio"]:checked + .vp-weight-card-inner {
    border-color: #0071a1;
    background: #f0f7ff;
    box-shadow: 0 0 0 1px rgba(0, 113, 161, 0.25);
}

/* فوکوس با کیبورد */
.vp-weight-card input[type="radio"]:focus + .vp-weight-card-inner,
.vp-weight-card input[type="radio"]:focus-visible + .vp-weight-card-inner {
    border-color: #0071a1;
    box-shadow: 0 0 0 2px rgba(0, 113, 161, 0.18);
}

/* هاور دسکتاپ */
@media (hover: hover) {
    .vp-weight-card-inner:hover {
        border-color: #0071a1;
        background: #f8fbff;
        transform: translateY(-1px);
    }
}

/* تبلت */
@media (max-width: 768px) {
    .vp-weight-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .vp-weight-card-inner {
        min-height: 70px;
        padding: 12px;
    }

    .vp-weight-label {
        font-size: 14px;
    }

    .vp-weight-price {
        font-size: 13px;
    }
}

/* موبایل */
@media (max-width: 480px) {
    .vp-weight-grid {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .vp-weight-card-inner {
        min-height: auto;
        padding: 13px 12px;
        gap: 4px;
    }

    .vp-weight-label {
        font-size: 14px;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    .vp-weight-price {
        font-size: 13px;
    }

    .vp-weight-price .amount,
    .vp-weight-price bdi {
        white-space: normal;
    }
}
