/* Mobile composition: full-width type and controls, with a viewport-height
   portrait composition below and natural overflow on smaller screens. */
@media (max-width: 767px) {
  html { scroll-padding-top: 16px; }
  .site-header { padding: max(15px, env(safe-area-inset-top)) 16px 15px; gap: 12px; align-items: center; }
  .site-header .brand-mark { width: 46px; height: 46px; flex-basis: 46px; }
  .auth-links { margin: 0 0 0 auto; gap: 14px; font-size: 12px; }
  .auth-links a { min-height: 44px; }
  .menu-toggle { width: 44px; height: 44px; }

  .hero {
    min-height: 0;
    height: auto;
    max-height: none;
    padding: 108px 16px 68px;
    justify-content: flex-start;
    gap: 0;
  }
  .hero-photo { background-position: 25% center; filter: brightness(.82); }
  .hero-shade { background: linear-gradient(180deg, #05070555, #05070518 32%, #050705bf 67%, #050705f5 100%); }
  .hero-price { width: 100%; }
  .hero-price > p { font-size: 14px; line-height: 1.65; margin: 0 0 5px; }
  .hero-price strong {
    font-size: clamp(90px, 31.2vw, 232px);
    line-height: 1.04;
    letter-spacing: -.025em;
    max-width: 100%;
  }
  .hero-price > div.hero-price-actions { margin-top: 10px; gap: 0; justify-content: flex-start; }
  .hero-price-actions .price-more { font-size: 12px; gap: 18px; padding: 8px 0; min-height: 44px; }
  .hero-replay { display: none; }
  .hero-bottom { margin-top: 30px; gap: 0; width: 100%; }
  .hero-bottom h1 {
    font-size: clamp(30px, 10.5vw, 60px);
    line-height: 1.13;
    letter-spacing: -.06em;
    margin: 0 0 16px;
    word-break: keep-all;
  }
  .hero-bottom > div > p:last-of-type { font-size: 15px; line-height: 1.7; color: #f2f3e9; }
  .hero-bottom > .button { min-height: 56px; margin: 24px 0 0; padding: 16px 18px; font-size: 16px; }
  .scroll-cue { left: 16px; right: 16px; bottom: 17px; padding-top: 11px; }
  .scroll-cue span { font-size: 9px; letter-spacing: .08em; }

  .consult-floating { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); }
  .floating-actions { gap: 8px; }
  .main-language-control { width: 40px; height: 40px; flex-basis: 40px; }
  .main-language-control > svg { inset: 10px; width: 18px; height: 18px; }
  .consult-toggle { width: 40px; height: 40px; min-height: 40px; }
  .consult-toggle > span:first-child { font-size: 23px; }
  .consult-options { width: min(310px, calc(100vw - 24px)); }
}

@media (max-width: 359px) {
  .site-header { gap: 10px; }
  .auth-links { gap: 11px; font-size: 11px; }
  .hero { padding-top: 100px; }
  .hero-bottom { margin-top: 24px; }
  .hero-bottom > div > p:last-of-type { font-size: 14px; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .site-header { padding-inline: 28px; }
  .hero { height: auto; min-height: 0; max-height: none; padding: 120px 28px 76px; gap: 0; }
  .hero-price strong { font-size: clamp(190px, 28vw, 260px); line-height: 1.05; }
  .hero-price > p { font-size: 16px; }
  .hero-bottom { margin-top: 38px; }
  .hero-bottom h1 { font-size: clamp(42px, 5.5vw, 56px); line-height: 1.15; }
  .hero-bottom > div > p:last-of-type { font-size: 15px; }
  .hero-bottom > .button { font-size: 16px; min-height: 56px; }
}

/* One complete opening screen; retain natural height when content needs more. */
@media (max-width: 1023px) and (orientation: portrait) {
  html { scroll-padding-top: 0; }
  .hero {
    min-height: 100svh;
    height: auto;
    max-height: none;
    padding-top: clamp(108px, 15svh, 150px);
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
    justify-content: space-between;
    gap: 36px;
  }
  .hero-price,
  .hero-bottom { flex-shrink: 0; }
  .hero-bottom { margin-top: 0; }
  .scroll-cue { bottom: calc(24px + env(safe-area-inset-bottom)); }
}

@media (max-width: 767px) and (max-height: 670px) and (orientation: portrait) {
  .hero { padding-top: 96px; padding-bottom: calc(64px + env(safe-area-inset-bottom)); gap: 16px; }
  .scroll-cue { bottom: calc(17px + env(safe-area-inset-bottom)); }
}

/* Use browser-native paging rather than intercepting touch or wheel input.
   Snap the whole section so oversized plans/expanded filters remain scrollable. */
@media (max-width: 1023px) and (orientation: portrait) {
  html {
    scroll-snap-type: y mandatory;
    scroll-padding-block: 0;
    scroll-behavior: smooth;
  }

  #main > section,
  .production-footer {
    scroll-snap-align: start;
    scroll-snap-stop: always;
    scroll-margin-block: 0;
  }

  html.reduce-motion,
  html:has(body.menu-open),
  html:has(dialog[open]),
  html:has(input:focus, textarea:focus) {
    scroll-snap-type: none;
  }

  html.reduce-motion { scroll-behavior: auto; }
  dialog { overscroll-behavior: contain; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-snap-type: none; scroll-behavior: auto; }
}

/* Keep the page in place while reading a long consultation form. A stable
   gutter prevents the layout from widening when the document scrollbar locks. */
@media (max-width: 1023px) {
  html { scrollbar-gutter: stable; }
  html:has(dialog[open]),
  body:has(dialog[open]) { overflow: hidden; }

  #consult-request-dialog .dialog-close {
    position: sticky;
    top: 0;
    z-index: 3;
    margin: -6px -6px 0 12px;
    padding: 10px 14px;
    border: 1px solid #c3cbb8;
    background: #f4f3ee;
    box-shadow: 0 3px 12px #17240f12;
  }
}
