/*
 * Responsive stability fixes.
 * Layout-only overrides: no visual tokens, content, or component styling changed.
 */

/* Grid and flex children must be allowed to shrink instead of widening the page. */
.contact-grid > *,
.ov-grid > *,
.proc-steps > *,
.pillars > *,
.uae-features > *,
.hero-c,
.hero-btns,
.ci > div:last-child {
  min-width: 0;
}

.ci-val {
  overflow-wrap: anywhere;
}

/* Service navigation contains more items than the global header. Switch to the
   existing compact header before controls are clipped on laptop viewports. */
@media (max-width: 1500px) {
  body.service-page nav,
  body.service-page .hdr-r {
    display: none;
  }

  body.service-page .burger {
    display: flex;
  }

  body.service-page header {
    left: var(--page-pad);
    right: var(--page-pad);
    top: 14px;
    height: 60px;
  }

  body.service-page .hdr-r {
    display: flex !important;
    gap: 10px;
  }

  body.service-page .hdr-r > .btn {
    display: none !important;
  }

  body.service-page .lang-switch {
    order: -1;
  }
}

/* Russian navigation labels need a slightly earlier compact breakpoint. */
@media (max-width: 1710px) {
  html[lang="ru"] body.service-page nav,
  html[lang="ru"] body.service-page .hdr-r {
    display: none;
  }

  html[lang="ru"] body.service-page .burger {
    display: flex;
  }

  html[lang="ru"] body.service-page header {
    left: var(--page-pad);
    right: var(--page-pad);
    top: 14px;
    height: 60px;
  }

  html[lang="ru"] body.service-page .hdr-r {
    display: flex !important;
    gap: 10px;
  }

  html[lang="ru"] body.service-page .hdr-r > .btn {
    display: none !important;
  }

  html[lang="ru"] body.service-page .lang-switch {
    order: -1;
  }
}

@media (max-width: 1450px) {
  html[lang="ru"] body.design-page nav,
  html[lang="ru"] body.design-page .hdr-r {
    display: none;
  }

  html[lang="ru"] body.design-page .burger {
    display: flex;
  }

  html[lang="ru"] body.design-page header {
    left: var(--page-pad);
    right: var(--page-pad);
    top: 14px;
    height: 60px;
  }

  html[lang="ru"] body.design-page .hdr-r {
    display: flex !important;
    gap: 10px;
  }

  html[lang="ru"] body.design-page .hdr-r > .btn {
    display: none !important;
  }

  html[lang="ru"] body.design-page .lang-switch {
    order: -1;
  }
}

@media (max-width: 480px) {
  /* Height-based desktop rules are declared later in the legacy stylesheet;
     restore the intended phone gutters on short mobile screens. */
  .hero-c {
    padding-left: 20px;
    padding-right: 20px;
  }

  /* Long Russian words and CTA labels stay inside the hero shell. */
  .hero h1,
  .hero h2 {
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: auto;
  }

  h1,
  h2,
  h3 {
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: auto;
  }

  html[lang="ru"] .hero h1 {
    font-size: clamp(28px, 8vw, 38px);
  }

  .hero-btns {
    width: 100%;
  }

  .hero-btns .btn {
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 46px;
    white-space: normal;
    text-align: center;
    line-height: 1.25;
  }

  .svc-panel-tag {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  /* Keep both contact columns on the same alignment line. */
  .contact .form-card {
    padding: 0;
  }

  /* Booking form fields must not retain the desktop two-column grid. */
  .bk-fields {
    grid-template-columns: 1fr;
  }

  .bk-fg.full {
    grid-column: auto;
  }

  .bk-toast {
    max-width: calc(100vw - 28px);
    white-space: normal;
    text-align: center;
  }
}

@media (max-width: 360px) {
  .hero-c {
    padding-left: 16px;
    padding-right: 16px;
  }

  .cookie-banner p {
    width: 100%;
    min-width: 0;
  }

  .cookie-btns {
    width: 100%;
    flex-direction: column;
  }

  .cookie-btns button {
    width: 100%;
  }

  .bk-slots {
    grid-template-columns: repeat(2, 1fr);
  }
}
