/**
 * Unified guest top bar — web + Capacitor (P1).
 * Include after css/shared-tokens.css on guest pages.
 */
:root {
  --guest-topbar-bg: #1a3a8f;
  /* Padding below safe-area (Dynamic Island) + row + bottom pad — must match .guest-topbar */
  --guest-topbar-pad-below-island: 12px;
  --guest-topbar-pad-bottom: 12px;
  --guest-topbar-row-min: 48px;
  --guest-topbar-stack-offset: calc(
    var(--guest-topbar-pad-below-island) + var(--guest-topbar-row-min) +
      var(--guest-topbar-pad-bottom)
  );
  /* Same as “My bookings” for optical balance */
  --guest-topbar-text-size: 13px;
  /* Minimum horizontal breathing room for center title vs. Dynamic Island / notch */
  --guest-topbar-brand-inset-x: clamp(14px, 5.5vw, 44px);
  /* Space between centered brand cluster and right-aligned “My bookings” */
  --guest-topbar-end-inset: clamp(20px, 5.5vw, 40px);
  /* Extra air inside the bar before the right screen edge (beyond safe area) */
  --guest-topbar-edge-pad: max(28px, calc(10px + env(safe-area-inset-right, 0px)));
}

.guest-topbar {
  /* Two columns under the hood; brand spans full width and centers so home+logo
     sit on the true viewport axis (not shifted by uneven side content). */
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto;
  align-items: center;
  column-gap: 0;
  padding-top: calc(
    env(safe-area-inset-top, 0px) + var(--guest-topbar-pad-below-island)
  );
  padding-bottom: var(--guest-topbar-pad-bottom);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: var(--guest-topbar-edge-pad);
  background: var(--color-brand, var(--guest-topbar-bg));
  color: #fff;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: calc(
    env(safe-area-inset-top, 0px) + var(--guest-topbar-pad-below-island) +
      var(--guest-topbar-row-min) + var(--guest-topbar-pad-bottom)
  );
  box-sizing: border-box;
  /* Reliable sticky stacking in WKWebView while scrolling the document */
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.guest-topbar__slot--start,
.guest-topbar__slot--end {
  min-width: 0;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 1;
}

.guest-topbar__slot--start {
  grid-column: 1;
  grid-row: 1;
  justify-content: flex-start;
}

.guest-topbar__slot--end {
  grid-column: 2;
  grid-row: 1;
  justify-content: flex-end;
  padding-inline-start: var(--guest-topbar-end-inset);
}

.guest-topbar__brand {
  grid-column: 1 / -1;
  grid-row: 1;
  justify-self: center;
  align-self: center;
  z-index: 0;
  pointer-events: none;
  /* One centered unit: home glyph + wordmark */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: max-content;
  max-width: min(320px, calc(100vw - 13rem));
  min-width: 0;
  box-sizing: border-box;
  font-size: var(--guest-topbar-text-size);
  line-height: 1.2;
  color: #fff;
  /* Horizontal inset keeps “Booksunbed.com” out of the Dynamic Island column */
  padding-inline: var(--guest-topbar-brand-inset-x);
}

.guest-topbar__brand a {
  pointer-events: auto;
}

.guest-topbar__home {
  color: inherit;
  line-height: 0;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border-radius: 4px;
  flex-shrink: 0;
  opacity: 0.98;
}

.guest-topbar__home-icon {
  display: block;
  width: 1.2em;
  height: 1.2em;
  flex-shrink: 0;
}

.guest-topbar__home:hover,
.guest-topbar__home:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.45);
  outline-offset: 2px;
}

/* Tappable home control (left) — iOS / mobile */
.guest-topbar__home-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s ease, transform 0.1s ease;
}

.guest-topbar__home-btn:active {
  background: rgba(255, 255, 255, 0.32);
  transform: scale(0.96);
}

.guest-topbar__home-btn .guest-topbar__home-icon {
  width: 20px;
  height: 20px;
}

.guest-topbar__brand--logo-only {
  gap: 0;
}

.guest-topbar__logo-btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.guest-topbar__logo-btn:active {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
}

.guest-topbar__bookings:active {
  color: #fff;
  opacity: 0.85;
}

.guest-topbar__logo {
  color: #fff;
  font-size: inherit;
  font-weight: 700;
  letter-spacing: -0.2px;
  text-decoration: none;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guest-topbar__logo:hover,
.guest-topbar__logo:focus-visible {
  text-decoration: underline;
}

.guest-topbar__bookings {
  color: rgba(255, 255, 255, 0.88);
  font-size: var(--guest-topbar-text-size);
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  padding-block: 6px;
  padding-inline-start: clamp(14px, 3.5vw, 26px);
  /* Clear inset from bar edge (bar already adds safe area + --guest-topbar-edge-pad) */
  padding-inline-end: 4px;
  text-align: end;
}

.guest-topbar__bookings:hover,
.guest-topbar__bookings:focus-visible {
  color: #fff;
  text-decoration: underline;
}

.guest-topbar__back {
  color: rgba(255, 255, 255, 0.95);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  max-width: 100%;
  min-width: 0;
}

.guest-topbar__back svg {
  flex-shrink: 0;
  stroke: currentColor;
}

.guest-topbar__back:hover,
.guest-topbar__back:focus-visible {
  color: #fff;
  text-decoration: underline;
}

.guest-topbar__back--text {
  font-weight: 500;
  font-size: 13px;
}

.guest-bridge-main {
  padding: 1.5rem 1rem;
  text-align: center;
  color: #374151;
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.5;
}
