/* Booking / enquiry module. Uses the site's tokens (colours, radius, fonts) so it fits every theme.
   Link it after styles.css + theme: <link rel="stylesheet" href="/assets/css/booking.css"> */
@layer components {
  .booking-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: clamp(1.25rem, 1rem + 2vw, 2.25rem);
    box-shadow: var(--shadow);
    max-width: 44rem;
  }
  .booking-card .bk-promise { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin-block: 0 var(--space-m); padding: 0; list-style: none; font-size: var(--step--1); color: var(--color-muted); }
  .booking-card .bk-promise li { display: flex; gap: 0.4rem; align-items: center; }
  .booking-card .bk-promise li::before { content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--color-success, #1f7a4d); flex: none; }

  .bk-fields { display: grid; gap: var(--space-s); border: 0; margin: 0; padding: 0; min-width: 0; }
  .bk-fields legend { font-family: var(--font-heading); font-weight: var(--heading-weight); font-size: var(--step-1, 1.25rem); padding: 0; margin-block-end: var(--space-xs); }
  .bk-row { display: grid; gap: var(--space-s); }
  @media (min-width: 34rem) { .bk-row { grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); } }

  .bk-field { display: grid; gap: 0.35rem; min-width: 0; }
  .bk-field > span, .bk-field > label { font-weight: 600; font-size: var(--step--1); }
  .bk-field small { color: var(--color-muted); font-size: var(--step--1); }
  .bk-field input:not([type="checkbox"]):not([type="radio"]), .bk-field select, .bk-field textarea {
    width: 100%; min-height: 3rem; padding: 0.65rem 0.85rem;
    border: 1.5px solid var(--color-border); border-radius: var(--radius);
    background: var(--color-bg); color: var(--color-text); font-size: 1rem;    /* 16px: no zoom on iOS */
    transition: border-color 0.15s, box-shadow 0.15s;
  }
  .bk-field textarea { min-height: 6.5rem; resize: vertical; }
  .bk-field input:focus-visible, .bk-field select:focus-visible, .bk-field textarea:focus-visible {
    outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary), transparent 75%);
  }
  .bk-field input:user-invalid, .bk-field select:user-invalid, .bk-field textarea:user-invalid { border-color: #b3261e; }

  .bk-stepper { display: grid; grid-template-columns: 3rem 1fr 3rem; align-items: stretch; }
  .bk-stepper input { text-align: center; border-radius: 0 !important; -moz-appearance: textfield; }
  .bk-stepper input::-webkit-outer-spin-button, .bk-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
  .bk-stepper button { border: 1.5px solid var(--color-border); background: var(--color-tint); color: var(--color-text); font-size: 1.35rem; line-height: 1; cursor: pointer; }
  .bk-stepper button:first-child { border-radius: var(--radius) 0 0 var(--radius); border-right: 0; }
  .bk-stepper button:last-child { border-radius: 0 var(--radius) var(--radius) 0; border-left: 0; }
  .bk-stepper button:hover { background: var(--color-border); }

  .bk-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
  .bk-chips label { position: relative; }
  .bk-chips input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
  .bk-chips span { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0.5rem 1rem; border: 1.5px solid var(--color-border); border-radius: 999px; background: var(--color-bg); font-weight: 600; font-size: var(--step--1); }
  .bk-chips input:checked + span { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-primary-contrast); }
  .bk-chips input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--color-primary), transparent 60%); outline-offset: 2px; }

  .bk-summary { margin: 0; padding: 0.75rem 1rem; border-radius: var(--radius); background: var(--color-tint); font-weight: 600; }
  .bk-privacy { font-size: var(--step--1); color: var(--color-muted); }
  .bk-actions { display: flex; flex-wrap: wrap; gap: var(--space-s); align-items: center; }
  .bk-actions .btn { min-height: 3.25rem; }
  .bk-status { min-height: 1.25em; margin: 0; font-weight: 600; }
  .bk-status[data-bad="true"] { color: #b3261e; }
  .bk-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

  .bk-done { text-align: center; padding-block: var(--space-m); }
  .bk-done:focus { outline: none; }
  .bk-done .bk-check { width: 3.5rem; height: 3.5rem; margin: 0 auto var(--space-s); border-radius: 50%; display: grid; place-items: center; background: var(--color-success, #1f7a4d); color: #fff; }
  .bk-done .bk-check svg { width: 1.75rem; height: 1.75rem; stroke: currentColor; fill: none; stroke-width: 3; }
  .bk-done h3 { font-family: var(--font-heading); }
  .bk-done > * + * { margin-block-start: var(--space-xs); }
  .bk-test { color: #8a5a00; font-size: var(--step--1); }
  @media (prefers-reduced-motion: no-preference) {
    .bk-done:not([hidden]) .bk-check { animation: bk-pop 0.5s var(--ease, ease) both; }
    @keyframes bk-pop { from { transform: scale(0.4); opacity: 0; } to { transform: none; opacity: 1; } }
  }
}
