/* ns-mobile-bottom-nav — mobile app-style tab bar */
:root {
  --ns-mnav-h: 56px;
  --ns-mnav-fg: #6b6560;
  --ns-mnav-fg-active: #9a524a;
  --ns-mnav-accent: #e8a39a;
  --ns-mnav-bg: rgba(255, 252, 248, 0.96);
  --ns-mnav-border: rgba(42, 36, 32, 0.1);
  --ns-mnav-safe: env(safe-area-inset-bottom, 0px);
}

.ns-mnav {
  display: none;
}

@media (max-width: 991px) {
  .ns-mnav {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1300;
    padding-bottom: var(--ns-mnav-safe);
    background: var(--ns-mnav-bg);
    border-top: 1px solid var(--ns-mnav-border);
    box-shadow: 0 -6px 24px rgba(42, 36, 32, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .ns-mnav__bar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    height: var(--ns-mnav-h);
    max-width: 560px;
    margin: 0 auto;
  }

  .ns-mnav__tab {
    appearance: none;
    border: 0;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: var(--ns-mnav-h);
    padding: 6px 4px 4px;
    color: var(--ns-mnav-fg);
    text-decoration: none;
    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1.15;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .ns-mnav__tab:focus-visible {
    outline: 2px solid var(--ns-mnav-accent);
    outline-offset: -2px;
  }

  .ns-mnav__tab svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
  }

  .ns-mnav__tab.is-active {
    color: var(--ns-mnav-fg-active);
    font-weight: 600;
  }

  .ns-mnav__tab.is-active svg {
    stroke: var(--ns-mnav-fg-active);
  }

  .ns-mnav__tab--book {
    color: var(--ns-mnav-fg-active);
  }

  .ns-mnav__tab--book svg {
    stroke: var(--ns-mnav-fg-active);
  }

  /* Room for the bar on all mobile pages */
  body {
    padding-bottom: calc(var(--ns-mnav-h) + var(--ns-mnav-safe) + 8px) !important;
  }

  /* Sticky service CTA sits above the tab bar */
  .svc-sell__sticky-cta {
    bottom: calc(var(--ns-mnav-h) + var(--ns-mnav-safe)) !important;
  }

  body:has(.svc-sell__sticky-cta) {
    padding-bottom: calc(76px + var(--ns-mnav-h) + var(--ns-mnav-safe)) !important;
  }

  /* Cookie banner above tab bar */
  .ns-cookie {
    bottom: calc(var(--ns-mnav-h) + var(--ns-mnav-safe) + 10px) !important;
  }

  /* ===== More sheet ===== */
  .ns-mnav__overlay {
    position: fixed;
    inset: 0;
    z-index: 1390;
    background: rgba(42, 36, 32, 0.42);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s ease;
  }

  .ns-mnav__sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1400;
    max-height: min(72vh, 520px);
    background: #fffcf8;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -12px 40px rgba(42, 36, 32, 0.16);
    padding: 8px 0 calc(12px + var(--ns-mnav-safe));
    transform: translateY(110%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    flex-direction: column;
  }

  .ns-mnav.is-more-open .ns-mnav__overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .ns-mnav.is-more-open .ns-mnav__sheet {
    transform: translateY(0);
  }

  .ns-mnav__handle {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: rgba(42, 36, 32, 0.18);
    margin: 4px auto 8px;
    flex-shrink: 0;
  }

  .ns-mnav__sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 18px 12px;
    border-bottom: 1px solid var(--ns-mnav-border);
  }

  .ns-mnav__sheet-title {
    margin: 0;
    font-size: 16px;
    font-weight: 650;
    color: #2a2420;
  }

  .ns-mnav__sheet-close {
    appearance: none;
    border: 0;
    background: transparent;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    color: #2a2420;
    cursor: pointer;
    border-radius: 8px;
  }

  .ns-mnav__sheet-close:focus-visible {
    outline: 2px solid var(--ns-mnav-accent);
  }

  .ns-mnav__sheet-list {
    list-style: none;
    margin: 0;
    padding: 4px 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .ns-mnav__sheet-list a {
    display: block;
    padding: 15px 20px;
    color: #2a2420;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    border-bottom: 1px solid rgba(42, 36, 32, 0.06);
  }

  .ns-mnav__sheet-list a:active,
  .ns-mnav__sheet-list a.is-active {
    color: var(--ns-mnav-fg-active);
    background: rgba(232, 163, 154, 0.12);
  }

  body.ns-mnav-more-open {
    overflow: hidden;
  }
}

@media (max-width: 991px) and (prefers-reduced-motion: reduce) {
  .ns-mnav__overlay,
  .ns-mnav__sheet {
    transition: none;
  }
}
