/*
  A free page (ShopSection canvas): the organizer's whole design in place of
  the shop's header, hero and blocks, with the shop's footer under it. The
  design starts where a page of its own would: no style of the shop's is
  handed down into it, and the shop's plain-element styles (global.css) step
  back, so it looks the way it was built. Its class names carry a prefix (ShopSection::Markup), so no
  block of the shop's reaches in either.

  What it may take from the shop is the look, by name: the variables below
  (ShopSection::LOOK_VARIABLES) carry the accent, the page's colours and the
  two faces of whichever look the page wears, the shop's, the event's or a
  version's. A design that writes var(--shop-accent) where it would have
  written a colour follows the theme settings; one that writes the colour
  stays as it is.

  Both rules weigh nothing (:where), so anything the design says wins.
*/
.has-shop-canvas .site-main {
  gap: 0;
  padding-block: 0;
}

:where(.shop-canvas__design) {
  all: initial;
  display: block;
  position: relative;

  /* Its pinned bars and layers stay below the shop's dock and consent banner */
  isolation: isolate;

  /* The look the page wears, for the design to follow (accent text and fill keep any accent readable, themes.css) */
  --shop-accent: var(--color-accent);
  --shop-accent-text: var(--color-accent-text);
  --shop-accent-fill: var(--color-accent-fill);
  --shop-on-accent: var(--color-on-accent);
  --shop-page: var(--color-surface-0);
  --shop-card: var(--color-surface-1);
  --shop-text: var(--color-text);
  --shop-muted: var(--color-muted);
  --shop-heading-font: var(--font-display);
  --shop-body-font: var(--font-body);
}

/* A short design still fills the window, unless the shop's own tickets stand under it */
:where(.shop-canvas__design:not(:has(~ .shop-canvas__tickets))) {
  min-block-size: 100dvh;
}

/*
  Pictures and drawings keep what their own attributes say (width, height,
  fill, stroke): a rule here, however light, would outweigh those.
*/
:where(.shop-canvas__design) :where(*:not(img, svg, svg *), *::before, *::after) {
  all: revert;
}

/*
  What moves can be held still (WCAG 2.2.2): a button anyone can see and reach,
  in the page's first corner, wearing the shop's look so it reads on whatever
  the design shows under it. A design with a button of its own (data-do="hold")
  gets none of this.
*/
.shop-canvas__hold {
  align-items: center;
  appearance: none;
  background: var(--color-surface-0);
  block-size: 2.75rem;
  border: 0;
  border-radius: var(--radius-pill);
  box-shadow:
    0 0 0 var(--border-width) color-mix(in oklab, var(--color-text) 30%, transparent),
    var(--shadow-raised);
  color: var(--color-text);
  cursor: pointer;
  display: inline-flex;
  inline-size: 2.75rem;
  inset-block-start: max(var(--space-xs), env(safe-area-inset-top));
  inset-inline-start: max(var(--space-xs), env(safe-area-inset-left));
  justify-content: center;
  position: fixed;
  z-index: var(--z-nav);

  &[aria-pressed="false"] [data-when="paused"],
  &[aria-pressed="true"] [data-when="running"] {
    display: none;
  }
}

@media (forced-colors: active) {
  .shop-canvas__hold {
    border: var(--border-width) solid ButtonText;
  }
}

.shop-canvas[data-own-page-still-value="true"] .shop-canvas__design :where(*, *::before, *::after) {
  animation-play-state: paused !important;
}

/* What the page adds below the design wears the event's look */
.shop-canvas__tickets {
  padding-block: var(--space-l-xl);
}

