/* Full-screen booking overlay, see /booking-overlay.js. The booking card
   (.chk-tool) itself becomes the overlay; the widget inside is untouched. */

:root {
  --hdp-ov-pad: 16px;
}

.hdp-ov-bar {
  display: none;
}

/* The hero's inner grid is a stacking context (z-index: 1) below the header
   (z-index: 20). While the overlay is open it is lifted above everything but
   the consent banner (2000), which must stay answerable. */
html.hdp-ov-open .chk-hero__inner {
  z-index: 1500;
}

html.hdp-ov-open .sticky-cta {
  display: none;
}

.chk-tool.is-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: auto;
  height: 100%;
  height: 100dvh;
  min-width: 0;
  margin: 0;
  padding: 0 var(--hdp-ov-pad) calc(28px + env(safe-area-inset-bottom, 0px));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  border-radius: 0;
  background: var(--white, #fff);
  box-shadow: none;
  animation: hdp-ov-in 180ms ease-out;
}

/* Room for the consent banner, which sits over the bottom of the overlay. */
body.consent-open .chk-tool.is-overlay {
  padding-bottom: 180px;
}

.chk-tool.is-overlay > .hdp-ov-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  margin: 0 calc(-1 * var(--hdp-ov-pad)) 14px;
  padding: 8px 8px 8px var(--hdp-ov-pad);
  border-bottom: 1px solid rgba(17, 26, 43, 0.1);
  background: var(--white, #fff);
}

.hdp-ov-bar__title {
  display: flex;
  flex-direction: column;
  min-width: 0;
  color: var(--ink, #111a2b);
  line-height: 1.25;
}

.hdp-ov-bar__title strong {
  font-size: 17px;
  font-weight: 800;
}

.hdp-ov-bar__sub {
  overflow: hidden;
  color: var(--muted, #5b6675);
  font-size: 12.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.hdp-ov-bar__sub:empty {
  display: none;
}

.hdp-ov-close {
  display: grid;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #eef1f4;
  color: var(--ink, #111a2b);
  cursor: pointer;
}

.hdp-ov-close:hover {
  background: #e1e6ec;
}

.hdp-ov-close svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
}

/* Wider screens: the same card, centred in a full-screen sheet. */
@media (min-width: 760px) {
  .chk-tool.is-overlay {
    --hdp-ov-pad: max(24px, calc((100vw - 720px) / 2));
  }

  .chk-tool.is-overlay > .hdp-ov-bar {
    padding-right: var(--hdp-ov-pad);
  }
}

@keyframes hdp-ov-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .chk-tool.is-overlay { animation: none; }
}
