/*
 * Puget Sound Firearms — Layaway Payment Flow
 * File: psflh-payment-flow.css
 *
 * Four-step layaway payment flow:
 * 1 Details / 2 Payment / 3 Review / 4 Confirmation
 *
 * Plugin-owned frontend styles. Uses scoped selectors and cascade
 * specificity rather than declaration-level priority flags.
 */

/* =========================================================
   00 — PAYMENT FLOW TOKENS
   ========================================================= */

body.psflh-child-payment-flow {
  --psflh-flow-green: var(--psf-green, #254d18);
  --psflh-flow-green-dark: var(--psf-green-dark, #193811);
  --psflh-flow-green-bright: var(--psf-green-bright, #5a8f36);
  --psflh-flow-green-hover: var(--psf-green-hover, #6aa63f);
  --psflh-flow-green-soft: #edf3e9;
  --psflh-flow-bg: #f5f5f2;
  --psflh-flow-card: #fff;
  --psflh-flow-text: #171a18;
  --psflh-flow-muted: #666d67;
  --psflh-flow-border: rgb(17 20 18 / .12);
  --psflh-flow-radius: 14px;
  --psflh-flow-radius-small: 8px;
  --psflh-flow-font: var(--psf-body-font, "Work Sans", Arial, sans-serif);
  --psflh-flow-grad-primary:
    var(
      --psf-grad-primary,
      linear-gradient(to bottom, #5a8f36 0%, #254d18 100%)
    );
  --psflh-flow-grad-primary-hover:
    var(
      --psf-grad-primary-hover,
      linear-gradient(to bottom, #6aa63f 0%, #193811 100%)
    );
  --psflh-flow-shadow:
    0 16px 38px rgb(17 20 18 / .065),
    0 2px 8px rgb(17 20 18 / .025);

  overflow-x: hidden;
  background: var(--psflh-flow-bg);
}

/* =========================================================
   01 — PAGE CHROME
   ========================================================= */

body.psflh-child-payment-flow #wrapper,
body.psflh-child-payment-flow #main,
body.psflh-child-payment-flow .page-wrapper,
body.psflh-child-payment-flow .page-inner,
body.psflh-child-payment-flow .woocommerce,
body.psflh-child-payment-flow .woocommerce-MyAccount-content {
  background: var(--psflh-flow-bg);
}

body.psflh-child-payment-flow .page-title,
body.psflh-child-payment-flow .woocommerce-breadcrumb {
  display: none;
}

/* =========================================================
   02 — SHELL
   ========================================================= */

body.psflh-child-payment-flow .psflh-flow,
body.psflh-child-payment-flow .psflh-flow *,
body.psflh-child-payment-flow .psflh-flow *::before,
body.psflh-child-payment-flow .psflh-flow *::after {
  box-sizing: border-box;
}

body.psflh-child-payment-flow .psflh-flow {
  width: min(100% - 32px, 1160px);
  max-width: 100%;
  min-width: 0;
  margin: 0 auto;
  padding: 42px 0 58px;

  color: var(--psflh-flow-text);
  font-family: var(--psflh-flow-font);
  font-size: 15px;
  line-height: 1.55;
}

body.psflh-child-payment-flow .psflh-flow img,
body.psflh-child-payment-flow .psflh-flow iframe,
body.psflh-child-payment-flow .psflh-flow table {
  max-width: 100%;
}

@media (max-width: 700px) {
  body.psflh-child-payment-flow .psflh-flow {
    width: min(100% - 20px, 1160px);
    padding: 26px 0 42px;
  }
}

/* Keep WooCommerce prices inline and in the inherited color. */
body.psflh-child-payment-flow .psflh-flow .woocommerce-Price-currencySymbol,
body.psflh-child-payment-flow .psflh-flow .woocommerce-Price-amount,
body.psflh-child-payment-flow .psflh-flow .woocommerce-Price-amount bdi {
  display: inline;
  color: inherit;
  font: inherit;
  white-space: nowrap;
}

/* =========================================================
   03 — HERO
   ========================================================= */

body.psflh-child-payment-flow .psflh-flow-hero {
  margin-bottom: 28px;
}

body.psflh-child-payment-flow .psflh-flow-hero h1 {
  margin: 0 0 8px;
  color: var(--psflh-flow-text);
  font-family: var(--psflh-flow-font);
  font-size: clamp(32px, 3.5vw, 42px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.035em;
  text-rendering: optimizeLegibility;
  text-transform: none;
}

body.psflh-child-payment-flow .psflh-flow-hero p {
  max-width: 620px;
  margin: 0;
  color: var(--psflh-flow-muted);
  font-size: 15px;
  line-height: 1.55;
}

@media (max-width: 700px) {
  body.psflh-child-payment-flow .psflh-flow-hero h1 {
    font-size: 30px;
  }
}

/* =========================================================
   04 — PROGRESS BAR
   ========================================================= */

body.psflh-child-payment-flow .psflh-flow-progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  gap: 0;
  margin: 0 0 32px;
}

body.psflh-child-payment-flow .psflh-flow-progress__step {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: #747a75;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -.01em;
}

body.psflh-child-payment-flow .psflh-flow-progress__step.is-complete,
body.psflh-child-payment-flow .psflh-flow-progress__step.is-current {
  color: var(--psflh-flow-green);
}

body.psflh-child-payment-flow
.psflh-flow-progress__step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: calc(100% - 18px);
  right: 18px;
  top: 50%;
  z-index: 0;
  height: 2px;
  background: #dfe2dd;
  transform: translateY(-50%);
}

body.psflh-child-payment-flow
.psflh-flow-progress__step.is-complete:not(:last-child)::after,
body.psflh-child-payment-flow
.psflh-flow-progress__step.is-current:not(:last-child)::after {
  background: var(--psflh-flow-green);
}

body.psflh-child-payment-flow .psflh-flow-progress__number {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border: 1px solid #d8ddd6;
  border-radius: 50%;
  color: var(--psflh-flow-text);
  background: #f1f2ef;
  font-size: 14px;
  font-weight: 700;
}

body.psflh-child-payment-flow
.psflh-flow-progress__step.is-complete .psflh-flow-progress__number,
body.psflh-child-payment-flow
.psflh-flow-progress__step.is-current .psflh-flow-progress__number {
  border-color: var(--psflh-flow-green);
  color: #fff;
  background: var(--psflh-flow-grad-primary);
  box-shadow: 0 5px 13px rgb(37 77 24 / .2);
}

body.psflh-child-payment-flow .psflh-flow-progress__label {
  position: relative;
  z-index: 1;
  padding-right: 14px;
  color: inherit;
  background: var(--psflh-flow-bg);
  white-space: nowrap;
}

@media (max-width: 700px) {
  body.psflh-child-payment-flow .psflh-flow-progress {
    gap: 6px;
  }

  body.psflh-child-payment-flow .psflh-flow-progress__step {
    display: grid;
    justify-items: center;
    gap: 6px;
    font-size: 10.5px;
    text-align: center;
  }

  body.psflh-child-payment-flow
  .psflh-flow-progress__step:not(:last-child)::after {
    left: calc(50% + 22px);
    right: calc(-50% + 22px);
    top: 18px;
  }

  body.psflh-child-payment-flow .psflh-flow-progress__label {
    padding: 0;
    background: transparent;
    white-space: normal;
  }
}

@media (max-width: 420px) {
  body.psflh-child-payment-flow .psflh-flow-progress__number {
    flex-basis: 32px;
    width: 32px;
    height: 32px;
  }

  body.psflh-child-payment-flow
  .psflh-flow-progress__step:not(:last-child)::after {
    left: calc(50% + 20px);
    right: calc(-50% + 20px);
    top: 16px;
  }
}

/* =========================================================
   05 — CARDS + TYPOGRAPHY
   ========================================================= */

body.psflh-child-payment-flow .psflh-flow-card {
  overflow: hidden;
  max-width: 100%;
  min-width: 0;
  padding: 32px;
  border: 1px solid var(--psflh-flow-border);
  border-radius: var(--psflh-flow-radius);
  background: var(--psflh-flow-card);
  box-shadow: var(--psflh-flow-shadow);
}

body.psflh-child-payment-flow .psflh-flow-card__intro {
  max-width: 100%;
  min-width: 0;
  margin-bottom: 28px;
}

body.psflh-child-payment-flow .psflh-flow-card__step,
body.psflh-child-payment-flow .psflh-flow-label {
  display: block;
  margin-bottom: 8px;
  color: var(--psflh-flow-green);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: .09em;
  text-transform: uppercase;
}

body.psflh-child-payment-flow .psflh-flow-card__intro h2,
body.psflh-child-payment-flow .psflh-flow-card h2,
body.psflh-child-payment-flow .psflh-flow-card h3 {
  color: var(--psflh-flow-text);
}

body.psflh-child-payment-flow .psflh-flow-card__intro h2,
body.psflh-child-payment-flow
.psflh-flow-card--confirmation > h2 {
  margin: 0 0 9px;
  font-family: var(--psflh-flow-font);
  font-size: clamp(27px, 3vw, 34px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -.035em;
  text-rendering: optimizeLegibility;
  text-transform: none;
}

body.psflh-child-payment-flow .psflh-flow-card__intro p,
body.psflh-child-payment-flow
.psflh-flow-card--confirmation > p {
  max-width: 660px;
  margin: 0;
  color: var(--psflh-flow-muted);
  font-size: 15px;
  line-height: 1.6;
}

@media (max-width: 700px) {
  body.psflh-child-payment-flow .psflh-flow-card {
    padding: 22px;
  }

  body.psflh-child-payment-flow .psflh-flow-card__intro h2,
  body.psflh-child-payment-flow
  .psflh-flow-card--confirmation > h2 {
    font-size: 27px;
  }
}

/* =========================================================
   06 — ORDER HEAD + BALANCE
   ========================================================= */

body.psflh-child-payment-flow .psflh-flow-order-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 100%;
  min-width: 0;
  margin: 0 -32px 24px;
  padding: 22px 32px;
  border-top: 1px solid var(--psflh-flow-border);
  border-bottom: 1px solid var(--psflh-flow-border);
  background: #fff;
}

body.psflh-child-payment-flow .psflh-flow-order-head h3,
body.psflh-child-payment-flow .psflh-flow-summary h3 {
  margin: 0 0 5px;
  font-family: var(--psflh-flow-font);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.025em;
  text-transform: none;
}

body.psflh-child-payment-flow .psflh-flow-order-head p {
  margin: 0;
  color: var(--psflh-flow-muted);
  font-size: 13px;
  line-height: 1.5;
}

body.psflh-child-payment-flow .psflh-flow-balance {
  flex: 0 0 auto;
  min-width: 225px;
  padding: 18px 20px;
  border: 1px solid rgb(37 77 24 / .12);
  border-radius: 9px;
  background:
    linear-gradient(
      135deg,
      #f7f9f4 0%,
      var(--psflh-flow-green-soft) 100%
    );
}

body.psflh-child-payment-flow .psflh-flow-balance span {
  display: block;
  margin-bottom: 8px;
  color: var(--psflh-flow-green);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

body.psflh-child-payment-flow .psflh-flow-balance strong {
  display: flex;
  align-items: baseline;
  gap: 2px;
  color: var(--psflh-flow-text);
  font-family: var(--psflh-flow-font);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.03em;
  white-space: nowrap;
}

@media (max-width: 700px) {
  body.psflh-child-payment-flow .psflh-flow-order-head {
    display: grid;
    margin: 0 -22px 22px;
    padding: 20px 22px;
  }

  body.psflh-child-payment-flow .psflh-flow-balance {
    min-width: 0;
    width: 100%;
  }

  body.psflh-child-payment-flow .psflh-flow-balance strong {
    font-size: 26px;
  }
}

/* =========================================================
   07 — ORDER ITEMS + TOTALS
   ========================================================= */

body.psflh-child-payment-flow .psflh-flow-items {
  margin-bottom: 22px;
}

body.psflh-child-payment-flow .psflh-flow-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid var(--psflh-flow-border);
}

body.psflh-child-payment-flow .psflh-flow-item__image {
  display: grid;
  place-items: center;
  overflow: hidden;
  width: 96px;
  height: 76px;
  border: 1px solid rgb(17 20 18 / .08);
  border-radius: var(--psflh-flow-radius-small);
  background: #fafafa;
}

body.psflh-child-payment-flow .psflh-flow-item__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

body.psflh-child-payment-flow .psflh-flow-item__content {
  display: grid;
  gap: 4px;
  min-width: 0;
}

body.psflh-child-payment-flow .psflh-flow-item__content strong {
  color: var(--psflh-flow-text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

body.psflh-child-payment-flow .psflh-flow-item__content span,
body.psflh-child-payment-flow .psflh-flow-item__meta,
body.psflh-child-payment-flow .psflh-flow-item__meta p {
  margin: 0;
  color: var(--psflh-flow-muted);
  font-size: 12.5px;
  line-height: 1.45;
}

body.psflh-child-payment-flow .psflh-flow-item__total {
  color: var(--psflh-flow-text);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

@media (max-width: 700px) {
  body.psflh-child-payment-flow .psflh-flow-item {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
  }

  body.psflh-child-payment-flow .psflh-flow-item__image {
    width: 72px;
    height: 62px;
  }

  body.psflh-child-payment-flow .psflh-flow-item__total {
    grid-column: 2;
  }
}

body.psflh-child-payment-flow .psflh-flow-totals,
body.psflh-child-payment-flow .psflh-flow-summary,
body.psflh-child-payment-flow .psflh-flow-confirmation-summary {
  margin-top: 8px;
}

body.psflh-child-payment-flow .psflh-flow-summary {
  max-width: 100%;
  min-width: 0;
}

body.psflh-child-payment-flow .psflh-flow-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  min-height: 48px;
  padding: 12px 0;
  border-bottom: 1px solid var(--psflh-flow-border);
}

body.psflh-child-payment-flow .psflh-flow-total span {
  color: var(--psflh-flow-muted);
  font-size: 13.5px;
  font-weight: 500;
}

body.psflh-child-payment-flow .psflh-flow-total strong {
  color: var(--psflh-flow-text);
  font-size: 14px;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

body.psflh-child-payment-flow .psflh-flow-total--remaining {
  margin-top: 7px;
  padding: 16px 18px;
  border: 1px solid rgb(37 77 24 / .14);
  border-radius: var(--psflh-flow-radius-small);
  background: var(--psflh-flow-green-soft);
}

body.psflh-child-payment-flow .psflh-flow-total--remaining span,
body.psflh-child-payment-flow .psflh-flow-total--remaining strong {
  color: var(--psflh-flow-green);
}

body.psflh-child-payment-flow .psflh-flow-total--remaining span {
  font-weight: 650;
}

body.psflh-child-payment-flow .psflh-flow-total--remaining strong {
  font-size: 18px;
  font-weight: 700;
}

@media (max-width: 420px) {
  body.psflh-child-payment-flow .psflh-flow-total {
    align-items: flex-start;
  }

  body.psflh-child-payment-flow .psflh-flow-total strong {
    white-space: normal;
  }
}

/* =========================================================
   08 — SECURITY NOTE
   ========================================================= */

body.psflh-child-payment-flow .psflh-flow-security {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding: 14px 16px;
  border: 1px solid rgb(37 77 24 / .12);
  border-radius: var(--psflh-flow-radius-small);
  background: #f6f8f3;
}

body.psflh-child-payment-flow .psflh-flow-security > span {
  display: grid;
  place-items: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #fff;
  background: var(--psflh-flow-green);
  font-size: 13px;
  font-weight: 800;
}

body.psflh-child-payment-flow .psflh-flow-security p {
  margin: 0;
  color: #4e554f;
  font-size: 13px;
  line-height: 1.45;
}

body.psflh-child-payment-flow .psflh-flow-security--compact {
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: transparent;
}

/* =========================================================
   09 — PAYMENT AMOUNT
   ========================================================= */

body.psflh-child-payment-flow .psflh-flow-payment-form {
  margin: 0;
}

body.psflh-child-payment-flow .psflh-flow-field label,
body.psflh-child-payment-flow .psflh-flow-quick > strong {
  display: block;
  margin: 0 0 6px;
  color: var(--psflh-flow-text);
  font-size: 14px;
  font-weight: 700;
}

body.psflh-child-payment-flow .psflh-flow-field p {
  margin: 0 0 13px;
  color: var(--psflh-flow-muted);
  font-size: 13.5px;
  line-height: 1.55;
}

body.psflh-child-payment-flow .psflh-flow-money {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  align-items: center;
  overflow: hidden;
  min-height: 66px;
  border: 1px solid #cfd4ce;
  border-radius: 9px;
  background: #fff;
  transition: border-color .16s ease, box-shadow .16s ease;
}

body.psflh-child-payment-flow .psflh-flow-money:focus-within {
  border-color: var(--psflh-flow-green-bright);
  box-shadow: 0 0 0 3px rgb(90 143 54 / .14);
}

body.psflh-child-payment-flow .psflh-flow-money > span {
  display: grid;
  place-items: center;
  align-self: stretch;
  border-right: 1px solid #dfe3dd;
  color: var(--psflh-flow-text);
  background: #f3f4f1;
  font-size: 19px;
  font-weight: 800;
}

body.psflh-child-payment-flow .psflh-flow-money input {
  width: 100%;
  height: 64px;
  margin: 0;
  padding: 0 18px;
  border: 0;
  color: var(--psflh-flow-text);
  background: transparent;
  box-shadow: none;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -.02em;
  text-align: center;
}

body.psflh-child-payment-flow .psflh-flow-money input::placeholder {
  color: #8b8f8b;
}

body.psflh-child-payment-flow .psflh-flow-quick {
  margin-top: 26px;
}

body.psflh-child-payment-flow .psflh-flow-quick__buttons {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

body.psflh-child-payment-flow button.psflh-flow-quick-button,
body.psflh-child-payment-flow .psflh-flow-quick-button {
  min-height: 46px;
  margin: 0;
  padding: 10px 12px;

  border: 1px solid #cfd4ce;
  border-radius: 7px;
  color: var(--psflh-flow-text);
  background: #fff;
  box-shadow: none;

  font-family: var(--psflh-flow-font);
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;

  cursor: pointer;
}

body.psflh-child-payment-flow button.psflh-flow-quick-button:hover,
body.psflh-child-payment-flow button.psflh-flow-quick-button:focus-visible,
body.psflh-child-payment-flow button.psflh-flow-quick-button.is-selected,
body.psflh-child-payment-flow .psflh-flow-quick-button:hover,
body.psflh-child-payment-flow .psflh-flow-quick-button:focus-visible,
body.psflh-child-payment-flow .psflh-flow-quick-button.is-selected {
  border-color: var(--psflh-flow-green);
  color: var(--psflh-flow-green);
  background: var(--psflh-flow-green-soft);
}

body.psflh-child-payment-flow button.psflh-flow-quick-button--balance,
body.psflh-child-payment-flow .psflh-flow-quick-button--balance {
  border-color: var(--psflh-flow-green);
  color: var(--psflh-flow-green);
}

@media (max-width: 900px) {
  body.psflh-child-payment-flow .psflh-flow-quick__buttons {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  body.psflh-child-payment-flow .psflh-flow-quick__buttons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* =========================================================
   10 — BUTTONS
   ========================================================= */

body.psflh-child-payment-flow .psflh-flow-actions {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: 14px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--psflh-flow-border);
}

body.psflh-child-payment-flow .psflh-flow-actions--single {
  grid-template-columns: 1fr;
}

body.psflh-child-payment-flow .psflh-flow-button,
body.psflh-child-payment-flow .psflh-flow-gateway #place_order,
body.psflh-child-payment-flow .psflh-flow-gateway .button.alt {
  min-height: 54px;
  border-radius: 7px;
  font-family: var(--psflh-flow-font);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.005em;
  text-transform: none;
  cursor: pointer;
}

body.psflh-child-payment-flow .psflh-flow-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0;
  padding: 13px 22px;
  text-align: center;
  text-decoration: none;
  transition:
    transform .16s ease,
    box-shadow .16s ease,
    background .16s ease,
    border-color .16s ease;
}

body.psflh-child-payment-flow .psflh-flow-button--primary,
body.psflh-child-payment-flow .psflh-flow-gateway #place_order,
body.psflh-child-payment-flow .psflh-flow-gateway .button.alt {
  border: 1px solid var(--psflh-flow-green);
  color: #fff;
  background: var(--psflh-flow-grad-primary);
  box-shadow:
    0 8px 20px rgb(37 77 24 / .22),
    inset 0 1px 0 rgb(255 255 255 / .16);
}

body.psflh-child-payment-flow .psflh-flow-button--primary:hover,
body.psflh-child-payment-flow .psflh-flow-button--primary:focus-visible,
body.psflh-child-payment-flow .psflh-flow-gateway #place_order:hover,
body.psflh-child-payment-flow .psflh-flow-gateway .button.alt:hover {
  border-color: var(--psflh-flow-green-dark);
  color: #fff;
  background: var(--psflh-flow-grad-primary-hover);
}

body.psflh-child-payment-flow .psflh-flow-button--primary:hover,
body.psflh-child-payment-flow .psflh-flow-button--primary:focus-visible {
  transform: translateY(-1px);
  box-shadow:
    0 11px 26px rgb(37 77 24 / .30),
    inset 0 1px 0 rgb(255 255 255 / .18);
}

body.psflh-child-payment-flow .psflh-flow-button--secondary {
  border: 1px solid var(--psflh-flow-green);
  color: var(--psflh-flow-green);
  background: #fff;
  box-shadow: none;
}

body.psflh-child-payment-flow .psflh-flow-button--secondary:hover,
body.psflh-child-payment-flow .psflh-flow-button--secondary:focus-visible {
  border-color: var(--psflh-flow-green-bright);
  color: var(--psflh-flow-green-dark);
  background: var(--psflh-flow-green-soft);
}

body.psflh-child-payment-flow .psflh-flow-button:focus-visible,
body.psflh-child-payment-flow .psflh-flow-quick-button:focus-visible {
  outline: 3px solid rgb(90 143 54 / .28);
  outline-offset: 3px;
}

body.psflh-child-payment-flow .psflh-flow-cancel {
  display: block;
  width: fit-content;
  margin: 16px auto 0;
  color: var(--psflh-flow-muted);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 700px) {
  body.psflh-child-payment-flow .psflh-flow-actions {
    grid-template-columns: 1fr;
  }

  body.psflh-child-payment-flow
  .psflh-flow-actions .psflh-flow-button--secondary {
    order: 2;
  }
}

/* =========================================================
   11 — REVIEW STEP + PAYMENT GATEWAY
   ========================================================= */

body.psflh-child-payment-flow .psflh-flow-review-grid {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 20px;
}

@media (min-width: 901px) {
  body.psflh-child-payment-flow .psflh-flow-review-grid {
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: 22px;
  }
}

body.psflh-child-payment-flow .psflh-flow-card--review,
body.psflh-child-payment-flow .psflh-flow-card--gateway {
  height: 100%;
}

body.psflh-child-payment-flow .psflh-flow-review-back {
  width: 100%;
  margin-top: 24px;
}

/* Shipping protection belongs to the original checkout, not the payment flow. */
body.psflh-child-payment-flow
.psflh-flow-gateway .shop_table.order_details,
body.psflh-child-payment-flow
.psflh-flow-gateway .woocommerce-order-details,
body.psflh-child-payment-flow
.psflh-flow-gateway .woocommerce-customer-details,
body.psflh-child-payment-flow
.psflh-flow-gateway .psf-shipping-protection-row,
body.psflh-child-payment-flow .psf-shipping-protection-row,
body.psflh-child-payment-flow .psf-shipping-protection-wrap,
body.psflh-child-payment-flow [class*="shipping-protection"] {
  display: none;
}

/* Standard WooCommerce form-pay order table */
body.psflh-child-payment-flow .psflh-flow-gateway .shop_table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 13.5px;
}

body.psflh-child-payment-flow .psflh-flow-gateway .shop_table th,
body.psflh-child-payment-flow .psflh-flow-gateway .shop_table td {
  padding: 10px 8px;
  vertical-align: top;
  word-break: break-word;
  overflow-wrap: anywhere;
}

body.psflh-child-payment-flow
.psflh-flow-gateway .shop_table .product-quantity {
  width: 46px;
  text-align: center;
}

body.psflh-child-payment-flow
.psflh-flow-gateway .shop_table .product-total,
body.psflh-child-payment-flow
.psflh-flow-gateway .shop_table tfoot td {
  width: 92px;
  text-align: right;
}

body.psflh-child-payment-flow .psflh-flow-gateway form#order_review,
body.psflh-child-payment-flow .psflh-flow-gateway .woocommerce-form-pay {
  margin: 0;
}

body.psflh-child-payment-flow .psflh-flow-gateway #payment,
body.psflh-child-payment-flow
.psflh-flow-gateway #payment ul.payment_methods {
  min-width: 0;
  max-width: 100%;
}

body.psflh-child-payment-flow .psflh-flow-gateway #payment {
  background: transparent;
}

body.psflh-child-payment-flow
.psflh-flow-gateway #payment ul.payment_methods {
  margin: 0;
  padding: 0;
  border: 0;
}

body.psflh-child-payment-flow
.psflh-flow-gateway #payment ul.payment_methods > li {
  min-width: 0;
  max-width: 100%;
  margin: 0 0 10px;
  padding: 14px 16px;
  border: 1px solid var(--psflh-flow-border);
  border-radius: var(--psflh-flow-radius-small);
  background: #fafbf9;
  font-size: 14px;
  line-height: 1.5;
}

body.psflh-child-payment-flow
.psflh-flow-gateway #payment .payment_box {
  min-width: 0;
  max-width: 100%;
  margin: 12px 0 0;
  padding: 14px;
  border-radius: 7px;
  background: #f1f4ef;
  font-size: 13.5px;
  line-height: 1.55;
}

body.psflh-child-payment-flow
.psflh-flow-gateway #payment .payment_box::before {
  border-bottom-color: #f1f4ef;
}

body.psflh-child-payment-flow
.psflh-flow-gateway #payment .place-order {
  margin: 16px 0 0;
  padding: 0;
}

body.psflh-child-payment-flow .psflh-flow-gateway #place_order,
body.psflh-child-payment-flow .psflh-flow-gateway .button.alt {
  width: 100%;
}

/* Hosted card fields must never exceed the gateway card. */
body.psflh-child-payment-flow .psflh-flow-gateway iframe,
body.psflh-child-payment-flow .psflh-flow-gateway input,
body.psflh-child-payment-flow .psflh-flow-gateway select,
body.psflh-child-payment-flow .psflh-flow-gateway .wc-credit-card-form,
body.psflh-child-payment-flow .psflh-flow-gateway .wc-payment-form {
  max-width: 100%;
  box-sizing: border-box;
}

/* Standard WooCommerce credit-card markup */
body.psflh-child-payment-flow .psflh-flow-gateway .wc-credit-card-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

body.psflh-child-payment-flow
.psflh-flow-gateway .wc-credit-card-form .form-row {
  float: none;
  width: auto;
  margin: 0;
  padding: 0;
}

@media (min-width: 480px) {
  body.psflh-child-payment-flow
  .psflh-flow-gateway .wc-credit-card-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.psflh-child-payment-flow
  .psflh-flow-gateway .wc-credit-card-form .form-row-wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  body.psflh-child-payment-flow
  .psflh-flow-gateway
  .woocommerce-terms-and-conditions-wrapper .form-row,
  body.psflh-child-payment-flow
  .psflh-flow-gateway .wc-terms-and-conditions {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 14px 0;
  }

  body.psflh-child-payment-flow
  .psflh-flow-gateway
  .woocommerce-terms-and-conditions-wrapper
  input[type="checkbox"] {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    margin: 1px 0 0;
  }

  body.psflh-child-payment-flow
  .psflh-flow-gateway
  .woocommerce-terms-and-conditions-checkbox-text {
    font-size: 13.5px;
    line-height: 1.45;
  }
}

/* =========================================================
   12 — CONFIRMATION
   ========================================================= */

body.psflh-child-payment-flow .psflh-flow-card--confirmation {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

body.psflh-child-payment-flow
.psflh-flow-card--confirmation > h2 {
  font-size: clamp(29px, 3.2vw, 36px);
}

body.psflh-child-payment-flow .psflh-flow-success-icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin: 0 auto 16px;
  border-radius: 50%;
  color: #fff;
  background: var(--psflh-flow-grad-primary);
  box-shadow: 0 10px 24px rgb(37 77 24 / .24);
  font-size: 31px;
  font-weight: 800;
}

body.psflh-child-payment-flow
.psflh-flow-card--confirmation .psflh-flow-order-head,
body.psflh-child-payment-flow
.psflh-flow-card--confirmation .psflh-flow-total {
  text-align: left;
}

body.psflh-child-payment-flow .psflh-flow-confirmation-summary {
  margin-top: 24px;
}

/* =========================================================
   13 — TRUST ROW
   ========================================================= */

body.psflh-child-payment-flow .psflh-flow-trust-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}

body.psflh-child-payment-flow .psflh-flow-trust-row > div {
  display: grid;
  gap: 4px;
  padding: 19px 20px;
  border: 1px solid var(--psflh-flow-border);
  border-radius: 9px;
  background: rgb(255 255 255 / .72);
}

body.psflh-child-payment-flow .psflh-flow-trust-row strong {
  color: var(--psflh-flow-text);
  font-size: 13.5px;
  font-weight: 700;
}

body.psflh-child-payment-flow .psflh-flow-trust-row span {
  color: var(--psflh-flow-muted);
  font-size: 12.5px;
  line-height: 1.55;
}

@media (max-width: 700px) {
  body.psflh-child-payment-flow .psflh-flow-trust-row {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   14 — WOOCOMMERCE NOTICES
   ========================================================= */

body.psflh-child-payment-flow
.psflh-flow .woocommerce-error,
body.psflh-child-payment-flow
.psflh-flow .woocommerce-message,
body.psflh-child-payment-flow
.psflh-flow .woocommerce-info {
  margin: 0 0 18px;
  padding: 14px 16px 14px 46px;
  border-radius: var(--psflh-flow-radius-small);
  box-shadow: none;
}

/* =========================================================
   15 — CHAT WIDGET CLEARANCE
   These selectors only apply on the layaway payment-flow page.
   ========================================================= */

@media (max-width: 900px) {
  body.psflh-child-payment-flow #tawkchat-container,
  body.psflh-child-payment-flow .woot--bubble-holder,
  body.psflh-child-payment-flow #hubspot-messages-iframe-container,
  body.psflh-child-payment-flow .crisp-client {
    bottom: 96px;
  }
}

/* =========================================================
   16 — REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  body.psflh-child-payment-flow .psflh-flow *,
  body.psflh-child-payment-flow .psflh-flow *::before,
  body.psflh-child-payment-flow .psflh-flow *::after {
    scroll-behavior: auto;
    transition: none;
  }
}
