/* ═══════════════════════════════════════════════════════════════
   KWIKO GLOBAL HEADER (v17.1 Fixed)
   Using CSS Grid for perfect centering
   ═══════════════════════════════════════════════════════════════ */

:root {
    --header-height: 80px;
}

/* 1. HEADER WRAPPER */
.k-header {
    position: fixed;
    top: 24px;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: calc(100% - 48px);
    max-width: 1200px;
    z-index: 9999;
    opacity: 1;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

.k-header.header-hidden {
    transform: translateY(-150%);
    opacity: 0;
}

/* 2. NAV CONTAINER (Grid for Center Alignment) */
.k-nav-container {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    /* Left | Center | Right */
    align-items: center;
    height: 72px;
    padding: 0 24px;

    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    width: 100%;
}

.k-header.scrolled .k-nav-container {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* 3. ALIGNMENT HELPERS */
.k-logo {
    justify-self: start;
    display: flex;
    align-items: center;
    text-decoration: none;
    z-index: 2;
}

.k-logo-text {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.04em;
    text-transform: uppercase;
}

/* 4. DESKTOP NAVIGATION (Center) */
.k-nav-desktop {
    justify-self: center;
    display: none;
    /* Hidden on mobile */
    z-index: 1;
}

@media (min-width: 900px) {
    .k-nav-desktop {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 6px;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.05);
        border-radius: 100px;
    }
}

.k-nav-link {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 100px;
    transition: all 0.2s ease;
}

.k-nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.k-nav-link.is-active {
    background: #fff;
    color: #000;
    font-weight: 600;
}

/* 5. CTA BUTTON */
.k-btn-cta {
    justify-self: end;
    /* Pushes to right edge */
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1px;
    border-radius: 100px;
    overflow: hidden;
    text-decoration: none;
    cursor: pointer;
}

/* Animated Gradient Border */
.k-btn-cta::before {
    content: "";
    position: absolute;
    inset: -200%;
    background: conic-gradient(from 0deg, transparent 0%, transparent 80%, var(--k-orange) 100%);
    animation: border-spin 3s linear infinite;
}

@keyframes border-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.k-btn-content {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 100px;
    background: rgba(20, 20, 20, 0.9);
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 1;
    transition: all 0.3s ease;
}

.k-btn-cta:hover .k-btn-content {
    background: rgba(243, 112, 34, 0.15);
}

.k-btn-icon {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.k-btn-cta:hover .k-btn-icon {
    transform: translateX(4px);
}

@media (max-width: 900px) {
    .k-btn-cta {
        display: none;
    }
}

/* 6. MOBILE OVERRIDES */
.k-menu-toggle {
    display: flex;
    justify-self: end;
    /* Push toggle to right */
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    padding: 0;
    margin: 0;
    z-index: 10001;
}

/* Fine-tune hamburger centering inside the circular toggle */
.k-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
}

.k-menu-toggle .hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    top: 1px;
    /* tiny optical tweak downwards */
}

/* Keep the three lines perfectly horizontal + centered */
.k-menu-toggle .hamburger-line {
    left: 0;
}

@media (min-width: 900px) {
    .k-menu-toggle {
        display: none;
    }
}

@media (max-width: 900px) {
    .k-nav-container {
        /* Switch back to flex for mobile simplicity (Logo Left, Toggle Right) */
        display: flex;
        justify-content: space-between;
    }
}

/* 7. HAMBURGER ANIMATION */
.hamburger {
    width: 20px;
    height: 14px;
    position: relative;
}

.hamburger-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.hamburger-line:nth-child(1) {
    top: 0;
}

.hamburger-line:nth-child(2) {
    top: 6px;
}

.hamburger-line:nth-child(3) {
    top: 12px;
}

.k-menu-toggle.is-active .hamburger-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.k-menu-toggle.is-active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.k-menu-toggle.is-active .hamburger-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* 8. MOBILE OVERLAY */
.k-mobile-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

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

.k-mobile-close {
    position: absolute;
    top: 32px;
    right: 32px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.k-mobile-close:hover {
    color: #fff;
    border-color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.k-mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 24px;
    text-align: center;
}

.k-mobile-link {
    font-family: var(--font-display);
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: color 0.3s ease, transform 0.3s ease;
}

.k-mobile-link:hover,
.k-mobile-link.is-active {
    color: #fff;
    transform: translateX(10px);
}

.k-mobile-cta {
    font-size: 1.2rem;
    font-weight: 600;
    font-family: var(--font-body);
    color: var(--k-orange);
    margin-top: 24px;
    padding: 12px 32px;
    border: 1px solid var(--k-orange);
    border-radius: 100px;
    text-decoration: none;
}

.k-mobile-footer {
    position: absolute;
    bottom: 40px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 40px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
}

.k-mobile-footer a {
    color: inherit;
    text-decoration: none;
}