/*
 * vBooking Bridge price table layouts (docs/layouts-plan.md): Cards, Compact, Side by side.
 * Classic uses the theme's own styles and none of this.
 *
 * Every rule sits under the .vbk wrapper (two classes deep), so it beats a theme's general
 * rules (all links, all tables) without !important, never leaks into the rest of the page, and a
 * theme can still adjust it with its own specific rules. Fonts and text colour come from the
 * theme; the brand's colours arrive as --vbk-primary and --vbk-accent.
 */
.vbk {
  --vbk-primary-default: #1f2937;
  --vbk-accent-default: #b45309;
  --vbk-line: color-mix(in srgb, currentColor 14%, transparent);
  --vbk-soft: color-mix(in srgb, currentColor 4%, transparent);
  --vbk-muted: color-mix(in srgb, currentColor 65%, transparent);
  margin: 1.25em 0 1.75em;
  font: inherit;
  color: inherit;
  line-height: 1.45;
}
.vbk *,
.vbk *::before,
.vbk *::after {
  box-sizing: border-box;
}
.vbk p,
.vbk ul {
  margin: 0;
  padding: 0;
}
.vbk ul {
  list-style: none;
}

/* Shared pieces: price, offer, note, call button. */
.vbk .vbk-price {
  display: flex;
  flex-direction: column;
  gap: 0.1em;
}
.vbk .vbk-amount {
  font-size: 1.3em;
  font-weight: 700;
  color: var(--vbk-primary, var(--vbk-primary-default));
}
.vbk .vbk-offer {
  font-size: 0.85em;
  font-weight: 600;
  color: var(--vbk-accent, var(--vbk-accent-default));
}
.vbk .vbk-offer s {
  font-weight: 400;
  color: var(--vbk-muted);
}
.vbk .vbk-tax {
  font-size: 0.8em;
  color: var(--vbk-muted);
}
.vbk .vbk-note {
  margin-top: 0.75em;
  font-size: 0.85em;
  color: var(--vbk-muted);
}
.vbk .vbk-action {
  display: block;
  margin-top: 0.75em;
  padding: 0.6em 1em;
  border-radius: var(--vbk-radius, 8px);
  background: var(--vbk-primary, var(--vbk-primary-default));
  color: #fff;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}
.vbk .vbk-action:hover,
.vbk .vbk-action:focus-visible {
  filter: brightness(1.1);
  color: #fff;
}

/* Cards: one card per vehicle (or package), as many per row as fit. */
.vbk .vbk-cards__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
  gap: 1em;
}
.vbk .vbk-card {
  display: flex;
  flex-direction: column;
  gap: 0.3em;
  padding: 1em;
  border: 1px solid var(--vbk-line);
  border-radius: var(--vbk-radius, 8px);
}
.vbk .vbk-card__photo,
.vbk .vbk-vehicle__photo {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  margin: 0 0 0.5em;
  border-radius: calc(var(--vbk-radius, 8px) / 2);
  background: var(--vbk-soft);
}
.vbk .vbk-vehicle__photo {
  max-width: 32rem;
  margin-bottom: 1em;
}
.vbk .vbk-card__name {
  font-size: 1.1em;
  font-weight: 700;
}
.vbk .vbk-card__meta,
.vbk .vbk-card__extras {
  font-size: 0.9em;
  color: var(--vbk-muted);
}
.vbk .vbk-card__included {
  font-weight: 600;
}
.vbk .vbk-card .vbk-price {
  margin-top: auto;
  padding-top: 0.5em;
}

/* Compact: one line per vehicle (or package), price on the right. */
.vbk .vbk-compact__list {
  border: 1px solid var(--vbk-line);
  border-radius: var(--vbk-radius, 8px);
}
.vbk .vbk-compact__list > li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  padding: 0.7em 1em;
}
.vbk .vbk-compact__list > li + li {
  border-top: 1px solid var(--vbk-line);
}
.vbk .vbk-compact__name small {
  display: block;
  font-size: 0.85em;
  color: var(--vbk-muted);
}
.vbk.vbk-compact .vbk-price {
  align-items: flex-end;
  text-align: right;
  flex-shrink: 0;
}
/* On a phone the price's parts join the row's own grid: the amount (and "from") sit beside the
   name with the tax note under them, and an offer takes a line of its own below, so it can no
   longer squeeze the name. */
@media (max-width: 480px) {
  .vbk .vbk-compact__list > li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    /* The name spans two rows; the second takes what is left, so the tax note stays under the amount. */
    grid-template-rows: auto 1fr auto;
    align-items: start;
    gap: 0;
  }
  .vbk .vbk-compact__name {
    grid-column: 1;
    grid-row: 1 / span 2;
    padding-right: 1em;
  }
  .vbk.vbk-compact .vbk-price {
    display: contents;
  }
  .vbk.vbk-compact .vbk-from {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    margin-right: 0.3em;
  }
  /* A tight line, so the larger amount sits on the name's first line without pushing it down. */
  .vbk.vbk-compact .vbk-amount {
    grid-column: 3;
    grid-row: 1;
    line-height: 1.1;
  }
  .vbk.vbk-compact .vbk-tax {
    grid-column: 2 / 4;
    grid-row: 2;
    align-self: start;
  }
  .vbk.vbk-compact .vbk-offer {
    grid-column: 1 / -1;
    grid-row: 3;
    margin-top: 0.2em;
    text-align: left;
  }
}
/* A page's own rule for last children (an accordion's ".panel :last-child { margin-bottom }")
   must not shorten the last card or row, or pad a card below its button. These selectors are
   one step heavier than that rule on purpose; they are the stylesheet's one exception to
   "two classes deep". */
.vbk .vbk-cards__list > .vbk-card,
.vbk .vbk-compact__list > li {
  margin: 0;
}
.vbk .vbk-card > .vbk-action {
  margin-bottom: 0;
}

/* Side by side: vehicles as columns; scrolls inside its own box on narrow screens. */
.vbk .vbk-compare__scroll {
  overflow-x: auto;
  border: 1px solid var(--vbk-line);
  border-radius: var(--vbk-radius, 8px);
}
.vbk.vbk-compare table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  font-size: 0.95em;
}
.vbk.vbk-compare th,
.vbk.vbk-compare td {
  padding: 0.6em 0.8em;
  border: 0;
  border-bottom: 1px solid var(--vbk-line);
  text-align: left;
  vertical-align: top;
  min-width: 8.5em;
}
.vbk.vbk-compare thead th {
  font-weight: 700;
  /* Names that wrap stay next to their column. */
  vertical-align: bottom;
}
.vbk.vbk-compare tbody th {
  font-weight: 600;
  color: var(--vbk-muted);
  min-width: 6em;
}
.vbk.vbk-compare th:first-child {
  position: sticky;
  left: 0;
  /* Opaque over the scrolled cells, in the page's own background: a block theme's base and
     contrast colours, else the browser's (a theme may set --vbk-bg and --vbk-bg-text). */
  background: var(--vbk-bg, var(--wp--preset--color--base, Canvas));
  color: var(--vbk-bg-text, var(--wp--preset--color--contrast, CanvasText));
}
.vbk.vbk-compare tr:last-child > * {
  border-bottom: 0;
}

/* Trip lengths ([vbk_trip_lengths], includes/trip-lengths.php): jump links, then every length. */
.vbk.vbk-lengths__nav {
  margin: 0 0 1em;
}
.vbk.vbk-lengths__nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
}
.vbk.vbk-lengths__nav a {
  display: inline-block;
  min-height: 44px;
  box-sizing: border-box;
  padding: 0.6em 0.9em;
  border: 1px solid var(--vbk-line);
  border-radius: 999px;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}
.vbk-lengths .vbk-lengths__length {
  margin: 0 0 1.6em;
  scroll-margin-top: 5em;
}
.vbk-lengths .vbk-lengths__title {
  margin: 0 0 0.5em;
}

/* Trip lengths as one grid: vehicles down, lengths across; scrolls inside its own box. */
.vbk .vbk-grid__scroll {
  overflow-x: auto;
  border: 1px solid var(--vbk-line);
  border-radius: var(--vbk-radius, 8px);
}
.vbk.vbk-grid table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  font-size: 0.95em;
}
.vbk.vbk-grid th,
.vbk.vbk-grid td {
  padding: 0.6em 0.8em;
  border: 0;
  border-bottom: 1px solid var(--vbk-line);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}
.vbk.vbk-grid thead th {
  font-weight: 700;
}
.vbk.vbk-grid tbody th {
  min-width: 7em;
  font-weight: 600;
  white-space: normal;
}
.vbk.vbk-grid tbody th small {
  white-space: nowrap;
}
.vbk.vbk-grid tbody th small,
.vbk.vbk-grid .vbk-grid__km {
  display: block;
  color: var(--vbk-muted);
  font-size: 0.85em;
  font-weight: 400;
}
.vbk.vbk-grid th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--vbk-bg, var(--wp--preset--color--base, Canvas));
  color: var(--vbk-bg-text, var(--wp--preset--color--contrast, CanvasText));
}
.vbk.vbk-grid .vbk-grid__none {
  color: var(--vbk-muted);
}
.vbk.vbk-grid tr:last-child > * {
  border-bottom: 0;
}

/* Screen-reader-only text, for themes without the WordPress class. */
.vbk .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Asking for a price (includes/enquiry.php): enquiry-only licences and trips not priced online. */
.vbk-from {
  font-size: 0.8em;
  font-weight: 400;
  opacity: 0.75;
}
.vbk.vbk-ask {
  margin: 1em 0;
  padding: 1em 1.1em;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--vbk-radius, 8px);
}
.vbk-ask__title {
  margin: 0 0 0.3em;
  font-weight: 600;
}
.vbk-ask__text {
  margin: 0 0 0.6em;
}
.vbk-ask__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  margin: 0;
}
.vbk .vbk-ask__actions .vbk-action {
  display: inline-block;
  margin-top: 0;
}

/* Enquiry and booking forms (includes/forms.php, 0.9.0). Inherit the theme's fonts and colours. */
.vbk .vbk-ask__actions {
  align-items: flex-start;
}
.vbk-enquiry {
  flex-basis: 100%;
}
.vbk-enquiry > summary {
  display: inline-block;
  cursor: pointer;
  list-style: none;
}
.vbk-enquiry > summary::-webkit-details-marker {
  display: none;
}
.vbk-enquiry[open] > summary {
  opacity: 0.7;
}
.vbk-form {
  display: grid;
  gap: 0.6em;
  max-width: 34em;
  margin-top: 0.8em;
}
.vbk-form fieldset {
  display: grid;
  gap: 0.6em;
  margin: 0;
  padding: 0;
  border: 0;
}
.vbk-form legend {
  margin-bottom: 0.3em;
  font-weight: 600;
}
.vbk-form fieldset[hidden] {
  display: none;
}
.vbk-form__field {
  display: grid;
  gap: 0.25em;
  margin: 0;
}
.vbk-form__field label {
  font-size: 0.9em;
}
.vbk-form input,
.vbk-form select,
.vbk-form textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 2.6em;
  padding: 0.45em 0.6em;
  border: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: calc(var(--vbk-radius, 8px) / 2);
  font: inherit;
}
.vbk-form__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9em, 1fr));
  gap: 0.6em;
}
.vbk-form__actions {
  margin: 0.2em 0 0;
}
.vbk-form__actions .vbk-action {
  border: 0;
  cursor: pointer;
  font: inherit;
}
.vbk-form__actions .vbk-action[disabled] {
  opacity: 0.6;
  cursor: wait;
}
.vbk-form__status:empty,
.vbk-form__note:empty {
  display: none;
}
.vbk-form__status,
.vbk-form__note,
.vbk-form__done {
  margin: 0;
}
.vbk-form__status--problem {
  color: #b42318;
}
.vbk-form__note {
  font-size: 0.85em;
  opacity: 0.75;
}
.vbk-form__done {
  font-weight: 600;
}
.vbk-form__trip {
  margin: 0 0 0.75em;
  font-weight: 600;
}
.vbk-form__trip[hidden] {
  display: none;
}
.vbk-hp {
  position: absolute !important;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.vbk-booking__option {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.6em;
  align-items: center;
  padding: 0.6em 0.8em;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: calc(var(--vbk-radius, 8px) / 2);
}
.vbk-booking__option:has(input:checked) {
  border-color: var(--vbk-primary, currentColor);
  box-shadow: 0 0 0 1px var(--vbk-primary, currentColor);
}
.vbk-form .vbk-booking__option input {
  width: auto;
  min-height: 0;
}
.vbk-booking__vehicle {
  display: grid;
}
.vbk-booking__meta {
  font-size: 0.85em;
  opacity: 0.75;
}
.vbk-booking__price {
  font-weight: 600;
  white-space: nowrap;
}
.vbk-booking__options {
  display: grid;
  gap: 0.5em;
}
/* Several cars on one booking (plugin 0.10.0, ADR 0019): a count per vehicle. */
.vbk-booking__option--chosen {
  border-color: var(--vbk-primary, currentColor);
  box-shadow: 0 0 0 1px var(--vbk-primary, currentColor);
}
.vbk-booking__count {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
}
.vbk-booking__count output {
  min-width: 1.5em;
  text-align: center;
  font-weight: 600;
}
.vbk-form .vbk-booking__step {
  width: 2.2em;
  min-height: 2.2em;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 1.1em;
  line-height: 1;
  cursor: pointer;
}
.vbk-form .vbk-booking__step:disabled {
  opacity: 0.35;
  cursor: default;
}
/* initiate_enquiry's dialog (includes/webmcp.php): the enquiry form, opened by an assistant. */
.vbk-dialog {
  box-sizing: border-box;
  width: min(36em, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 1em 1.2em 1.2em;
  border: 1px solid var(--vbk-line);
  border-radius: var(--vbk-radius, 8px);
  font: inherit;
}
.vbk-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}
.vbk-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  margin-bottom: 0.4em;
  font-size: 1.1em;
}
.vbk-dialog__head form {
  margin: 0;
}
.vbk-dialog__close {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  background: none;
  color: inherit;
  font-size: 1.6em;
  line-height: 1;
  cursor: pointer;
}
.vbk-dialog .vbk-form {
  max-width: none;
}
.vbk-booking__selection {
  margin: 0.8em 0 0;
  font-weight: 600;
}
@media (max-width: 480px) {
  .vbk-booking__option {
    grid-template-columns: 1fr auto;
  }
  .vbk-booking__count {
    grid-column: 1 / -1;
    justify-self: end;
  }
}
