/* Montonio banklist — loaded after CCC so it always wins (HL-like tiles) */
body#checkout #montonio-payments-checkout .montonio-bank-select-class,
body#checkout #montonio-payments-checkout select.montonio-bank-select-class {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-height: 44px !important;
  margin: 0 0 .75rem !important;
  padding: .55rem .85rem !important;
  border: 1px solid #d1d5db !important;
  border-radius: 10px !important;
  background: #fff !important;
  font-size: .92rem !important;
  color: #111827 !important;
}

body#checkout #montonio-payments-checkout .montonio-bank-items,
body#checkout #montonio-payments-checkout .montonio-bank-items--grid,
body#checkout #montonio-payments-checkout .montonio-container.montonio-bank-items {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
  width: 100% !important;
  max-width: 100% !important;
  align-items: stretch !important;
  justify-content: stretch !important;
  flex-wrap: unset !important;
}

@media (min-width: 420px) {
  body#checkout #montonio-payments-checkout .montonio-bank-items,
  body#checkout #montonio-payments-checkout .montonio-bank-items--grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 560px) {
  body#checkout #montonio-payments-checkout .montonio-bank-items,
  body#checkout #montonio-payments-checkout .montonio-bank-items--grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

body#checkout #montonio-payments-checkout,
body#checkout #montonio-payments-checkout .montonio-bank-items,
body#checkout #montonio-payments-checkout .montonio-bank-items--grid {
  pointer-events: auto !important;
  position: relative !important;
  z-index: 3 !important;
}

body#checkout #montonio-payments-checkout .montonio-bank,
body#checkout #montonio-payments-checkout .montonio-bank-items .montonio-bank {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 58px !important;
  height: auto !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 12px 10px !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 10px !important;
  background: #fff !important;
  box-sizing: border-box !important;
  cursor: pointer !important;
  flex: unset !important;
  pointer-events: auto !important;
  position: relative !important;
  z-index: 4 !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}

body#checkout #montonio-payments-checkout .montonio-bank img {
  pointer-events: none !important;
}

/* Selected bank must beat the white tile rules above */
body#checkout #montonio-payments-checkout .montonio-bank.montonio-bank-active,
body#checkout #montonio-payments-checkout .montonio-bank.montonio-bank-item--selected,
body#checkout #montonio-payments-checkout .montonio-bank[aria-pressed="true"],
body#checkout #montonio-payments-checkout .montonio-bank[aria-selected="true"],
body#checkout #montonio-payments-checkout .montonio-bank.selected,
body#checkout #montonio-payments-checkout .montonio-bank.is-selected {
  border: 2px solid #d71920 !important;
  border-color: #d71920 !important;
  background: #fff5f5 !important;
  background-color: #fff5f5 !important;
  box-shadow: 0 0 0 1px rgba(215, 25, 32, .35) !important;
}

/* Do not force-show other countries' banks */
body#checkout #montonio-payments-checkout .montonio-bank.montonio-bank-item--hidden,
body#checkout #montonio-payments-checkout .montonio-bank-item--hidden {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

body#checkout #montonio-payments-checkout .montonio-bank:hover {
  border-color: #d1d5db !important;
  background: #fafafa !important;
}

body#checkout #montonio-payments-checkout .montonio-bank.montonio-bank-active:hover,
body#checkout #montonio-payments-checkout .montonio-bank.montonio-bank-item--selected:hover {
  border-color: #d71920 !important;
  background: #fff5f5 !important;
  background-color: #fff5f5 !important;
}

/* MAKSA locked until bank / payment method / terms are really chosen */
body#checkout.hl-payment-method-pending #payment-confirmation button.btn-primary,
body#checkout.hl-payment-method-pending #payment-confirmation input[type="submit"],
body#checkout.hl-payment-method-pending #hl-final-checkout .hl-pay-cta,
body#checkout.hl-payment-method-pending .hl-final-checkout__pay .hl-pay-cta,
body#checkout.hl-montonio-bank-pending #payment-confirmation button.btn-primary,
body#checkout.hl-montonio-bank-pending #hl-final-checkout .hl-pay-cta,
body#checkout.hl-terms-pending #payment-confirmation button.btn-primary,
body#checkout.hl-terms-pending #payment-confirmation input[type="submit"],
body#checkout.hl-terms-pending #hl-final-checkout .hl-pay-cta,
body#checkout.hl-terms-pending .hl-final-checkout__pay .hl-pay-cta {
  opacity: .45 !important;
  pointer-events: none !important;
  cursor: not-allowed !important;
}

/* When delivery is ready / DPD point chosen, never leave payment list unclickable */
body#checkout.hl-delivery-ready #checkout-payment-step .payment-options__list,
body#checkout.hl-dpd-point-ok #checkout-payment-step .payment-options__list,
body#checkout.hl-dpd-point-ok #checkout-payment-step .js-payment-confirmation,
body#checkout.hl-dpd-point-ok #checkout-payment-step #payment-confirmation,
body#checkout.hl-dpd-point-ok #checkout-payment-step .js-conditions-to-approve {
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* FI card row: MobilePay sits in the same 20px strip as the other marks. */
body#checkout .payment-option__label img.miu-card-logos {
  height: 20px !important;
  width: auto !important;
  max-width: none !important;
  max-height: none !important;
  flex: 0 0 auto;
  object-fit: contain;
}

/* Beat Montonio injected .montonio-bank img { max-height: 26px } */
body#checkout #montonio-payments-checkout .montonio-bank img,
body#checkout #montonio-payments-checkout .montonio-bank-items .montonio-bank img,
body#checkout #montonio-payments-checkout img {
  max-height: 34px !important;
  max-width: 110px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  display: block !important;
}

body#checkout .payment-option:has(input[name="payment-option"]:checked) .js-payment-option-form,
body#checkout .payment-option:has(input[name="payment-option"]:checked) .js-additional-information {
  display: block !important;
  visibility: visible !important;
  overflow: visible !important;
}

/* DPD live search (theme-loaded, not CCC-dependent) */
body#checkout .miu-dpd-street-wrap { position: relative !important; width: 100% !important; }

/* Never show native DPD <select> as a black listbox */
body#checkout .miu-dpd-street-select--native,
body#checkout select[name="dpd-street"].miu-dpd-street-select--native,
body#checkout .miu-dpd-street-wrap > select[name="dpd-street"] {
  position: absolute !important;
  left: -9999px !important;
  top: 0 !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  max-height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  clip: rect(0, 0, 0, 0) !important;
  overflow: hidden !important;
  border: 0 !important;
  background: transparent !important;
  color: transparent !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  z-index: -1 !important;
}

body#checkout .miu-dpd-picked {
  margin: 0 0 .45rem !important;
  padding: .65rem .9rem !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 10px !important;
  background: #f9fafb !important;
  color: #111827 !important;
  font-size: .88rem !important;
}

body#checkout .miu-dpd-results {
  display: block !important;
  margin: 0 0 .35rem !important;
  max-height: 240px !important;
  overflow: auto !important;
  border: 1px solid #d1d5db !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  background-color: #ffffff !important;
  color: #111827 !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .08) !important;
  z-index: 5 !important;
}

body#checkout .miu-dpd-results[hidden] {
  display: none !important;
}

body#checkout .miu-dpd-results,
body#checkout .miu-dpd-results * {
  background-color: #ffffff !important;
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  opacity: 1 !important;
  filter: none !important;
}

body#checkout .miu-dpd-results__list {
  list-style: none !important;
  margin: 0 !important;
  padding: .25rem 0 !important;
  background: #ffffff !important;
}

body#checkout .miu-dpd-results__item {
  display: flex !important;
  flex-direction: column !important;
  gap: .1rem !important;
  padding: .55rem .85rem !important;
  cursor: pointer !important;
  font-size: .86rem !important;
  background: #ffffff !important;
  color: #111827 !important;
}

body#checkout .miu-dpd-results__item:hover,
body#checkout .miu-dpd-results__item.is-selected {
  background: #fff1f2 !important;
  background-color: #fff1f2 !important;
}

body#checkout .miu-dpd-results__city {
  font-size: .78rem !important;
  color: #6b7280 !important;
  -webkit-text-fill-color: #6b7280 !important;
}

body#checkout .miu-dpd-results__city-head {
  padding: .45rem .85rem .2rem !important;
  font-size: .72rem !important;
  font-weight: 700 !important;
  letter-spacing: .02em !important;
  text-transform: uppercase !important;
  color: #6b7280 !important;
  -webkit-text-fill-color: #6b7280 !important;
  background: #f9fafb !important;
  cursor: default !important;
  pointer-events: none !important;
}

body#checkout .miu-dpd-results__hint {
  padding: .55rem .85rem !important;
  font-size: .78rem !important;
  color: #6b7280 !important;
  -webkit-text-fill-color: #6b7280 !important;
  background: #f9fafb !important;
  cursor: default !important;
  pointer-events: none !important;
}

body#checkout .miu-dpd-street-wrap--open .miu-dpd-search {
  border-color: #d71920 !important;
}

body#checkout .miu-dpd-search {
  display: block !important;
  width: 100% !important;
  min-height: 44px !important;
  padding: 0 14px !important;
  border: 1px solid #d1d5db !important;
  border-radius: 10px !important;
  margin: 0 0 .45rem !important;
  background: #ffffff !important;
  color: #111827 !important;
}
