/* Medset Shop 1.0.23 (B-7994): while the checkout loads, skeleton bars in its shape instead of the spinner (last block). */
/* Medset Shop 1.0.5 (B-6968, B-7191): the pop-up shell on sales pages (North Star frames: 544px panel at 1440, bottom sheet at 390). */
html.mpop-lock, html.mpop-lock body { overflow: hidden !important; }
html.mpop-lock body { position: fixed; left: 0; right: 0; width: 100%; }

.mpop-root[hidden] { display: none !important; }
.mpop-root { position: fixed; inset: 0; z-index: 2147483000; }
.mpop-backdrop { position: absolute; inset: 0; background: rgba(20, 20, 20, .55); opacity: 0; }
.mpop-panel {
  --mpop-h: 560px;
  position: absolute; left: 50%; top: 50%;
  width: min(544px, calc(100vw - 32px));
  height: min(var(--mpop-h), calc(100vh - 64px));
  height: min(var(--mpop-h), calc(100dvh - 64px));
  transform: translate(-50%, -50%);
  background: #fff; border-radius: 20px; overflow: hidden;
  box-shadow: 0 24px 64px rgba(20, 20, 20, .28);
  display: flex; flex-direction: column; opacity: 0;
}
.mpop-frame { flex: 1 1 auto; width: 100%; height: 100%; border: 0; display: block; background: #fff; opacity: 0; }
.mpop-root.is-ready .mpop-frame { opacity: 1; }
.mpop-root.is-ready .mpop-load { display: none; }
.mpop-root.is-open .mpop-backdrop, .mpop-root.is-open .mpop-panel { opacity: 1; }

.mpop-x { position: absolute; top: 16px; right: 16px; z-index: 2; display: grid; place-items: center; cursor: pointer; }
/* [1.0.5 B-7191] The theme styles every button (blue fill, pink on hover or focus). Ruling 1648: Pay is the only blue, so the
   close button resets every state the theme touches. */
.mpop-root .mpop-x,
.mpop-root .mpop-x:hover,
.mpop-root .mpop-x:focus,
.mpop-root .mpop-x:active,
.mpop-root .mpop-x:visited {
  width: 44px !important; height: 44px !important; min-width: 0 !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important;
  border: 0 !important; border-radius: 999px !important; background: transparent !important; background-image: none !important;
  color: #141414 !important; box-shadow: none !important; text-shadow: none !important; text-transform: none !important;
  letter-spacing: 0 !important; line-height: 1 !important; font-size: 0 !important; transform: none !important; opacity: 1;
  -webkit-appearance: none; appearance: none;
}
.mpop-root .mpop-x:hover { background: #F5F7FB !important; }
.mpop-root .mpop-x:focus { outline: none !important; }
.mpop-root .mpop-x:focus-visible { outline: 3px solid #2F66E0 !important; outline-offset: 2px !important; }
.mpop-root .mpop-x[aria-disabled="true"] { opacity: .35 !important; cursor: not-allowed !important; background: transparent !important; }
.mpop-x svg { width: 20px !important; height: 20px !important; display: block; stroke: currentColor !important; fill: none !important; }
.mpop-sentinel { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.mpop-load {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  font: 400 15px/1.5 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; color: #4A5261;
}
.mpop-spin { width: 24px; height: 24px; border-radius: 50%; border: 3px solid rgba(47, 102, 224, .25); border-top-color: #2F66E0; }

/* Phone: a sheet from the bottom that stops 40px below the top. */
@media (max-width: 599px) {
  .mpop-panel {
    left: 0; right: 0; top: 40px; bottom: 0; width: auto; height: auto;
    transform: none; border-radius: 20px 20px 0 0;
  }
  .mpop-root .mpop-x { top: 12px; right: 8px; }   /* [1.0.16 B-8035, North Star] the X's centre on the basket's remove-ring column (was 4px left) */
}

/* Motion only for people who have not asked for less of it. */
@media (prefers-reduced-motion: no-preference) {
  .mpop-backdrop { transition: opacity .2s ease; }
  .mpop-panel { transition: opacity .2s ease, transform .2s ease; }
  .mpop-root:not(.is-open) .mpop-panel { transform: translate(-50%, calc(-50% + 16px)); }
  .mpop-frame { transition: opacity .15s ease; }
  .mpop-spin { animation: mpop-spin .8s linear infinite; }
  @media (max-width: 599px) {
    .mpop-root:not(.is-open) .mpop-panel { transform: translateY(32px); }
    .mpop-root.is-open .mpop-panel { transform: none; }
  }
}
@keyframes mpop-spin { to { transform: rotate(360deg); } }

/* [1.0.11 B-7953] Phone: the sheet fits its content (it was always full height, so a short checkout, e.g. a signed-in buyer,
   left white space under the coupon line); it still stops 40px below the top and scrolls inside when the form is longer. */
@media (max-width: 599px) {
  .mpop-panel { top: auto; height: min(var(--mpop-h), calc(100vh - 40px)); height: min(var(--mpop-h), calc(100dvh - 40px)); }
}

/* =====================================================================================================================
 * [1.0.23 B-7994] (Sean 27 Nov: the "Opening checkout" spinner becomes a calm skeleton). CSS only: the spinner is hidden and the
 * panel shows still bars in the checkout's shape (picture, name, access line and price; email; first | last name; card number; the
 * payment line and Pay at the bottom) at the places the checkout draws them (measured on the 1.0.22 frame: 544 panel and 390 sheet),
 * with a slow shimmer only for people who have not asked for less motion. The bars are one ::before, never catch a click and leave
 * the close button's corner clear. "Opening checkout" stays in the markup (role="status"), read by screen readers, not shown.
 * It shows for as long as the pop-up waits for the checkout (popup.js READY_TIMEOUT, 25 s in 1.0.23) and goes with .is-ready as before.
 * ===================================================================================================================== */
.mpop-load .mpop-spin { display: none; }
.mpop-load > span:not(.mpop-spin) {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.mpop-load::before {
  --mpop-s: 24px;   /* side inset: the checkout's own (16px on the phone sheet) */
  --mpop-bar: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='100%25' height='100%25' rx='6'/%3E%3C/svg%3E");
  --mpop-box: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='100%25' height='100%25' rx='12'/%3E%3C/svg%3E");
  --mpop-pill: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='100%25' height='100%25' rx='24'/%3E%3C/svg%3E");
  --mpop-line: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='100%25' height='100%25'/%3E%3C/svg%3E");
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, #E4E7EE 40%, #F5F7FB 50%, #E4E7EE 60%) 0 0 / 300% 100% #E4E7EE;
  /* picture, name, access line, price | hairline | email label + field | name labels + two fields | card label + field | payment line, Pay.
     (A position percentage places the bar's own share: calc(50% + 46px) puts an 80px bar's left edge 6px right of the middle.) */
  -webkit-mask-image: var(--mpop-box), var(--mpop-bar), var(--mpop-bar), var(--mpop-bar), var(--mpop-line), var(--mpop-bar), var(--mpop-box), var(--mpop-bar), var(--mpop-bar), var(--mpop-box), var(--mpop-box), var(--mpop-bar), var(--mpop-box), var(--mpop-bar), var(--mpop-pill);
          mask-image: var(--mpop-box), var(--mpop-bar), var(--mpop-bar), var(--mpop-bar), var(--mpop-line), var(--mpop-bar), var(--mpop-box), var(--mpop-bar), var(--mpop-bar), var(--mpop-box), var(--mpop-box), var(--mpop-bar), var(--mpop-box), var(--mpop-bar), var(--mpop-pill);
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: left var(--mpop-s) top 24px, left calc(var(--mpop-s) + 60px) top 30px, left calc(var(--mpop-s) + 60px) top 54px, right calc(var(--mpop-s) + 56px) top 41px, left 0 top 88px,
    left var(--mpop-s) top 118px, left var(--mpop-s) top 142px, left var(--mpop-s) top 210px, left calc(50% + 46px) top 210px, left var(--mpop-s) top 234px, right var(--mpop-s) top 234px,
    left var(--mpop-s) top 312px, left var(--mpop-s) top 336px, left 50% bottom 84px, left 50% bottom 16px;
          mask-position: left var(--mpop-s) top 24px, left calc(var(--mpop-s) + 60px) top 30px, left calc(var(--mpop-s) + 60px) top 54px, right calc(var(--mpop-s) + 56px) top 41px, left 0 top 88px,
    left var(--mpop-s) top 118px, left var(--mpop-s) top 142px, left var(--mpop-s) top 210px, left calc(50% + 46px) top 210px, left var(--mpop-s) top 234px, right var(--mpop-s) top 234px,
    left var(--mpop-s) top 312px, left var(--mpop-s) top 336px, left 50% bottom 84px, left 50% bottom 16px;
  -webkit-mask-size: 48px 48px, min(220px, calc(100% - var(--mpop-s) * 2 - 196px)) 14px, min(160px, calc(100% - var(--mpop-s) * 2 - 196px)) 11px, 64px 14px, 100% 1px,
    104px 13px, calc(100% - var(--mpop-s) * 2) 48px, 80px 13px, 80px 13px, calc(50% - var(--mpop-s) - 6px) 48px, calc(50% - var(--mpop-s) - 6px) 48px,
    96px 13px, calc(100% - var(--mpop-s) * 2) 48px, min(300px, calc(100% - 32px)) 11px, calc(100% - 32px) 48px;
          mask-size: 48px 48px, min(220px, calc(100% - var(--mpop-s) * 2 - 196px)) 14px, min(160px, calc(100% - var(--mpop-s) * 2 - 196px)) 11px, 64px 14px, 100% 1px,
    104px 13px, calc(100% - var(--mpop-s) * 2) 48px, 80px 13px, 80px 13px, calc(50% - var(--mpop-s) - 6px) 48px, calc(50% - var(--mpop-s) - 6px) 48px,
    96px 13px, calc(100% - var(--mpop-s) * 2) 48px, min(300px, calc(100% - 32px)) 11px, calc(100% - 32px) 48px;
}
@media (max-width: 599px) { .mpop-load::before { --mpop-s: 16px; } }
@keyframes mpop-sk-shine { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: no-preference) { .mpop-load::before { animation: mpop-sk-shine 1.6s ease-in-out infinite; } }
@media (prefers-reduced-motion: reduce) { .mpop-load::before { animation: none; background: #E4E7EE; } }   /* still bars, no shimmer */
