/* Jawwal Pay: payment choice, pay button and payment panel.
   Styled with the storefront palette (red actions, black text, neutral surfaces); the official logo carries the brand.
   Reuses .commerceModal / .commerceForm / .btnCheckout from style.css. */
:root {
    --jawwal: var(--red, #d90018);            /* accent = the site red */
    --jawwal-dark: var(--red-dark, #b80016);  /* hover / pressed */
    --jawwal-soft: #f7f7f7;                   /* neutral surfaces, as in the order summary */
    --jawwal-ring: rgba(217, 0, 24, .1);
    --jawwal-green: #16a34a;                  /* success, as elsewhere on the site */
}

/* ---------- Logo ---------- */
.jpLogo { flex: none; width: 28px; height: 28px; border-radius: 7px; object-fit: contain; }
.jpLogoLg { width: 40px; height: 40px; border-radius: 10px; }

/* ---------- Payment choice in the checkout form ---------- */
.payMethods { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
.payMethods legend { margin-bottom: 6px; font-size: 14px; font-weight: 700; }
.payMethods label { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 13px; border: 1px solid rgba(0, 0, 0, .14); border-radius: 12px; background: #fff; cursor: pointer; font-size: 14px; transition: border-color .15s, box-shadow .15s, background .15s; }
.payMethods label:hover { border-color: rgba(0, 0, 0, .28); }
.payMethods input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--red, #d90018); }
.payMethods .payCod i { width: 28px; text-align: center; color: #16a34a; font-size: 18px; }
.payMethods .payCod:has(input:checked) { border-color: var(--red, #d90018); box-shadow: 0 0 0 3px rgba(217, 0, 24, .08); }
.payMethods .payJawwal span { font-weight: 700; color: #111; }
.payMethods .payJawwal input { accent-color: var(--jawwal); }
.payMethods .payJawwal:has(input:checked) { border-color: var(--jawwal); background: #fff; box-shadow: 0 0 0 3px var(--jawwal-ring); }
.payMethods small { margin-inline-start: auto; padding: 2px 8px; border-radius: 999px; background: #f2f2f2; color: #666; font-size: 11px; white-space: nowrap; }
.payMethods .payJawwal:has(input:checked) small { background: rgba(217, 0, 24, .08); color: var(--jawwal); }

/* ---------- Jawwal Pay button (checkout submit when Jawwal Pay is chosen, and buttons inside the panel) ---------- */
.btnCheckout.btnJawwal, .jpCard .btnCheckout { background: var(--jawwal); }
.btnCheckout.btnJawwal:hover, .jpCard .btnCheckout:hover { background: var(--jawwal-dark); }
.btnCheckout.btnJawwal .jpLogo { width: 26px; height: 26px; border-radius: 7px; background: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, .7); }
.btnCheckout.btnJawwal:focus-visible, .jpCard .btnCheckout:focus-visible { outline: 3px solid rgba(217, 0, 24, .3); outline-offset: 2px; }
.jpCard .btnViewCart:hover { border-color: #111; color: #111; }

/* ---------- Payment page ---------- */
.jpPageTitle { display: flex; align-items: center; gap: 12px; }
.jpLayout { align-items: start; }
.jpCard { min-width: 0; padding: 24px; border: 1px solid var(--border, rgba(0, 0, 0, .08)); border-radius: 18px; background: #fff; }
.jpPanelTitle { margin-bottom: 14px; font-size: 20px; font-weight: 700; }
.jpSecure { display: flex; align-items: center; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(0, 0, 0, .08); font-size: 12px; color: #777; }
.jpSecure i { color: #16a34a; }
.jpItems { display: grid; gap: 10px; margin: 0 0 14px; padding: 0 0 14px; border-bottom: 1px solid rgba(0, 0, 0, .08); list-style: none; font-size: 14px; }
.jpItems li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: start; }
.jpItemName { min-width: 0; overflow-wrap: anywhere; }
.jpItemName small { display: block; font-size: 12px; color: #777; }
.jpColor { display: flex !important; align-items: center; gap: 6px; margin-top: 2px; }
.jpSwatch { flex: none; width: 12px; height: 12px; border: 1px solid rgba(0, 0, 0, .2); border-radius: 50%; }
.jpItemQty { color: #777; white-space: nowrap; }
.jpDelivery { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: #fff; font-size: 13px; line-height: 1.6; }
.jpDelivery span { display: block; font-weight: 700; color: #555; }
.jpDoneActions { display: grid; gap: 8px; width: 100%; margin-top: 8px; }
.jpDoneActions .btnViewCart { margin-top: 0; }
.accBtnJawwal { gap: 8px; }
.accBtnJawwal img { border-radius: 5px; }
.jpSummary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; margin-bottom: 14px; border-radius: 12px; background: var(--jawwal-soft); font-size: 14px; }
.jpAmount { font-size: 22px; font-weight: 800; color: #111; }
.jpTabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; margin-bottom: 4px; border-radius: 12px; background: #f2f2f2; }
.jpTabs[hidden] { display: none; }
.jpTabs button { min-height: 40px; border: 0; border-radius: 9px; background: transparent; font: inherit; font-weight: 600; color: #555; cursor: pointer; }
.jpTabs button[aria-selected="true"] { background: #fff; color: #111; box-shadow: 0 1px 4px rgba(0, 0, 0, .12), inset 0 -2px 0 var(--jawwal); }
.jpTabs button:disabled { opacity: .45; cursor: not-allowed; }
.jpTabs button:focus-visible { outline: 2px solid var(--jawwal); outline-offset: 2px; }
.jpPanel[hidden], .jpForm[hidden], .jpSteps[hidden], .jpDone[hidden] { display: none; }
.jpForm { padding: 12px 0 0; }
.jpForm label { font-size: 14px; font-weight: 600; }
.jpCard .commerceForm .kt-input:focus { border-color: var(--jawwal); box-shadow: 0 0 0 3px var(--jawwal-ring); }
.jpCard .commerceForm input:focus-visible { outline-color: var(--jawwal); }
.jpOtp { font-size: 22px; letter-spacing: .4em; text-align: center; }
.jpHint { font-size: 14px; color: #555; }
.jpQrBox { display: grid; place-items: center; margin: 14px auto 10px; }
.jpQrBox:empty { display: none; }
.jpQrBox svg { width: min(240px, 70vw); height: auto; padding: 10px; border: 1px solid var(--border, rgba(0, 0, 0, .12)); border-radius: 16px; background: #fff; }
.jpSteps { margin: 0 0 12px; padding-inline-start: 20px; font-size: 14px; color: #444; line-height: 1.8; list-style: decimal; }
.jpSteps li::marker { color: var(--jawwal); font-weight: 700; }
#jpPanelQr .btnCheckout, #jpPanelQr .btnViewCart { width: 100%; }
#jpPanelQr .btnViewCart { margin-top: 8px; }
.jpStatus { min-height: 1.4em; margin-top: 12px; font-size: 14px; color: #444; }
.jpStatus:empty { display: none; }
.jpDone { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 8px 4px; text-align: center; }
.jpDone i { font-size: 44px; }
.jpDone.isPaid i { color: var(--jawwal-green); }
.jpDone.isNotice i { color: #ca8a04; }
.jpDone .btnCheckout { width: 100%; }
.jpRef { font-size: 13px; color: #555; }
[aria-busy="true"] { cursor: progress; }

@media (max-width: 480px) {
    .jpCard { padding: 18px 14px; border-radius: 16px; }
    .jpAmount { font-size: 19px; }
    .jpLogoLg { width: 34px; height: 34px; }
}

/* Confirmation stays visible while the provider responds, including slow connections. */
.jpConfirmProgress{display:flex;align-items:center;gap:12px;margin-block:16px;padding:16px;border:1px solid #d8ebd2;border-radius:12px;background:#f5faf3;color:#285f19}
.jpConfirmProgress[hidden]{display:none}
.jpConfirmProgress strong{display:block;font-size:14px;font-weight:600}
.jpConfirmProgress p{margin:4px 0 0;font-size:12px;line-height:1.7;color:#64715f}
.jpConfirmSpinner{flex:none;width:26px;height:26px;border:3px solid #d8ebd2;border-top-color:var(--jawwal,#5aab36);border-radius:50%;animation:jp-confirm-spin .8s linear infinite}
@keyframes jp-confirm-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.jpConfirmSpinner{animation:none;border-style:dotted}}

.jpInvoiceAction{width:100%;margin-block:8px}.jpInvoiceAction[hidden]{display:none}.jpInvoiceAction .btnCheckout{width:100%;display:flex;align-items:center;justify-content:center;gap:8px}
