/* ============== WDPO Frontend v7 ============== */

/* Force Vazirmatn font everywhere on WDPO elements */
.wdpo-options,
.wdpo-options *,
.wdpo-live-price,
.wdpo-live-stock,
.wdpo-live-discount,
.wdpo-add-to-cart-form,
.wdpo-add-to-cart-form *,
.wdpo-initial-notice,
.wdpo-initial-notice * {
    font-family: 'Vazirmatn', 'Tahoma', 'IRANSans', 'Segoe UI', sans-serif !important;
    box-sizing: border-box;
}

.wdpo-options {
    direction: rtl;
    width: 100%;
    margin-top: 15px;
}

/* Initial notice shown when no option is selected yet */
.wdpo-initial-notice {
    background: #fff8e1;
    border: 1px solid #ffd54f;
    color: #5d4037;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 16px;
    line-height: 1.9;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: opacity .2s;
}
.wdpo-initial-notice.is-hidden {
    display: none !important;
}
.wdpo-initial-notice::before {
    content: 'ⓘ';
    font-size: 18px;
    color: #f9a825;
}

.wdpo-option-group {
    display: none;
    margin: 0 0 28px;
}
.wdpo-option-group.is-visible {
    display: block;
}
.wdpo-group-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 14px;
    display: flex;
    gap: 10px;
    align-items: baseline;
}
.wdpo-selected-label {
    font-size: 13px;
    color: #777;
    font-weight: 400;
}

.wdpo-option-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* ============== Display: button (default) ============== */
.wdpo-display-button .wdpo-option {
    position: relative;
    min-width: 110px;
    min-height: 52px;
    padding: 10px 22px;
    border-radius: 14px;
    border: 1px solid #ddd;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all .2s;
    font-size: 14px;
    color: #333;
}
.wdpo-display-button .wdpo-option:hover {
    border-color: #315b85;
}
.wdpo-display-button .wdpo-option.is-selected {
    background: #315b85;
    color: #fff;
    border-color: #315b85;
}

/* ============== Display: icon (compact, no button chrome) ============== */
.wdpo-display-icon .wdpo-option {
    position: relative;
    min-width: auto;
    min-height: auto;
    padding: 4px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: all .2s;
    width: 64px;
    font-size: 12px;
    color: #555;
}
.wdpo-display-icon .wdpo-option:hover {
    background: #f0f6ff;
    border-color: #cfe2ff;
}
.wdpo-display-icon .wdpo-option.is-selected {
    background: #eaf2ff;
    border-color: #315b85;
    color: #315b85;
    box-shadow: 0 0 0 2px #315b85 inset;
}
.wdpo-display-icon .wdpo-option img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 8px;
}
.wdpo-display-icon .wdpo-option .wdpo-color-dot {
    width: 44px;
    height: 44px;
    border-radius: 8px;
}
.wdpo-display-icon .wdpo-option .wdpo-option-name {
    font-size: 11px;
    text-align: center;
    line-height: 1.2;
}
.wdpo-display-icon .wdpo-option .wdpo-check {
    position: absolute;
    top: -4px;
    left: -4px;
    background: #315b85;
    color: #fff;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}
.wdpo-display-icon .wdpo-option.is-selected .wdpo-check {
    display: inline-flex;
}

/* ============== Display: color (small swatch, no text) ============== */
.wdpo-display-color .wdpo-option {
    position: relative;
    min-width: auto;
    min-height: auto;
    padding: 0;
    border-radius: 50%;
    border: 2px solid #eee;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .2s;
    width: 36px;
    height: 36px;
    font-size: 0;
    color: transparent;
}
.wdpo-display-color .wdpo-option:hover {
    border-color: #999;
    transform: scale(1.05);
}
.wdpo-display-color .wdpo-option.is-selected {
    border-color: #315b85;
    box-shadow: 0 0 0 2px #315b85, 0 0 0 4px #fff inset;
}
.wdpo-display-color .wdpo-option .wdpo-color-dot {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 0;
}
.wdpo-display-color .wdpo-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
.wdpo-display-color .wdpo-option .wdpo-option-name {
    display: none;
}
.wdpo-display-color .wdpo-option .wdpo-check {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255,255,255,.85);
    color: #315b85;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}
.wdpo-display-color .wdpo-option.is-selected .wdpo-check {
    display: inline-flex;
}

/* ============== Shared bits ============== */
.wdpo-check { display: none; }
.wdpo-option.is-selected .wdpo-check { display: inline-flex; }
.wdpo-option img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    border-radius: 8px;
}
.wdpo-color-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid #ccc;
    background: var(--wdpo-color);
    display: inline-block;
}
/* آیتمی که به دلیل عدم تطابق با انتخاب‌های قبلی بی‌ربط است، اصلاً نمایش داده نمی‌شود. */
.wdpo-filtered-out {
    display: none !important;
}
/* آیتمی که مرتبط است ولی موجودی ندارد، دیده می‌شود اما غیرقابل‌انتخاب و خط‌خورده است. */
.wdpo-option.is-out-of-stock {
    opacity: .35 !important;
    pointer-events: none !important;
    text-decoration: line-through;
}
.wdpo-unavailable {
    display: none;
    font-size: 11px;
    color: #b42318;
    margin-right: 6px;
}
.wdpo-option.is-out-of-stock .wdpo-unavailable {
    display: inline;
}

/* Live price / stock boxes (auto-injected into WooCommerce price/stock HTML) */
.wdpo-live-box {
    background: #f7f7f7;
    border-radius: 16px;
    padding: 16px 20px;
    text-align: center;
    margin: 8px 0;
}
.wdpo-live-price {
    display: block;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #222;
}

/* حالت «هنوز گزینه‌ای انتخاب نشده» - متن راهنما با اندازه بزرگ‌تر */
.wdpo-live-price.is-placeholder {
    display: block;
    font-size: 18px;
    line-height: 2;
    font-weight: 700;
    color: #5d4037;
    text-align: center;
}

/* واحد پول و اجزای اضافه قالب در حالت راهنما پنهان می‌شوند */
.wdpo-live-price.is-placeholder + .wdpo-live-discount {
    display: none !important;
}
.wdpo-live-stock {
    display: block;
    font-size: 14px;
    margin-bottom: 10px;
    color: #555;
}
.wdpo-live-stock.is-out {
    color: #b42318;
    font-weight: 700;
}
.wdpo-live-discount {
    display: inline-block;
    background: #ffe3e3;
    color: #b42318;
    padding: 2px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
}
.wdpo-cart-error {
    color: #b42318;
    margin-top: 12px;
    font-size: 13px;
}
.wdpo-add-to-cart-form .single_add_to_cart_button.disabled {
    opacity: .55;
    cursor: not-allowed;
}

/* قلاب کمکی: تا وقتی هیچ گزینه‌ای انتخاب نشده، کلاس wdpo-no-selection روی body قرار می‌گیرد.
   اگر قالب شما واحد پول را در المان خاصی چاپ می‌کند، می‌توانید آن را این‌طور پنهان کنید:
   body.wdpo-no-selection .selector-of-currency { display:none !important; } */

body.wdpo-no-selection .summary .woocommerce-Price-currencySymbol,
body.wdpo-no-selection .entry-summary .woocommerce-Price-currencySymbol {
    display: none !important;
}
