/**
 * Popups — front end.
 *
 * Colours come from the theme's design tokens so a popup inherits the site's palette and
 * responds to the light/dark toggle. The five background choices mirror the approved section
 * backgrounds (White, Light, Dark, Black, Magenta).
 *
 * Scroll-lock note: html.adm-pop-open freezes <html>, never <body>. Locking <body> makes it the
 * sticky header's scrollport, which re-anchors the header and sends it off-screen. Same fix as
 * html.adm-booking-open and html.menu-open.
 */

html.adm-pop-open { overflow: hidden; overscroll-behavior: none; }

.adm-pop-root[hidden] { display: none; }

.adm-pop-root {
  position: fixed;
  inset: 0;
  z-index: 2147483000;            /* below the booking sheet (…001) so booking always wins */
  display: flex;
  padding: clamp(12px, 4vw, 40px);
  background: rgba(10, 10, 10, 0);
  -webkit-backdrop-filter: blur(0);
  backdrop-filter: blur(0);
  transition: background .3s ease, backdrop-filter .3s ease;
}
.adm-pop-root.is-open {
  background: rgba(10, 10, 10, var(--pop-dim, .55));
  -webkit-backdrop-filter: blur(var(--pop-blur, 3px));
  backdrop-filter: blur(var(--pop-blur, 3px));
}

/* ── The panel ───────────────────────────────────────────────────────── */
.adm-pop {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  max-width: var(--pop-w, 560px);
  max-height: calc(100vh - 24px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: clamp(20px, 3vw, 34px);
  border-radius: var(--pop-r, 16px);
  border: 1px solid var(--color-border, rgba(0, 0, 0, .1));
  background: var(--color-surface-1, #fff);
  color: var(--color-text, #0a0a0a);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .45);
  transition: transform .42s cubic-bezier(.16, 1, .3, 1), opacity .42s ease;
  will-change: transform, opacity;
}

/* ── Placement per style ─────────────────────────────────────────────── */
.adm-pop--modal      { margin: auto; }
.adm-pop-root:has(.adm-pop--sheet)  { align-items: flex-end; justify-content: center; padding-bottom: 0; }
.adm-pop--sheet      { border-radius: var(--pop-r, 16px) var(--pop-r, 16px) 0 0; }
.adm-pop-root:has(.adm-pop--corner) { align-items: flex-end; justify-content: flex-end; }
.adm-pop--corner     { max-width: min(var(--pop-w, 380px), 92vw); }
.adm-pop-root:has(.adm-pop--bar)    { align-items: flex-end; justify-content: center; padding: 0; }
.adm-pop--bar        { max-width: none; border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0; }
.adm-pop-root:has(.adm-pop--fullscreen) { padding: 0; }
.adm-pop--fullscreen { max-width: none; height: 100%; max-height: none; border-radius: 0; border: 0; display: flex; align-items: center; justify-content: center; }

/* Fallback for browsers without :has() — centre everything rather than misplacing it. */
@supports not selector(:has(*)) {
  .adm-pop-root { align-items: center; justify-content: center; }
}

/* ── Entry animations ────────────────────────────────────────────────── */
.adm-pop--anim-zoom        { opacity: 0; transform: scale(.94); }
.adm-pop--anim-fade        { opacity: 0; }
.adm-pop--anim-slide-up    { opacity: 0; transform: translateY(28px); }
.adm-pop--anim-slide-right { opacity: 0; transform: translateX(36px); }
.adm-pop--sheet.adm-pop--anim-slide-up { transform: translateY(110%); opacity: 1; }
.is-open .adm-pop { opacity: 1; transform: none; }

/* ── Backgrounds. Dark/Black/Magenta remap the text tokens so nested elements
      that read var(--color-text) invert with the panel rather than staying dark. ── */
.adm-pop--bg-white   { background: #fff; color: #0a0a0a; }
.adm-pop--bg-light   { background: var(--color-surface-2, #f5f5f7); color: #0a0a0a; }
.adm-pop--bg-dark    { background: #0a0a0a; }
.adm-pop--bg-black   { background: #000; }
.adm-pop--bg-magenta { background: #e5006d; }
.adm-pop--bg-dark,
.adm-pop--bg-black,
.adm-pop--bg-magenta {
  --color-text: #fff;
  --color-text-secondary: rgba(255, 255, 255, .78);
  --color-text-muted: rgba(255, 255, 255, .62);
  --color-border: rgba(255, 255, 255, .18);
  color: #fff;
  border-color: rgba(255, 255, 255, .16);
}

/* ── Content ─────────────────────────────────────────────────────────── */
.adm-pop__title {
  margin: 0 0 .5em;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  font-weight: 500;                /* headings are never bold on this site */
  line-height: 1.15;
  text-wrap: balance;
}
/* Brand sweep on <u>. Uses --pop-ink rather than var(--color-text) so it stays legible on the
   inverted panels, where the panel sets its own colour independently of the section. */
.adm-pop { --pop-ink: var(--color-text, #0a0a0a); }
.adm-pop__title u {
  text-decoration: none;
  background: linear-gradient(90deg, var(--pop-ink) 0%, var(--pop-ink) 40%, #e5006d 50%, var(--pop-ink) 60%, var(--pop-ink) 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: admPopSweep 6s linear infinite;
}
.adm-pop--bg-magenta .adm-pop__title u { background: none; color: #fff; animation: none; }
@keyframes admPopSweep { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.adm-pop__text { font-size: .95rem; line-height: 1.6; color: var(--color-text-secondary, #444); }
.adm-pop__text p { margin: 0 0 .6em; }
.adm-pop__text p:last-child { margin-bottom: 0; }

.adm-pop__ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.adm-pop--align-center .adm-pop__ctas { justify-content: center; }
.adm-pop__note { margin: 12px 0 0; font-size: .76rem; color: var(--color-text-muted, #777); }

.adm-pop--align-center { text-align: center; }
.adm-pop--align-left   { text-align: left; }

.adm-pop__form { margin-top: 16px; text-align: left; }

/* ── Media ───────────────────────────────────────────────────────────── */
.adm-pop__media img { display: block; width: 100%; height: auto; border-radius: calc(var(--pop-r, 16px) * .6); }
.adm-pop--img-top .adm-pop__media { margin: 0 0 18px; }

.adm-pop--img-left,
.adm-pop--img-right { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, 2.4vw, 28px); align-items: center; }
.adm-pop--img-right .adm-pop__media { order: 2; }
.adm-pop--img-left  .adm-pop__media { order: 0; }
.adm-pop--img-left .adm-pop__body,
.adm-pop--img-right .adm-pop__body { order: 1; }
/* Side-by-side media is CONTAINED and vertically centred, not cover-cropped.
   Cover stretched a 425px-tall dashboard graphic to fill a 500px column, upscaling it and
   cutting the edges off the card — which is exactly the part that makes a UI screenshot
   readable. Contain keeps the whole panel visible at its true aspect; a column shorter than
   the copy beside it looks intentional, a cropped screenshot does not. */
.adm-pop--img-left .adm-pop__media,
.adm-pop--img-right .adm-pop__media { align-self: center; }
.adm-pop--img-left .adm-pop__media img,
.adm-pop--img-right .adm-pop__media img { height: auto; object-fit: contain; }

.adm-pop__bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; border-radius: inherit; }
.adm-pop__bg img { width: 100%; height: 100%; object-fit: cover; }
.adm-pop--img-bg .adm-pop__body { position: relative; z-index: 1; }
.adm-pop--img-bg::after {
  content: ""; position: absolute; inset: 0; z-index: 0; border-radius: inherit;
  background: linear-gradient(180deg, rgba(0, 0, 0, .25), rgba(0, 0, 0, .68));
}
.adm-pop--img-bg { --color-text: #fff; --color-text-secondary: rgba(255,255,255,.8); --color-text-muted: rgba(255,255,255,.65); color: #fff; }
.adm-pop--img-bg .adm-pop__close { z-index: 2; }

/* ── Close ───────────────────────────────────────────────────────────── */
.adm-pop__close {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(0, 0, 0, .07); color: inherit;
  font-size: 22px; line-height: 1;
  transition: background .2s ease;
}
.adm-pop__close:hover { background: rgba(0, 0, 0, .14); }
.adm-pop--bg-dark .adm-pop__close,
.adm-pop--bg-black .adm-pop__close,
.adm-pop--bg-magenta .adm-pop__close,
.adm-pop--img-bg .adm-pop__close { background: rgba(255, 255, 255, .16); }
.adm-pop--bg-dark .adm-pop__close:hover,
.adm-pop--bg-black .adm-pop__close:hover,
.adm-pop--bg-magenta .adm-pop__close:hover,
.adm-pop--img-bg .adm-pop__close:hover { background: rgba(255, 255, 255, .28); }

.adm-pop :focus-visible { outline: 2px solid #e5006d; outline-offset: 2px; }

/* ── Small screens: side-by-side collapses, bar and corner go full width ── */
@media (max-width: 700px) {
  .adm-pop--img-left,
  .adm-pop--img-right { grid-template-columns: 1fr; }
  .adm-pop--img-left .adm-pop__media,
  .adm-pop--img-right .adm-pop__media { order: 0; }
  .adm-pop--img-left .adm-pop__media img,
  .adm-pop--img-right .adm-pop__media img { height: auto; max-height: 190px; }
  .adm-pop--corner { max-width: none; }
  .adm-pop-root { padding: 10px; }
  .adm-pop-root:has(.adm-pop--sheet) { padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .adm-pop-root, .adm-pop { transition: none; }
  .adm-pop { opacity: 1; transform: none; }
  .adm-pop__title u { animation: none; }
}

/* ── Tick list ─────────────────────────────────────────────────────────
   Left-aligned even inside a centred popup: a centred list of different-length
   items has a ragged left edge and is markedly harder to scan. */
.adm-pop__list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  text-align: left;
  display: grid;
  gap: 9px;
}
.adm-pop__list li {
  position: relative;
  padding-left: 28px;
  font-size: .93rem;
  line-height: 1.45;
  color: var(--color-text, #0a0a0a);
}
.adm-pop__list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .28em;
  width: 15px;
  height: 9px;
  border-left: 2.5px solid #e5006d;
  border-bottom: 2.5px solid #e5006d;
  transform: rotate(-45deg);
  border-radius: 1px;
}
.adm-pop--bg-magenta .adm-pop__list li::before { border-color: #fff; }

/* The below-copy image is capped and top-cropped rather than shown whole.
   A full landscape dashboard pushes the panel past a laptop viewport, which puts the CTA
   below the fold on the one element the popup exists to surface. Showing the top band reads
   as a deliberate peek into the product and keeps the button visible. */
.adm-pop__media--below { margin: 20px 0 0; }
.adm-pop__media--below img {
  max-height: 250px;
  object-fit: cover;
  object-position: top center;
  border: 1px solid var(--color-border, rgba(0,0,0,.1));
  border-radius: calc(var(--pop-r, 16px) * .55);
  box-shadow: 0 12px 30px -14px rgba(0,0,0,.28);
}
@media (max-height: 780px) {
  .adm-pop__media--below img { max-height: 170px; }
}
