/* GetYourGuide booking — host typography sync + modal */

:root {
  --gyg-font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gyg-radius: 0.5rem;
  --gyg-footer-trim-inline: 44px;
  /* Trimmed display height placeholder — updated by booking.js after first inline size. */
  --gyg-widget-height: 20rem;
}

.gyg-host {
  width: 100%;
  font-family: var(--gyg-font);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
}

/* GYG reads font-size + link color from a parent <p> */
.gyg-host__sync {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

.gyg-host__sync a {
  color: var(--gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.gyg-widget {
  width: 100%;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  border-radius: var(--gyg-radius);
  border: 1px solid rgba(240, 180, 41, 0.2);
  font-family: var(--gyg-font);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  isolation: isolate;
}

/* Reserve trimmed display height before GYG sizes — avoids CLS; JS takes over via .is-sized. */
.gyg-widget:not(.is-sized) {
  height: var(--gyg-widget-height);
  min-height: var(--gyg-widget-height);
}

/* Parent height is trimmed in booking.js after GYG postMessage resize. */
.gyg-widget iframe {
  display: block;
  width: 100% !important;
  max-width: 100%;
  margin: 0 auto;
  font-family: var(--gyg-font);
}

.gyg-widget--inline {
  max-width: none;
}

.gyg-widget__credit {
  margin: 0.75rem 0 0;
  font-family: var(--gyg-font);
  font-size: 0.72rem;
  line-height: 1.45;
  color: rgba(250, 248, 245, 0.35);
  text-align: center;
}

.gyg-widget__credit a {
  color: rgba(240, 180, 41, 0.55);
  font-weight: 600;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.gyg-widget__credit a:hover {
  color: #ffc94d;
}

.book-inline {
  width: 100%;
  margin: 1.5rem auto 0;
  text-align: center;
}

.pricing-compare__item .book-inline {
  margin-top: 1rem;
  text-align: left;
}

.gyg-host--modal {
  position: relative;
  background-color: #0e1018;
}

.gyg-host--modal .gyg-widget {
  background-color: #0e1018;
  border-color: rgba(240, 180, 41, 0.15);
}

/* ── Modal ── */
.book-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    max(0.75rem, env(safe-area-inset-top))
    max(0.75rem, env(safe-area-inset-right))
    max(0.75rem, env(safe-area-inset-bottom))
    max(0.75rem, env(safe-area-inset-left));
  pointer-events: none;
  visibility: hidden;
}

.book-modal.is-open {
  pointer-events: auto;
  visibility: visible;
}

.book-modal[hidden] {
  display: none !important;
}

.book-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 5, 10, 0.72);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.book-modal.is-open .book-modal__backdrop {
  opacity: 1;
}

.book-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: min(100%, 26rem);
  max-height: min(
    88svh,
    calc(100svh - 1.5rem - env(safe-area-inset-top) - env(safe-area-inset-bottom))
  );
  margin: 0 auto;
  padding: 1.25rem var(--pad);
  background: #0e1018;
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.45);
  overflow: hidden auto;
  transform: translateY(1.25rem) scale(0.97);
  opacity: 0;
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.35s ease;
  box-sizing: border-box;
}

.book-modal.is-open .book-modal__panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.book-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.book-modal__title {
  margin: 0;
  font-family: var(--gyg-font);
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.25;
}

.book-modal__close {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid rgba(250, 248, 245, 0.12);
  border-radius: var(--radius-round);
  background: rgba(250, 248, 245, 0.06);
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.book-modal__close:hover {
  background: rgba(250, 248, 245, 0.12);
}

.book-modal__close:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.gyg-widget--modal {
  max-width: none;
}

html.book-modal-open,
html.book-modal-open body {
  overflow: hidden;
}

@media (max-width: 768px) {
  :root {
    --gyg-footer-trim-inline: 62px;
  }
}

@media (min-width: 36rem) {
  .book-modal {
    padding: var(--pad);
  }

  .book-modal__panel {
    max-width: min(100%, var(--max-w, 40rem));
    max-height: calc(
      100svh - 2rem - env(safe-area-inset-top) - env(safe-area-inset-bottom)
    );
    overflow: hidden;
    padding: 1.25rem 1rem;
  }

  .gyg-host--modal,
  .gyg-widget--modal {
    width: 100%;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .book-modal__backdrop,
  .book-modal__panel {
    transition: none;
  }

  .book-modal__panel {
    transform: none;
    opacity: 1;
  }
}
