html:has(.trip-nav-drawer[open]) {
  overflow: hidden;
}

.trip-nav-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(79vw, 380px);
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #fff;
  color: var(--purple-dark, #34204b);
  box-shadow: -12px 0 38px #22153535;
  overflow: auto;
  overscroll-behavior: contain;
}

.trip-nav-drawer::backdrop {
  background: #26173566;
}

.trip-nav-drawer-content {
  min-height: 100%;
  padding: max(16px, env(safe-area-inset-top, 0px))
    max(16px, env(safe-area-inset-right, 0px))
    max(20px, env(safe-area-inset-bottom, 0px)) 16px;
}

.trip-nav-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.trip-nav-drawer-header h2 {
  margin: 0;
  color: var(--drawer-purple, var(--purple));
  font-size: clamp(18px, 4.8vw, 22px);
  line-height: 1.2;
}

.trip-nav-drawer-header button {
  display: grid;
  place-items: center;
  width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--departure-line, #e5ddec);
  border-radius: 10px;
  background: #f7f2fb;
  color: var(--drawer-purple, var(--purple));
  cursor: pointer;
}

.trip-nav-drawer nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 7px 0;
  color: inherit;
  font-size: 15px;
  font-weight: 650;
}

.trip-nav-drawer nav a + a + a {
  border-top: 1px solid var(--departure-line, #e5ddec);
}

.trip-nav-drawer .trip-nav-icon {
  display: grid;
  flex: 0 0 30px;
  place-items: center;
  height: 30px;
  border-radius: 8px;
  background: #f7f2fb;
  color: var(--drawer-purple, var(--purple));
}

.trip-nav-drawer nav .trip-nav-primary {
  justify-content: center;
  margin-bottom: 8px;
  padding-inline: 8px;
  border-radius: 10px;
  background: #462073;
  color: #fff;
  text-align: center;
}

.trip-nav-primary .trip-nav-icon {
  flex-basis: 20px;
  background: transparent;
  color: inherit;
}

.trip-nav-drawer nav a:not(.trip-nav-primary):hover {
  color: var(--drawer-purple, var(--purple));
  text-decoration: underline;
}

.trip-nav-drawer :is(a, button):focus-visible {
  outline: 2px solid var(--drawer-purple, var(--purple));
  outline-offset: 2px;
}

@media (prefers-reduced-motion: no-preference) {
  .trip-nav-drawer[open] {
    animation: trip-nav-enter 170ms ease-out;
  }
}

@keyframes trip-nav-enter {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
