/* TPC BrightPay Bureau — co-brand styling (cart/checkout). */
.bpb-cobrand {
  text-align: center;
  padding: 18px 16px;
  margin: 0 0 20px;
  border: 1px solid #e3e6ea;
  border-radius: 10px;
  background: #fafbfc;
}
.bpb-cobrand__label {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b7280;
  margin-bottom: 10px;
}
.bpb-cobrand__logo {
  max-width: 340px !important;
  width: 100%;
  height: auto;
}
.bpb-secure {
  font-size: 13px;
  color: #4b5563;
  text-align: center;
  margin: 14px 0;
}
/* Full-width line directly above the Place Order button row. */
body.bpb-checkout .bpb-secure {
  display: block;
  width: 100%;
  margin: 16px 0 10px;
}
@media (max-width: 480px) {
  .bpb-cobrand {
    padding: 14px 12px;
  }
  .bpb-cobrand__logo {
    max-width: 260px;
  }
}

/* Per-delegate "Delegate N" heading (injected by bpb.js before each seat's first-name field). */
.bpb-delegate-heading {
  clear: both;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 2px solid #e3e6ea;
  margin: 20px 0 10px;
  padding-top: 14px;
  font-weight: 700;
  font-size: 15px;
  color: #0b3d66;
}

/* "Copy from billing details" button on delegate 1. */
.bpb-copy-billing {
  font-size: 12px;
  font-weight: 600;
  color: #0b3d66;
  background: #eef2f6;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
  white-space: nowrap;
}
.bpb-copy-billing:hover {
  background: #e2e8f0;
}

/* ---- Order summary polish (BrightPay checkout only) ---- */
/* Hide the placeholder thumbnail (and the qty badge nested in it); the "Seats: N" line below the
   product name shows the quantity reliably instead. */
body.bpb-checkout .wc-block-components-order-summary-item__image {
  display: none;
}
body.bpb-checkout .wc-block-components-order-summary-item {
  padding: 8px 0;
}
/* The per-seat rows share one product; keep them tight and readable. */
body.bpb-checkout .wc-block-components-product-metadata__description {
  font-size: 12px;
  color: #6b7280;
}

/* ---- BrightPay fields group (moved just above the payment options by bpb.js) ----
   Grid layout: every field full width, except delegate/admin first + last name side by side.
   The grid gap gives one even spacing everywhere (replaces the old float layout, whose
   margin-top on the email field collapsed against the floats). */
body.bpb-checkout .bpb-fields-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  border: 1px solid #e3e6ea;
  border-radius: 10px;
  padding: 20px;
  margin: 8px 0 24px;
  background: #fff;
}
body.bpb-checkout .bpb-fields-group > * {
  grid-column: 1 / -1; /* full width by default */
  float: none;
  width: auto;
  margin: 0 !important; /* spacing comes from the grid gap */
}
/* First + last name: half width each, side by side. */
body.bpb-checkout .bpb-fields-group [class*="tpc-bpb-seat-"][class*="-first"],
body.bpb-checkout .bpb-fields-group [class*="tpc-bpb-seat-"][class*="-last"],
body.bpb-checkout .bpb-fields-group [class*="tpc-bpb-admin-"][class*="-first"],
body.bpb-checkout .bpb-fields-group [class*="tpc-bpb-admin-"][class*="-last"] {
  grid-column: auto;
}
/* "Licence admin" / "Delegate N" heading: divider line + even space above. */
body.bpb-checkout .bpb-fields-group .bpb-delegate-heading {
  border-top: 1px solid #e3e6ea;
  padding-top: 16px;
}

/* "Are you a BrightPay customer?" dropdown — styled like the WooCommerce text inputs
   (label small inside the top of the box, white background, arrow on the right). Overrides
   the theme's dark <select> styling. */
body.bpb-checkout .bpb-fields-group .wc-blocks-components-select__container {
  position: relative;
  display: block;
  width: 100%;
}
body.bpb-checkout .bpb-fields-group .wc-blocks-components-select__label {
  position: absolute;
  top: 6px;
  left: 13px;
  z-index: 1;
  margin: 0;
  font-size: 13px;
  line-height: 1.2;
  color: #757575;
  pointer-events: none;
}
body.bpb-checkout .bpb-fields-group select.wc-blocks-components-select__select {
  display: block;
  width: 100%;
  height: 50px;
  margin: 0;
  padding: 20px 40px 4px 12px;
  background: #fff;
  color: #1e1e1e;
  border: 1px solid #949494;
  border-radius: 4px;
  box-shadow: none;
  font-size: 16px;
  line-height: 1.4;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
}
body.bpb-checkout
  .bpb-fields-group
  select.wc-blocks-components-select__select:focus {
  outline: none;
  border-color: #0b3d66;
  box-shadow: 0 0 0 1px #0b3d66;
}
body.bpb-checkout .bpb-fields-group .wc-blocks-components-select__expand {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  pointer-events: none;
}

@media (max-width: 480px) {
  /* Stack everything on small screens. */
  body.bpb-checkout .bpb-fields-group {
    grid-template-columns: 1fr;
    padding: 16px;
  }
  body.bpb-checkout .bpb-fields-group [class*="tpc-bpb-seat-"][class*="-first"],
  body.bpb-checkout .bpb-fields-group [class*="tpc-bpb-seat-"][class*="-last"],
  body.bpb-checkout
    .bpb-fields-group
    [class*="tpc-bpb-admin-"][class*="-first"],
  body.bpb-checkout
    .bpb-fields-group
    [class*="tpc-bpb-admin-"][class*="-last"] {
    grid-column: 1 / -1;
  }
}

/* ---- Seats quantity form (printed by PHP, moved into the Order Summary by bpb.js) ---- */
/* Hidden until bpb.js places it, to avoid a flash above the checkout. */
.bpb-qty-form {
  display: none;
}
body.bpb-qty-placed .bpb-qty-form,
body.bpb-qty-fallback .bpb-qty-form {
  display: block;
  margin: 10px 0 0;
}
.bpb-qty-form__label {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin: 0 0 6px;
}
.bpb-qty-form__row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.bpb-qty {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
  height: 34px;
}
.bpb-qty .bpb-qty__btn {
  width: 32px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: #0b3d66;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.bpb-qty .bpb-qty__btn:hover:not(:disabled) {
  background: #eef2f6;
}
.bpb-qty .bpb-qty__btn:disabled {
  color: #cbd5e0;
  cursor: not-allowed;
}
.bpb-qty .bpb-qty__input {
  width: 44px;
  min-height: 0;
  height: auto;
  padding: 0;
  margin: 0;
  border: 0;
  border-left: 1px solid #e3e6ea;
  border-right: 1px solid #e3e6ea;
  border-radius: 0;
  background: #fff;
  color: #111827;
  font-size: 14px;
  text-align: center;
  box-shadow: none;
  -moz-appearance: textfield;
  appearance: textfield;
}
.bpb-qty .bpb-qty__input::-webkit-outer-spin-button,
.bpb-qty .bpb-qty__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.bpb-qty-form .bpb-qty-form__update {
  height: 34px;
  padding: 0 14px;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #0b3d66;
  background: #eef2f6;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  cursor: pointer;
}
.bpb-qty-form .bpb-qty-form__update:hover {
  background: #e2e8f0;
}

/* Checkout banner placed directly above the Order Summary (right-hand sidebar) by bpb.js. */
.bpb-cobrand.bpb-cobrand--summary {
  margin: 0 0 16px;
  padding: 0px;
}
/* Space between the page intro text ("Don't have an account?…") and the checkout, so neither the
   logo (sidebar) nor "Contact information" (main column) sits tight against it. Applies on all
   screen sizes; on tablet/mobile the stacked banner is the first thing in the checkout, so it
   gets the same gap (replaces the old stacked-only margin, which would now double up). */
body.bpb-checkout .wp-block-woocommerce-checkout {
  margin-top: 32px;
}
.bpb-cobrand.bpb-cobrand--summary .bpb-cobrand__logo {
  max-width: 100%;
}

/* Tablet/mobile: hide WooCommerce's duplicate (top) Order Summary — bpb.js adds this class only
   when two summaries are visible at once, keeping the one above Place Order. */
body.bpb-checkout
  .wp-block-woocommerce-checkout-order-summary-block.bpb-summary-hidden {
  display: none !important;
}

/* Tablet/mobile: the stacked Order Summary — border + inner spacing so the title, prices and
   totals don't touch the edges (bpb.js adds .bpb-summary--stacked only in the stacked layout). */
body.bpb-checkout
  .wp-block-woocommerce-checkout-order-summary-block.bpb-summary--stacked {
  padding: 0 16px;
  box-sizing: border-box;
  overflow: hidden;
}

/* Tablet/mobile stacked Order Summary: no space above the "ORDER SUMMARY" title bar, and no
   top/bottom divider lines around it (WooCommerce draws those on the collapsible title). */
body.bpb-checkout
  .wp-block-woocommerce-checkout-order-summary-block.bpb-summary--stacked {
  margin-top: 0;
  padding-top: 0;
}
body.bpb-checkout
  .bpb-summary--stacked
  .wc-block-components-checkout-order-summary__title {
  margin-top: 0;
  border-top: 0;
  border-bottom: 0;
}

body.bpb-checkout .bpb-fields-group {
  background: transparent;
  padding-left: 0px;
  padding-right: 0px;
  border: 0px;
}

#template_header_image img {
  max-width: 250px;
  height: auto;
}

td#template_header_image img {
  width: 200px;
}
