/* التصميم الجديد والمحسّن للنموذج */

/* تنسيق الكارد المحيط بالنموذج */
.wqo-card {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px 25px;
    /* تقليل البادينج قليلاً */
    margin: 20px auto;
    /* توسيط */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    max-width: 420px;
    /* تحديد العرض كما طلب المستخدم */
    width: 100%;
    box-sizing: border-box;
}

#wqo-form {
    /* إزالة الستايل القديم لأنه أصبح في الكارد */
    border: none;
    padding: 0;
    margin-top: 0;
    box-shadow: none;
    background: transparent;
}

.wqo-form-section {
    margin-bottom: 15px;
    clear: both;
}

/* تقليل المسافة */
.wqo-form-section:last-child {
    margin-bottom: 0;
}

.wqo-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
    margin-top: 0;
    margin-bottom: 12px;
}

#wqo-form .form-row {
    padding: 0;
    margin: 0 0 10px;
}

/* تقليل المسافة بين الحقول */
#wqo-form .form-row label {
    font-weight: 500;
    margin-bottom: 4px;
    display: block;
    font-size: 14px;
}

#wqo-form .form-row input.input-text {
    width: 100%;
    padding: 8px 12px;
    /* تصغير الحقل */
    font-size: 14px;
    /* تصغير الخط */
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#wqo-form .form-row input.input-text:focus {
    outline: none;
}

/* تنسيق الأقسام الرئيسية */
.wqo-quantity-section,
.wqo-variations-container table.variations {
    width: 100%;
    border-collapse: collapse;
}

.wqo-variations-container td {
    display: block;
    /* جعل الخلايا بلوك لتأتي تحت بعضها */
    padding: 0;
    border: none;
    text-align: right;
}

.wqo-variations-container td.label {
    display: block;
    margin-bottom: 8px;
}

/* تنسيق تسمية المتغير (مثل: الحجم، اللون) لتشبه عناوين الأقسام */
.wqo-variations-container td.label label {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.wqo-variations-container td.value {
    margin-bottom: 5px;
    /* تقليل المسافة بين صفوف المتغيرات */
}

/* تنسيق الأقسام الرئيسية */
.wqo-quantity-section,
.wqo-variations-container {
    width: 100%;
    margin-bottom: 10px;
    /* تقليل المسافة الكلية أسفل القسم */
    clear: both;
}

/* تنسيق عنوان قسم الكمية */
.wqo-quantity-section .wqo-section-title {
    display: block;
    width: 100%;
    margin-bottom: 10px;
    text-align: right;
    /* محاذاة لليمين للعربية */
}

/* تنسيق خاص للكمية */
.wqo-quantity-section .wqo-quantity {
    display: inline-flex;
}

/* ✨ تنسيق أزرار المقاسات (Swatches) ✨ */
.wqo-swatches-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    /* محاذاة البداية */
    gap: 10px;
    margin-top: 5px;
    margin-bottom: 0;
}

.wqo-swatch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    /* عرض ثابت */
    height: 40px;
    /* ارتفاع ثابت */
    padding: 0;
    /* إزالة البادينج */
    border: 1px solid #ccc;
    background-color: #fff;
    cursor: pointer;
    border-radius: 50%;
    /* دائرة كاملة */
    font-size: 14px;
    font-weight: 500;
    color: #333;
    transition: all 0.2s ease;
    user-select: none;
    margin: 0;
    box-sizing: border-box;
    text-transform: uppercase;
}

.wqo-swatch:hover {
    border-color: #888;
}

.wqo-swatch.selected {
    border: 2px solid #e50914;
    /* سيتم تحديثه بـ JS */
    color: #333;
    background-color: #fff;
    font-weight: 700;
    box-shadow: none;
}

.wqo-swatch.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f5f5f5;
    border-color: #eee;
    color: #aaa;
}

/* إخفاء القائمة المنسدلة سيتم عبر JS بعد إنشاء الأزرار لضمان عدم اختفاء الحقل في حالة حدوث خطأ */
.wqo-variations-container select.hidden-by-js {
    display: none !important;
}

/* إخفاء زر "مسح" الصغير الخاص بـ Woo */
.reset_variations {
    display: none !important;
}

/* تعديل عرض Price Container */
.wqo-price-container {
    margin-top: 10px;
}

/* ------------------------------------------- */

/* تنسيق حقل الكمية المعزول */
.wqo-quantity {
    display: inline-flex;
    border: 1px solid #ccc;
    border-radius: 6px;
    overflow: hidden;
}

.wqo-quantity .wqo-qty {
    width: 45px;
    /* تصغير قليلا */
    text-align: center;
    border: none;
    font-weight: bold;
    font-size: 15px;
    /* تصغير الخط */
    -moz-appearance: textfield;
    appearance: textfield;
    padding: 5px;
}

.wqo-quantity .wqo-qty::-webkit-outer-spin-button,
.wqo-quantity .wqo-qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.wqo-quantity .wqo-plus,
.wqo-quantity .wqo-minus {
    background-color: #f9f9f9;
    border: none;
    width: 35px;
    /* تصغير الزر */
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    color: #555;
    transition: background-color 0.2s ease;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wqo-quantity .wqo-plus:hover,
.wqo-quantity .wqo-minus:hover {
    background-color: #e0e0e0;
}


/* زر إرسال الطلب */
#wqo-form button[type="submit"] {
    width: 100%;
    padding: 14px;
    font-size: 18px;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    transition: filter 0.2s ease, transform 0.1s ease;
}

#wqo-form button[type="submit"]:active {
    transform: scale(0.98);
}

/* رسائل النتيجة */
#wqo-result p {
    margin: 15px 0 0;
    padding: 15px;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
    border: 1px solid;
}

.wqo-success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.wqo-error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}