/* =============================================================
   OVERFLOW HEADER — Horizontal nav with "More ▾" overflow
   Prefix: hof-
   ============================================================= */

.hof-header {
    --hof-height: 72px;
    --hof-height-mobile: 60px;
    --hof-bg: #ffffff;
    --hof-text: #1a1a2e;
    --hof-text-muted: #64748b;
    --hof-accent: var(--main-bg, #025273);
    --hof-accent-light: var(--bg-third, #F5FDFF);
    --hof-border: rgba(0,0,0,0.06);
    --hof-shadow: 0 1px 0 var(--hof-border);
    --hof-dropdown-shadow:
        0 4px 6px -1px rgba(0,0,0,0.07),
        0 12px 24px -4px rgba(0,0,0,0.09);
    --hof-radius: 10px;
    --hof-ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --hof-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --hof-speed: 0.22s;
    --hof-font: 'poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    position: relative;
    z-index: 100;
    font-family: var(--hof-font);
    -webkit-font-smoothing: antialiased;
}

/* ── Bar ── */
.hof-bar {
    width: 100%;
    height: var(--hof-height);
    background: var(--hof-bg);
    box-shadow: var(--hof-shadow);
    position: relative;
    z-index: 102;
}

.hof-container {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 36px !important;
    gap: 8px;
}

/* ── Logo ── */
.hof-logo { flex-shrink: 0; }

.hof-logo-link {
    display: flex;
    align-items: center;
    height: var(--hof-height);
    text-decoration: none !important;
}

.hof-logo img,
.hof-logo .logo-img { max-height: 42px; width: auto; object-fit: contain; display: block; }

.hof-logo .logo-lg-text-light {
    font-size: 20px;
    font-weight: 700;
    color: var(--hof-text);
    letter-spacing: -0.02em;
    white-space: nowrap;
}

/* ── Desktop Nav ── */
.hof-nav {
    display: flex;
    align-items: center;
    height: 100%;
    margin-left: auto;
    min-width: 0;
    overflow: visible;
}

.hof-menu {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 100%;
    gap: 2px;
    flex-wrap: nowrap;
    overflow: visible;
    position: relative;
}

.hof-item {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* ── Nav Links ── */
.hof-link {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 6px 14px;
    font-family: var(--hof-font);
    font-size: 14px;
    font-weight: 600;
    color: var(--hof-text);
    text-decoration: none !important;
    white-space: nowrap;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 8px;
    transition:
        background var(--hof-speed) var(--hof-ease),
        color var(--hof-speed) var(--hof-ease);
    position: relative;
    line-height: 1.5;
    letter-spacing: -0.01em;
}

.hof-link:hover, .hof-link:focus-visible {
    background: var(--hof-accent-light);
    color: var(--hof-accent);
    text-decoration: none !important;
}

/* Underline indicator */
.hof-link::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 14px;
    right: 14px;
    height: 2px;
    border-radius: 2px;
    background: var(--hof-accent);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.3s var(--hof-ease-out);
    pointer-events: none;
}

@media (min-width: 769px) {
    .hof-item:hover > .hof-link::after,
    .hof-item:focus-within > .hof-link::after {
        transform: scaleX(1);
    }

    .hof-item--more > .hof-link--more::after { display: none; }
}

/* ── Chevron ── */
.hof-chevron {
    width: 12px; height: 12px;
    flex-shrink: 0;
    transition: transform 0.3s var(--hof-ease-out);
    margin-left: 1px;
}

/* ── Dropdown ── */
.hof-dropdown {
    position: absolute;
    top: calc(100% - 4px);
    left: 0;
    padding-top: 8px;
    z-index: 200;
    pointer-events: none;
}

.hof-more-dropdown { left: auto; right: 0; }

.hof-dropdown-inner {
    min-width: 220px;
    background: var(--hof-bg);
    border: 1px solid var(--hof-border);
    border-radius: var(--hof-radius);
    box-shadow: var(--hof-dropdown-shadow);
    padding: 6px;
    opacity: 0;
    transform: translateY(6px);
    transition:
        opacity var(--hof-speed) var(--hof-ease),
        transform var(--hof-speed) var(--hof-ease);
}

@media (min-width: 769px) {
    .hof-item--has-children:hover > .hof-dropdown,
    .hof-item--has-children:focus-within > .hof-dropdown,
    .hof-item.hof-open > .hof-dropdown {
        pointer-events: auto;
    }

    .hof-item--has-children:hover > .hof-dropdown .hof-dropdown-inner,
    .hof-item--has-children:focus-within > .hof-dropdown .hof-dropdown-inner,
    .hof-item.hof-open > .hof-dropdown .hof-dropdown-inner {
        opacity: 1;
        transform: translateY(0);
    }

    .hof-item--has-children:hover > .hof-link .hof-chevron,
    .hof-item.hof-open > .hof-link .hof-chevron {
        transform: rotate(180deg);
    }
}

.hof-dropdown-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    font-size: 13.5px;
    font-weight: 500;
    font-family: var(--hof-font);
    color: var(--hof-text);
    text-decoration: none !important;
    border-radius: 7px;
    transition: background var(--hof-speed) var(--hof-ease), color var(--hof-speed) var(--hof-ease);
}

.hof-dropdown-link:hover {
    background: var(--hof-accent-light);
    color: var(--hof-accent);
    text-decoration: none !important;
}


/* ── Hamburger (mobile only) ── */
.hof-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    margin-left: auto;
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    z-index: 103;
    transition: background var(--hof-speed);
}

.hof-hamburger:hover { background: var(--hof-accent-light); }

.hof-hamburger-line {
    display: block;
    width: 20px; height: 2px;
    background: var(--hof-text);
    border-radius: 2px;
    transition: transform 0.3s var(--hof-ease-out), opacity 0.2s ease;
    position: absolute;
}

.hof-hamburger-line:nth-child(1) { transform: translateY(-6px); }
.hof-hamburger-line:nth-child(2) { transform: translateY(0); }
.hof-hamburger-line:nth-child(3) { transform: translateY(6px); }

.hof-hamburger.active .hof-hamburger-line:nth-child(1) { transform: rotate(45deg); }
.hof-hamburger.active .hof-hamburger-line:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hof-hamburger.active .hof-hamburger-line:nth-child(3) { transform: rotate(-45deg); }

/* ── Backdrop ── */
.hof-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.2);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s var(--hof-ease), visibility 0.3s;
    backdrop-filter: blur(2px);
}

.hof-backdrop.active { opacity: 1; visibility: visible; }


/* =============================================================
   MOBILE (≤ 768px)
   ============================================================= */
@media (max-width: 768px) {
    .hof-bar { height: var(--hof-height-mobile); }
    .hof-container { padding: 0 16px !important; }
    .hof-logo-link { height: var(--hof-height-mobile); }
    .hof-logo img, .hof-logo .logo-img { max-height: 34px; }

    .hof-hamburger { display: flex; }

    /* Mobile nav panel */
    .hof-nav {
        position: fixed;
        top: var(--hof-height-mobile);
        left: 0; right: 0; bottom: 0;
        background: var(--hof-bg);
        margin-left: 0;
        flex-direction: column;
        align-items: stretch;
        height: auto;
        max-height: calc(100dvh - var(--hof-height-mobile));
        overflow-y: auto;
        overscroll-behavior: contain;
        z-index: 101;
        padding: 8px 0 32px;
        transform: translateY(-8px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition:
            transform 0.3s var(--hof-ease-out),
            opacity 0.25s var(--hof-ease),
            visibility 0.3s;
    }

    .hof-nav.hof-mobile-open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .hof-menu {
        flex-direction: column;
        align-items: stretch;
        height: auto;
        gap: 0;
        padding: 0 12px;
        overflow: visible;
    }

    .hof-item {
        height: auto;
        flex-direction: column;
        align-items: stretch;
    }

    .hof-link {
        padding: 12px 16px;
        font-size: 15px;
        border-radius: 10px;
        width: 100%;
        justify-content: space-between;
    }

    .hof-link::after { display: none; }

    .hof-dropdown { position: static; padding-top: 0; pointer-events: auto; }

    .hof-dropdown-inner {
        min-width: auto;
        border: none; border-radius: 0; box-shadow: none;
        padding: 0 0 4px 12px;
        max-height: 0;
        overflow: hidden;
        opacity: 1; transform: none;
        transition: max-height 0.35s var(--hof-ease-out);
    }

    .hof-item--has-children.hof-open > .hof-dropdown .hof-dropdown-inner { max-height: 600px; }
    .hof-item--has-children.hof-open > .hof-link .hof-chevron { transform: rotate(180deg); }

    body.hof-menu-open { overflow: hidden; }
}

/* ── Page width alignment ── */
@media (min-width: 992px) {
    .hof-container { max-width: var(--page-max-desktop) !important; }
}

.hof-header * { box-sizing: border-box; }
.hof-header a { text-decoration: none !important; }
.hof-header ul { list-style: none; margin: 0; padding: 0; }
.hof-header button { font-family: inherit; }
