/* ============================================================
   BuildX Header, Navigation, Marquee, Floating Buttons
   ============================================================ */

/* ── Utility Bar ────────────────────────────────────────────── */
.utility-bar {
    background: #000;
    padding: 6px 0;
    font-size: 0.75rem;
    color: #ccc;
    position: relative;
    z-index: 1100;
}

.utility-bar__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.utility-bar__left {
    display: flex;
    align-items: center;
    gap: 4px;
}

.utility-bar__sep {
    margin: 0 4px;
    color: #666;
}

.utility-bar a {
    color: #ccc;
    transition: color 0.2s;
}

.utility-bar a:hover {
    color: #F5A623;
}

.utility-bar__right {
    display: flex;
    gap: 16px;
}

/* ── Scrolling Ticker (replaces deprecated <marquee>) ──────── */
.ticker {
    background: #F5A623;
    overflow: hidden;
    height: 38px;
    line-height: 38px;
    position: relative;
    width: 100%;
    z-index: 1100;
}

.ticker__track {
    display: flex;
    width: max-content;
    white-space: nowrap;
    animation: ticker-scroll 25s linear infinite;
    will-change: transform;
}

.ticker:hover .ticker__track {
    animation-play-state: paused;
}

.ticker__link {
    display: inline-block;
    padding: 0 60px;
    font-size: 16px;
    font-weight: 700;
    color: #000;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.ticker__link:hover {
    text-decoration: underline;
}

@keyframes ticker-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ── Header ─────────────────────────────────────────────────── */
.header {
    background: #000;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.header__logo img {
    height: 44px;
    width: auto;
}

/* ── Navigation ─────────────────────────────────────────────── */
.nav__list {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav__link {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #FFFFFF;
    border-radius: 6px;
    transition: color 0.2s, background-color 0.2s;
    white-space: nowrap;
}

.nav__link:hover,
.nav__link--active {
    color: #F5A623;
}

.nav__arrow {
    transition: transform 0.2s;
}

/* Dropdown */
.nav__item--dropdown {
    position: relative;
}

.nav__dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: #000000;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.2s ease;
    z-index: 1001;
}

.nav__item--dropdown:hover .nav__dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav__item--dropdown:hover .nav__arrow {
    transform: rotate(180deg);
}

.nav__dropdown-link {
    display: block;
    padding: 10px 20px;
    font-size: 0.875rem;
    color: #ccc;
    transition: color 0.2s, background-color 0.2s;
}

.nav__dropdown-link:hover {
    color: #F5A623;
    background: rgba(255, 255, 255, 0.05);
}

/* Header CTA */
.btn--header {
    padding: 8px 24px;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 6px;
}

/* ── Hamburger ──────────────────────────────────────────────── */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    width: 30px;
    padding: 4px 0;
    z-index: 1052;
}

.hamburger__line {
    display: block;
    width: 100%;
    height: 2px;
    background: #FFFFFF;
    border-radius: 2px;
    transition: all 0.3s;
}

.hamburger.active .hamburger__line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active .hamburger__line:nth-child(2) {
    opacity: 0;
}

.hamburger.active .hamburger__line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ── Floating Buttons -- REMOVED ────────────────────────────── */
.floating-buttons {
    display: none !important;
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

.floating-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.floating-btn--answers {
    background: #FFF;
    border: 2px solid #E0E0E0;
    color: #000000;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 10px 12px;
    border-radius: 8px 0 0 8px;
    text-align: center;
    line-height: 1.3;
    box-shadow: -2px 2px 8px rgba(0,0,0,0.1);
}

.floating-btn--answers:hover {
    background: #F8F8F8;
}

.floating-btn--callback {
    background: #F5A623;
    color: #000;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 10px 16px;
    border-radius: 8px 0 0 8px;
    box-shadow: -2px 2px 8px rgba(0,0,0,0.15);
}

.floating-btn--callback:hover {
    background: #E09510;
}

.floating-btn--phone {
    background: #2196F3;
    color: #FFFFFF;
    width: 48px;
    height: 48px;
    border-radius: 50% 0 0 50%;
    box-shadow: -2px 2px 8px rgba(0,0,0,0.2);
}

.floating-btn--phone:hover {
    background: #1976D2;
}

/* -- Mobile Nav Panel (lives OUTSIDE header in DOM) ----------- */
/*
 * FIXED 2026-08-08. Aaron reported the open drawer had its top items hidden and
 * its bottom items unreachable, with no way to scroll to either. Measured in a
 * real headless Chrome at a 360px-wide phone with an 800px LAYOUT viewport but
 * only ~610px actually VISIBLE (browser URL bar + system nav bar cover the rest).
 * Two separate, independent faults -- both reproduced, both fixed here:
 *
 * FAULT 1 -- THE TOP WAS COVERED, NOT MISSING.
 *   .utility-bar and .ticker both carry z-index: 1100. The panel was 1051.
 *   So the black bar and the orange ADU-Home-Tour ticker painted OVER the open
 *   drawer, swallowing the first nav item AND the close button. Measured proof:
 *   elementFromPoint at the close button returned A.ticker__link, and the close
 *   button tested reachable: false. That is why nothing up top was clickable.
 *   FIX: panel z-index 1101 (above 1100), overlay 1100.
 *
 * FAULT 2 -- height: 100vh LIED, so the bottom could not be scrolled to.
 *   100vh resolves to the LAYOUT viewport (800px), not the visible area (610px).
 *   The panel therefore believed it was 800px tall with only 836px of content,
 *   giving just 36px of available scroll -- while 226px of scrolling was needed
 *   to bring the last item into view. Measured SCROLL_SHORTFALL: 190px, leaving
 *   'LET'S TALK' and the phone number permanently unreachable. This is the exact
 *   chronic bug documented in skills/mobile-nav-scroll/SKILL.md.
 *   FIX: 100dvh (dynamic viewport height) with the 100vh line kept ABOVE it as a
 *   fallback for old browsers, plus generous bottom padding so the last item
 *   clears the address bar instead of sitting flush against it.
 *
 * Do NOT reintroduce `right: -100%` for the slide -- it can cause horizontal
 * page scroll. transform: translateX() never does.
 */
.nav--mobile {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 300px;
    height: 100vh;                      /* fallback -- old browsers only */
    height: 100dvh;                     /* REAL fix: tracks the visible area */
    background: #000000;
    padding: 24px 20px calc(120px + env(safe-area-inset-bottom));
    transform: translateX(100%);        /* off-screen without side-scroll */
    transition: transform 0.3s ease;
    z-index: 1101;                      /* MUST beat .utility-bar/.ticker (1100) */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;  /* iOS momentum scroll */
    overscroll-behavior: contain;       /* don't scroll the page behind it */
}

.nav--mobile.active {
    transform: translateX(0);
}

.nav--mobile .nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-top: 40px;
    /*
     * NO padding-bottom here. Aaron, 2026-08-08: the CTA buttons must sit
     * DIRECTLY below the divider under "Learning Center", not after a block of
     * empty space. I had added 80px earlier today as scroll-buffer insurance, but
     * that padding lands BETWEEN the last nav link's border-bottom and the CTA
     * block, which is precisely the dead gap he is pointing at -- it pushed the
     * two buttons a full screen down so they read as missing until you scrolled.
     * The panel's own bottom padding already guarantees the last element clears
     * the address bar, so this buffer was never needed here anyway.
     */
}

.nav--mobile .nav__link {
    padding: 14px 16px;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.nav--mobile .nav__dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    background: #000000;
    border-radius: 0;
    padding: 0;
}

.nav--mobile .nav__dropdown-link {
    padding: 12px 32px;
}

/*
 * CTA buttons sit BETWEEN the two dividing lines (Aaron, 2026-08-08).
 * The line ABOVE them is the last nav link's own border-bottom. The line BELOW
 * them is this block's border-bottom -- moved off border-top, because with the
 * dead space removed a border-top would have stacked directly against the nav
 * link's border-bottom and rendered as an ugly double rule. Buttons in the gap,
 * one line above, one line below, no empty space.
 */
.nav--mobile .nav__mobile-cta {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px 16px;
    margin-top: 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.nav__close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #fff;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.2s;
}

.nav__close:hover {
    background: rgba(255,255,255,0.1);
}

/* Mobile overlay (appended to body via JS) */
/* Raised 1050 -> 1100 alongside the panel's 1101 so the scrim still sits directly
 * beneath the drawer but now also dims the utility bar and ticker (both 1100)
 * instead of being painted over by them. */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Hide mobile nav panel on desktop, show desktop nav */
@media (min-width: 1271px) {
    .nav--mobile {
        display: none !important;
    }
    .nav-overlay {
        display: none !important;
    }
}

/* ── Mobile Responsive ──────────────────────────────────────── */
@media (max-width: 1270px) {
    .utility-bar__right {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    /* Hide desktop nav on mobile */
    .nav--desktop {
        display: none;
    }

    .header__actions {
        display: none;
    }

}

@media (max-width: 480px) {
    .utility-bar__left span:first-child {
        display: none;
    }
    .utility-bar__sep {
        display: none;
    }
    .ticker__link {
        font-size: 0.75rem;
    }
    .floating-btn--answers {
        display: none;
    }
}
