/* ══════════════════════════════════════════════════════════════════════
   CU29 — MOBILE & TABLET REFINEMENTS (loaded last on every demo page)
   ══════════════════════════════════════════════════════════════════════ */

/* iPhone Safari: keep text size steady when the phone is rotated */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.nav-mobile-cta {
  display: none;
}

.brand-logo {
  flex-shrink: 0;
}

.btn-header-cta {
  white-space: nowrap;
}

/* Small laptops: the full menu fits between the logo and the button */
@media (min-width: 1025px) and (max-width: 1279px) {
  .nav-desktop-links {
    gap: clamp(14px, 1.7vw, 22px);
  }

  .nav-desktop-links .nav-link {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    white-space: nowrap;
  }

  .nav-actions > .btn-header-cta {
    padding: 11px 18px;
    letter-spacing: 0.08em;
  }

  .nav-actions {
    gap: 8px;
  }

  .cart-icon-btn {
    flex-shrink: 0;
  }
}

/* Touch screens: the mouse tilt would stay stuck on a card after a tap */
@media (hover: none) {
  .product-card,
  .science-pillar-card {
    transform: none !important;
  }
}

/* ══════════════════════════════════════════════════════════════════════
   TABLETS & PHONES
   ══════════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  /* ── Hamburger menu ── */
  .nav-desktop-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: calc(100vh - var(--header-height));
    /* dvh keeps the last item clear of the phone browser's toolbar */
    max-height: calc(100dvh - var(--header-height));
    overflow-y: auto;
    padding: 8px 24px 28px;
    background: #050C16;
    border-bottom: 1px solid rgba(70, 130, 180, 0.32);
    box-shadow: 0 24px 40px rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
  }

  .site-header.menu-open .nav-desktop-links {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav-desktop-links .nav-link {
    display: block;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .nav-desktop-links .nav-link::after {
    display: none;
  }

  .menu-toggle {
    margin-right: -10px;
  }

  .site-header.menu-open .menu-toggle-bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .site-header.menu-open .menu-toggle-bar:nth-child(2) {
    opacity: 0;
  }

  .site-header.menu-open .menu-toggle-bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  /* ── Form fields: 16px stops iPhone Safari zooming in on tap ── */
  .newsletter-input,
  .form-field-input,
  .form-field-select,
  .form-field-textarea {
    font-size: 1rem;
  }

  /* ── Footer: comfortable tap targets, no overflow on narrow phones ── */
  .footer-top-grid > *,
  .newsletter-form,
  .newsletter-input-group {
    min-width: 0;
  }

  .newsletter-input {
    width: 100%;
    min-width: 0;
  }

  .newsletter-btn {
    flex-shrink: 0;
  }

  .footer-links-list {
    gap: 0;
  }

  .footer-link {
    display: inline-block;
    padding: 11px 0;
    line-height: 1.4;
  }

  .footer-bottom-bar > div {
    flex-wrap: wrap;
    row-gap: 0;
  }
}

/* ── About page tabs: line up with the page gutter, easier to tap ── */
@media (max-width: 820px) {
  .about-tabs-track {
    scroll-padding-inline: 18px;
  }

  .about-tab-btn {
    padding: 13px 16px;
  }
}

/* ══════════════════════════════════════════════════════════════════════
   PHONES
   ══════════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  /* ── Header: the CTA moves into the menu so it no longer covers the logo ── */
  .nav-actions > .btn-header-cta {
    display: none;
  }

  .nav-mobile-cta {
    display: block;
    padding-top: 20px;
  }

  .nav-mobile-cta .btn-header-cta {
    width: 100%;
    padding: 15px 20px;
  }

  .nav-actions {
    gap: 8px;
  }

  /* ── Hero: as tall as its content, so tall phones get no empty bands.
        The room under the buttons shows the two bottles. ── */
  .hero-stage {
    height: auto;
    min-height: 0;
    align-items: flex-start;
    padding-bottom: clamp(110px, 18vh, 170px);
  }

  .hero-content-wrapper {
    padding-top: calc(var(--header-height) + clamp(28px, 5vh, 48px));
    /* The scroll script lifts and fades this block, which widened the gap */
    transform: none !important;
    opacity: 1 !important;
  }

  .hero-subtitle {
    text-wrap: pretty;
  }

  .hero-cta-group {
    margin-bottom: 0;
  }

  /* Scroll hint and coordinates collided */
  .hero-scroll-indicator {
    display: none;
  }

  /* The dark pill keeps the coordinates readable over the bottle label */
  .hero-location-tag {
    right: auto;
    left: 20px;
    bottom: 20px;
    padding: 6px 12px;
    border-radius: 9999px;
    background: rgba(5, 12, 22, 0.72);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.6875rem;
    letter-spacing: 0.05em;
    white-space: nowrap;
  }

  .hero-location-tag svg {
    flex-shrink: 0;
  }

  /* ── Portrait: its scroll effect slid the photo off the top of the frame ── */
  .lifestyle-portrait-img {
    transform: none !important;
  }

  /* ── Buttons ── */
  .btn-primary-pill,
  .final-cta-btn {
    justify-content: center;
    padding-left: 20px;
    padding-right: 20px;
    letter-spacing: 0.1em;
    text-align: center;
  }

  .btn-primary-pill svg,
  .final-cta-btn svg {
    flex-shrink: 0;
  }

  /* ── The two-step system ── */
  .system-view-tabs {
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 32px;
  }

  .system-tab-btn {
    padding: 13px 16px;
  }

  .product-card {
    min-width: 0;
  }

  .product-step-indicator {
    flex-wrap: wrap;
    gap: 8px;
  }

  .step-num-pill,
  .product-spec-pill {
    white-space: nowrap;
  }

  .step-num-pill {
    letter-spacing: 0.08em;
  }

  .product-card-footer {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 12px;
  }

  .duo-bundle-box {
    padding: 32px 24px;
  }

  .duo-bundle-badge {
    font-size: 0.6875rem;
    letter-spacing: 0.05em;
  }

  .duo-bundle-cta-wrap {
    text-align: center;
  }

  /* ── Testimonials ── */
  .testimonial-author-meta {
    flex-wrap: wrap;
    gap: 10px 12px;
  }

  .author-badge,
  .author-location {
    white-space: nowrap;
  }

  /* ── Final call to action ── */
  .final-headline {
    font-size: min(2.6rem, 9vw);
  }

  /* ── Quiz: "Back" stays on one line beside the main button ── */
  .drawer-footer {
    gap: 18px;
  }

  .drawer-footer #quizPrevBtn {
    flex-shrink: 0;
    padding: 12px 0;
    white-space: nowrap;
  }

  .drawer-footer .btn-primary-pill {
    width: auto;
    flex: 1;
  }

  /* ── Clinic price cards: stack the prices, keep the radio at the side ── */
  .system-select-card {
    flex-direction: row;
    align-items: center;
    padding: 20px;
    gap: 16px;
  }

  .system-card-pricing {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .custom-radio-dot {
    align-self: center;
    margin-top: 0;
  }

  .btn-submit-inquiry {
    padding-left: 20px;
    padding-right: 20px;
    letter-spacing: 0.08em;
  }
}

@media (max-width: 350px) {
  .hero-location-tag {
    left: 14px;
    padding: 6px 10px;
    letter-spacing: 0;
  }
}
