/* ============================================================
   ONESEA Solutions — MOBILE NAVIGATION DRAWER (≤1180px only)
   Isolated from desktop: every rule is inside the media query.
   ============================================================ */
.os-drawer { display: none; }

@media (max-width: 1180px) {
  /* the old stacked-panel mobile menu is replaced by the drawer */
  #root [data-nav-fixed] nav.mobile-open > div:last-of-type,
  #root [data-nav-fixed] nav > div:last-of-type {
    position: absolute !important;
    max-height: 0 !important;
    max-width: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    pointer-events: none !important;
    visibility: hidden !important;
  }

  html.os-drawer-lock, body.os-drawer-lock { overflow: hidden !important; touch-action: none; }

  .os-drawer {
    display: block;
    position: fixed; inset: 0;
    z-index: 2000;
    background: rgba(0, 20, 45, 0.45);
    -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
  }
  /* the author display rule above outranks the UA [hidden] rule — restore it */
  .os-drawer[hidden] { display: none !important; }
  .os-drawer.is-open { opacity: 1; pointer-events: auto; }

  .os-drawer__panel {
    position: absolute; top: 0; right: 0;
    width: min(420px, 100%);
    height: 100vh; height: 100dvh;
    display: flex; flex-direction: column;
    background: var(--onesea-navy);
    box-shadow: -18px 0 60px rgba(0, 12, 28, 0.45);
    transform: translateX(100%);
    transition: transform .34s cubic-bezier(.22, 1, .36, 1);
  }
  .os-drawer.is-open .os-drawer__panel { transform: none; }

  /* ---------- header ---------- */
  .os-drawer__head {
    flex: 0 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px;
    padding: 14px 12px 14px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }
  .os-drawer__logo { height: 52px; width: auto; display: block; }
  .os-drawer__close {
    width: 52px; height: 52px; flex: 0 0 52px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 0; border-radius: 50%;
    color: #fff; cursor: pointer;
    transition: background-color .18s ease;
  }
  .os-drawer__close:hover { background: var(--onesea-pink); }
  .os-drawer__close svg { width: 24px; height: 24px; }

  /* ---------- scrollable nav ---------- */
  .os-drawer__body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 8px 0 20px;
  }
  .os-drawer__group + .os-drawer__group { border-top: 1px solid rgba(255, 255, 255, 0.08); }
  .os-drawer__row { display: flex; align-items: stretch; }
  .os-drawer__link {
    flex: 1 1 auto; min-width: 0;
    display: flex; align-items: center;
    min-height: 58px;
    padding: 12px 8px 12px 22px;
    font-family: var(--font-sans); font-weight: 600; font-size: 18px;
    line-height: 1.3; letter-spacing: -0.01em;
    color: #fff !important; text-decoration: none;
    overflow-wrap: anywhere;
  }
  .os-drawer__link.is-current { color: var(--onesea-pink) !important; }
  .os-drawer__toggle {
    flex: 0 0 58px; width: 58px;
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent; border: 0;
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
  }
  .os-drawer__toggle svg { width: 22px; height: 22px; transition: transform .28s ease; }
  .os-drawer__group.is-open .os-drawer__toggle { color: var(--onesea-pink); }
  .os-drawer__group.is-open .os-drawer__toggle svg { transform: rotate(180deg); }

  /* accordion */
  .os-drawer__sub {
    display: grid; grid-template-rows: 0fr;
    transition: grid-template-rows .3s cubic-bezier(.22, 1, .36, 1);
  }
  .os-drawer__group.is-open .os-drawer__sub { grid-template-rows: 1fr; }
  .os-drawer__sub-inner { overflow: hidden; min-height: 0; }
  .os-drawer__sublink {
    display: flex; align-items: center;
    min-height: 48px;
    padding: 10px 22px 10px 38px;
    font-family: var(--font-sans); font-weight: 500; font-size: 15px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.78) !important; text-decoration: none;
    overflow-wrap: anywhere;
    position: relative;
    opacity: 0; transform: translateY(-4px);
    transition: opacity .26s ease, transform .26s ease, color .18s ease;
  }
  .os-drawer__group.is-open .os-drawer__sublink { opacity: 1; transform: none; }
  .os-drawer__sublink::before {
    content: ""; position: absolute; left: 22px; top: 50%;
    width: 6px; height: 1px; background: rgba(255, 255, 255, 0.35);
  }
  .os-drawer__sublink.is-current { color: var(--onesea-pink) !important; }
  .os-drawer__sublink.is-current::before { background: var(--onesea-pink); }
  .os-drawer__group.is-open .os-drawer__sub-inner { padding-bottom: 10px; }

  /* ---------- footer CTA ---------- */
  .os-drawer__foot {
    flex: 0 0 auto;
    padding: 16px 22px calc(18px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.12);
  }
  .os-drawer__cta {
    display: flex; align-items: center; justify-content: center;
    min-height: 52px;
    background: var(--onesea-pink); color: #fff !important;
    font-family: var(--font-sans); font-weight: 700; font-size: 16px;
    border-radius: 100px; text-decoration: none;
  }
  .os-drawer__logins { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
  .os-drawer__login {
    flex: 1 1 auto; min-height: 44px;
    background: transparent; border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 100px; color: rgba(255, 255, 255, 0.85);
    font-family: var(--font-sans); font-weight: 600; font-size: 13px;
    padding: 8px 12px; cursor: pointer; white-space: nowrap;
  }
  .os-drawer__login:hover { border-color: var(--onesea-pink); color: #fff; }
}

/* small phones */
@media (max-width: 400px) {
  .os-drawer__panel { width: 100%; }
  .os-drawer__head { padding-left: 18px; }
  .os-drawer__link { padding-left: 18px; font-size: 17px; min-height: 54px; }
  .os-drawer__sublink { padding-left: 34px; padding-right: 18px; }
  .os-drawer__sublink::before { left: 18px; }
  .os-drawer__foot { padding-left: 18px; padding-right: 18px; }
  .os-drawer__logins { gap: 6px; }
  .os-drawer__login { font-size: 12px; padding: 8px 10px; }
}

/* short / landscape viewports — keep CTA reachable, nav scrolls */
@media (max-width: 1180px) and (max-height: 520px) {
  .os-drawer__logo { height: 40px; }
  .os-drawer__head { padding-top: 8px; padding-bottom: 8px; }
  .os-drawer__link { min-height: 48px; padding-top: 8px; padding-bottom: 8px; }
  .os-drawer__toggle { flex-basis: 48px; width: 48px; }
  .os-drawer__foot { padding-top: 10px; padding-bottom: 10px; }
  .os-drawer__logins { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .os-drawer, .os-drawer__panel, .os-drawer__sub, .os-drawer__sublink, .os-drawer__toggle svg { transition: none !important; }
}
