/* Shared responsive rules, loaded after the page-specific CSS bundles. */
:root {
  --site-header-height: 100px;
  --contact-dock-height: 76px;
  --support-viewport-height: 100dvh;
  --support-keyboard-offset: 0px;
}

body .header nav > a,
body .header .nav-services-toggle {
  display: flex;
  align-items: center;
  min-height: 44px;
}

/* Long contact details must be allowed to shrink inside grid and flex tracks. */
.ct > *,
.ct-rows li > div,
footer#footer .footer-main > div { min-width: 0; }

.ct-rows a,
footer#footer .footer-main a { overflow-wrap: anywhere; }

.ct-rows a[href^="tel:"] {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ct .button {
  max-width: 100%;
  white-space: normal;
}

body .mobile-actions.contact-dock > a.whatsapp-float {
  display: grid;
  place-items: center;
  padding: 0;
  background: #25d366;
}

@media (min-width: 701px) {
  body .mobile-actions.contact-dock { display: contents; }
  body .contact-dock > a:not(.whatsapp-float) { display: none; }
}

@media (max-width: 1000px) {
  body .header .menu-toggle {
    display: flex;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
  }

  body .header .menu-toggle span {
    display: block;
    flex: none;
    width: 23px;
    height: 1.5px;
    background: var(--ink);
    transition: transform .2s ease;
  }

  body .header .menu-toggle[aria-expanded="true"] span:first-child {
    transform: translateY(3.75px) rotate(45deg);
  }

  body .header .menu-toggle[aria-expanded="true"] span:last-child {
    transform: translateY(-3.75px) rotate(-45deg);
  }

  body .header.wrap nav {
    max-height: calc(100dvh - var(--site-header-height) - 12px);
    overscroll-behavior: contain;
    overflow-y: auto;
    border-radius: 0;
  }
}

@media (max-width: 700px) {
  html { scroll-padding-bottom: calc(var(--contact-dock-height) + 12px); }
  body { padding-bottom: var(--contact-dock-height); }

  main a,
  main button,
  main summary { scroll-margin-bottom: calc(var(--contact-dock-height) + 12px); }

  body .header .brand {
    flex: 0 1 146px;
    min-width: 0;
  }

  body .language-switch a { min-width: 44px; }

  body .header.wrap nav {
    max-height: calc(100dvh - var(--site-header-height) - var(--contact-dock-height) - 12px);
  }

  body .mobile-actions.contact-dock {
    position: fixed;
    inset: auto 0 var(--support-keyboard-offset);
    z-index: 46;
    display: grid;
    grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr) 44px 44px;
    align-items: center;
    gap: 6px;
    padding: 10px max(12px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    border-top: 1px solid #e1e5e8;
    background: #fff;
    box-shadow: 0 -4px 18px #2525250d;
  }

  body .contact-dock > a:not(.whatsapp-float) {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 44px;
    padding: 8px 6px;
    font-size: 13px;
    line-height: 1.3;
    overflow-wrap: anywhere;
  }

  body .contact-dock > a:nth-child(2) {
    background: #c8102e;
    color: #fff;
  }

  body .contact-dock .faq-assistant { position: static; }

  body .contact-dock .assistant-toggle {
    justify-content: center;
    width: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: 50%;
    box-shadow: none;
  }

  .contact-dock .assistant-toggle-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  body .mobile-actions.contact-dock > a.whatsapp-float {
    position: static;
    display: grid;
    flex: none;
    place-items: center;
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #25d366;
    color: #fff;
    box-shadow: none;
  }

  body .contact-dock .faq-assistant section {
    position: fixed;
    inset: auto max(12px, env(safe-area-inset-right)) calc(var(--contact-dock-height) + var(--support-keyboard-offset) + 12px) max(12px, env(safe-area-inset-left));
    width: auto;
    max-height: calc(var(--support-viewport-height) - var(--contact-dock-height) - 24px);
    padding: 18px;
    overscroll-behavior: contain;
  }

  /* Show a wider video frame while keeping the introduction above the contact dock. */
  .surgery-landing {
    height: auto;
    min-height: max(360px, calc(85svh - var(--site-header-height) - var(--contact-dock-height)));
    max-height: none;
    display: flex;
  }

  .surgery-content {
    width: 100%;
    height: auto;
    min-width: 0;
    padding-top: 90px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body .header .menu-toggle span { transition: none; }
}
