/* SYNCD card panel. Scoped to .syncd-card so theme/checkout styling outside the payment box is untouched. */
.syncd-card{--syncd-accent:#1f56d6;--syncd-ring:#d5def2;--syncd-ink:#1d1d1f;--syncd-muted:#6b6f76;--syncd-faint:#9a9da4;--syncd-line:#d6d8dd;--syncd-field:#f7f7f8;--syncd-visa:#1434cb;
  --syncd-ring:color-mix(in srgb,var(--syncd-accent) 20%,#fff);
  display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:18px 16px;background:#f8f8f8;border-radius:12px;padding:20px;color:var(--syncd-ink);
  container-type:inline-size;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Inter,Roboto,Helvetica,Arial,sans-serif;font-size:14px;line-height:1.4;box-sizing:border-box}
.syncd-card *,.syncd-card *::before,.syncd-card *::after{box-sizing:border-box}
.syncd-card p{margin:0;padding:0}

/* Selected method tile */
.syncd-card .syncd-method{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:60px;padding:12px 16px;background:#fff;
  border:2px solid var(--syncd-accent);border-radius:8px;box-shadow:0 0 0 3px var(--syncd-ring)}
.syncd-card .syncd-method-label{display:flex;flex-direction:column;align-items:flex-start;gap:2px;color:var(--syncd-accent);font-weight:600;font-size:15px}
.syncd-card .syncd-ico{display:block;color:currentColor}

/* Brand marks: all accepted brands when unknown, only the detected brand once known */
.syncd-card .syncd-marks,.syncd-card .syncd-input-brand{display:flex;align-items:center;gap:8px;flex:none}
.syncd-card .syncd-mark{display:block;height:auto;flex:none}
.syncd-card .syncd-mark-visa{width:46px}
.syncd-card .syncd-mark-mastercard{width:34px}
.syncd-card .syncd-mark-amex{width:24px;border-radius:3px}
.syncd-card .syncd-method .syncd-mark{opacity:.9}
.syncd-card[data-brand="visa"] .syncd-mark:not(.syncd-mark-visa),
.syncd-card[data-brand="mastercard"] .syncd-mark:not(.syncd-mark-mastercard),
.syncd-card[data-brand="amex"] .syncd-mark:not(.syncd-mark-amex){display:none}
.syncd-card[data-brand="visa"] .syncd-method .syncd-mark-visa{width:56px;opacity:1}
.syncd-card[data-brand="mastercard"] .syncd-method .syncd-mark-mastercard{width:42px;opacity:1}
.syncd-card[data-brand="amex"] .syncd-method .syncd-mark-amex{width:32px;opacity:1}
.syncd-card .syncd-input-brand{display:none}
.syncd-card[data-brand="visa"] .syncd-input-brand,.syncd-card[data-brand="mastercard"] .syncd-input-brand,.syncd-card[data-brand="amex"] .syncd-input-brand{display:flex}
.syncd-card .syncd-input-brand .syncd-mark-visa{width:40px}
.syncd-card .syncd-input-brand .syncd-mark-mastercard{width:30px}
.syncd-card .syncd-input-brand .syncd-mark-amex{width:24px}
.syncd-card .syncd-desc{grid-column:1/-1;color:var(--syncd-muted);font-size:14px;line-height:1.5}
.syncd-card .syncd-brand-note{grid-column:1/-1;margin-top:-10px !important;color:#c62828;font-size:13px}
.syncd-card .syncd-brand-note:empty{display:none}

/* Fields */
.syncd-card .syncd-field{min-width:0}
.syncd-card .syncd-name,.syncd-card .syncd-pan,.syncd-card .syncd-offer,.syncd-card .syncd-secure,.syncd-card .syncd-test{grid-column:1/-1}
.syncd-card label{display:flex;align-items:center;gap:4px;margin:0 0 8px;font-size:14px;font-weight:600;color:var(--syncd-ink)}
.syncd-card .syncd-req{color:var(--syncd-muted);font-weight:400;margin-left:2px}
.syncd-card .syncd-input{position:relative;display:block}
.syncd-card input[data-syncd-card]{display:block;width:100%;max-width:100%;height:50px;margin:0;padding:0 14px;background:var(--syncd-field);color:var(--syncd-ink);
  border:1px solid var(--syncd-line);border-radius:8px;font:inherit;font-size:16px;letter-spacing:.02em;box-shadow:none;outline:0;-webkit-appearance:none;appearance:none;
  transition:border-color .15s,box-shadow .15s,background-color .15s}
.syncd-card .has-adorn input[data-syncd-card]{padding-right:64px}
.syncd-card input[data-syncd-card]::placeholder{color:var(--syncd-faint);opacity:1;letter-spacing:.02em}
.syncd-card input[data-syncd-card]:focus{background:#fff;border-color:var(--syncd-accent);box-shadow:0 0 0 3px var(--syncd-ring)}
.syncd-card input[data-syncd-card][aria-invalid="true"]{border-color:#c62828;box-shadow:0 0 0 3px #f6d5d5}
.syncd-card .syncd-input-brand,.syncd-card .syncd-input-icon{position:absolute;right:14px;top:50%;transform:translateY(-50%);pointer-events:none}
.syncd-card .syncd-input-icon{color:var(--syncd-ink)}
.syncd-card .syncd-pan input{font-variant-numeric:tabular-nums}

/* CVC help tip */
.syncd-card .syncd-help{position:relative;display:inline-grid;place-items:center;width:18px;height:18px;margin-left:6px;border:1.5px solid var(--syncd-faint);border-radius:50%;
  color:var(--syncd-faint);font-size:11px;font-weight:700;line-height:1;cursor:help}
.syncd-card .syncd-help:focus{outline:2px solid var(--syncd-accent);outline-offset:2px}
.syncd-card .syncd-help::after{content:attr(data-tip);position:absolute;bottom:calc(100% + 8px);right:-8px;width:max-content;max-width:200px;padding:7px 10px;border-radius:6px;
  background:var(--syncd-ink);color:#fff;font-size:12px;font-weight:500;line-height:1.35;opacity:0;visibility:hidden;transition:opacity .15s;z-index:5}
.syncd-card .syncd-help:hover::after,.syncd-card .syncd-help:focus::after{opacity:1;visibility:visible}

/* Offer badge */
.syncd-card .syncd-offer:empty{display:none}
.syncd-card .syncd-badge{display:inline-flex;align-items:center;gap:10px;max-width:100%;padding:9px 16px 9px 12px;border-radius:999px;font-size:14px;font-weight:500;line-height:1.3}
.syncd-card .syncd-badge svg{flex:none}
.syncd-card .syncd-badge-visa{background:#e8ebfa;color:var(--syncd-visa)}
.syncd-card .syncd-badge-mastercard{background:#fdefe7;color:#a63a00}
.syncd-card .syncd-badge[hidden]{display:none}
/* Pending: the order total is being recalculated for the detected card */
.syncd-card .syncd-badge-pending{background:#eef0f3;color:var(--syncd-muted)}
.syncd-card[data-brand="visa"] .syncd-badge-pending{background:#e8ebfa;color:var(--syncd-visa)}
.syncd-card[data-brand="mastercard"] .syncd-badge-pending{background:#fdefe7;color:#a63a00}
.syncd-card .syncd-spinner{flex:none;width:16px;height:16px;border-radius:50%;border:2px solid currentColor;border-right-color:transparent;opacity:.85;animation:syncd-spin .7s linear infinite}
@keyframes syncd-spin{to{transform:rotate(360deg)}}
.syncd-card.is-updating .syncd-badge:not(.syncd-badge-pending){display:none}
/* Classic checkout dims the payment box (blockUI, z-index 1000) while recalculating; keep the progress pill crisp above it */
.syncd-card.is-updating .syncd-offer{position:relative;z-index:1001}

/* Footer */
.syncd-card .syncd-secure{display:flex;align-items:center;gap:8px;color:var(--syncd-muted);font-size:13px}
.syncd-card .syncd-secure svg{color:var(--syncd-faint);flex:none}
.syncd-card .syncd-secure img{display:block;width:56px;height:auto}
.syncd-card .syncd-test{margin-top:-8px;font-size:12px;color:#795311}
.syncd-card .syncd-test::before{content:"";display:inline-block;width:6px;height:6px;margin-right:6px;border-radius:50%;background:#e0a100;vertical-align:1px}

@media (max-width:420px){
  .syncd-card{padding:16px;gap:16px 12px}
  .syncd-card .syncd-method{padding:10px 12px}
  .syncd-card .syncd-badge{font-size:13px}
  .syncd-card input[data-syncd-card]{padding:0 12px;letter-spacing:0}
  .syncd-card .has-adorn input[data-syncd-card]{padding-right:52px}
  .syncd-card .syncd-input-brand,.syncd-card .syncd-input-icon{right:12px}
  .syncd-card .syncd-input-brand .syncd-mark-visa{width:32px}
  .syncd-card .syncd-marks{gap:6px}
  .syncd-card .syncd-method .syncd-mark-visa{width:40px}
  .syncd-card .syncd-method .syncd-mark-mastercard{width:30px}
}
@media (prefers-reduced-motion:reduce){.syncd-card input[data-syncd-card],.syncd-card .syncd-help::after{transition:none}.syncd-card .syncd-spinner{animation-duration:2s}}

/* Checkout block */
.syncd-block-label{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%}
.syncd-block-label-marks{display:flex;align-items:center;gap:8px}
.syncd-block-label-marks img{display:block;height:auto}
.syncd-block-label-marks .syncd-mark-visa{width:38px}
.syncd-block-label-marks .syncd-mark-mastercard{width:28px}
.syncd-block-label-marks .syncd-mark-amex{width:20px;border-radius:2px}
.syncd-card--block{margin:4px 0}
.syncd-card .syncd-declined{grid-column:1/-1;padding:10px 12px;border-radius:8px;background:#fdecec;color:#8a1c1c;font-size:14px}

/* Classic checkout: our panel is the payment box, so drop WooCommerce's own box padding/background around it */
.woocommerce-checkout #payment div.payment_box.payment_method_syncd_fac{padding:0;margin:8px 0 0;background:transparent;box-shadow:none}
.woocommerce-checkout #payment div.payment_box.payment_method_syncd_fac::before{display:none}
.woocommerce-checkout #payment div.payment_box.payment_method_syncd_fac p{margin:0}

/* Narrow columns (sidebars, small phones): compact by the panel's own width, not the viewport */
@container (max-width: 340px){
  .syncd-card .syncd-field label{font-size:13px;white-space:nowrap}
  .syncd-card input[data-syncd-card]{padding:0 10px;letter-spacing:0}
  .syncd-card .has-adorn input[data-syncd-card]{padding-right:46px}
  .syncd-card .syncd-input-brand,.syncd-card .syncd-input-icon{right:10px}
  .syncd-card .syncd-input-brand .syncd-mark-visa{width:28px}
  .syncd-card .syncd-input-brand .syncd-mark-mastercard{width:24px}
  .syncd-card .syncd-input-brand .syncd-mark-amex{width:20px}
  .syncd-card .syncd-badge{font-size:13px;padding:8px 12px 8px 10px}
}
