.custom-order-form {
    direction: rtl;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* فاصله لیبل با فیلد پایینش */
.custom-order-form label {
    display: block;
    margin-top: 6px;
    margin-bottom: 4px;
    font-weight: 600;
}

/* استایل فیلدها */
.custom-order-form input[type="text"],
.custom-order-form input[type="number"],
.custom-order-form select,
.custom-order-form textarea {
    width: 100%;
    padding: 8px;
    margin-top: 0;
    margin-bottom: 8px;
    box-sizing: border-box;
}

/* کنار هم بودن استان و شهر */
.state-city-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}
.state-city-wrapper > div {
    flex: 1;
}

/* ظرف دکمه‌ها و ورودی تعداد - عرض کامل */
.qty-wrapper {
    display: flex;
    flex-direction: row-reverse; /* جابجایی کامل سمت چپ و راست */
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-bottom: 10px;
}


/* دکمه‌های تعداد */
.qty-wrapper button {
    background: #C1004B;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    user-select: none;
    width: 50px; /* عرض ثابت برای دکمه ها */
    height: 40px;
    flex-shrink: 0; /* جلوگیری از کوچک شدن دکمه */
}

/* ورودی تعداد */
.qty-wrapper input[type="number"] {
    flex-grow: 1; /* اشغال کل فضای باقی مانده */
    text-align: center;
    padding: 5px 0;
    margin: 0 10px; /* فاصله افقی بین دکمه‌ها */
    box-sizing: border-box;
    -moz-appearance: textfield;
}
.qty-wrapper input[type=number]::-webkit-inner-spin-button, 
.qty-wrapper input[type=number]::-webkit-outer-spin-button { 
    -webkit-appearance: none;
    margin: 0;
}

/* دکمه پرداخت */
.custom-order-form button.custom-order-submit {
    background: #C1004B;
    color: #fff;
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
}
.custom-order-form button.custom-order-submit:hover {
    background: #005177;
}

/* پاپ‌آپ موفق یا خطا */
.popup {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    padding: 30px 25px 40px 25px;
    border-radius: 12px;
    box-shadow: 0 12px 25px rgba(0,0,0,0.2);
    z-index: 9999;
    max-width: 400px;
    text-align: center;
    font-weight: 600;
    animation: popupFadeIn 0.3s ease forwards;
}
.popup.success {
    border: 2px solid green;
}
.popup.error {
    border: 2px solid red;
}
.popup button, .retry-btn {
    display: block;
    margin: 15px auto 0;
    padding: 8px 20px;
    border: none;
    background: #C1004B;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
    text-align: center;
    width: fit-content;
}
.popup.error button, .retry-btn {
    background: linear-gradient(135deg, #d32f2f, #9a1f1f);
    box-shadow: 0 5px 12px rgba(211, 47, 47, 0.5);
}
.popup button:hover, .retry-btn:hover {
    background-color: #005177;
    color: #ffffff;
}
.popup.error button:hover, .retry-btn:hover {
    background: linear-gradient(135deg, #9a1f1f, #6e1616);
    box-shadow: 0 8px 16px rgba(154, 31, 31, 0.7);
}

/* انیمیشن پاپ‌آپ */
@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}
#phone, #postal_code {
  direction: rtl;
  text-align: right; /* اگر لازم داری متن داخل input هم راست‌چین باشه */
}

/* placeholder ها هم راست‌چین بشن */
#phone::placeholder,
#postal_code::placeholder {
  text-align: right;
  direction: rtl;
}
