/*
 * Peptides Direct — Payment Messaging Styles
 *
 * Styles the markup emitted by components/core/commerce/payments/renderer.php.
 * Keep selectors in sync with that file — every class here maps to markup there.
 *
 * Tokens prefixed --pd-pay- to avoid collision with theme tokens.
 * Respects prefers-reduced-motion: no transitions fire.
 */

:root {
  --pd-pay-navy:   #0D1B2A;
  --pd-pay-teal:   #1B9E8A;
  --pd-pay-teal-d: #147A6A;
  --pd-pay-teal-s: #EBF8F6;
  --pd-pay-gold:   #C9922A;
  --pd-pay-gold-s: #FEF3DC;
  --pd-pay-slate:  #4A5568;
  --pd-pay-mist:   #718096;
  --pd-pay-line:   #E2E8F0;
  --pd-pay-line2:  #CBD5E0;

  /* APD brand (logo) — used for the shop trust banner. */
  --pd-brand-navy: #072549;
  --pd-brand-blue: #1970B5;
}

/* ── TRUST BANNER (sitewide, before main content) ─────────────────────────── */

/* Light-blue fill that fades to transparent at the left/right edges, with a
   hairline outline that fades the same way (border-image gradient). */
.pd-trust-banner {
  background: linear-gradient(to right,
    transparent 0%,
    rgba(25, 112, 181, .10) 16%,
    rgba(25, 112, 181, .13) 50%,
    rgba(25, 112, 181, .10) 84%,
    transparent 100%);
  border-style: solid;
  border-width: 1px 0;
  border-image: linear-gradient(to right,
    transparent 0%,
    rgba(25, 112, 181, .30) 22%,
    rgba(25, 112, 181, .30) 78%,
    transparent 100%) 1;
  padding: 10px 20px;
  width: 100%;
}

.pd-trust-banner__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
}

.pd-trust-banner__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--pd-brand-navy);
  letter-spacing: .01em;
  white-space: nowrap;
}

.pd-trust-banner__icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  color: var(--color-accent);
}

.pd-trust-banner__cta {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding-left: 6px;
}

.pd-trust-banner__cta-label {
  font-size: 12px;
  color: var(--pd-brand-navy);
  opacity: .8;
}

.pd-trust-banner__cta-value {
  font-size: 15px;
  font-weight: 800;
  color: var(--color-accent);
}

@media (max-width: 600px) {
  .pd-trust-banner__inner { gap: 12px; }
  .pd-trust-banner__item  { font-size: 11.5px; }
}

/* ── PRODUCT PAGE STRIP (below add-to-cart) ───────────────────────────────── */

.pd-product-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--pd-pay-teal-s);
  border: 1px solid rgba(27, 158, 138, .25);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 16px 0 4px;
}

.pd-product-strip__badge {
  flex: none;
  background: var(--pd-pay-gold);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.pd-product-strip__content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.pd-product-strip__label {
  font-size: 13px;
  font-weight: 700;
  color: var(--pd-pay-navy);
}

.pd-product-strip__sub {
  font-size: 11.5px;
  color: var(--pd-pay-slate);
  margin-top: 1px;
}

.pd-product-strip__icons {
  display: inline-flex;
  gap: 8px;
  flex: none;
}

.pd-product-strip__icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: var(--pd-pay-teal);
}

/* ── CART PAYMENT BLOCK (inside cart totals table) ────────────────────────── */

/* Standalone box, rendered below the Proceed to Checkout button. */
.pd-cart-block {
  border: 1.5px solid rgba(27, 158, 138, .3);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  margin-top: 14px;
  text-align: left;
}

.pd-cart-block__header {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--pd-pay-navy);
  padding: 11px 14px;
}

.pd-cart-block__icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: #fff;
}

.pd-cart-block__title {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.pd-cart-block__badge {
  flex: none;
  background: var(--pd-pay-teal);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 3px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* Single checked list: discount line first, then perks. Tight, no bottom gap.
   list-style + margin forced off — the theme's content `ul/li` rules add a disc
   marker and a 1.5em bottom margin that otherwise show through. */
.pd-cart-block__perks {
  list-style: none !important;
  margin: 0 !important;
  padding: 11px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pd-cart-block__perks li {
  position: relative;
  list-style: none !important;
  margin: 0 !important;
  padding-left: 22px;
  font-size: 12.5px;
  color: var(--pd-pay-slate);
  line-height: 1.4;
  text-align: left;
}

.pd-cart-block__perks li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--pd-pay-teal);
  font-weight: 700;
}

.pd-cart-block__perk--disc {
  font-weight: 600;
  color: var(--pd-pay-navy) !important;
  margin-bottom: 1px;
}

.pd-cart-block__perk--disc strong { color: var(--pd-pay-teal-d); font-weight: 800; }

/* Checkout: payment method description paragraph above the trust block. */
.pd-pay-method-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--pd-pay-slate);
  margin: 0 0 4px;
}

/* FAQ answer rich content (lists in "What payment methods…"). */
.pd-pay-faq__answer ul {
  margin: 8px 0;
  padding-left: 20px;
  list-style: disc;
}

.pd-pay-faq__answer li { margin: 4px 0; }

.pd-pay-faq__answer p + p { margin-top: 8px; }

/* ── CHECKOUT TRUST BLOCK (inside the ACH gateway payment box) ─────────────── */

.pd-checkout-trust {
  margin-top: 10px;
}

.pd-checkout-trust__perks {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  flex-wrap: wrap;
  background: var(--pd-pay-teal-s);
  border-radius: 6px;
  padding: 9px 14px;
  margin-bottom: 12px;
}

.pd-checkout-trust__perk {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--pd-pay-slate);
  white-space: nowrap;
}

/* Hard size cap so the inline SVGs can never balloon to column width. */
.pd-checkout-trust__icon {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  color: var(--pd-pay-teal);
}

.pd-checkout-trust__redirect-note {
  font-size: 12px;
  line-height: 1.5;
  color: var(--pd-pay-slate);
  margin: 0;
}

/* Test-mode notice rendered by the gateway in test mode. */
.pd-test-mode-notice {
  background: var(--pd-pay-gold-s);
  border: 1px solid var(--pd-pay-gold);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  color: #5a4000;
  margin: 0;
  line-height: 1.5;
}

/* ── ORDER STATUS BLOCK (thank-you page) ──────────────────────────────────── */

.pd-order-status-block {
  background: #fff;
  border: 1px solid var(--pd-pay-line);
  border-radius: 10px;
  padding: 22px 24px;
  margin: 24px 0;
}

.pd-order-status-block__header {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 6px;
}

.pd-order-status-block__header svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: var(--pd-brand-blue);
}

.pd-order-status-block__heading {
  font-size: 16px;
  font-weight: 700;
  color: var(--pd-pay-navy);
  margin: 0;
}

.pd-order-status-block__note {
  font-size: 13px;
  color: var(--pd-pay-slate);
  line-height: 1.6;
  margin: 14px 0 0;
}

/* Shipment tracking row inside the Order Status block. */
.pd-track {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(37, 99, 235, .08);
  border: 1px solid rgba(37, 99, 235, .25);
  border-radius: 8px;
}

.pd-track__icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  color: var(--color-accent);
}

.pd-track__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.pd-track__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.pd-track__detail {
  font-size: 13px;
  color: var(--pd-brand-navy);
  word-break: break-all;
}

.pd-track__btn {
  flex: none;
  background: var(--color-accent);
  color: #fff !important;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 6px;
  text-decoration: none;
  white-space: nowrap;
}

.pd-track__btn:hover { background: var(--color-accent-dark); }

/* Pending state — shown before a tracking number is added, so the capability
   is always visible. */
.pd-track--pending { background: rgba(37, 99, 235, .05); }

.pd-track__detail--pending {
  font-size: 12px;
  font-style: italic;
  color: var(--pd-pay-mist);
}

@media (max-width: 480px) {
  .pd-track { flex-wrap: wrap; }
  .pd-track__btn { width: 100%; text-align: center; }
}

/* ── CLEARANCE TIMELINE (frontend) ────────────────────────────────────────── */

.pd-timeline {
  display: flex;
  align-items: flex-start;
  margin: 18px 0 4px;
}

.pd-timeline__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  width: 76px;
  text-align: center;
}

.pd-timeline__dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--pd-pay-line2);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--pd-pay-mist);
}

.pd-timeline__dot svg {
  width: 14px;
  height: 14px;
  color: #fff;
}

/* Reversed scheme: button-blue circles + labels, dark-navy lines (pops more).
   Done = filled blue circle; active = blue ring on white. */
.pd-timeline__step.is-done .pd-timeline__dot {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}

.pd-timeline__step.is-active .pd-timeline__dot {
  background: #fff;
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.pd-timeline__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .03em;
  color: var(--pd-pay-mist);
  line-height: 1.3;
}

.pd-timeline__sub {
  font-size: 9.5px;
  color: var(--pd-pay-mist);
  line-height: 1.3;
}

.pd-timeline__step.is-done  .pd-timeline__label { color: var(--color-accent); }
.pd-timeline__step.is-active .pd-timeline__label { color: var(--color-accent); }

.pd-timeline__connector {
  flex: 1 1 auto;
  height: 2px;
  background: var(--pd-pay-line);
  margin-top: 13px; /* aligns with the centre of the 28px dot */
  min-width: 12px;
}

/* Completed segments get the dark navy (light circles, dark lines). */
.pd-timeline__step.is-done + .pd-timeline__connector {
  background: var(--pd-brand-navy);
}

/* ── FAQ ( [pd_payment_faq] shortcode ) ───────────────────────────────────── */

.pd-pay-faq {
  border-top: 1px solid var(--pd-pay-line);
}

.pd-pay-faq__item {
  border-bottom: 1px solid var(--pd-pay-line);
}

.pd-pay-faq__question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 2px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--pd-pay-navy);
  line-height: 1.4;
}

.pd-pay-faq__chevron {
  flex: none;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--pd-pay-teal);
  border-bottom: 2px solid var(--pd-pay-teal);
  transform: rotate(45deg);
  margin-top: -4px;
}

.pd-pay-faq__question[aria-expanded="true"] .pd-pay-faq__chevron {
  transform: rotate(-135deg);
  margin-top: 4px;
}

.pd-pay-faq__answer {
  font-size: 13.5px;
  color: var(--pd-pay-slate);
  line-height: 1.7;
  padding: 0 2px 16px;
}

.pd-pay-faq__answer p { margin: 0; }

/* Collapsed by default when JS is active; open when expanded or when no JS. */
.pd-pay-faq--js .pd-pay-faq__answer { display: none; }
.pd-pay-faq--js .pd-pay-faq__question[aria-expanded="true"] + .pd-pay-faq__answer { display: block; }

@media (prefers-reduced-motion: no-preference) {
  .pd-pay-faq__chevron { transition: transform .18s ease; }
}

/* ── ADMIN ORDER STATUS COLOURS ───────────────────────────────────────────── */

mark.order-status.status-pd-awaiting-clearance { background: var(--pd-pay-gold-s); color: #92640a; }
mark.order-status.status-pd-cleared            { background: var(--pd-pay-teal-s); color: var(--pd-pay-teal-d); }

/* ── RESPONSIVE ───────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
  .pd-product-strip   { flex-wrap: wrap; }
  .pd-timeline__step  { width: 64px; }
  .pd-timeline__label { font-size: 9px; }
  .pd-timeline__sub   { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .pd-pay-faq__chevron { transition: none !important; }
}
