/* ==========================================================================
   Activation King - Header & Mega Menu
   ========================================================================== */

/* ===== HEADER BAR ===== */
.ak-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    font-family: var(--font-body, 'Inter', system-ui, sans-serif);
}

.ak-nav {
    background: var(--hdr-nav-bg, #6941C6);
    transition: none;
}

.ak-header.ak-ready .ak-nav {
    transition: background 0.3s, backdrop-filter 0.3s, -webkit-backdrop-filter 0.3s;
}

.ak-header.scrolled .ak-nav {
    background: var(--hdr-scrolled-bg, rgba(105, 65, 198, 0.82));
    backdrop-filter: blur(var(--hdr-blur, 16px));
    -webkit-backdrop-filter: blur(var(--hdr-blur, 16px));
    box-shadow: 0 1px 0 rgba(255,255,255,.08), 0 4px 20px rgba(16,24,40,0.12);
}

.ak-nav-inner {
    max-width: var(--hdr-container-max, 1280px);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--hdr-px, 24px);
    height: var(--hdr-height, 72px);
    transition: height 0.3s;
}

.ak-header.scrolled .ak-nav-inner {
    height: var(--hdr-scrolled-height, 56px);
}

/* ===== HERO PAGE: transparent header over hero ===== */
.has-hero .ak-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.has-hero .ak-nav {
    background: transparent;
}

.has-hero .ak-header.scrolled {
    position: fixed;
}

.has-hero .ak-header.scrolled .ak-nav {
    background: var(--hdr-hero-bg, rgba(26, 10, 46, 0.8));
    backdrop-filter: blur(var(--hdr-blur, 16px));
    -webkit-backdrop-filter: blur(var(--hdr-blur, 16px));
}

/* ===== LOGO ===== */
.ak-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
    transition: filter 0.3s;
}

/* #3 Logo hover glow */
.ak-logo:hover {
    filter: brightness(1.15);
}

.ak-logo img {
    height: 32px;
    width: auto;
    margin-top: -2px;
}

.ak-logo-text {
    font-size: var(--hdr-logo-size, 20px);
    font-weight: var(--hdr-logo-weight, 700);
    color: #fff;
    letter-spacing: -0.3px;
}

/* ===== DESKTOP MENU ===== */
.ak-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    height: 100%;
}

.ak-menu-item {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.ak-menu-link {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 16px;
    color: var(--hdr-link-color, rgba(255, 255, 255, 0.9));
    text-decoration: none;
    font-size: var(--hdr-link-size, 15px);
    font-weight: var(--hdr-link-weight, 500);
    letter-spacing: 0.2px;
    border-radius: 100px;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
    height: auto;
    cursor: pointer;
    position: relative;
}

.ak-menu-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.ak-menu-item.active > .ak-menu-link {
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
}

/* ===== CONTACT PILL ===== */
.ak-contact-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: #FF6B81;
    border: 1px solid rgba(255,255,255,0.15);
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
    white-space: nowrap;
    margin-right: 4px;
}
.ak-contact-pill:hover {
    background: #f25a70;
    transform: scale(1.03);
    color: #fff;
}

.ak-nav-signin {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-primary, #7F56D9);
    background: #fff;
    text-decoration: none;
    transition: background .2s, transform .2s;
    white-space: nowrap;
}
.ak-nav-signin:hover {
    background: #F5F0FF;
    transform: scale(1.03);
    color: var(--color-primary, #7F56D9);
}
.scrolled .ak-nav-signin { background: #F5F0FF; color: #6941C6; }
.scrolled .ak-nav-signin:hover { background: #EDE9FE; }

.ak-nav-cta-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--color-accent-light, #FF8A9E) 0%, var(--color-accent, #F43F5E) 100%);
    text-decoration: none;
    transition: transform .2s, box-shadow .2s;
    white-space: nowrap;
}
.ak-nav-cta-pill:hover {
    transform: scale(1.03);
    box-shadow: 0 2px 12px rgba(244, 63, 94, .3);
    color: #fff;
}

/* ===== RIGHT SIDE ===== */
.ak-nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.ak-nav-action {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--hdr-link-color, rgba(255, 255, 255, 0.9));
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 8px;
    transition: color 0.15s, background 0.15s;
}

.ak-nav-action:hover {
    color: #fff;
    background: var(--hdr-link-hover-bg, rgba(255, 255, 255, 0.1));
}

/* ===== HAMBURGER ===== */
.ak-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 6px;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s;
}

.ak-hamburger:hover {
    background: var(--hdr-link-hover-bg, rgba(255, 255, 255, 0.1));
}

.ak-hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.ak-hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.ak-hamburger.open span:nth-child(2) {
    opacity: 0;
}

.ak-hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ===== MINI DROPDOWNS (Lang, Account, Cart) ===== */
.ak-mini-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.ak-nav-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--hdr-link-color, rgba(255, 255, 255, 0.9));
    transition: color 0.15s, background 0.15s;
    position: relative;
}

.ak-nav-icon-btn:hover {
    color: #fff;
    background: var(--hdr-link-hover-bg, rgba(255, 255, 255, 0.1));
}

/* #16 Cart wiggle on hover */
.ak-cart-btn:hover svg {
    animation: ak-wiggle 0.4s ease;
}

@keyframes ak-wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-8deg); }
    50% { transform: rotate(8deg); }
    75% { transform: rotate(-4deg); }
}

/* Cart badge */
.cart-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--color-accent, #F43F5E);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: transform 0.3s cubic-bezier(.4,0,.2,1);
}

.cart-badge.bounce {
    animation: ak-badge-bounce 0.4s cubic-bezier(.4,0,.2,1);
}

.cart-badge[data-count="0"] {
    display: none;
}

@keyframes ak-badge-bounce {
    0% { transform: scale(1); }
    40% { transform: scale(1.4); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

.ak-mini-dd-panel {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12), 0 2px 8px rgba(16, 24, 40, 0.06);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(6px);
    transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
    padding: 4px;
    z-index: 100;
    margin-top: 8px;
}

/* Invisible bridge to prevent gap closing */
.ak-mini-dd-panel::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 0;
    right: 0;
    height: 8px;
}

.ak-mini-dropdown.active .ak-mini-dd-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.ak-mini-dd-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text, #344054);
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.12s, color 0.12s;
}

.ak-mini-dd-item:hover {
    background: var(--gray-50, #F9FAFB);
    color: var(--color-text, #344054);
}

/* #5 Active language checkmark */
.ak-mini-dd-item.active {
    color: var(--color-primary, #7F56D9);
    font-weight: 600;
}

.ak-mini-dd-item.active::after {
    content: '\2713';
    margin-left: auto;
    font-size: 13px;
    color: var(--color-primary, #7F56D9);
}

.ak-mini-dd-label {
    flex: 1;
}

.ak-mini-dd-code {
    font-size: 11px;
    color: var(--color-text-light, #98A2B3);
    font-weight: 400;
}

.ak-mini-dd-flag {
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
}

/* #14 Mini dropdown icon color transition */
.ak-mini-dd-icon {
    flex-shrink: 0;
    color: var(--color-text-light, #667085);
    margin-right: 4px;
    transition: color 0.2s;
}

.ak-mini-dd-item:hover .ak-mini-dd-icon {
    color: var(--color-primary, #7F56D9);
}

/* Account user info */
.ak-mini-dd-user {
    padding: 12px;
    border-bottom: 1px solid var(--gray-100, #F2F4F7);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ak-mini-dd-user-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.ak-mini-dd-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-primary, #7F56D9);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

.ak-mini-dd-user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ak-mini-dd-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text, #101828);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ak-mini-dd-user-email {
    font-size: 11px;
    color: var(--color-text-light, #667085);
    display: block;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ak-mini-dd-tier {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.ak-tier-pro {
    background: var(--color-primary-bg, #F5F0FF);
    color: var(--color-primary, #7F56D9);
}

.ak-tier-trial {
    background: #FEF3C7;
    color: #92400E;
}

.ak-mini-dd-danger {
    color: #DC2626;
}

.ak-mini-dd-danger .ak-mini-dd-icon {
    color: #DC2626;
}

.ak-mini-dd-danger:hover {
    background: #FEF2F2;
    color: #DC2626;
}

.ak-mini-dd-divider {
    height: 1px;
    background: var(--gray-100, #F2F4F7);
    margin: 4px 0;
}

/* ===== MOBILE OVERLAY ===== */
.ak-mobile-overlay {
    position: fixed;
    inset: 0;
    background: var(--hdr-overlay-bg, rgba(0, 0, 0, 0.4));
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.ak-mobile-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* ===== MOBILE MENU ===== */
.ak-mobile-menu {
    position: fixed;
    top: 0;
    right: calc(var(--hdr-mobile-menu-w, 320px) * -1);
    width: var(--hdr-mobile-menu-w, 320px);
    max-width: 85vw;
    height: 100dvh;
    background: #fff;
    z-index: 999;
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.1);
    touch-action: pan-y;
}

.ak-mobile-menu.open {
    right: 0;
}

/* #13 Swipe hint - drag handle */
.ak-mobile-menu::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 40px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.3s;
}

.ak-mobile-menu.open::before {
    opacity: 1;
}

.ak-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100, #F2F4F7);
}

.ak-mobile-header .ak-logo-text {
    color: var(--color-text, #101828);
    font-size: 18px;
}

.ak-mobile-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    color: var(--color-text-light, #667085);
    transition: background 0.15s;
}

.ak-mobile-close:hover {
    background: var(--gray-50, #F9FAFB);
}

.ak-mobile-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
}

.ak-mobile-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text, #101828);
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.15s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.ak-mobile-link:hover {
    background: var(--gray-50, #F9FAFB);
}

.ak-mobile-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    margin: 4px 0;
}

/* #11 Mobile utility row (lang + account) */
.ak-mobile-utils {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--gray-100, #F2F4F7);
}

.ak-mobile-lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--gray-50, #F9FAFB);
    border: 1px solid var(--gray-100, #F2F4F7);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text, #344054);
    cursor: pointer;
    flex: 1;
    justify-content: center;
}

.ak-mobile-account-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--gray-50, #F9FAFB);
    border: 1px solid var(--gray-100, #F2F4F7);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text, #344054);
    text-decoration: none;
    flex: 1;
    justify-content: center;
}

.ak-mobile-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--gray-100, #F2F4F7);
}

/* ===== RESPONSIVE ===== */

/* Tablet: hide desktop menu, show hamburger */
@media (max-width: 991px) {
    .ak-menu {
        display: none;
    }

    .ak-nav-right {
        display: none;
    }

    .ak-hamburger {
        display: flex;
    }

    .ak-nav-inner {
        height: var(--hdr-mobile-height, 56px);
        padding: 0 var(--hdr-mobile-px, 16px);
    }

    .ak-nav {
        background: var(--hdr-nav-bg, #6941C6);
    }

    .has-hero .ak-nav {
        background: transparent;
    }

    .ak-header.scrolled .ak-nav {
        background: var(--hdr-scrolled-bg, rgba(105, 65, 198, 0.85));
        backdrop-filter: blur(var(--hdr-blur, 16px));
        -webkit-backdrop-filter: blur(var(--hdr-blur, 16px));
    }

    .has-hero .ak-header.scrolled .ak-nav {
        background: var(--hdr-hero-bg, rgba(26, 10, 46, 0.8));
        backdrop-filter: blur(var(--hdr-blur, 16px));
        -webkit-backdrop-filter: blur(var(--hdr-blur, 16px));
    }
}

/* Desktop: hide mobile elements */
@media (min-width: 992px) {
    .ak-mobile-overlay,
    .ak-mobile-menu,
    .ak-hamburger {
        display: none !important;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .ak-mobile-menu {
        width: 100%;
        max-width: 100vw;
        right: -100%;
    }
}
