/*!
 * WayForPay "Pay in parts" for OpenCart 3 / ocStore 3
 * Storefront styles. Deliberately framework free: no Bootstrap, no theme
 * variables, every rule scoped under .wfp-* so it cannot leak into the theme.
 */

.wfp-widget,
.wfp-modal,
.wfp-confirm,
.wfp-checkout-ui {
  --wfp-accent: #162C46;
  --wfp-accent-hover: #0f2035;
  --wfp-accent-soft: #eef1f4;
  --wfp-accent-border: #c5ced8;
  --wfp-border: #e5e7eb;
  --wfp-text: #111827;
  --wfp-muted: #6b7280;
  --wfp-bg: #f3f4f6;
  --wfp-card: #ffffff;
}

.wfp-widget {
  box-sizing: border-box;
  /* Grid + minmax(0,1fr) is what stops theme flex columns from expanding. */
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  max-width: 100%;
  min-width: 0 !important;
  flex: 0 1 100%;
  align-self: stretch;
  overflow: hidden;
  margin: 14px 0 18px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--wfp-text);
  font-size: 14px;
  line-height: 1.4;
}

.wfp-widget *,
.wfp-modal * {
  box-sizing: border-box;
}

/* ------------------------------------------------------------------ *
 * Product banks — simple horizontal scroll line + arrow buttons.
 * Outer widget is a 1-col grid so content width cannot inflate parents.
 * ------------------------------------------------------------------ */

.wfp-banks-shell {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.wfp-banks-wrap {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: scroll;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  touch-action: pan-x;
  cursor: grab;
}

.wfp-banks-wrap.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto;
}

.wfp-banks-wrap::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.wfp-banks {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 8px;
  width: max-content;
  max-width: none;
  margin: 0;
  padding: 2px 0 6px;
  list-style: none;
  touch-action: pan-x;
}

.wfp-banks__item {
  flex: 0 0 auto;
  width: 168px;
  max-width: 168px;
  min-width: 168px;
  touch-action: pan-x;
}

.wfp-banks-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--wfp-border);
  border-radius: 50%;
  background: #fff;
  color: var(--wfp-accent);
  box-shadow: 0 1px 4px rgba(17, 24, 39, .12);
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  -webkit-appearance: none;
  appearance: none;
}

.wfp-banks-nav[hidden] {
  display: none !important;
}

.wfp-banks-nav:hover,
.wfp-banks-nav:focus-visible {
  border-color: var(--wfp-accent);
  background: var(--wfp-accent-soft);
  outline: none;
}

.wfp-banks-nav--prev {
  left: 4px;
}

.wfp-banks-nav--next {
  right: 4px;
}

/* Beat theme rules like `.product-actions a { width: 100% }`. */
.wfp-widget a.wfp-card {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  column-gap: 8px;
  align-items: center;
  width: 100%;
  max-width: 100%;
  height: 100%;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--wfp-border);
  border-radius: 12px;
  background: var(--wfp-card);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  touch-action: pan-x;
  transition: border-color .15s ease, box-shadow .15s ease;
  -webkit-user-drag: none;
  user-select: none;
}

.wfp-widget a.wfp-card:hover,
.wfp-widget a.wfp-card:focus-visible {
  border-color: #9ca3af;
  box-shadow: 0 4px 14px rgba(17, 24, 39, .08);
  outline: none;
}

.wfp-card__logo-wrap {
  position: relative;
  width: 40px;
  height: 40px;
}

.wfp-card__logo {
  display: grid;
  place-items: center;
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--wfp-border);
  overflow: hidden;
}

.wfp-card__logo img {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.wfp-card__initial {
  font-size: 14px;
  font-weight: 700;
  color: var(--wfp-accent);
  line-height: 1;
}

.wfp-card__badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  z-index: 1;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border: 1px solid var(--wfp-border);
  border-radius: 999px;
  background: #fff;
  color: #111;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}

.wfp-card__body {
  display: grid;
  gap: 1px;
  min-width: 0;
  overflow: hidden;
}

.wfp-card__name {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wfp-card__offer {
  display: block;
  font-size: 12px;
  line-height: 1.25;
  color: var(--wfp-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wfp-card__from {
  color: var(--wfp-muted);
  font-weight: 500;
}

.wfp-card__offer strong {
  font-weight: 700;
}

.wfp-widget__note {
  margin: 8px 0 0;
  padding: 0;
  color: var(--wfp-muted);
  font-size: 11px;
  line-height: 1.35;
}

/* ------------------------------------------------------------------ *
 * Modal
 * ------------------------------------------------------------------ */

.wfp-modal {
  position: fixed;
  /* Above typical chat/callback widgets (Binotel etc.). */
  z-index: 2147483000;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px 16px 96px;
  background: rgba(17, 24, 39, .55);
  color: #23282d;
  font-size: 14px;
  line-height: 1.45;
}

.wfp-modal.is-open {
  display: flex;
}

.wfp-modal__dialog {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 120px);
  max-height: calc(100dvh - 120px);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
}

.wfp-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #e2e6ea;
}

.wfp-modal__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.wfp-modal__close {
  border: 0;
  padding: 4px 8px;
  background: none;
  color: #6b7280;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.wfp-modal__close:hover {
  color: #23282d;
}

.wfp-modal__body {
  overflow-y: auto;
  padding: 12px 14px;
}

.wfp-modal__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid #e2e6ea;
}

.wfp-step__label {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: #6b7280;
}

.wfp-step + .wfp-step {
  margin-top: 12px;
}

.wfp-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.wfp-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #e2e6ea;
  border-radius: 8px;
  background: #fbfcfd;
  cursor: pointer;
  line-height: 1.2;
}

.wfp-option input {
  margin: 0;
  flex: 0 0 auto;
}

.wfp-option.is-active {
  border-color: var(--wfp-accent);
  background: var(--wfp-accent-soft);
}

.wfp-option__logo {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  max-width: 28px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
}

.wfp-option__name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  white-space: normal;
  overflow: visible;
  word-break: break-word;
}

.wfp-months {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.wfp-month {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border: 1px solid #e2e6ea;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
}

.wfp-month input {
  margin: 0;
}

.wfp-month.is-active {
  border-color: var(--wfp-accent);
  background: var(--wfp-accent-soft);
  font-weight: 600;
}

.wfp-summary {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f4f6f8;
}

.wfp-summary:empty {
  display: none;
}

.wfp-summary__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 0;
}

.wfp-summary__row--main {
  font-size: 16px;
  font-weight: 700;
  color: var(--wfp-accent);
}

.wfp-schedule {
  width: 100%;
  margin-top: 12px;
  border-collapse: collapse;
  font-size: 13px;
}

.wfp-schedule th,
.wfp-schedule td {
  padding: 6px 8px;
  border-bottom: 1px solid #e6e9ec;
  text-align: left;
}

.wfp-schedule th {
  color: #6b7280;
  font-weight: 600;
}

.wfp-schedule td:last-child,
.wfp-schedule th:last-child {
  text-align: right;
}

.wfp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  min-width: 96px;
  padding: 8px 18px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
}

.wfp-btn--primary {
  background: var(--wfp-accent);
  color: #fff;
}

.wfp-btn--primary:hover {
  background: var(--wfp-accent-hover);
}

.wfp-btn--ghost {
  border-color: #d3d8dd;
  background: #fff;
  color: #23282d;
}

.wfp-btn--ghost:hover {
  background: #f4f6f8;
}

.wfp-btn[disabled] {
  opacity: .55;
  cursor: not-allowed;
}

.wfp-alert {
  margin: 0 0 12px;
  padding: 9px 12px;
  border-radius: 8px;
  background: #fdecea;
  color: #9b1c1c;
  font-size: 13px;
}

.wfp-alert[hidden] {
  display: none;
}

/* ------------------------------------------------------------------ *
 * Confirm step block
 * ------------------------------------------------------------------ */

.wfp-confirm {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.45;
  color: #23282d;
}

.wfp-confirm__selected {
  display: block;
  margin: 8px 0 6px;
  padding: 8px 12px;
  border: 1px solid var(--wfp-accent-border, #c5ced8);
  border-radius: 8px;
  background: var(--wfp-accent-soft, #eef1f4);
  font-size: 13px;
  line-height: 1.4;
  color: #23282d;
}

.wfp-confirm__selected[data-wfp-open-plan] {
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.wfp-confirm__selected[data-wfp-open-plan]:hover,
.wfp-confirm__selected[data-wfp-open-plan]:focus {
  border-color: var(--wfp-accent, #162C46);
  background: #e4e9ee;
  outline: none;
}

.wfp-confirm__selected--prompt {
  border-style: dashed;
  color: var(--wfp-accent, #162C46);
  font-weight: 600;
}

.wfp-confirm__selected strong {
  color: var(--wfp-accent, #162C46);
}

.wfp-checkout-ui {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 6px 0 10px;
  padding: 0 0 0 28px;
  box-sizing: border-box;
}

.wfp-checkout-ui[hidden] {
  display: none !important;
}

.wfp-checkout-ui .wfp-widget__more,
.wfp-checkout-ui [data-wfp-change-plan] {
  display: none !important;
}

.wfp-confirm__testmode {
  margin-bottom: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #fff8e1;
  color: #8a5a00;
  font-size: 13px;
}

.wfp-confirm__buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.wfp-widget__more {
  display: inline-block;
  margin-top: 10px;
  border: 0;
  padding: 0;
  background: none;
  color: var(--wfp-accent);
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

@media (max-width: 480px) {
  .wfp-modal {
    align-items: flex-start;
    padding: 10px 10px 120px;
  }

  .wfp-modal__dialog {
    max-height: calc(100vh - 140px);
    max-height: calc(100dvh - 140px);
    margin-top: 8px;
  }

  .wfp-modal__head,
  .wfp-modal__body,
  .wfp-modal__foot {
    padding: 10px 12px;
  }

  .wfp-step + .wfp-step {
    margin-top: 10px;
  }

  .wfp-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .wfp-option {
    gap: 6px;
    padding: 6px 8px;
  }

  .wfp-option__logo {
    width: 26px;
    height: 26px;
    max-width: 26px;
  }

  .wfp-option__name {
    font-size: 12px;
    white-space: normal;
    overflow: visible;
  }

  .wfp-months {
    gap: 5px;
  }

  .wfp-month {
    padding: 5px 8px;
    font-size: 11px;
  }

  .wfp-summary {
    margin-top: 10px;
    padding: 8px 10px;
  }
}
