/* Mobile-only presentation adjustments. Desktop CSS is intentionally untouched. */
.mobile-menu-toggle { display: none; }

@media (max-width: 900px) {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; }
  body { min-width: 0; overflow-wrap: break-word; }
  img, video, svg, iframe { max-width: 100%; }
  img { height: auto; }
  iframe { display: block; width: 100%; }
  .topbar { padding: 9px 14px; line-height: 1.45; font-size: 12px; }
  .topbar > * { min-width: 0; overflow-wrap: anywhere; }

  /* Reuse the original page navigation: do not change any desktop links. */
  header.container { position: relative; padding: 14px; }
  header .logo-row { position: relative; gap: 10px; align-items: center; }
  header .logo-row > .logo { width: 64px; height: 68px; flex: 0 0 64px; }
  header .logo-row > div:not(.logo) { flex: 1 1 0; min-width: 0; }
  header .logo-row > div:not(.logo) > div[style] { font-size: clamp(14px, 3.6vw, 18px) !important; line-height: 1.25; overflow-wrap: anywhere; }
  header .logo-row > nav {
    display: none !important;
    position: absolute; top: calc(100% + 12px); left: 0; right: 0;
    z-index: 120; width: 100%; max-height: min(70vh, 560px);
    overflow-y: auto; overscroll-behavior: contain;
    margin: 0 !important; padding: 7px;
    background: #fff; border: 1px solid #e5e9ee; border-radius: 9px;
    box-shadow: 0 14px 32px rgba(0, 0, 0, .15);
  }
  header .logo-row > nav.mobile-nav-open { display: block !important; }
  header .logo-row > nav ul,
  header .logo-row > nav ul ul {
    display: flex !important; flex-direction: column; gap: 0;
    list-style: none; margin: 0; padding: 0;
  }
  header .logo-row > nav ul p,
  header .logo-row > nav ul li { margin: 0; padding: 0; }
  header .logo-row > nav a {
    display: flex; align-items: center; width: 100%; min-height: 44px;
    padding: 11px 13px; border-radius: 6px;
    text-decoration: none; line-height: 1.4; font-size: 15px;
    color: #173047; font-weight: 600;
  }
  header .logo-row > nav a:focus-visible,
  header .logo-row > nav a:hover { background: #eff6fc; outline-offset: 2px; }
  .mobile-menu-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    flex: 0 0 44px; width: 44px; height: 44px; padding: 0;
    border: 1px solid #dce5ed; border-radius: 7px;
    background: #fff; color: #0b66a3; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-menu-toggle:focus-visible { outline: 3px solid #0b66a3; outline-offset: 2px; }
  .mobile-menu-toggle .menu-lines,
  .mobile-menu-toggle .menu-lines::before,
  .mobile-menu-toggle .menu-lines::after {
    display: block; width: 20px; height: 2px; border-radius: 2px;
    background: currentColor; transition: transform .16s ease, opacity .16s ease;
  }
  .mobile-menu-toggle .menu-lines { position: relative; }
  .mobile-menu-toggle .menu-lines::before,
  .mobile-menu-toggle .menu-lines::after { position: absolute; left: 0; content: ''; }
  .mobile-menu-toggle .menu-lines::before { transform: translateY(-6px); }
  .mobile-menu-toggle .menu-lines::after { transform: translateY(6px); }
  .mobile-menu-toggle[aria-expanded="true"] .menu-lines { background: transparent; }
  .mobile-menu-toggle[aria-expanded="true"] .menu-lines::before { transform: rotate(45deg); }
  .mobile-menu-toggle[aria-expanded="true"] .menu-lines::after { transform: rotate(-45deg); }

  /* Internal content, cards, forms and embedded maps. */
  .container { max-width: 100%; }
  main.container, div.container:not(.logo-row) { padding: 20px 14px; }
  .row, .info-grid, .visit-grid, .form-grid { flex-direction: column; align-items: stretch; gap: 16px; }
  .row > *, .col-main, .col-side, .col-8, .col-4,
  .info-item, .visit-item, .form-left, .form-right {
    min-width: 0 !important; width: 100%; max-width: 100%; flex: 1 1 auto;
  }
  .card { max-width: 100%; }
  .article img.lead-img { float: none; display: block; width: 100%; max-width: 520px; height: auto; margin: 0 0 16px; }
  .page-title { font-size: clamp(24px, 5vw, 30px); line-height: 1.2; padding: 20px 14px; }
  .hero-title { font-size: clamp(22px, 5vw, 28px); line-height: 1.3; }
  h1, h2, h3 { overflow-wrap: anywhere; }
  input[type="text"], input[type="email"], input[type="tel"], textarea, select,
  .form-left input, .form-left textarea {
    display: block; max-width: 100%; width: 100%; min-width: 0;
    font-size: 16px; box-sizing: border-box;
  }
  textarea { max-width: 100%; }
  button, input[type="submit"], .submit { min-height: 44px; }
  .float-actions { right: 12px; bottom: 12px; max-width: calc(100vw - 24px); gap: 8px; }
  .float-actions .btn { min-height: 44px; font-size: 13px; padding: 9px 12px; }
  .whatsapp-button { max-width: calc(100vw - 24px); left: 12px; bottom: 12px; min-height: 44px; }
  footer .footer-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 24px; }
  footer .footer-grid > * { min-width: 0; overflow-wrap: anywhere; }

  /* Treatment and image galleries have their own original layouts. */
  .card-container { padding: 0 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 16px; }
  .card-container .card img { max-width: 100%; }
  .gallery { padding: 8px 14px 20px; }
  .gallery-item { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; min-width: 0; }
  .gallery-item > img.fixed-size-image { width: 100%; max-width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
  .gallery-item > h3, .gallery-item > b { grid-column: 1 / -1; min-width: 0; margin: 10px 0 2px; }
  .gallery-item > br { display: none; }

  /* Home-page content is not inside the site's usual container. */
  body > h2, body > p, body > ul { margin-left: 14px; margin-right: 14px; }
  body > h2 { font-size: clamp(22px, 5vw, 28px); line-height: 1.25; margin-top: 22px; }
  body > p { line-height: 1.55; }
  body > img[src*="home.jpeg"], body > h2:first-of-type + img {
    display: block; float: none !important;
    width: calc(100% - 28px) !important; max-width: 520px;
    height: auto !important; margin: 12px auto;
  }
  body > section.contact { padding: 14px; }
  body > section.contact form { max-width: 100%; }
}

@media (max-width: 480px) {
  header.container { padding: 12px; }
  header .logo-row > .logo { width: 56px; height: 62px; flex-basis: 56px; }
  header .logo-row { gap: 8px; }
  .topbar { font-size: 12px; }
  main.container, div.container:not(.logo-row) { padding: 16px 12px; }
  .card { padding: 14px; }
  .gallery-item { grid-template-columns: minmax(0, 1fr); }
  .gallery-item > img.fixed-size-image { max-height: 320px; }
  .card-container { grid-template-columns: minmax(0, 1fr); padding: 0 12px; }
  footer { padding: 26px 14px; }
}

@media (prefers-reduced-motion: reduce) and (max-width: 900px) {
  .mobile-menu-toggle .menu-lines,
  .mobile-menu-toggle .menu-lines::before,
  .mobile-menu-toggle .menu-lines::after { transition: none; }
}
