/* إخفاء منتقي الكمية (+/−) عند عروض Radio — عصرية */
body.charov-bundle-hide-qty .ClsParent,
body.charov-bundle-product.charov-bundle-hide-qty .ClsParent {
    display: none !important;
}

/* ——— اختيار لكل قطعة — شاك أوت بسيطة (ألوان من قالب --mior-*) ——— */
#mior-form .charov-bundle-pieces-panel--simple {
    margin: 14px 0 18px;
    padding: 14px 16px;
    border: 2px solid var(--mior-border, #ccc);
    border-radius: var(--mior-radius, 12px);
    background: var(--mior-surface, #faf9fa);
    direction: rtl;
    box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

#mior-form .charov-bundle-pieces-panel--simple .charov-bundle-pieces-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

#mior-form .charov-bundle-pieces-panel--simple .charov-bundle-pieces-panel__head-main {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

#mior-form .charov-bundle-pieces-panel--simple .charov-bundle-pieces-panel__title {
    font-weight: 700;
    font-size: 15px;
    color: var(--mior-text, #222);
    font-family: "Cairo", "Droid Arabic Naskh", sans-serif;
}

#mior-form .charov-bundle-pieces-panel--simple .charov-bundle-pieces-panel__price-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 16px;
    background: var(--mior-primary, #b3004b);
    color: var(--mior-btn-text, #fff);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

#mior-form .charov-bundle-pieces-panel--simple .charov-bundle-pieces-panel__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--mior-primary, #b3004b) 0%, var(--mior-primary-hover, #a00044) 100%);
    color: var(--mior-btn-text, #fff);
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

#mior-form .charov-bundle-pieces-panel--simple .charov-bundle-piece-row {
    padding: 12px 6px;
    border-top: 1px dashed var(--mior-border, #ccc);
}

#mior-form .charov-bundle-pieces-panel--simple .charov-bundle-piece-row:first-of-type {
    border-top: none;
    padding-top: 0;
}

#mior-form .charov-bundle-pieces-panel--simple .charov-bundle-piece-row__label {
    margin-bottom: 10px;
}

#mior-form .charov-bundle-pieces-panel--simple .charov-bundle-piece-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 16px;
    background: var(--mior-input-bg, #fff);
    border: 1px solid var(--mior-border, #ccc);
    color: var(--mior-label, #666);
    font-weight: 700;
    font-size: 13px;
}

#mior-form .charov-bundle-pieces-panel--simple .charov-bundle-piece-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

#mior-form .charov-bundle-pieces-panel--simple .charov-bundle-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--mior-label, #666);
}

#mior-form .charov-bundle-pieces-panel--simple .charov-bundle-field select {
    width: 100%;
    min-height: 48px;
    height: auto;
    line-height: 1.55;
    padding: 11px 12px;
    border: 1px solid var(--mior-border, #ccc);
    border-radius: var(--mior-radius, 8px);
    font-size: var(--mior-font-size, 15px);
    background: var(--mior-input-bg, #fff);
    color: var(--mior-text, #222);
    direction: rtl;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

#mior-form .charov-bundle-pieces-panel--simple .charov-bundle-field select:focus {
    border-color: var(--mior-primary, #b3004b);
    outline: none;
}

/* تلوين القطعة/الحقول الفارغة عند التحقق — بسيطة (مثل العصرية) */
#mior-form .charov-bundle-pieces-panel--simple .charov-bundle-piece-row--error {
    background: rgba(231, 76, 60, 0.07);
    border-radius: var(--mior-radius, 8px);
    border-top-color: #e74c3c;
}

#mior-form .charov-bundle-pieces-panel--simple .charov-bundle-field--error,
#mior-form .charov-bundle-pieces-panel--simple .charov-bundle-field-wrap--error select {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.22) !important;
}

#mior-form .charov-bundle-pieces-panel--simple .charov-bundle-field-wrap--error label {
    color: #c0392b;
}

@keyframes charovBundleRowShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

#mior-form .charov-bundle-pieces-panel--simple .charov-bundle-piece-row--shake {
    animation: charovBundleRowShake 0.55s ease;
}

@media (max-width: 480px) {
    #mior-form .charov-bundle-pieces-panel--simple .charov-bundle-piece-fields {
        grid-template-columns: 1fr;
    }

    #mior-form .charov-bundle-pieces-panel--simple {
        margin: 10px 0 14px;
        padding: 12px;
    }
}

/* عصرية: الألوان الديناميكية من القالب تُحقَن عبر PHP (CharovBundlePieces.php) */
.charov-bundle-pieces-panel--modern {
    direction: rtl;
    font-family: "Cairo", "Droid Arabic Naskh", sans-serif;
}

.charov-bundle-linked-hidden {
    display: none !important;
}

body.charov-bundle-product .mior-qty-wrapper,
body.charov-bundle-product .charov-bundle-qty-source,
body.charov-bundle-product .quantity.buttons_added,
#mior-form.charov-bundle-product .mior-qty-wrapper,
body.charov-bundle-active .mior-qty-wrapper,
body.charov-bundle-active .input-number-wrap,
body.charov-bundle-active .quantity.buttons_added,
#mior-form.charov-bundle-active .mior-qty-wrapper {
    display: none !important;
}

body.charov-bundle-active .ClsParent,
body.charov-bundle-active .single_variation_wrap .woocommerce-variation-add-to-cart .quantity {
    display: none !important;
}

body.charov-bundle-active .charov-bundle-qty-forced {
    visibility: visible;
}

.charov-bundle-panel-row td {
    padding: 0 14px 14px 14px !important;
    border: none !important;
}

.woocommerce-billing-fields__field-wrappernew .charov-bundle-pieces-panel:not(.charov-bundle-pieces-panel--modern) {
    margin: 12px 0 16px;
}
