/* Shared mobile navigation: the single source of truth for drawer and bottom dock. */
.mobile-nav-head,
.mobile-nav-foot,
.mobile-nav-icon,
.mobile-nav-overlay,
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 950px) {
  body.mobile-menu-open .site-header {
    border-bottom-color: rgba(229, 231, 235, .9);
    background: rgba(248, 249, 250, .96);
    backdrop-filter: blur(16px);
  }
  :root { --mobile-dock-space: 96px; }

  html,
  body { max-width: 100%; overflow-x: clip; }
  body { padding-bottom: var(--mobile-dock-space); }
  body.mobile-menu-open { overflow: hidden; }

  .site-header { z-index: 1030; }
  .nav-actions { display: flex; margin-right: 14px; }
  .nav-actions > .btn { display: none; }
  header.site-header .nav-actions .menu-toggle {
    position: relative;
    z-index: 1030;
    display: grid;
    place-content: center;
    gap: 5px;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid #d9dee7;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(17, 24, 39, .07);
  }
  .menu-toggle span {
    display: block;
    width: 21px;
    height: 2px;
    border-radius: 2px;
    background: #111827;
    transition: transform var(--motion-base) var(--motion-ease), opacity var(--motion-fast) ease;
  }
  .menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(7px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-7px) rotate(-45deg); }

  .nav-links {
    position: fixed;
    z-index: 1020;
    top: 78px;
    right: auto;
    bottom: 0;
    left: 50%;
    display: flex;
    width: min(390px, calc(100vw - 40px));
    height: auto;
    padding: 26px 22px 122px;
    overflow-y: auto;
    flex-direction: column;
    gap: 8px;
    border: 1px solid #e5e7eb;
    border-bottom: 0;
    border-radius: 15px 15px 0 0;
    background: #fff;
    box-shadow: 0 18px 55px rgba(17, 24, 39, .16);
    transform: translateX(calc(-50% + 110vw));
    visibility: hidden;
    transition: transform var(--motion-base) var(--motion-ease), visibility var(--motion-base);
  }
  .nav-links.open {
    position: fixed;
    top: 78px;
    right: auto;
    bottom: 0;
    left: 50%;
    width: min(390px, calc(100vw - 40px));
    transform: translateX(-50%);
    visibility: visible;
  }

  .mobile-nav-head {
    display: flex;
    min-height: 55px;
    margin: -5px 58px 12px 0;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e5e7eb;
  }
  .mobile-nav-head span { font-size: 22px; font-weight: 800; color: #111827; }
  .mobile-nav-head small { font-size: 9px; font-weight: 800; color: #9ca3af; text-transform: uppercase; }

  .nav-links > a {
    position: relative;
    display: grid;
    min-height: 63px;
    padding: 9px 43px 9px 12px;
    grid-template-columns: 42px 1fr;
    align-items: center;
    gap: 13px;
    border: 1px solid transparent;
    border-radius: 13px;
    color: #344054;
    font-size: 16px;
    font-weight: 750;
    text-decoration: none;
    transition: border-color var(--motion-fast) ease, background var(--motion-fast) ease, color var(--motion-fast) ease, transform var(--motion-fast) var(--motion-ease);
  }
  .nav-links > a::after {
    content: "→";
    position: absolute;
    right: 13px;
    bottom: auto;
    left: auto;
    display: grid;
    width: 27px;
    height: 27px;
    place-items: center;
    border: 1px solid #e1e6ed;
    border-radius: 8px;
    background: transparent;
    color: #7a8699;
    font-size: 13px;
  }
  .mobile-nav-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid #dfe4eb;
    border-radius: 12px;
    background: #f8fafc;
    color: #657287;
  }
  .mobile-nav-icon svg { width: 21px; height: 21px; }
  .nav-links > a:hover { background: #fafafa; transform: translateX(-2px); }
  .nav-links > a.active {
    border-color: rgba(211, 47, 47, .23);
    background: #fff5f5;
    color: #d32f2f;
  }
  .nav-links > a.active::before {
    content: "";
    position: absolute;
    left: -1px;
    width: 3px;
    height: 31px;
    border-radius: 0 3px 3px 0;
    background: #d32f2f;
  }
  .nav-links > a.active .mobile-nav-icon { border-color: #d32f2f; background: #d32f2f; color: #fff; }
  .nav-links > a.active::after {
    right: 13px;
    bottom: auto;
    left: auto;
    width: 27px;
    height: 27px;
    border-color: transparent;
    color: #d32f2f;
    background: transparent;
  }

  .mobile-nav-foot {
    display: flex;
    margin-top: auto;
    padding: 17px 5px 0;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #e5e7eb;
    color: #667085;
    font-size: 11px;
  }
  .mobile-nav-foot span { display: flex; align-items: center; gap: 7px; }
  .mobile-nav-foot .dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px #dcfce7; }
  .mobile-nav-foot .office-status.is-closed { color: #c62828; font-weight: 750; }
  .mobile-nav-foot .office-status.is-closed .dot { background: #d32f2f; box-shadow: 0 0 0 4px #fee2e2; }
  .mobile-nav-foot a { color: #344054; font-weight: 750; text-decoration: none; }

  .mobile-nav-overlay {
    position: fixed;
    z-index: 1010;
    inset: 0;
    display: block;
    border: 0;
    background: rgba(17, 24, 39, .52);
    opacity: 0;
    visibility: hidden;
    backdrop-filter: blur(4px);
    transition: opacity var(--motion-base) ease, visibility var(--motion-base);
  }
  body.mobile-menu-open .mobile-nav-overlay { opacity: 1; visibility: visible; }

  body > nav.mobile-bottom-nav {
    position: fixed;
    z-index: 1040;
    left: 12px;
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom));
    display: grid;
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    margin: 0;
    height: 74px;
    padding: 7px 9px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: center;
    border: 1px solid rgba(209, 216, 226, .95);
    border-radius: 23px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 11px 28px rgba(17, 24, 39, .14), 0 2px 6px rgba(17, 24, 39, .05);
    backdrop-filter: blur(16px);
    overflow: hidden;
  }
  body.mobile-menu-open > nav.mobile-bottom-nav {
    z-index: 1100;
    display: grid;
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  body > nav.mobile-bottom-nav > a {
    display: flex;
    min-width: 0;
    height: 58px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 3px;
    border-radius: 17px;
    color: #778397;
    font-size: 10.5px;
    font-weight: 750;
    line-height: 1;
    text-decoration: none;
    overflow: visible;
  }
  .mobile-bottom-nav svg {
    box-sizing: content-box;
    width: 20px;
    height: 20px;
    padding: 5px;
    border: 1px solid #dfe4eb;
    border-radius: 10px;
    background: #f8fafc;
    transition: transform var(--motion-fast) var(--motion-ease), color var(--motion-fast) ease, background var(--motion-fast) ease, border-color var(--motion-fast) ease;
  }
  .mobile-bottom-nav > a.active { color: #d32f2f; }
  .mobile-bottom-nav > a.active svg { border-color: #d32f2f; background: #d32f2f; color: #fff; }
  .mobile-bottom-nav > a:active svg { transform: scale(.9); }
  .mobile-bottom-nav .mobile-bottom-primary { color: #d32f2f; }
  .mobile-bottom-nav .mobile-bottom-primary svg { width: 20px; height: 20px; padding: 5px; border-color: #d32f2f; background: #d32f2f; color: #fff; box-shadow: 0 6px 13px rgba(211, 47, 47, .2); }

  .whatsapp-float {
    right: 18px;
    bottom: calc(var(--mobile-dock-space) + 10px);
    transform: scale(.84);
    transform-origin: right bottom;
  }
  body.mobile-menu-open .whatsapp-float {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

@media (max-width: 370px) {
  body > nav.mobile-bottom-nav { left: 7px; right: 7px; width: calc(100vw - 14px); max-width: calc(100vw - 14px); padding-inline: 5px; }
  .mobile-bottom-nav > a { font-size: 9.5px; }
  .mobile-bottom-nav svg { width: 19px; height: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  .nav-links,
  .mobile-nav-overlay,
  .menu-toggle span,
  .mobile-bottom-nav svg { transition: none; }
}

/* Session-start mobile drawer composition. */
@media (max-width: 950px) {
  body.mobile-menu-open .site-header {
    border-bottom-color: transparent;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    pointer-events: none;
  }
  body.mobile-menu-open .site-header .brand {
    opacity: 0;
    transform: translateX(-140px);
    pointer-events: auto;
  }
  body.mobile-menu-open .site-header .menu-toggle {
    position: fixed;
    z-index: 1200;
    top: 17px;
    right: 16px;
    pointer-events: auto;
  }
  .brand { transition: transform var(--motion-base) var(--motion-ease); }

  .nav-links,
  .nav-links.open {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100vw;
    max-width: none;
    height: 100dvh;
    padding: 26px 22px 122px;
    border: 0;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
  }
  .nav-links::before {
    content: "";
    position: absolute;
    top: 17px;
    left: 0;
    width: 14px;
    height: 56px;
    border-radius: 0 12px 12px 0;
    background: var(--red);
  }
  .nav-links { transform: translateX(105%); }
  .nav-links.open { transform: translateX(0); }

  .mobile-nav-head {
    min-height: 55px;
    margin: -5px 58px 12px 55px;
  }
}
