/* ═══════════════════════════════════════════════════════════
   COD Form Arabic  v1.1  —  RTL, 2×2 grid, qty+button row
   ═══════════════════════════════════════════════════════════ */

.cfa-wrap {
  direction: rtl;
  text-align: right;
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  color: inherit;
  line-height: 1.7;
  box-sizing: border-box;
  width: 100%;
}
.cfa-wrap *, .cfa-wrap *::before, .cfa-wrap *::after { box-sizing: inherit; }

/* ── Notices ─────────────────────────────────────────────── */
.cfa-notice {
  padding: 13px 16px;
  border-radius: 6px;
  font-size: .9rem;
  margin-bottom: 16px;
  line-height: 1.6;
}
.cfa-notice--error   { background: #fef2f2; border: 1.5px solid #fca5a5; color: #b91c1c; }
.cfa-notice--success { background: #f0fdf4; border: 1.5px solid #86efac; color: #166534; }
.cfa-thankyou-title  { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }
.cfa-thankyou-body   { font-size: .95rem; line-height: 1.7; }

/* ── Field ───────────────────────────────────────────────── */
.cfa-field {
  display: flex;
  flex-direction: column;
}

/* ── Input ───────────────────────────────────────────────── */
.cfa-input {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  font-size: 1rem;
  font-family: inherit;
  color: inherit;
  background: transparent;
  border: 1.5px solid #d1d5db;
  border-radius: 0;
  outline: none;
  text-align: right;
  direction: rtl;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
  appearance: none;
}
.cfa-input::placeholder { color: inherit; opacity: .45; }
.cfa-input:focus        { border-color: #000; box-shadow: 0 0 0 1px #000; }
.cfa-input.cfa-invalid  { border-color: #dc2626 !important; box-shadow: 0 0 0 1px #dc2626 !important; }

.cfa-field-err {
  display: block;
  font-size: .78rem;
  color: #dc2626;
  margin-top: 4px;
  min-height: 1em;
  line-height: 1.3;
}

/* ════════════════════════════════════════════════════════════
   2 × 2 GRID ROWS  (Name|Phone  and  City|Address)
   Always 2 columns — even on mobile
   ════════════════════════════════════════════════════════════ */
.cfa-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

/* ════════════════════════════════════════════════════════════
   ROW 3 — Quantity stepper  +  Place Order button
   Qty shrinks to its content, button fills the rest
   ════════════════════════════════════════════════════════════ */
.cfa-row--action {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 0;
}

/* ── Quantity control ────────────────────────────────────── */
.cfa-qty-ctrl {
  display: inline-flex;
  flex-direction: row;
  border: 1.5px solid #d1d5db;
  height: 50px;
  flex-shrink: 0;
  overflow: hidden;
}

.cfa-qty-btn {
  width: 40px;
  height: 50px;
  flex-shrink: 0;
  border: none;
  background: #f3f4f6;
  color: #000 !important;
  font-size: 1.3rem;
  line-height: 50px;
  text-align: center;
  cursor: pointer;
  padding: 0;
  margin: 0;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background .12s;
}
#cfa-plus  { border-left:  1.5px solid #d1d5db; }
#cfa-minus { border-right: 1.5px solid #d1d5db; }
.cfa-qty-btn:hover { background: #e5e7eb; }

.cfa-qty-num {
  width: 44px;
  height: 50px;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: #fff !important;
  color: #000 !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  font-family: inherit;
  text-align: center;
  padding: 0;
  margin: 0;
  -moz-appearance: textfield;
}
.cfa-qty-num::-webkit-inner-spin-button,
.cfa-qty-num::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.cfa-qty-num:focus { outline: none; }

/* ── Submit button ───────────────────────────────────────── */
.cfa-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex: 1;                   /* fills remaining space next to qty */
  height: 50px;
  padding: 0 20px;
  background: #000;
  color: #fff;
  border: 1.5px solid #000;
  border-radius: 0;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background .18s, color .18s;
  -webkit-tap-highlight-color: transparent;
  direction: rtl;
  white-space: nowrap;
}
.cfa-submit:hover:not(:disabled) { background: #fff; color: #000; }
.cfa-submit:disabled { opacity: .5; cursor: not-allowed; }

.cfa-spinner-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  animation: cfa-spin .7s linear infinite;
}
@keyframes cfa-spin { to { transform: rotate(360deg); } }

/* ════════════════════════════════════════════════════════════
   ORDER SUMMARY DROPDOWN
   ════════════════════════════════════════════════════════════ */
.cfa-summary-wrap {
  border: 1.5px solid #000;
  margin-top: 12px;
  direction: rtl;
}

.cfa-summary-toggle {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 13px 16px;
  background: #fff;
  color: #000;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 700;
  text-align: right;
  direction: rtl;
  transition: background .15s;
  -webkit-tap-highlight-color: transparent;
}
.cfa-summary-toggle:hover { background: #f9f9f9; }

.cfa-summary-toggle__label { flex: 1; text-align: right; }
.cfa-summary-toggle__total { font-weight: 700; font-size: 1rem; }

.cfa-chevron {
  width: 18px; height: 18px;
  flex-shrink: 0;
  transition: transform .2s;
}
.cfa-summary-toggle[aria-expanded="true"] .cfa-chevron { transform: rotate(180deg); }

.cfa-summary-panel {
  border-top: 1.5px solid #000;
  padding: 14px 16px;
  background: #fafafa;
  direction: rtl;
}
.cfa-summary-panel[hidden] { display: none; }

.cfa-summary-line {
  display: flex;
  flex-direction: row-reverse;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 7px 0;
  font-size: .9rem;
  border-bottom: 1px solid #e5e7eb;
}
.cfa-summary-line:last-child { border-bottom: none; }

.cfa-summary-line__name {
  font-weight: 600;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60%;
  text-align: right;
}
.cfa-summary-line__value { white-space: nowrap; text-align: left; }

.cfa-summary-line--total {
  padding-top: 10px;
  margin-top: 4px;
  font-size: 1rem;
  font-weight: 700;
  border-top: 1.5px solid #000;
  border-bottom: none;
}
