/* Load after the existing AlphaWorks storefront styles. */
@media (max-width: 767px) and (min-height: 560px) {
  html.aw-mobile-flow {
    --aw-flow-header: 72px;
    --aw-flow-intro: 105px;
    --aw-flow-strip: 49px;
    --aw-flow-band: 237px;
    --aw-flow-screen: 100vh;
    scroll-padding-block-start: var(--aw-flow-header);
    scroll-snap-type: y mandatory;
  }

  @supports (height: 100svh) {
    html.aw-mobile-flow { --aw-flow-screen: 100svh; }
  }

  .aw-mobile-flow [data-aw-flow-section] {
    scroll-snap-align: start;
    scroll-snap-stop: normal;
  }

  .aw-mobile-flow #main > [data-aw-flow-section="scene"] {
    min-block-size: max(0px, calc(var(--aw-flow-screen) - var(--aw-flow-header)));
    margin-block: 0;
    isolation: isolate;
  }

  /* The intro and its yellow sound strip form the first complete scene. */
  .aw-mobile-flow #main > .hero {
    min-block-size: max(0px, calc(var(--aw-flow-screen) - var(--aw-flow-intro) - var(--aw-flow-strip)));
    isolation: isolate;
    overflow: clip;
    scroll-margin-block-start: max(0px, calc(var(--aw-flow-intro) - var(--aw-flow-header)));
    scroll-margin-block-end: var(--aw-flow-strip);
  }
  .aw-mobile-flow .hero .hero-inner {
    block-size: auto;
    min-block-size: inherit;
    justify-content: space-between;
  }

  .aw-mobile-flow #main > .category-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-block: clamp(28px, 5svh, 48px);
  }
  .aw-mobile-flow .category-grid {
    margin-inline-end: 0;
    max-inline-size: 100%;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
  }
  .aw-mobile-flow .category-grid > .category-tile { scroll-snap-align: start; }

  /* Product listings and guides retain their natural, readable height. */
  .aw-mobile-flow #main > .featured-section,
  .aw-mobile-flow #main > .buying-guide-links {
    padding-block: 32px;
    margin-block: 0;
  }

  .aw-mobile-flow #main > .lifestyle-pair {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding-block: 24px;
  }
  .aw-mobile-flow .lifestyle-pair > .lifestyle-card {
    block-size: auto;
    min-block-size: max(280px, calc((var(--aw-flow-screen) - var(--aw-flow-header) - 64px) / 2));
    margin: 0;
  }

  .aw-mobile-flow #main > .campaign-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 28px;
    padding-block: 32px;
  }
  .aw-mobile-flow .campaign-section > .campaign-visual {
    flex: 0 0 auto;
    inline-size: 100%;
    block-size: auto;
    min-block-size: 0;
    aspect-ratio: 16 / 9;
  }

  /* These quieter blocks read as one continuous transition. */
  .aw-mobile-flow #main > .brand-note {
    min-block-size: max(0px, calc(var(--aw-flow-screen) - var(--aw-flow-header) - var(--aw-flow-band)));
    margin-block: 0;
    padding-block: 32px;
    scroll-margin-block-end: var(--aw-flow-band);
  }
  .aw-mobile-flow #main > .red-band { margin-block: 0; padding-block: 32px; }
  .aw-mobile-flow #main > .red-band h2 { font-size: clamp(28px, 8.2vw, 42px); }
  .aw-mobile-flow .site-footer { padding-bottom: max(24px, env(safe-area-inset-bottom)); }

  /* Let the browser handle focused forms, overlays and magnified reading. */
  html.aw-mobile-flow[data-aw-flow-paused],
  html.aw-mobile-flow:has(dialog[open]),
  html.aw-mobile-flow:has(input:focus, textarea:focus, select:focus, [contenteditable="true"]:focus) {
    scroll-snap-type: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.aw-mobile-flow { scroll-snap-type: none; scroll-behavior: auto; }
  .aw-mobile-flow .category-grid { scroll-snap-type: none; }
}
