/* P2 mobile navigation prototype. Active only at the existing 800px breakpoint. */
.p2-mobile-nav,
.p2-menu-close,
.p2-menu-backdrop,
.p2-bottom-bar {
  display: none;
}

@media (max-width: 800px) {
  :root {
    --p2-header-height: 85px;
    --p2-safe-bottom: env(safe-area-inset-bottom, 0px);
  }

  body.p2-enhanced header.p2-mobile-header {
    position: sticky;
    inset-block-start: 0;
    z-index: 90;
    min-height: var(--p2-header-height);
    background: rgba(23, 25, 24, .97);
    border-bottom-color: #4b524d;
    transform: translateY(0);
    transition: transform .22s ease, box-shadow .22s ease;
  }

  body.p2-enhanced[data-p2-header="fixed"] header.p2-mobile-header {
    box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
  }

  body.p2-enhanced[data-p2-header="reveal"] header.p2-mobile-header.p2-header-hidden {
    transform: translateY(calc(-100% - 2px));
  }

  body.p2-menu-open header.p2-mobile-header {
    transform: translateY(0) !important;
  }

  body.p2-enhanced .brand,
  body.p2-enhanced .language-switch a,
  body.p2-enhanced .menu-toggle {
    min-width: 44px;
    min-height: 44px;
  }

  body.p2-enhanced .brand {
    min-width: 0;
  }

  body.p2-enhanced .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 12px;
    border-color: #79827b;
  }

  body.p2-enhanced .menu-toggle[aria-expanded="true"] {
    border-color: var(--accent);
    color: var(--accent);
  }

  body.p2-enhanced header nav {
    display: none;
    position: absolute;
    inset: 100% 0 auto auto;
    z-index: 92;
    width: min(92vw, 420px);
    height: calc(100dvh - var(--p2-header-height));
    max-height: calc(100dvh - var(--p2-header-height));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 20px 5% calc(28px + var(--p2-safe-bottom));
    background: #202422;
    border: 0;
    border-left: 1px solid var(--rule);
    box-shadow: -18px 18px 50px rgba(0, 0, 0, .42);
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  body.p2-enhanced header nav.open {
    display: flex;
  }

  body.p2-enhanced header nav > .p2-legacy-link {
    display: none;
  }

  .p2-menu-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-end;
    min-width: 44px;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid #707971;
    background: transparent;
    color: var(--paper);
    cursor: pointer;
  }

  .p2-mobile-nav {
    display: grid;
    gap: 22px;
  }

  .p2-mobile-nav-label {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
  }

  .p2-service-list {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .p2-service-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 52px;
    padding: 11px 0;
    border-bottom: 1px solid #485049;
    font-size: 16px;
    line-height: 1.35;
  }

  .p2-service-list a::after {
    content: '\2192';
    color: var(--accent);
    font-size: 19px;
  }

  .p2-mobile-actions {
    display: grid;
    gap: 10px;
  }

  .p2-mobile-actions .button {
    width: 100%;
    min-height: 52px;
    text-align: center;
  }

  .p2-mobile-actions .button.p2-calendar-action {
    border: 1px solid #778078;
    background: transparent;
    color: var(--paper);
  }

  .p2-menu-backdrop {
    position: fixed;
    inset: var(--p2-header-height) 0 0;
    z-index: 89;
    border: 0;
    background: rgba(0, 0, 0, .62);
    cursor: pointer;
  }

  body.p2-menu-open .p2-menu-backdrop {
    display: block;
  }

  body.p2-menu-open {
    overflow: hidden;
  }

  .p2-bottom-bar {
    position: fixed;
    inset: auto 0 0;
    z-index: 80;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
    gap: 8px;
    padding: 10px 12px calc(10px + var(--p2-safe-bottom));
    background: rgba(23, 25, 24, .98);
    border-top: 1px solid #59615b;
    box-shadow: 0 -12px 34px rgba(0, 0, 0, .35);
    transform: translateY(110%);
    opacity: 0;
    pointer-events: none;
    transition: transform .22s ease, opacity .22s ease;
  }

  body.p2-enhanced[data-p2-contact="bar"] .p2-bottom-bar {
    display: grid;
  }

  body.p2-contact-bar-visible .p2-bottom-bar {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  body.p2-enhanced[data-p2-contact="bar"] .floating-wa {
    display: none !important;
  }

  .p2-bottom-bar a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 50px;
    padding: 10px 12px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
  }

  .p2-bottom-bar .p2-bottom-wa {
    background: var(--accent);
    color: var(--ink);
  }

  .p2-bottom-bar .p2-bottom-calendar {
    border: 1px solid #7a837c;
    color: var(--paper);
  }

  body.p2-contact-bar-visible footer {
    padding-bottom: calc(125px + var(--p2-safe-bottom));
  }
}

@media (max-width: 360px) {
  .p2-bottom-bar a {
    padding-inline: 8px;
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.p2-enhanced header.p2-mobile-header,
  .p2-bottom-bar {
    transition: none;
  }
}
