/* Keep the document and off-canvas navigation within the viewport. */
html, body { width: 100%; max-width: 100%; overflow-x: clip; }
#app, .header, .hero, .footer { min-width: 0; max-width: 100%; }
.header .brand, .header-actions { flex-shrink: 0; }
.hero-copy { min-width: 0; width: 100%; }
.drawer:not(.open) { visibility: hidden; pointer-events: none; }
.drawer.open { visibility: visible; }
.chapter-content > *, .contact > *, .region-grid > * { min-width: 0; }

/* Direct telephone call, opposite the WhatsApp button. */
.floating-phone {
  position: fixed;
  left: 22px;
  bottom: 22px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 40px;
  padding: 12px 19px;
  background: #00aaff;
  color: #062b42;
  box-shadow: 0 0 16px #00aaff, 0 0 32px #00aaff65;
  font-size: 14px;
  font-weight: bold;
  touch-action: manipulation;
}
.floating-phone svg { width: 24px; height: 24px; flex: none; pointer-events: none; }
.floating-phone:hover { background: #21c1ff; }
.floating-phone:active { transform: scale(.97); }
.drawer.open ~ .floating-phone { visibility: hidden; }
@media (max-width: 700px) {
  .floating-phone { left: 15px; bottom: 15px; padding: 15px; }
  .floating-phone span { display: none; }
}

/* Keep all navigation links visible on a second row on smaller displays. */
@media (max-width: 1280px) {
  .header { height: auto; flex-wrap: wrap; gap: 4px 12px; justify-content: space-between; padding: 10px clamp(12px, 4vw, 32px) 12px; }
  .header .desktop-nav { display: flex; order: 3; flex: 0 0 100%; min-width: 0; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; font-size: clamp(12px, 1.7vw, 14px); }
  .header .desktop-nav a { padding: 9px 0; text-align: center; line-height: 1.25; }
  .header .desktop-nav a.active::after { bottom: 3px; }
  .header .brand img { width: clamp(112px, 25vw, 184px); }
  .header-actions { gap: clamp(6px, 2vw, 18px); }
  .header .menu-btn { display: grid; }
  .header .top-phone { display: inline-flex; justify-content: center; width: 44px; border: 1px solid currentColor; border-radius: 50%; }
  .header .top-phone span { display: none; }
  .cover-home .hero .hero-copy { padding-top: 165px; }
}
@media (max-width: 540px) {
  .header .desktop-nav { justify-content: center; column-gap: 14px; }
  .cover-home .hero .hero-copy { padding-top: 185px; }
}
@media (max-width: 390px) {
  .header { padding-inline: 10px; gap: 4px 6px; }
  .header .desktop-nav { gap: 0 12px; }
  .header .brand img { width: 104px; }
  .header-actions { gap: 6px; }
  .language-toggle { padding-inline: 6px; gap: 5px; }
  .header .menu-btn { padding-inline: 6px; }
  .hero .buttons .btn { min-width: 0; flex-basis: 100%; }
}

/* Phone portrait: use the existing drawer instead of the desktop navigation. */
@media (max-width: 540px) {
  .header .desktop-nav { display: none; }
  .cover-home .hero .hero-copy {
    padding: 100px clamp(18px, 5vw, 26px) 55px;
    justify-content: center;
  }
  .cover-home .hero h1 {
    font-size: clamp(30px, 8vw, 42px);
    line-height: 1.12;
    letter-spacing: -.035em;
    margin: 16px 0 18px;
    text-wrap: balance;
    text-shadow: 0 2px 8px #0006;
  }
  .cover-home .hero .eyebrow {
    font-size: 11px;
    letter-spacing: .1em;
    line-height: 1.5;
    max-width: 100%;
  }
  .cover-home .hero .lede {
    font-size: 16px;
    line-height: 1.55;
    text-shadow: 0 1px 4px #000a;
    max-width: 100%;
  }
  .cover-home .hero:after {
    background: linear-gradient(90deg, #10181deb 0%, #142027d4 48%, #15202769 100%);
  }
  .cover-home .hero .buttons { margin-top: 23px; gap: 10px; }
  .cover-home .hero .buttons .btn {
    flex: 1 1 calc(50% - 5px);
    min-width: 0;
    padding: 12px 8px;
    font-size: 14px;
    min-height: 48px;
  }
}
