/* Modern UI Styles for Moyasar Payment Forms */

.wc-cedit-card-form {
    max-width: 500px;
    margin: 20px auto;
}

#wc-moyasar-cc-form,
#wc-moyasar-stc-pay-form {
    border: 1px solid #e5e5e5;
    background: #fdfdfd;
    padding: 25px;
    /* Increased padding per request */
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

#wc-moyasar-cc-form *,
#wc-moyasar-stc-pay-form * {
    box-sizing: border-box;
    /* Ensure padding doesn't break layout */
}

/* Ensure full width for these rows */
#wc-moyasar-cc-form .form-row.form-row-wide,
#wc-moyasar-stc-pay-form .form-row.form-row-wide {
    width: 100%;
    margin: 0 0 20px;
    clear: both;
}

#wc-moyasar-cc-form label,
#wc-moyasar-stc-pay-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #444;
    font-size: 14px;
}

/* Polished Input Styles (using input-text class for specificity) */
#wc-moyasar-cc-form input.input-text,
#wc-moyasar-cc-form input[type="text"],
#wc-moyasar-cc-form input[type="password"],
#wc-moyasar-stc-pay-form input[type="text"] {
    width: 100%;
    padding: 0 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px;
    line-height: 48px;
    /* Consistent height */
    height: 48px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

#wc-moyasar-cc-form input.input-text:focus,
#wc-moyasar-cc-form input[type="text"]:focus,
#wc-moyasar-cc-form input[type="password"]:focus,
#wc-moyasar-stc-pay-form input[type="text"]:focus {
    border-color: #316896;
    box-shadow: 0 0 0 4px rgba(49, 104, 150, 0.1);
    outline: none;
}

/* Credit Card Group */
#wc-moyasar-cc-form .moyasar-cc-group {
    position: relative;
    /* Ensures icon is relative to this */
}

/* Expiry & CVC Layout */
.moyasar-cc-expiry-cvc-group {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.moyasar-cc-expiry-cvc-group .form-row {
    flex: 1;
    float: none;
    /* Override WC float */
    margin: 0;
    width: auto;
}

/* Icon adjustments */
#moyasar_card_brand {
    font-style: normal;
    font-weight: 100 !important;
}

/* Quick Buy Button */
.moyasar-quick-buy-btn {
    margin-top: 10px;
    width: 100%;
    background-color: #1a1a1a !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none !important;
    padding: 15px 20px !important;
    font-size: 16px !important;
    border-radius: 8px !important;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.moyasar-quick-buy-btn:hover {
    background-color: #000000 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.moyasar-quick-buy-btn.loading {
    opacity: 0.8;
    cursor: not-allowed;
    background-color: #333 !important;
    background-image: none !important;
}

/* RTL Support for Card Form */
.woocommerce-checkout[dir="rtl"] .moyasar-cc-group .moyasar-cc-logos,
.woocommerce-cart[dir="rtl"] .moyasar-cc-group .moyasar-cc-logos,
[dir="rtl"] .moyasar-cc-group .moyasar-cc-logos {
    right: auto !important;
    left: 12px !important;
}

[dir="rtl"] .moyasar-cc-group input {
    padding-left: 50px !important;
    /* Space for icon on left */
    padding-right: 12px !important;
}

/* Ensure LTR inputs have space on right */
[dir="ltr"] .moyasar-cc-group input,
.moyasar-cc-group input:not([dir="rtl"]) {
    padding-right: 50px !important;
}

/* Gateway Icons Styling */
.moyasar-gateway-icon {
    max-height: 32px !important;
    vertical-align: middle;
    /* Default LTR (float right) */
    float: right;
    margin-left: 10px;
}

/* RTL Override */
[dir="rtl"] .moyasar-gateway-icon,
.woocommerce[dir="rtl"] .moyasar-gateway-icon {
    float: left;
    margin-left: 0;
    margin-right: 10px;
}