/* ==========================================================================
   Top App Bar — replaces the legacy 140px sidebar with a horizontal nav row.
   Matches iata-unifra-ui-kit nav-item styling.
   ========================================================================== */

/* --- Header container --- */

.iata-top-app-bar {
    background-color: var(--iata-white);
    position: relative;
    z-index: 100;
}

.iata-top-app-bar__content {
    display: flex;
    align-items: center;
    height: 100px;
    padding: 0 40px;
}

/* --- Brand (logo + wordmark) --- */

.iata-top-app-bar__brand {
    display: flex;
    align-items: center;
    color: var(--iata-blue-40);
    font-family: 'AktivGrotesk', Arial, Helvetica, sans-serif;
    font-weight: 400;
    font-size: 20px;
    line-height: 22px;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.iata-top-app-bar__brand:hover {
    color: var(--iata-blue-40);
}

.iata-top-app-bar__brand img {
    width: 87px;
    height: auto;
    margin-right: 6px;
}

.iata-top-app-bar__brand-logo {
    display: block;
}

.iata-top-app-bar__brand-title {
    display: flex;
    flex-direction: column;
}

.iata-top-app-bar__brand-title-primary {
    font-weight: 700;
    line-height: 26px;
}

/* --- Primary nav (desktop tabs) --- */

.iata-top-app-bar__nav {
    display: flex;
    align-items: center;
    flex: 1;
    /* Let the tabs scroll inside the nav, as they are set up to, rather than
       push the session block -- which a company name widens -- past the
       viewport: at 960px that scrolled the whole page sideways (ARMIP-196). */
    min-width: 0;
    margin-left: 60px;
    height: 100%;
}

.iata-top-app-bar__tabs {
    display: flex;
    align-items: stretch;
    gap: 40px;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
}

.iata-top-app-bar .iata-top-app-bar__tab-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    padding: 0;
    text-decoration: none;
    color: var(--iata-grey-40);
    font-family: 'AktivGrotesk', Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 20px;
    font-weight: 400;
    white-space: nowrap;
    border-bottom: 4px solid transparent;
    outline-offset: 4px;
}

.iata-top-app-bar .iata-top-app-bar__tab-link:hover {
    color: var(--iata-blue-40);
}

.iata-top-app-bar .iata-top-app-bar__tab-link.is-active {
    color: var(--iata-blue-40);
    border-bottom-color: var(--iata-blue-40);
}

.iata-top-app-bar .iata-top-app-bar__tab-link:focus-visible {
    outline: var(--iata-focus-width) solid var(--iata-focus-color);
    border-radius: var(--iata-radius-button);
}

.iata-top-app-bar__tab-link--icon {
    width: 32px;
}

.iata-top-app-bar .iata-top-app-bar__tab-link--icon md-icon {
    color: var(--iata-grey-40);
    font-size: 32px;
}

.iata-top-app-bar .iata-top-app-bar__tab-link--icon:hover md-icon,
.iata-top-app-bar .iata-top-app-bar__tab-link--icon.is-active md-icon {
    color: var(--iata-blue-40);
}

/* --- Desktop dropdown menu groups --- */

.iata-top-app-bar__menu-group {
    position: relative;
    display: inline-flex;
    align-items: stretch;
}

.iata-top-app-bar__tab-caret {
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-left: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transform-origin: center;
    transition: transform 0.15s ease;
}

.iata-top-app-bar__menu-group:hover .iata-top-app-bar__tab-caret,
.iata-top-app-bar__menu-group:focus-within .iata-top-app-bar__tab-caret {
    transform: rotate(225deg) translateY(-2px);
}

md-menu {
    --md-menu-container-color: var(--iata-white);
}

md-menu-item {
    --md-menu-item-label-text-font: 'AktivGrotesk', Arial, Helvetica, sans-serif;
    --md-menu-item-label-text-size: 14px;
}

/* --- Session UI --- */

.iata-top-app-bar__session {
    margin-left: 30px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 14px;
    line-height: 1.3;
}

.iata-top-app-bar__session p {
    text-align: right;
    font-size: 14px;
    margin-bottom: 2px;
}

.iata-top-app-bar__session a {
    color: var(--iata-grey-40);
    font-family: 'AktivGrotesk', Arial, Helvetica, sans-serif;
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
}

.iata-top-app-bar__session a:hover {
    color: var(--iata-red-primary);
}

/* --- Mobile hamburger (hidden on desktop) --- */

/* Figma "Registry - Mobile" (2086:35684): a 40px IATA/Blue menu glyph at the
   far right of the bar. Every state keeps the blue, as the tab icons do. */
.iata-top-app-bar__hamburger {
    display: none;
    flex-shrink: 0;
    margin-left: auto;
    --md-icon-button-icon-color: var(--iata-blue-40);
    --md-icon-button-hover-icon-color: var(--iata-blue-40);
    --md-icon-button-focus-icon-color: var(--iata-blue-40);
    --md-icon-button-pressed-icon-color: var(--iata-blue-40);
}

/* The size is set on the glyph, not through `--md-icon-button-icon-size`:
   material-symbols.css pins every md-icon at 24px, as the tab icon above meets. */
.iata-top-app-bar .iata-top-app-bar__hamburger md-icon {
    font-size: 40px;
}

/* --- Folded: tabs too wide for the bar go behind the hamburger (ARMIP-214) ---
   top-app-bar.js sets the modifier while the tabs would scroll. How wide they
   need to be depends on who is signed in -- the NDC Portals tab and the
   username/company block come and go -- so no breakpoint can say when. The
   session block moves into the drawer with the tabs; it is still in the bar
   while top-app-bar.js measures, so the fold point does not move. */

.iata-top-app-bar--folded .iata-top-app-bar__nav,
.iata-top-app-bar--folded .iata-top-app-bar__session {
    display: none;
}

.iata-top-app-bar--folded .iata-top-app-bar__hamburger {
    display: inline-flex;
}

/* --- Mobile navigation drawer --- */

.iata-mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 320px;
    max-width: 85vw;
    height: 100vh;
    background: var(--iata-white);
    z-index: 1100;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* The shadow belongs to the open drawer, not the closed one. `translateX(-100%)`
   moves the panel off-canvas but not its shadow, which kept bleeding ~6px back
   over the page at x=0 on every viewport, at every width. It is also `position:
   fixed`, so in a full-page screenshot it paints at whatever scroll offset the
   capture began at -- a viewport-tall band that migrates down the image and made
   `VccOorrQuestionnaires__oorr_questionnaire_errors` fail intermittently in CI
   (builds 475 and 476) against a baseline that passed in build 474. */
.iata-mobile-drawer.open {
    transform: translateX(0);
    box-shadow: var(--iata-shadow-drag);
}

.iata-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--iata-gap-s) var(--iata-gap-s) var(--iata-gap-s) var(--iata-gap-m);
    border-bottom: var(--iata-border-hairline);
    font-family: 'AktivGrotesk', Arial, Helvetica, sans-serif;
    font-weight: 500;
    font-size: 18px;
    color: var(--iata-grey-40);
}

.iata-drawer-nav {
    padding: var(--iata-gap-s) 0;
}

/* The rows md-list used to draw, drawn here instead.
   `.iata-material-shell` is compounded into both selectors on purpose: the
   shell's own `ul, ol` rule (material-pages.css) carries a bullet, a bottom
   margin and 1.5rem of indent, and it out-specifies a bare `.iata-drawer-nav
   ul` -- see docs/reference/material-design.md, "shell element rules
   out-specify bare classes". The 8px is md-list's own vertical padding. */
.iata-material-shell .iata-drawer-nav ul {
    margin: 0;
    padding: 8px 0;
    list-style: none;
}

.iata-material-shell .iata-drawer-nav li {
    margin: 0;
    padding: 0;
}

/* md-list-item's one-line row, to the pixel: 56px tall, 16px in from the left,
   the body font at 16px/24px in the surface's own ink. The 24px leading space
   the group rule below used to ask for never applied -- the label sat in the
   default slot, not the `headline` one the token governs -- so every row lined
   up at 16px and still does. */
.iata-drawer-nav a {
    display: flex;
    align-items: center;
    min-height: 56px;
    padding: 0 16px;
    font-family: 'AktivGrotesk', Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 24px;
    text-decoration: none;
    color: var(--md-sys-color-on-surface);
}

/* Who is signed in, above the Logout row: the bar's session block is hidden
   wherever the hamburger shows (ARMIP-214). The rows' 16px inset; compounded
   with `.iata-material-shell` to beat the shell's `p` margin, as above. */
.iata-drawer-session {
    padding-top: 16px;
}

.iata-material-shell .iata-drawer-session p {
    margin: 0;
    padding: 0 16px;
    font-size: 14px;
    line-height: 20px;
    color: var(--iata-grey-40);
    overflow-wrap: anywhere;
}

/* md-list-item's hover state layer: 8% of the same ink. */
.iata-drawer-nav a:hover {
    background: var(--iata-state-hover-layer);
}

/* No `gap` on the row: the "(opens in a new tab)" text beside this icon is an
   sr-only span, and a flex container would space a 1x1 clipped box off the
   icon as if it were a word. */
.iata-drawer-nav a md-icon {
    margin-left: 4px;
}

/* --- Scrim (overlay behind drawer) --- */

.iata-drawer-scrim {
    position: fixed;
    inset: 0;
    background: var(--md-sys-color-scrim);
    z-index: 1090;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.iata-drawer-scrim.open {
    opacity: 1;
    pointer-events: auto;
}

/* --- Drawer group headings --- */

.iata-drawer-group {
    padding: 0;
}

.iata-drawer-group__heading {
    font-family: 'AktivGrotesk', Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--iata-grey-60);
    padding: var(--iata-gap-s) var(--iata-gap-m) var(--iata-gap-xs);
    margin-top: var(--iata-gap-xs);
}

/* --- Responsive: collapse nav tabs below 768px --- */

@media (max-width: 767px) {
    .iata-top-app-bar__nav {
        display: none;
    }

    .iata-top-app-bar__brand {
        font-size: 18px;
    }

    .iata-top-app-bar__brand img {
        height: 48px;
        width: auto;
    }

    .iata-top-app-bar__content {
        height: 56px;
        padding: 0 var(--iata-gap-s);
    }

    .iata-top-app-bar__session {
        display: none;
    }

    /* Figma's mobile header has it on the right, as when folded (ARMIP-241). */
    .iata-top-app-bar__hamburger {
        display: inline-flex;
        order: 1;
        margin-left: auto;
    }
}
