/* Phone-only layout. Loaded last. Everything here sits inside a phone-width
   media query, except the first rule, which keeps the phone-only pieces off
   larger screens. test/page.test.mjs checks that this stays true. */
.mobile-bar,
.swipe-hint,
.swipe-dots {
  display: none;
}

@media (max-width: 620px) {
  :root {
    --gutter: max(4vw, (100vw - 560px) / 2);
  }

  /* "How it works" and the benefits become rows to swipe sideways, so a
     phone visitor is not scrolling through ten tall cards. The next card
     peeks in from the right. */
  .flow,
  .features {
    /* Keeps the section as wide as the screen however wide the row is. */
    grid-template-columns: minmax(0, 1fr);
  }
  [data-swipe] {
    display: flex;
    gap: 12px;
    margin-inline: calc(var(--gutter) * -1);
    padding: 10px var(--gutter) 34px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-padding-inline: var(--gutter);
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  [data-swipe]::-webkit-scrollbar {
    display: none;
  }
  [data-swipe] > * {
    flex: 0 0 min(84%, 400px);
    scroll-snap-align: center;
  }
  /* Cards waiting off to the side are already drawn, so the peek shows. */
  .js-reveal [data-swipe] .reveal {
    opacity: 1;
    translate: 0 0;
  }
  .flow-step.is-on {
    translate: 0 0;
  }
  .swipe-hint {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin: 18px 0 -16px;
    font-size: 1.55rem;
    line-height: 1;
  }
  .swipe-hint svg {
    flex: none;
    width: 46px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .bento + .swipe-dots,
  .flow-steps + .swipe-dots {
    display: flex;
    justify-content: center;
    gap: 7px;
    margin-top: -14px;
  }
  .swipe-dots i {
    width: 7px;
    height: 7px;
    border-radius: 4px;
    background: #c4cfbf;
    transition:
      width 0.25s ease,
      background 0.25s ease;
  }
  .swipe-dots i.is-current {
    width: 22px;
    background: #214d36;
  }
}

@media (max-width: 740px) {
  /* Sign up, WhatsApp and call stay within reach of a thumb. */
  .mobile-bar {
    position: fixed;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    left: 12px;
    z-index: 11;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    border: 1px solid rgba(245, 233, 203, 0.28);
    border-radius: 999px;
    background: rgba(20, 44, 32, 0.95);
    box-shadow: 0 16px 34px -12px rgba(0, 0, 0, 0.6);
    visibility: hidden;
    translate: 0 calc(100% + 30px);
    transition:
      translate 0.35s cubic-bezier(0.2, 0.7, 0.2, 1),
      visibility 0s 0.35s;
  }
  .mobile-bar.is-up {
    visibility: visible;
    translate: 0 0;
    transition:
      translate 0.35s cubic-bezier(0.2, 0.7, 0.2, 1),
      visibility 0s;
  }
  body:has(#enquiry[open]:not(.pilot-inline)) .mobile-bar {
    display: none;
  }
  .mobile-bar a {
    color: #f5e9cb;
    text-decoration: none;
  }
  .mobile-bar a:focus-visible {
    outline-color: #f5e9cb;
  }
  .mobile-bar-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 48px;
    border-radius: 999px;
    background: #f5e9cb;
    font-size: 0.98rem;
    font-weight: 650;
  }
  .mobile-bar a.mobile-bar-main {
    color: #183e2c;
  }
  .mobile-bar-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(245, 233, 203, 0.42);
    border-radius: 50%;
  }
  .mobile-bar-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
}

@media (max-width: 740px) and (prefers-reduced-motion: reduce) {
  .mobile-bar,
  .mobile-bar.is-up,
  .swipe-dots i {
    transition: none;
  }
}
