/* PAYMENT METHOD BUTTONS (Card | Google Pay | Apple Pay) */
/* Equal-width columns regardless of the buttons' content; empty wallet
   containers are display:none so they don't take up a column. */
.gf-tp-method-nav {
  --gf-tp-btn-height: 50px; /* height of the Card / GPay / APay buttons */
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 220px);
  justify-content: start;
  gap: 10px;
  margin-bottom: 16px;
}

.gf-tp-method-nav > .gf-tp-card-btn,
.gf-tp-method-nav > .gf-tp-wallet-btn {
  width: 100%;
  min-width: 0;
  height: var(--gf-tp-btn-height) !important;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .gf-tp-method-nav {
    grid-auto-flow: row;
    grid-template-columns: 1fr;
  }
}

/* Card button styled to sit alongside the black GPay / APay buttons */
.gf-tp-method-nav .gf-tp-card-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 0 16px;
  border: none !important;
  border-radius: 4px;
  background: #000 !important;
  color: #fff !important;
  box-shadow: none;
  font-family: "Google Sans", Roboto, Arial, sans-serif;
  font-size: 18px !important;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 0.15s,
    box-shadow 0.15s;
}

.gf-tp-method-nav .gf-tp-card-btn:hover {
  background: #3c4043 !important;
}

.gf-tp-method-nav .gf-tp-card-btn:focus-visible {
  outline: 2px solid var(--main-color, #c64239);
  outline-offset: 2px;
}

.gf-tp-method-nav .gf-tp-card-btn--active {
  box-shadow:
    0 0 0 2px #fff,
    0 0 0 4px var(--main-color, #c64239);
}

.gf-tp-method-nav .gf-tp-card-btn img {
  height: 22px;
  width: auto;
  display: block;
  filter: brightness(0) invert(1);
}

/* Card fields + Pay button stay hidden until "Card" is chosen */
.ginput_container_trustpayments.gf-tp-card-closed .st-form-container {
  display: none !important;
}

/* DONATION STYLING */
:root {
  --main-color: #c64239;
  --main-color-80: rgba(198, 66, 57, 0.8);
  --main-color-60: rgba(198, 66, 57, 0.6);
  --main-color-40: rgba(198, 66, 57, 0.4);
}

div#content {
  background: var(--main-color);
}

.mega-buttons .gfield_radio {
  grid-template-columns: none !important;
  grid-auto-flow: column;
  column-gap: 10px !important;
  justify-content: start;
}

.mega-buttons .gchoice label {
  cursor: pointer;
  border: 2px solid var(--main-color-60);
  background: var(--main-color-60);
  border-radius: 5px;
  padding: 10px 20px;
  text-align: center;
  justify-items: center;
  align-content: center;
  margin: 0 !important;
  color: white;
  font-weight: bold;
}

.mega-buttons .gchoice input[type="radio"] {
  display: none;
}

.mega-buttons .gchoice input[type="radio"]:hover + label {
  border: 2px solid var(--main-color-80);
  background: var(--main-color-80);
}

.mega-buttons .gchoice input[type="radio"]:checked + label {
  border: 2px solid var(--main-color);
  background: var(--main-color);
}

.gform_wrapper :has(.gfield--type-trustpayments) .gform-footer {
  margin-top: 0;
}

.gform_wrapper :has(.gf-tp-card-closed) .gform-footer {
  display: none;
}

.gform-footer .gform_button {
  cursor: pointer;
  border: 2px solid var(--main-color) !important;
  background: var(--main-color) !important;
  border-radius: 5px;
  padding: 10px 20px;
  text-align: center;
  justify-items: center;
  align-content: center;
  margin: 0 !important;
  color: white !important;
  font-weight: bold;
}

.gform_required_legend,
#st-apple-pay:empty,
#st-google-pay:empty {
  display: none !important;
}

#st-apple-pay apple-pay-button {
  --apple-pay-button-height: var(--gf-tp-btn-height, 50px);
}

:has(.mega-buttons) .ginput_container.ginput_container_product_price {
  margin-top: 15px;
}

@media (max-width: 768px) {
  :has(.mega-buttons) .ginput_container.ginput_container_product_price {
    margin-top: 0px !important;
  }
  /* :has(.mega-buttons) .gfield.gfield--type-product {
    margin-top: -30px !important;
  } */

  .mega-buttons .gfield_radio {
    flex-direction: row !important;
    flex-wrap: wrap;
  }
  .st-form-container {
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: 1fr 1fr;
  }
  .st-form-container #st-card-number {
    grid-column: span 2;
    grid-row: 1;
  }
  .st-form-container #st-expiration-date {
    grid-column: 1 2;
    grid-row: 2;
  }
  .st-form-container #st-security-code {
    grid-column: 2 3;
    grid-row: 2;
  }
}
