.afb-runtime-loader {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  pointer-events: none;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.afb-runtime-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.afb-runtime-loader__spinner {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  border: 5px solid rgba(100, 116, 139, 0.35);
  border-top-color: #f43f5e;
  animation: afb-runtime-spin 0.8s linear infinite;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.65);
}

.afb-runtime-error {
  position: fixed;
  z-index: 9999;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: none;
  max-width: 560px;
  width: calc(100% - 32px);
  background: #fff;
  border: 1px solid #ef4444;
  color: #991b1b;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.afb-runtime-error.is-visible {
  display: block;
}

/* Runtime page layout normalization (full-viewport, full-width) */
body.afb-booking-runtime-page {
  overflow-x: hidden;
}

.afb-booking-runtime-scope {
  --afb-admin-bar-height: 0px;
}

.afb-booking-runtime-embedded {
  overflow-x: hidden;
}

body.afb-booking-runtime-page #booking-app input.hidden-checkbox,
.afb-booking-runtime-embedded #booking-app input.hidden-checkbox {
  display: none !important;
  position: absolute !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.afb-booking-runtime-scope input[type="search"]::-webkit-search-cancel-button,
.afb-booking-runtime-scope input[type="search"]::-webkit-search-decoration,
.afb-booking-runtime-scope input[type="search"]::-webkit-search-results-button,
.afb-booking-runtime-scope input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

body.afb-booking-runtime-page > .widget_shopping_cart_live_region.screen-reader-text {
  position: fixed !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
  left: -9999px !important;
  top: -9999px !important;
  bottom: auto !important;
}

body.afb-booking-runtime-page,
body.afb-booking-runtime-page main.afb-booking-runtime-main,
body.afb-booking-runtime-page #booking-app,
body.afb-booking-runtime-page #booking-app > form,
body.afb-booking-runtime-page #booking-app > form > section:first-child {
  min-height: calc(100vh - var(--afb-admin-bar-height, 0px));
}

body.afb-booking-runtime-page .booking-form,
body.afb-booking-runtime-page main.afb-booking-runtime-main .booking-form,
body.afb-booking-runtime-page #booking-app .booking-form,
.afb-booking-runtime-embedded .booking-form,
.afb-booking-runtime-embedded #booking-app .booking-form {
  margin: 0 !important;
}

body.afb-booking-runtime-page #booking-app .afb-booking-body-region,
.afb-booking-runtime-embedded #booking-app .afb-booking-body-region {
  position: relative;
  z-index: 0;
}

body.afb-booking-runtime-page #booking-app .afb-booking-content-shell,
.afb-booking-runtime-embedded #booking-app .afb-booking-content-shell {
  position: relative;
  z-index: 0;
}

body.afb-booking-runtime-page #booking-app .afb-booking-inner-shell,
.afb-booking-runtime-embedded #booking-app .afb-booking-inner-shell {
  position: relative;
  z-index: 1;
}

.afb-booking-runtime-scope .aff-number-input-shell {
  display: flex;
  align-items: stretch;
}

.afb-booking-runtime-scope .aff-number-input-shell > div:first-child {
  margin-top: 0;
  white-space: normal;
}

.afb-booking-runtime-scope .aff-inline-input-shell {
  display: flex;
  align-items: stretch;
}

.afb-booking-runtime-scope .aff-inline-input-label {
  min-width: 0;
}

.afb-booking-runtime-scope .aff-inline-input-label > .cs-mask {
  flex: 0 0 auto;
}

.afb-booking-runtime-scope .aff-inline-input-label-text {
  line-height: 1.15;
}

.afb-booking-runtime-scope .aff-inline-input-field {
  min-width: 0;
}

.afb-booking-runtime-scope .aff-date-picker-root {
  position: relative;
}

.afb-booking-runtime-scope .aff-date-picker-input {
  cursor: pointer;
  background: #fff;
}

.afb-booking-runtime-scope .aff-date-picker-popover {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 60;
  width: 420px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 16px;
  border: 1px solid #c8edfa;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.12);
}

.afb-booking-runtime-scope .aff-date-picker-popover--datetime {
  width: 560px;
  max-width: min(560px, calc(100vw - 32px));
}

.afb-booking-runtime-scope .aff-date-picker-panel__section + .aff-date-picker-panel__section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e6f7fd;
}

.afb-booking-runtime-scope .aff-date-picker-panel__label {
  margin-bottom: 12px;
  color: #111827;
  font-size: 0.95rem;
  font-weight: 600;
}

.afb-booking-runtime-scope .aff-date-picker-panel__hint {
  margin: 10px 0 0;
  color: #64748b;
  font-size: 0.875rem;
  line-height: 1.45;
}

.afb-booking-runtime-scope .aff-date-picker-panel__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.afb-booking-runtime-scope .aff-date-picker-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.afb-booking-runtime-scope .aff-date-picker-toolbar__title {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
  color: #111827;
  font-size: 1rem;
  font-weight: 700;
}

.afb-booking-runtime-scope .aff-date-picker-grid {
  display: grid;
  gap: 10px;
}

.afb-booking-runtime-scope .aff-date-picker-grid--months,
.afb-booking-runtime-scope .aff-date-picker-grid--weekdays {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.afb-booking-runtime-scope .aff-date-picker-grid--years {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.afb-booking-runtime-scope .aff-date-picker-option,
.afb-booking-runtime-scope .aff-date-picker-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  border: 1px solid #c8edfa;
  background: #fff;
  color: #0f172a;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.afb-booking-runtime-scope .aff-date-picker-option:hover:not(.is-disabled),
.afb-booking-runtime-scope .aff-date-picker-action:hover:not(.is-disabled):not(:disabled) {
  border-color: #2ac4ea;
  background: #edfafe;
  color: #0891b2;
}

.afb-booking-runtime-scope .aff-date-picker-option.is-selected {
  border-color: #2ac4ea;
  background: #2ac4ea;
  color: #fff;
}

.afb-booking-runtime-scope .aff-date-picker-option.is-disabled,
.afb-booking-runtime-scope .aff-date-picker-action.is-disabled,
.afb-booking-runtime-scope .aff-date-picker-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.afb-booking-runtime-scope .aff-date-picker-action--primary {
  border-color: #2ac4ea;
  background: #2ac4ea;
  color: #fff;
}

.afb-booking-runtime-scope .aff-date-picker-action--primary:hover:not(.is-disabled):not(:disabled) {
  background: #21b7da;
  color: #fff;
}

.afb-booking-runtime-scope .aff-date-picker-time__grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.afb-booking-runtime-scope .aff-date-picker-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.afb-booking-runtime-scope .aff-date-picker-field__label {
  color: #475569;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.afb-booking-runtime-scope .aff-date-picker-field__control {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid #c8edfa;
  border-radius: 14px;
  background: #fff;
  color: #0f172a;
  font-size: 1rem;
  line-height: 1.2;
}

.afb-booking-runtime-scope .aff-date-picker-field__control:focus {
  outline: none;
  border-color: #2ac4ea;
  box-shadow: 0 0 0 3px rgba(42, 196, 234, 0.16);
}

.afb-booking-runtime-scope .aff-date-picker-popover .vc {
  position: static;
  width: 100%;
  min-width: 0;
  max-width: none;
  margin-top: 0;
  box-shadow: none;
  border: 0;
}

.afb-booking-runtime-scope button.cs-form-button-next.is-loading-inline::before,
.afb-booking-runtime-scope button.cs-form-button-next.is-loading-inline::after {
  content: none !important;
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  -webkit-mask-image: none !important;
  mask-image: none !important;
  background: transparent !important;
  width: 0 !important;
  height: 0 !important;
}

.afb-booking-runtime-scope button.aff-form-button-submit.is-summary {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 200px;
  min-height: 60px;
  padding: 18px 4.375rem 18px 1.875rem !important;
  border: 0 !important;
  border-radius: 9999px !important;
  background-color: transparent !important;
  background-image: linear-gradient(90deg, #2ac4ea 0%, #ff2a6b 100%) !important;
  color: #fff !important;
  font-family: Poppins, sans-serif;
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.875rem;
  text-transform: uppercase;
  text-decoration: none !important;
  box-shadow: none;
  overflow: hidden;
  cursor: pointer;
}

.afb-booking-runtime-scope button.aff-form-button-submit.is-summary:hover,
.afb-booking-runtime-scope button.aff-form-button-submit.is-summary:focus {
  color: #fff !important;
  text-decoration: none !important;
  opacity: 1;
}

.afb-booking-runtime-scope button.aff-form-button-submit.is-summary .aff-button-label {
  color: inherit;
}

.afb-booking-runtime-scope button.aff-form-button-submit.is-summary:disabled,
.afb-booking-runtime-scope button.aff-form-button-submit.is-summary.is-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.afb-booking-runtime-scope .aff-summary-edit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  min-height: 48px;
  padding: 0 1.25rem;
  border: 0;
  border-radius: 9999px;
  background: #64d5f0;
  color: #fff;
  font-family: Poppins, sans-serif;
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.afb-booking-runtime-scope .aff-summary-edit-button:hover,
.afb-booking-runtime-scope .aff-summary-edit-button:focus {
  background: #2ac4ea;
  color: #fff;
  text-decoration: none;
}

@media (max-width: 767px) {
  .afb-booking-runtime-scope .aff-number-input-shell {
    flex-direction: column;
  }

  .afb-booking-runtime-scope .aff-inline-input-shell {
    flex-direction: column;
  }

  .afb-booking-runtime-scope .aff-date-picker-popover,
  .afb-booking-runtime-scope .aff-date-picker-popover--datetime {
    width: 100%;
  }

  .afb-booking-runtime-scope .aff-date-picker-grid--years {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .afb-booking-runtime-scope .aff-number-input-shell {
    justify-content: space-between;
    align-items: center;
  }

  .afb-booking-runtime-scope .aff-inline-input-shell {
    display: grid;
    /* 50:50 split — label column and field column are equal width regardless
       of label text length. JS-set --aff-inline-label-width is ignored here. */
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    column-gap: 24px;
  }

  .afb-booking-runtime-scope .aff-inline-input-label {
    /* No more white-space: nowrap — long labels (e.g. "VI SÆTTER DIN IS UD
       FØR DET VALGTE TIDSPUNKT") were overflowing past the constrained
       label column at 768-1024px viewports and visually colliding with
       the field input. Wrapping to 2-3 lines keeps the field column
       intact. */
    min-width: 0;
  }

  .afb-booking-runtime-scope .aff-inline-input-label .aff-inline-input-label-text {
    white-space: normal;
    overflow-wrap: break-word;
  }

  .afb-booking-runtime-scope .aff-inline-input-field {
    width: 100%;
  }

  .afb-booking-runtime-scope .aff-date-picker-popover--datetime {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(220px, 0.9fr);
    gap: 18px;
  }

  .afb-booking-runtime-scope .aff-date-picker-popover--datetime .aff-date-picker-panel__section {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  .afb-booking-runtime-scope .aff-date-picker-popover--datetime .aff-date-picker-panel__section--side {
    padding-left: 18px;
    border-left: 1px solid #e6f7fd;
  }

  .afb-booking-runtime-scope .aff-date-picker-grid--months {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.afb-booking-runtime-scope .afb-booking-content-block {
  width: 100%;
  grid-column: 1 / -1;
  justify-self: stretch;
  margin: 0 0 24px;
  color: #111827;
}

.afb-booking-runtime-scope .afb-booking-content-block.is-display-card {
  margin-bottom: 30px;
  padding: 24px;
  border: 2px solid #c8edfa;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

@media (min-width: 768px) {
  .afb-booking-runtime-scope .afb-booking-content-block.is-display-card {
    padding: 30px;
  }
}

.afb-booking-runtime-scope .acf-innerblocks-container {
  margin-top: 0;
}

.afb-booking-runtime-scope .aff-step-desc + .acf-innerblocks-container {
  margin-top: 1.25rem;
}

@media (min-width: 1024px) {
  .afb-booking-runtime-scope .aff-step-desc + .acf-innerblocks-container {
    margin-top: 1.75rem;
  }
}

.afb-booking-runtime-scope .afb-booking-content-block > *:last-child {
  margin-bottom: 0;
}

.afb-booking-runtime-scope .afb-booking-content-block p {
  margin: 0 0 1em;
}

.afb-booking-runtime-scope .afb-booking-content-block h1,
.afb-booking-runtime-scope .afb-booking-content-block h2,
.afb-booking-runtime-scope .afb-booking-content-block h3,
.afb-booking-runtime-scope .afb-booking-content-block h4,
.afb-booking-runtime-scope .afb-booking-content-block h5,
.afb-booking-runtime-scope .afb-booking-content-block h6 {
  margin: 0 0 0.5em;
  font-weight: 600;
  line-height: 1.2;
}

.afb-booking-runtime-scope .afb-booking-content-block ul,
.afb-booking-runtime-scope .afb-booking-content-block ol {
  margin: 0 0 1em;
  padding-left: 1.5em;
}

.afb-booking-runtime-scope .afb-booking-content-block ul {
  list-style: disc;
}

.afb-booking-runtime-scope .afb-booking-content-block ol {
  list-style: decimal;
}

.afb-booking-runtime-scope .afb-booking-content-block li + li {
  margin-top: 0.35em;
}

.afb-booking-runtime-scope .afb-booking-content-block a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.afb-booking-runtime-scope .afb-booking-content-block img {
  display: block;
  max-width: 100%;
  height: auto;
}

.afb-booking-runtime-scope .afb-booking-content-block iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  border: 0;
}

.afb-booking-runtime-scope .afb-booking-content-block .has-text-align-center {
  text-align: center;
}

.afb-booking-runtime-scope .afb-booking-content-block .has-text-align-right {
  text-align: right;
}

.afb-booking-runtime-scope .afb-booking-content-block .has-text-align-left {
  text-align: left;
}

.afb-booking-runtime-scope .afb-booking-content-block .wp-block-quote {
  display: block;
  width: 100%;
  margin: 0 auto 1.5em;
  padding: 0;
  border-left: 0;
  text-align: center;
  max-width: none;
  font-size: clamp(1.25rem, 1rem + 1vw, 2rem);
  line-height: 1.2;
  font-weight: 400;
  color: #111827;
  box-sizing: border-box;
}

.afb-booking-runtime-scope .afb-booking-content-block .wp-block-quote.afb-booking-quote-block {
  padding-top: 15px;
  padding-bottom: 15px;
}

@media (max-width: 767px) {
  .afb-booking-runtime-scope h1.af-h1 {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }

  /* Match NumberInput's tightened mobile padding across all other input shells
     (TextInput, EmailInput, PhoneInput, TextArea, DatePicker, TimePicker, GoogleMap).
     Bundle's px-30p = 30px is too generous at 320px; 15px each side fits comfortably. */
  .afb-booking-runtime-scope .aff-inline-input-shell {
    padding-left: 15px !important;
    padding-right: 15px !important;
  }

}

/* DatePicker popover viewport-stretch — applies ONLY below 450px viewport.
   At 450px+, the popover reverts to the existing `width: 100%` of the shell
   parent (rule at line ~437), which matches the input width as the user wants.
   Offset math depends on shell padding-left = 15px + container padding = var(--cont-px) (16px).
   Target: popover left edge at viewport_x = 8px → offset = -(16 + 15 - 8) = -23px. */
@media (max-width: 449.98px) {
  .afb-booking-runtime-scope .aff-date-picker-popover,
  .afb-booking-runtime-scope .aff-date-picker-popover--datetime {
    width: calc(100vw - 16px);
    max-width: 400px;
    left: calc(-1 * (var(--cont-px, 16px) + 15px - 8px));
    min-width: 0;
  }
}

@media (min-width: 768px) {
  .afb-booking-runtime-scope .afb-booking-content-block .wp-block-quote.afb-booking-quote-block {
    padding-top: 40px;
    padding-bottom: 20px;
  }
}

@media (min-width: 1024px) {
  .afb-booking-runtime-scope .afb-booking-content-block .wp-block-quote.afb-booking-quote-block {
    padding-top: 55px;
    padding-bottom: 20px;
  }
}

.afb-booking-runtime-scope .afb-booking-content-block .wp-block-quote p {
  margin: 0;
  font-size: inherit;
  line-height: inherit;
  font-weight: inherit;
}

.afb-booking-runtime-scope .afb-booking-content-block .wp-block-quote cite {
  display: block;
  margin-top: 0.75em;
  font-size: 0.95em;
  opacity: 0.75;
  text-align: center;
}

.afb-booking-runtime-scope .afb-booking-content-block .wp-block-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.afb-booking-runtime-scope .afb-booking-content-block .wp-block-column {
  flex: 1 1 0;
  min-width: 220px;
}

.afb-booking-runtime-scope .afb-booking-content-block .wp-block-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.afb-booking-runtime-scope .afb-booking-content-block .wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  background: #0e7bc0;
  color: #fff;
  text-decoration: none;
}

.afb-booking-runtime-scope .aff-bartender-grid-two-col {
  column-gap: 30px !important;
}

.afb-booking-runtime-scope .aff-price-single-row {
  grid-template-columns: repeat(9, minmax(0, 1fr));
}

.afb-booking-runtime-scope .aff-price-single-media,
.afb-booking-runtime-scope .aff-price-single-body,
.afb-booking-runtime-scope .aff-price-single-price {
  grid-column: 1 / -1;
}

@media (min-width: 768px) {
  .afb-booking-runtime-scope .aff-price-single-row {
    grid-template-columns: 77px minmax(0, 1fr) auto;
  }

  .afb-booking-runtime-scope .aff-price-single-media {
    grid-column: 1;
  }

  .afb-booking-runtime-scope .aff-price-single-body {
    grid-column: 2;
  }

  .afb-booking-runtime-scope .aff-price-single-price {
    grid-column: 3;
  }
}

@media (max-height: 860px) {
  body.afb-booking-runtime-page #booking-app > form > section:first-child {
    min-height: calc(100vh - var(--afb-admin-bar-height, 0px));
  }
}

@keyframes afb-runtime-spin {
  to {
    transform: rotate(360deg);
  }
}

/*
 * Payment gateway picker
 * ----------------------
 * The picker renders full width on the summary step. Themes commonly style
 * every `[type=radio]` globally (absolute positioning, oversized boxes), and
 * the plugin's utility classes are emitted inside `:where()` — zero
 * specificity — so the theme wins and the control is torn out of its row.
 * Re-assert the row layout here, where the selector carries real specificity.
 */
.afb-booking-runtime-scope .afb-payment-gateway-option {
  display: block;
  width: 100%;
}

.afb-booking-runtime-scope .afb-payment-gateway-option input[type="radio"] {
  position: static;
  flex: 0 0 auto;
  width: 20px;
  min-width: 20px;
  height: 20px;
  margin: 0;
  inset: auto;
  accent-color: #2b76ed;
}
