/* ============================================================
   HEADER STYLES — Koncept Machining
   ============================================================ */

/* ─── TOPBAR ─── */
.header-topbar {
    background: var(--carbon);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding: 7px 0;
    font-size: 12px;
    transition: max-height 0.3s ease, padding 0.3s ease;
    overflow: hidden;
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.topbar-contact {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.topbar-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--fog);
    font-size: 12px;
    text-decoration: none;
    transition: color var(--transition);
}

.topbar-link:hover { color: var(--accent); }

.topbar-link .icon {
    width: 13px;
    height: 13px;
    color: var(--accent);
    flex-shrink: 0;
}

.topbar-sep {
    color: var(--steel);
    user-select: none;
}

.topbar-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(232,80,10,0.1);
    border: 1px solid rgba(232,80,10,0.2);
    padding: 3px 10px;
    border-radius: 20px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-social {
    color: var(--muted);
    transition: color var(--transition);
    display: flex;
    align-items: center;
}

.topbar-social:hover { color: var(--accent); }

/* ─── MAIN HEADER ─── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(13,15,20,0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    transition: box-shadow 0.3s ease;
}

.site-header.scrolled {
    box-shadow: 0 4px 32px rgba(0,0,0,0.6);
}

.site-header.scrolled .header-topbar {
    max-height: 0;
    padding: 0;
    overflow: hidden;
}

.header-main {
    padding: 14px 0;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

/* ─── LOGO ─── */
.site-logo {
    flex-shrink: 0;
}

.site-logo img {
    height: 48px;
    width: auto;
}

.logo-text {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-mark {
    width: 40px;
    height: 40px;
    background: var(--accent);
    color: var(--white);
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    flex-shrink: 0;
}

.logo-words {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.logo-name {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 15px;
    letter-spacing: -0.01em;
    color: var(--white);
    line-height: 1;
}

.logo-tagline {
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    font-family: var(--font-mono);
    line-height: 1;
}

/* ─── PRIMARY NAV ─── */
.primary-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    position: relative;
}

.nav-menu > li > a {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--fog);
    text-decoration: none;
    border-radius: var(--radius);
    transition: color var(--transition), background var(--transition);
    white-space: nowrap;
}

.nav-menu > li > a:hover,
.nav-menu > li.current-menu-item > a,
.nav-menu > li.current-menu-ancestor > a {
    color: var(--accent);
    background: rgba(232,80,10,0.08);
}

/* Chevron for dropdowns */
.nav-menu > li.menu-item-has-children > a::after {
    content: '';
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%238A93A8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='4,6 8,10 12,6'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    transition: transform 0.2s ease;
}

.nav-menu > li.menu-item-has-children:hover > a::after {
    transform: rotate(180deg);
}

/* ─── DROPDOWN MENU ─── */
.nav-menu .sub-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 220px;
    background: var(--carbon);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-lg);
    padding: 8px;
    list-style: none;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 100;
}

.nav-menu li:hover > .sub-menu,
.nav-menu li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-menu .sub-menu a {
    display: block;
    padding: 9px 14px;
    font-size: 13px;
    color: var(--fog);
    text-decoration: none;
    border-radius: 6px;
    transition: color var(--transition), background var(--transition);
}

.nav-menu .sub-menu a:hover {
    color: var(--accent);
    background: rgba(232,80,10,0.08);
}

/* ─── HEADER CTA ─── */
.header-cta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.btn-wa-header {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: rgba(37,211,102,0.12);
    border: 1px solid rgba(37,211,102,0.25);
    border-radius: var(--radius);
    color: var(--whatsapp);
    transition: all var(--transition);
}

.btn-wa-header:hover {
    background: var(--whatsapp);
    color: var(--white);
    border-color: var(--whatsapp);
}

/* ─── HAMBURGER ─── */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 36px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.hamburger__line {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--fog);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.hamburger.is-active .hamburger__line:nth-child(1) {
    transform: translateY(11px) rotate(45deg);
}

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

.hamburger.is-active .hamburger__line:nth-child(3) {
    transform: translateY(-11px) rotate(-45deg);
}

/* ─── MOBILE OVERLAY ─── */
.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

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

/* ─── RESPONSIVE ─── */
@media (max-width: 960px) {
    .topbar-contact .topbar-link:not(:first-child) { display: none; }
    .topbar-sep { display: none; }
}

@media (max-width: 768px) {
    .header-topbar { display: none; }
    .hamburger { display: flex; }

    .primary-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: min(320px, 85vw);
        height: 100vh;
        background: var(--carbon);
        border-left: 1px solid rgba(255,255,255,0.08);
        z-index: 1000;
        overflow-y: auto;
        padding: 80px 0 40px;
        transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .primary-nav.is-open {
        right: 0;
    }

    .nav-menu {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0 16px;
    }

    .nav-menu > li > a {
        padding: 13px 16px;
        font-size: 15px;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        border-radius: 0;
    }

    .nav-menu .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        background: rgba(0,0,0,0.2);
        padding: 0 0 0 16px;
        display: none;
        border-radius: 0;
    }

    .nav-menu li.is-open > .sub-menu {
        display: block;
    }

    .btn-wa-header { display: none; }
}
