/*
 * Aswaf frontend: 04-payment-cart.css
 * Responsibility: deposit gateway, payment cards, live totals, account rows, WhatsApp CTA, checkout breakdown panel, and cart summary.
 * This file was split from assets/css/frontend.css; keep import order in frontend.css.
 */

/* ═══════════════════════════════════════════════════════════
   PAYMENT GATEWAY — ASW Deposit v9.1 Professional UI
   ─────────────────────────────────────────────────────────
   Uses body prefix + inline CSS for max specificity vs xStore
═══════════════════════════════════════════════════════════ */

/* ── Root container ── */
body .asw-gw,
body #asw-gw {
  direction: rtl;
  display: flex;
  flex-direction: column;
  gap: 0;
  font-family: var(--et_body_font_family, inherit);
}

/* ── Block (step) ── */
body .asw-gw-block {
  padding: 1rem 0 0.85rem;
  border-bottom: 1px solid var(--asw-border);
  animation: aswFadeSlide 0.25s ease both;
}

body .asw-gw-block:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

body .asw-gw-block:nth-child(2) {
  animation-delay: 0.07s;
}

body .asw-gw-block:nth-child(3) {
  animation-delay: 0.14s;
}

@keyframes aswFadeSlide {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Block label ── */
body .asw-gw-block-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--asw-text-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.7rem;
}

body .asw-gw-block-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--asw-border);
}

body .asw-gw-block-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--asw-bg-3);
  color: var(--asw-text-2);
  font-size: 0.65rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════
   PAYMENT CARDS
══════════════════════════════════════════════ */
body .asw-gw-cards {
  display: flex;
  gap: 0.55rem;
}

/* Solo card (only one option) takes full width */
body .asw-gw-c.asw-gw-c-solo {
  flex: 1;
}

body .asw-gw-c {
  flex: 1;
  position: relative;
  display: flex;
  align-items: flex-start;
  text-align: right;
  gap: 0.6rem;
  padding: 0.85rem 0.9rem;
  border: 2px solid var(--asw-border);
  border-radius: var(--asw-r3);
  background: var(--asw-bg);
  cursor: pointer;
  overflow: hidden;
  transition:
    border-color 0.18s,
    box-shadow 0.18s,
    transform 0.15s;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

body .asw-gw-c:hover {
  border-color: var(--asw-primary);
  transform: translateY(-1px);
  box-shadow: 0 3px 12px rgba(200, 168, 74, 0.15);
}

body .asw-gw-c.sel {
  border-color: var(--asw-primary);
  background: linear-gradient(
    150deg,
    rgba(200, 168, 74, 0.06) 0%,
    var(--asw-bg) 100%
  );
  box-shadow:
    0 0 0 3px rgba(200, 168, 74, 0.12),
    0 3px 12px rgba(200, 168, 74, 0.15);
}

body .asw-gw-c:focus-visible {
  outline: 3px solid var(--asw-primary);
  outline-offset: 2px;
}

/* Radio circle */
body .asw-gw-c-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--asw-border);
  background: var(--asw-bg);
  flex-shrink: 0;
  margin-top: 0.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    border-color 0.15s,
    background 0.15s;
}

body .asw-gw-c.sel .asw-gw-c-radio {
  border-color: var(--asw-primary);
  background: var(--asw-primary);
}

body .asw-gw-c-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  transform: scale(0);
  transition: transform 0.15s;
}

body .asw-gw-c.sel .asw-gw-c-dot {
  transform: scale(1);
}

/* Card body */
body .asw-gw-c-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  height: 100%;
}

/* Pill badge */
body .asw-gw-c-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 0.12rem 0.45rem;
  border-radius: var(--asw-r-full);
  background: var(--asw-primary);
  color: var(--asw-text-inv);
  width: fit-content;
  letter-spacing: 0.03em;
  margin-bottom: 0.1rem;
}

body .asw-gw-c-pill-lock {
  background: var(--asw-bg-3);
  color: var(--asw-text-2);
}

/* Card main row */
body .asw-gw-c-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  text-align: right;
}

body .asw-gw-c-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
  line-height: 1;
}

body label.asw-gw-c input[type="radio"] {
  display: none !important;
}

body .asw-gw-c-texts {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
}

body .asw-gw-c-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--asw-text);
  line-height: 1.2;
}

body .asw-gw-c-desc {
  font-size: 0.7rem;
  color: var(--asw-text-2);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body .asw-gw-c-price {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--asw-text);
  letter-spacing: -0.02em;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.15s;
  margin-top: auto;
}

body .asw-gw-c.sel .asw-gw-c-price {
  color: var(--asw-primary);
}

body .asw-gw-c-price-gold {
  color: var(--asw-gold-dk) !important;
}

body .asw-gw-c-note {
  font-size: 0.65rem;
  color: var(--asw-text-3);
  margin-top: 0.1rem;
  padding-right: 1.6rem;
}

/* Mobile: stack cards */
@media (max-width: 480px) {
  body .asw-gw-cards {
    flex-direction: column-reverse !important;
  }

  body .asw-gw-c-price {
    font-size: 0.95rem;
  }
}

/* ══════════════════════════════════════════════
   SUMMARY STRIP (live totals)
══════════════════════════════════════════════ */
body .asw-gw-summary {
  margin-top: 0.75rem;
  background: var(--asw-bg-2);
  border: 1px solid var(--asw-border);
  border-radius: var(--asw-r2);
  overflow: hidden;
}

body .asw-gw-sum-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--asw-border);
}

body .asw-gw-sum-row:last-child {
  border-bottom: none;
}

body .asw-gw-sum-now {
  background: var(--asw-bg);
  font-weight: 800;
  font-size: 0.88rem;
}

body .asw-gw-sum-now strong {
  color: var(--asw-primary);
  font-size: 0.98rem;
}

body .asw-gw-sum-later {
  color: var(--asw-text-2);
  font-size: 0.78rem;
}

body .asw-gw-sum-ship {
  color: var(--asw-text-3);
  font-size: 0.72rem;
  font-style: italic;
}

/* ══════════════════════════════════════════════
   ACCOUNT ROWS
══════════════════════════════════════════════ */
body .asw-gw-accs {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

body .asw-gw-acc {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  background: var(--asw-bg-2);
  border: 1.5px solid var(--asw-border);
  border-radius: var(--asw-r2);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
  cursor: default;
}

body .asw-gw-acc:hover {
  border-color: var(--asw-border-dk);
  box-shadow: var(--asw-sh-xs);
}

body .asw-gw-acc-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  width: 52px;
  flex-shrink: 0;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

body .asw-brand-ip {
  color: #6a0dad;
}

body .asw-brand-wl {
  color: #d84315;
}

body .asw-gw-acc-num {
  flex: 1;
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--asw-text);
  font-family: "Courier New", Courier, monospace;
  letter-spacing: 0.08em;
}

body .asw-gw-acc-copy {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0.7rem;
  border-radius: var(--asw-r-full);
  border: 1.5px solid var(--asw-border);
  background: var(--asw-bg);
  color: var(--asw-text-2);
  font-size: 0.72rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: 0.18s;
  white-space: nowrap;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

body .asw-gw-acc-pay,
body .asw-gw-qr-link {
  position: relative;
  z-index: 2;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

body .asw-gw-acc-copy:hover,
body .asw-gw-acc-copy--done {
  background: var(--asw-green);
  color: #fff;
  border-color: var(--asw-green);
}

body .asw-gw-acc--instapay {
  align-items: flex-start;
  flex-wrap: wrap;
}

body .asw-gw-acc-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

body .asw-gw-qr-link {
  flex: 0 0 86px;
  display: block;
  padding: 0.35rem;
  border: 1px solid var(--asw-border);
  border-radius: 8px;
  background: #fff;
}

body .asw-gw-qr {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
}

body .asw-gw-acc-pay,
body .asw-gw-acc-pay:hover {
  background: var(--asw-primary);
  color: #fff;
  border-color: var(--asw-primary);
  text-decoration: none;
}

body .asw-ty-acc-qr {
  display: block;
  width: 120px;
  max-width: 100%;
  margin-top: 0.55rem;
  padding: 0.35rem;
  border: 1px solid var(--asw-border);
  border-radius: 8px;
  background: #fff;
}

body .asw-ty-pay-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.6rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--asw-r-full);
  background: var(--asw-primary);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}

/* ══════════════════════════════════════════════
   WHATSAPP CTA
══════════════════════════════════════════════ */
body .asw-gw-acc {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 0.75rem;
  row-gap: 0.65rem;
}

body .asw-gw-acc:not(.asw-gw-acc--instapay) {
  grid-template-columns: auto minmax(0, 1fr) 52px;
}

body .asw-gw-acc:not(.asw-gw-acc--instapay) .asw-gw-acc-brand {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
}

body .asw-gw-acc:not(.asw-gw-acc--instapay) .asw-gw-acc-num {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  margin-inline-end: 0;
  direction: ltr;
  text-align: right;
}

body .asw-gw-acc:not(.asw-gw-acc--instapay) .asw-gw-acc-copy {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
}

body .asw-gw-acc--instapay {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  flex-wrap: nowrap;
}

body .asw-gw-acc--instapay .asw-gw-acc-main {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  width: 100%;
  justify-content: flex-start;
  direction: rtl;
}

body .asw-gw-acc--instapay .asw-gw-acc-copy {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
}

body .asw-gw-acc--instapay .asw-gw-acc-actions {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
}

body .asw-gw-acc--instapay .asw-gw-acc-actions .asw-gw-acc-copy {
  justify-content: center;
  width: 100%;
}

body .asw-gw-acc--instapay .asw-gw-qr-link {
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
  min-width: 0;
  flex: none;
  justify-self: stretch;
  display: block;
  padding: 0.55rem;
}

body .asw-gw-acc--instapay .asw-gw-qr {
  width: 100%;
  max-width: 100%;
}

body .asw-gw-acc-copy,
body .asw-gw-acc-pay,
body .asw-gw-qr-link[href] {
  min-height: 38px;
  pointer-events: auto;
  cursor: pointer;
}

@media (max-width: 480px) {
  body .asw-gw-acc {
    padding: 0.65rem;
    column-gap: 0.55rem;
  }

  body .asw-gw-acc:not(.asw-gw-acc--instapay) {
    grid-template-columns: auto minmax(0, 1fr) 46px;
  }

  body .asw-gw-acc-brand {
    width: 46px;
  }

  body .asw-gw-acc-main {
    gap: 0.5rem;
  }

  body .asw-gw-acc-num {
    font-size: 0.82rem;
    letter-spacing: 0.04em;
  }

  body .asw-gw-acc-copy {
    padding: 0.45rem 0.75rem;
    min-width: 72px;
  }

  body .asw-gw-acc--instapay .asw-gw-acc-actions {
    min-width: 78px;
  }

  body .asw-gw-acc--instapay .asw-gw-qr-link {
    padding: 0.45rem;
  }
}

body .asw-gw-wa {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.1rem;
  background: #25d366;
  color: #fff !important;
  border-radius: var(--asw-r2);
  text-decoration: none !important;
  font-weight: 800;
  font-size: 0.84rem;
  transition:
    background 0.18s,
    transform 0.15s,
    box-shadow 0.18s;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.28);
}

body .asw-gw-wa:hover {
  background: #1daa57;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.38);
}

body .asw-gw-wa-text {
  flex: 1;
}

body .asw-gw-wa-num {
  font-size: 0.75rem;
  opacity: 0.85;
  font-weight: 400;
  direction: ltr;
}

body .asw-gw-wa-arrow {
  transform: rotate(180deg);
  opacity: 0.7;
  flex-shrink: 0;
}

body .asw-gw-wa-hint {
  font-size: 0.71rem;
  color: var(--asw-text-3);
  text-align: center;
  margin: 0.45rem 0 0;
}

/* ══════════════════════════════════════════════
   CHECKOUT BREAKDOWN PANEL
══════════════════════════════════════════════ */
body .asw-checkout-breakdown {
  background: var(--asw-bg);
  border: 1.5px solid var(--asw-border);
  border-radius: var(--asw-r3);
  overflow: hidden;
  margin-bottom: 1rem;
  box-shadow: var(--asw-sh-xs);
  animation: aswFadeSlide 0.25s ease both;
  direction: rtl;
}

body .asw-cb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  background: var(--asw-bg-2);
  border-bottom: 1px solid var(--asw-border);
}

body .asw-cb-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--asw-text);
}

body .asw-cb-sub {
  font-size: 0.7rem;
  color: var(--asw-text-3);
}

body .asw-cb-items {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

body .asw-cb-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--asw-r2);
  transition: box-shadow 0.15s;
}

body .asw-cb-group {
  background: rgba(200, 168, 74, 0.07);
  border: 1px solid rgba(200, 168, 74, 0.2);
}

body .asw-cb-neighbor {
  background: rgba(39, 174, 96, 0.06);
  border: 1px solid rgba(39, 174, 96, 0.18);
}

body .asw-cb-normal {
  background: var(--asw-bg-2);
  border: 1px solid var(--asw-border);
}

body .asw-cb-left {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

body .asw-cb-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 0.05rem;
}

body .asw-cb-name {
  font-size: 0.81rem;
  font-weight: 700;
  color: var(--asw-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
  margin-bottom: 0.12rem;
}

body .asw-cb-type-badge {
  display: inline-block;
  font-size: 0.63rem;
  font-weight: 800;
  padding: 0.06rem 0.38rem;
  border-radius: var(--asw-r-full);
  letter-spacing: 0.03em;
}

body .asw-badge-group {
  background: var(--asw-gold-lt);
  color: var(--asw-gold-dk);
}

body .asw-badge-neighbor {
  background: var(--asw-green-lt);
  color: var(--asw-green);
}

body .asw-badge-normal {
  background: var(--asw-bg-3);
  color: var(--asw-text-2);
  border: 1px solid var(--asw-border);
}

body .asw-cb-right {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
}

body .asw-cb-amount-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.77rem;
}

body .asw-cb-amt-lbl {
  color: var(--asw-text-2);
}

body .asw-cb-amt-val {
  font-weight: 700;
  color: var(--asw-text);
}

body .asw-cb-amt-val.asw-gold-txt {
  color: var(--asw-gold-dk) !important;
}

body .asw-cb-rem .asw-cb-amt-val {
  color: var(--asw-text-3);
  font-weight: 400;
}

/* Totals footer */
body .asw-cb-totals {
  border-top: 1px solid var(--asw-border);
  background: var(--asw-bg-2);
  display: flex;
  flex-direction: column;
  gap: 0;
}

body .asw-cb-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.42rem 1rem;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--asw-border);
}

body .asw-cb-total-row:last-child {
  border-bottom: none;
}

body .asw-cb-total-row span:first-child {
  color: var(--asw-text-2);
}

body .asw-cb-total-now {
  padding: 0.6rem 1rem;
  background: var(--asw-bg);
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--asw-text);
}

body .asw-cb-total-now strong {
  color: var(--asw-primary);
  font-size: 0.98rem;
}

body .asw-cb-total-later {
  color: var(--asw-text-2) !important;
  font-size: 0.78rem;
}

body .asw-cb-total-later span:last-child {
  font-weight: 600;
}

body .asw-cb-total-ship {
  color: var(--asw-text-3) !important;
  font-size: 0.73rem;
  font-style: italic;
}

body .asw-cb-total-all {
  font-size: 0.78rem;
  color: var(--asw-text-2) !important;
  border-top: 1px dashed var(--asw-border) !important;
}

/* WA footer */
body .asw-cb-wa-reminder {
  padding: 0.5rem 1rem;
  background: rgba(37, 211, 102, 0.06);
  border-top: 1px solid rgba(37, 211, 102, 0.15);
  font-size: 0.72rem;
  color: var(--asw-text-2);
}

body .asw-cb-wa-reminder a {
  color: var(--asw-green);
  font-weight: 700;
}

/* ══════════════════════════════════════════════
   CART SUMMARY (before cart totals)
══════════════════════════════════════════════ */
body .asw-cart-summary {
  background: var(--asw-bg);
  border: 1.5px solid var(--asw-border);
  border-radius: var(--asw-r3);
  overflow: hidden;
  margin-bottom: 1rem;
  direction: rtl;
}

body .asw-cart-summary-hd {
  padding: 0.6rem 0.9rem;
  background: var(--asw-bg-2);
  border-bottom: 1px solid var(--asw-border);
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--asw-text);
}

body .asw-cart-summary-body {
  padding: 0.65rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}

body .asw-cs-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  padding: 0.15rem 0;
}

body .asw-cs-row.asw-cs-now {
  font-weight: 800;
  font-size: 0.88rem;
  border-top: 1px solid var(--asw-border);
  padding-top: 0.35rem;
  margin-top: 0.1rem;
}

body .asw-cs-row.asw-cs-now strong {
  color: var(--asw-primary);
}

body .asw-cs-row.asw-cs-later {
  color: var(--asw-text-2);
  font-size: 0.76rem;
}

body .asw-cs-row.asw-cs-total {
  color: var(--asw-text-2);
  font-size: 0.74rem;
  border-top: 1px dashed var(--asw-border);
  padding-top: 0.3rem;
  margin-top: 0.1rem;
}

body .asw-cs-hint {
  font-size: 0.71rem;
  color: var(--asw-text-2);
  padding: 0.4rem 0.6rem;
  background: var(--asw-gold-lt);
  border-radius: var(--asw-r2);
  border: 1px solid rgba(200, 168, 74, 0.2);
  line-height: 1.5;
}

