/* ================================================
   AEKAM AI — HEADER & NAVIGATION
   Version 2.0 — Component-injected, mobile-first
   ================================================ */

:root {
    --header-height: 72px;
    --header-height-scrolled: 60px;
    --transition: 0.25s ease;
    --color-brand: #FF3B30;
    --color-black: #0A0A0A;
    --color-white: #FFFFFF;
    --mobile-menu-width: 320px;
}

/* ---- Body offset ---- */
body {
    padding-top: var(--header-height);
}

[id] {
    scroll-margin-top: 90px;
}

/* ================================================
   SITE HEADER BAR
   ================================================ */
#site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #ebebeb;
    transition: box-shadow var(--transition), height var(--transition);
}

#site-header.scrolled {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
}

/* ---- Inner row ---- */
.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: height var(--transition);
}

#site-header.scrolled .header-inner {
    height: var(--header-height-scrolled);
}

/* ================================================
   LOGO
   ================================================ */
.header-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: transform var(--transition);
}

.header-logo:hover {
    transform: scale(1.02);
}

.header-logo img {
    display: block;
    max-width: 100%;
    height: auto;
}


/* ================================================
   DESKTOP NAVIGATION
   ================================================ */
.header-desktop-nav {
    display: flex;
    align-items: center;
    height: 100%;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 100%;
}

.header-nav>li {
    position: relative;
    height: 100%;
    display: flex;
    align-items: stretch;
}

.header-nav>li>a {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 1rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #666;
    text-decoration: none;
    white-space: nowrap;
    transition: color var(--transition);
}

.header-nav>li>a:hover,
.header-nav>li.active>a {
    color: var(--color-black);
}

.header-nav>li>a .chevron {
    transition: transform var(--transition);
    opacity: 0.5;
}

.header-nav>li.has-submenu:hover>a .chevron {
    transform: rotate(180deg);
    opacity: 1;
}

/* ---- Dropdown Submenu ---- */
.header-nav li .submenu {
    position: absolute;
    top: calc(100% + 0px);
    left: 0;
    min-width: 220px;
    background: #fff;
    border: 1px solid #e8e8e8;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.09);
    border-radius: 14px;
    padding: 0.5rem;
    margin: 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 3000;
}

/* Invisible bridge to prevent submenu closing on gap */
.header-nav li .submenu::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
}

.header-nav li:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.header-nav li .submenu li a {
    display: flex;
    align-items: center;
    padding: 0.6rem 1rem;
    font-size: 0.82rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
    color: #555;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.header-nav li .submenu li a:hover {
    background: #f5f5f5;
    color: var(--color-black);
}

/* ---- Wide Submenu (Solutions grouped) ---- */
.header-nav li .submenu--wide {
    min-width: 260px;
    padding: 0.75rem;
}

/* Category section headers inside the dropdown */
.submenu-cat-label {
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    color: #aaa;
    padding: 0.5rem 0.75rem 0.2rem;
    cursor: default;
    user-select: none;
}

/* First category label gets no top padding */
.submenu--wide li.submenu-cat-label:first-child {
    padding-top: 0.2rem;
}

/* Thin divider between categories */
.submenu-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 0.4rem 0.5rem;
}

/* Small emoji icon before each link */
.submenu-icon {
    font-style: normal;
    font-size: 0.85rem;
    margin-right: 0.5rem;
    display: inline-block;
    flex-shrink: 0;
}

/* ---- CTA Button ---- */
.header-nav li.nav-cta {
    display: flex;
    align-items: center;
    padding-left: 0.75rem;
}

.header-nav li.nav-cta>a {
    background: var(--color-black);
    color: #fff !important;
    height: auto;
    padding: 9px 20px;
    border-radius: 50px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    transition: background 0.2s ease, transform 0.2s ease;
}

.header-nav li.nav-cta>a:hover {
    background: var(--color-brand);
    transform: translateY(-1px);
}

/* ================================================
   HAMBURGER (MOBILE ONLY)
   ================================================ */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    z-index: 3100;
    width: 36px;
    height: 36px;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 1.5px;
    background: var(--color-black);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: center;
}

.hamburger.open span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger.open span:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
}

/* ================================================
   MOBILE MENU — SLIDE-IN PANEL (RIGHT SIDE)
   ================================================ */
.mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--mobile-menu-width);
    max-width: 90vw;
    background: #fff;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1.75rem 2rem;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.12);
    overflow-y: auto;
}

.mobile-menu.open {
    transform: translateX(0);
}

/* ---- Backdrop ---- */
.mobile-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 2900;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-backdrop.visible {
    opacity: 1;
    visibility: visible;
}

/* ---- Close button ---- */
.mobile-menu-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f4f4f4;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    transition: background 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

.mobile-menu-close:hover {
    background: #e8e8e8;
    color: var(--color-black);
}

/* ---- Logo in menu ---- */
.mobile-menu-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--color-black);
    text-decoration: none;
    letter-spacing: -0.02em;
    margin-bottom: 2rem;
    margin-top: 0.25rem;
    padding-right: 2.5rem;
    /* avoid close btn */
}

/* ---- Nav links ---- */
.mobile-menu-nav {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex-grow: 1;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    padding: 0.8rem 0;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #444;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    transition: color 0.2s ease;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    color: var(--color-black);
}

.mobile-nav-link.active {
    color: var(--color-brand);
}

/* ---- Solutions accordion ---- */
.mobile-solutions-group {
    border-bottom: 1px solid #f0f0f0;
}

.mobile-solutions-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 0;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #444;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: color 0.2s ease;
}

.mobile-solutions-toggle:hover,
.mobile-solutions-toggle.active {
    color: var(--color-black);
}

.mobile-solutions-toggle.open {
    color: var(--color-black);
}

.toggle-chevron {
    transition: transform 0.3s ease;
    opacity: 0.5;
    flex-shrink: 0;
}

.mobile-solutions-toggle.open .toggle-chevron {
    transform: rotate(180deg);
    opacity: 1;
}

/* Drawer */
.mobile-solutions-drawer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.mobile-solutions-drawer.open {
    max-height: 400px;
    /* overridden by JS scrollHeight */
}

.mobile-sub-link {
    display: flex;
    align-items: center;
    padding: 0.55rem 0 0.55rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: #666;
    text-decoration: none;
    border-left: 2px solid #eee;
    margin-left: 0;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.mobile-sub-link:last-child {
    margin-bottom: 0.5rem;
}

.mobile-sub-link:hover {
    color: var(--color-black);
    border-left-color: #ccc;
}

.mobile-sub-link.active {
    color: var(--color-brand);
    border-left-color: var(--color-brand);
    font-weight: 600;
}

/* ---- CTA at bottom ---- */
.mobile-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 2rem;
    padding: 14px 28px;
    background: var(--color-black);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: 50px;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.mobile-cta:hover {
    background: var(--color-brand);
    transform: translateY(-1px);
}

/* ================================================
   RESPONSIVE BREAKPOINTS
   ================================================ */
@media (max-width: 900px) {
    .header-desktop-nav {
        display: none;
    }

    .hamburger {
        display: flex;
    }
}

/* ================================================
   SHARED FOOTER
   ================================================ */
#site-footer {
    background: #fff;
    border-top: 1px solid #EAEAEA;
    padding: 2rem 0 1rem;
    margin-top: 4rem;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-brand {
    display: flex;
    align-items: center;
}

.footer-location {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #9ca3af;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.footer-links a {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: #0A0A0A;
}

.footer-copy {
    text-align: center;
    font-size: 0.68rem;
    color: #d1d5db;
    padding: 0.75rem 2rem 0;
    border-top: 1px solid #f3f4f6;
}

@media (max-width: 640px) {
    .footer-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }
}