/**
 * Header Widget Styles - Professional & Modern
 *
 * @package PWZ_Theme
 * @since 1.0.0
 */

/* ============================================
   GLOBAL OVERFLOW FIX
   ============================================ */

/* Prevent horizontal scrollbar */
body.elementor-page {
    overflow-x: hidden;
    max-width: 100vw;
}

.elementor-section {
    overflow-x: hidden;
}

/* Ensure sections don't create stacking context that blocks header sub-menu */
.elementor-section,
.elementor-container,
.elementor-column,
.elementor-column-wrap,
.elementor-widget-wrap {
    position: relative;
}

/* Ensure header widget is always on top */
.elementor-section:has(.elementor-widget-pwz-header) {
    z-index: 999999 !important;
    position: relative;
}

/* ============================================
   ELEMENTOR COMPATIBILITY & OVERFLOW FIX
   ============================================ */

.elementor-widget-pwz-header {
    width: 100%;
    max-width: 100%;
    overflow: visible !important;
    z-index: 999999 !important;
    position: relative;
}

.elementor-widget-pwz-header .elementor-widget-container {
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100%;
    overflow: visible !important;
    z-index: 999999 !important;
    position: relative;
}

/* ============================================
   MAIN HEADER
   ============================================ */

.pwz-header {
    width: 100%;
    max-width: 100vw;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.98) 0%, rgba(10, 10, 10, 0.95) 100%);
    border-bottom: 1px solid rgba(0, 255, 136, 0.15);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 999999 !important;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: visible;
}

.pwz-header-sticky {
    position: sticky;
    top: 0;
}

.pwz-header-sticky.scrolled {
    background: rgba(0, 0, 0, 0.98);
    border-bottom-color: rgba(0, 255, 136, 0.25);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.6),
        0 0 40px rgba(0, 255, 136, 0.1);
    backdrop-filter: blur(15px);
}

.pwz-header-transparent {
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

.pwz-header-transparent.scrolled {
    background: rgba(0, 0, 0, 0.98);
    border-bottom-color: rgba(0, 255, 136, 0.25);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.6),
        0 0 40px rgba(0, 255, 136, 0.1);
}

/* Background Glow */
.pwz-header-glow {
    position: absolute;
    top: 0;
    left: 50%;
    width: 600px;
    height: 100%;
    background: radial-gradient(circle, rgba(0, 255, 136, 0.05) 0%, transparent 70%);
    transform: translateX(-50%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pwz-header.scrolled .pwz-header-glow {
    opacity: 1;
}

.pwz-header .pwz-container {
    max-width: 1320px;
    width: 100%;
    margin: 0 auto;
    padding: 0 24px;
    box-sizing: border-box;
    position: relative;
}

.pwz-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
    position: relative;
    z-index: 2;
    gap: 30px;
    isolation: isolate;
}

/* ============================================
   LOGO
   ============================================ */

.pwz-header-logo {
    position: relative;
    z-index: 3;
}

.pwz-logo-link {
    display: block;
    position: relative;
    transition: transform 0.3s ease;
}

.pwz-logo-link:hover {
    transform: scale(1.05);
}

.pwz-logo-image {
    display: block;
    height: auto;
    max-height: 45px;
    max-width: 100%;
    transition: filter 0.3s ease;
}

.pwz-logo-link:hover .pwz-logo-image {
    filter: drop-shadow(0 0 15px rgba(0, 255, 136, 0.6));
}

.pwz-logo-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0, 255, 136, 0.2) 0%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.3s ease;
    pointer-events: none;
}

.pwz-logo-link:hover .pwz-logo-glow {
    transform: translate(-50%, -50%) scale(1.5);
}

/* ============================================
   NAVIGATION
   ============================================ */

.pwz-header-nav {
    flex: 1;
    display: flex;
    justify-content: center;
    position: static;
    z-index: 100;
}

.pwz-header-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
    gap: 35px;
    position: relative;
    z-index: 100;
}

.pwz-header-menu > li {
    margin: 0;
    position: relative;
    z-index: 100;
}

.pwz-header-menu > li > a {
    font-family: var(--pwz-font-heading);
    font-size: 14px;
    font-weight: 600;
    color: #CCCCCC;
    text-decoration: none;
    padding: 10px 0;
    position: relative;
    display: inline-block;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.3px;
}

.pwz-header-menu > li > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #00FF88 50%, transparent 100%);
    transform: translateX(-50%);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.pwz-header-menu > li > a:hover,
.pwz-header-menu .current-menu-item > a,
.pwz-header-menu .current-menu-ancestor > a {
    color: #00FF88;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.pwz-header-menu > li > a:hover::after,
.pwz-header-menu .current-menu-item > a::after,
.pwz-header-menu .current-menu-ancestor > a::after {
    width: 100%;
}

.pwz-header-menu > li > a:focus:not(.focus-visible) {
    color: #00FF88;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
    outline: none;
    box-shadow: none;
}

.pwz-header-menu > li > a.focus-visible {
    color: #00FF88;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
    outline: 2px solid var(--pwz-accent);
    outline-offset: 2px;
}

.pwz-header-menu > li > a:focus {
    color: #00FF88;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
    outline: 2px solid var(--pwz-accent);
    outline-offset: 2px;
}

.pwz-header-menu > li > a:focus::after {
    width: 100%;
}

/* ============================================
   SUB-MENU / DROPDOWN
   ============================================ */

/* Dropdown Indicator */
.pwz-header-menu .menu-item-has-children > a {
    position: relative;
    padding-right: 20px !important;
}

.pwz-header-menu .menu-item-has-children > a::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #00FF88;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.9;
}

.pwz-header-menu .menu-item-has-children:hover > a::before {
    transform: translateY(-50%) rotate(180deg);
    opacity: 1;
    border-top-color: #00FF88;
    opacity: 1;
}

/* Sub-menu Container */
.pwz-header-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: linear-gradient(135deg, rgba(10, 10, 10, 0.98) 0%, rgba(0, 0, 0, 0.98) 100%);
    border: 1px solid rgba(0, 255, 136, 0.25);
    border-radius: 8px;
    padding: 12px 0;
    margin-top: 10px;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.6),
        0 0 30px rgba(0, 255, 136, 0.15),
        inset 0 1px 0 rgba(0, 255, 136, 0.1);
    z-index: 999999 !important;
    backdrop-filter: blur(10px);
}

.pwz-header-menu .menu-item-has-children:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Sub-menu Items */
.pwz-header-menu .sub-menu li {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid rgba(0, 255, 136, 0.08);
}

.pwz-header-menu .sub-menu li:last-child {
    border-bottom: none;
}

.pwz-header-menu .sub-menu a {
    display: block;
    padding: 12px 20px;
    font-family: var(--pwz-font-body);
    font-size: 13px;
    font-weight: 500;
    color: #CCCCCC;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    letter-spacing: 0.2px;
}

.pwz-header-menu .sub-menu a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(0, 255, 136, 0.15) 0%, transparent 100%);
    transition: width 0.3s ease;
    z-index: -1;
}

.pwz-header-menu .sub-menu a::after {
    content: '→';
    position: absolute;
    right: 20px;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    color: #00FF88;
}

.pwz-header-menu .sub-menu a:hover {
    color: #00FF88;
    padding-left: 28px;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.pwz-header-menu .sub-menu a:hover::before {
    width: 100%;
}

.pwz-header-menu .sub-menu a:hover::after {
    opacity: 1;
    transform: translateX(0);
}

/* Nested Sub-menu (Third Level) */
.pwz-header-menu .sub-menu .sub-menu {
    top: 0;
    left: 100%;
    margin-top: 0;
    margin-left: 10px;
}

.pwz-header-menu .sub-menu .menu-item-has-children > a::before {
    content: '';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 5px solid currentColor;
    margin-left: 0;
    opacity: 0.7;
}

.pwz-header-menu .sub-menu .menu-item-has-children:hover > a::before {
    transform: translateY(-50%) rotate(0deg);
    opacity: 1;
}

/* ============================================
   CTA BUTTON
   ============================================ */

.pwz-header-actions {
    display: flex;
    align-items: center;
}

.pwz-mobile-cta {
    display: none;
}

.pwz-header-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 24px;
    background: linear-gradient(135deg, #00FF88 0%, #00CC6A 100%);
    color: #000000;
    font-family: var(--pwz-font-body);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow:
        0 4px 15px rgba(0, 255, 136, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.pwz-header-cta::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
}

.pwz-header-cta:hover::before {
    width: 300px;
    height: 300px;
}

.pwz-header-cta:hover {
    transform: translateY(-2px);
    box-shadow:
        0 6px 25px rgba(0, 255, 136, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    gap: 12px;
    background: linear-gradient(135deg, #00CC6A 0%, #00AA55 100%);
}

.pwz-cta-text,
.pwz-cta-icon {
    position: relative;
    z-index: 1;
}

.pwz-cta-icon {
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.pwz-header-cta:hover .pwz-cta-icon {
    transform: translateX(3px);
}

/* ============================================
   MOBILE MENU TOGGLE
   ============================================ */

.pwz-menu-toggle {
    display: none;
    flex-direction: column;
    background: rgba(0, 255, 136, 0.08);
    border: 2px solid rgba(0, 255, 136, 0.25);
    border-radius: 8px;
    cursor: pointer;
    padding: 10px;
    gap: 5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 3;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.pwz-menu-toggle:hover {
    border-color: #00FF88;
    background: rgba(0, 255, 136, 0.15);
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(0, 255, 136, 0.2);
}

.pwz-menu-toggle span {
    width: 24px;
    height: 2.5px;
    background-color: #00FF88;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
    box-shadow: 0 0 5px rgba(0, 255, 136, 0.3);
}

.pwz-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.pwz-menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

.pwz-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Nav Close Button */
.pwz-nav-close {
    display: none;
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    color: var(--pwz-accent);
    cursor: pointer;
    transition: all 0.3s ease;
}

.pwz-nav-close:hover {
    background: var(--pwz-accent);
    border-color: var(--pwz-accent);
    color: #000000;
    transform: rotate(90deg);
}


/* Mobile Overlay */
.pwz-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 9998;
}

.pwz-nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1200px) {
    .pwz-header .pwz-container {
        max-width: 100%;
        padding: 0 20px;
    }

    .pwz-header-menu {
        gap: 28px;
    }

    .pwz-header-menu a {
        font-size: 13px;
    }

    .pwz-header-cta {
        padding: 10px 20px;
        font-size: 12px;
    }
}

@media (max-width: 1024px) {
    .pwz-header-inner {
        gap: 20px;
    }

    .pwz-header-menu {
        gap: 24px;
    }

    .pwz-header-menu a {
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .pwz-header .pwz-container {
        padding: 0 16px;
    }

    .pwz-header-inner {
        padding: 14px 0;
        gap: 16px;
    }

    .pwz-menu-toggle {
        display: flex;
    }

    .pwz-desktop-cta {
        display: none;
    }

    .pwz-header-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        max-width: 80%;
        height: 100vh;
        background: linear-gradient(135deg, rgba(10, 10, 10, 0.98) 0%, rgba(0, 0, 0, 0.98) 100%);
        padding: 70px 24px 24px;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow:
            -10px 0 40px rgba(0, 0, 0, 0.6),
            0 0 50px rgba(0, 255, 136, 0.1);
        border-left: 2px solid rgba(0, 255, 136, 0.25);
        overflow-y: auto;
        z-index: 9999;
    }

    .pwz-header-nav.active {
        right: 0;
    }

    .pwz-nav-close {
        display: flex;
    }

    .pwz-header-menu {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        width: 100%;
    }

    .pwz-header-menu li {
        width: 100%;
        border-bottom: 1px solid rgba(0, 255, 136, 0.12);
        animation: slideInRight 0.4s ease-out both;
    }

    .pwz-header-menu li:last-child {
        border-bottom: none;
    }

    .pwz-header-menu li:nth-child(1) { animation-delay: 0.1s; }
    .pwz-header-menu li:nth-child(2) { animation-delay: 0.15s; }
    .pwz-header-menu li:nth-child(3) { animation-delay: 0.2s; }
    .pwz-header-menu li:nth-child(4) { animation-delay: 0.25s; }
    .pwz-header-menu li:nth-child(5) { animation-delay: 0.3s; }
    .pwz-header-menu li:nth-child(6) { animation-delay: 0.35s; }

    @keyframes slideInRight {
        from {
            opacity: 0;
            transform: translateX(30px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    .pwz-header-menu > li > a {
        display: block;
        padding: 16px 0;
        width: 100%;
        font-size: 15px;
        font-weight: 600;
    }

    .pwz-header-menu > li > a::after {
        left: 0;
        transform: none;
        background: linear-gradient(90deg, #00FF88 0%, transparent 100%);
    }

    /* Mobile Sub-menu Styles */
    .pwz-header-menu .menu-item-has-children > a {
        padding-right: 30px !important;
    }

    .pwz-header-menu .menu-item-has-children > a::before {
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        border-left: 5px solid transparent;
        border-right: 5px solid transparent;
        border-top: 6px solid #00FF88;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .pwz-header-menu .menu-item-has-children.active > a::before {
        transform: translateY(-50%) rotate(180deg);
    }

    .pwz-header-menu .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: rgba(0, 255, 136, 0.03);
        border: none;
        border-left: 2px solid rgba(0, 255, 136, 0.3);
        border-radius: 0;
        margin: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
    }

    .pwz-header-menu .menu-item-has-children.active > .sub-menu {
        max-height: 500px;
        padding: 8px 0;
        margin-top: 8px;
        margin-bottom: 8px;
    }

    .pwz-header-menu .sub-menu li {
        border-bottom: 1px solid rgba(0, 255, 136, 0.06);
        animation: none;
    }

    .pwz-header-menu .sub-menu a {
        padding: 12px 0 12px 20px;
        font-size: 14px;
    }

    .pwz-header-menu .sub-menu a::before {
        display: none;
    }

    .pwz-header-menu .sub-menu a::after {
        display: none;
    }

    .pwz-header-menu .sub-menu a:hover {
        padding-left: 24px;
    }

    /* Nested Sub-menu Mobile */
    .pwz-header-menu .sub-menu .sub-menu {
        margin-left: 0;
        background: rgba(0, 255, 136, 0.02);
        border-left-color: rgba(0, 255, 136, 0.2);
    }

    .pwz-header-menu .sub-menu .sub-menu a {
        padding-left: 32px;
    }

    .pwz-header-menu .sub-menu .sub-menu a:hover {
        padding-left: 36px;
    }

    .pwz-header-menu .sub-menu .menu-item-has-children > a::before {
        right: 0;
        border-left: 5px solid currentColor;
        border-top: 4px solid transparent;
        border-bottom: 4px solid transparent;
    }

    .pwz-mobile-cta {
        display: block;
        margin-top: 24px;
        padding-top: 24px;
        border-top: 2px solid rgba(0, 255, 136, 0.15);
        animation: fadeInUp 0.4s ease-out 0.4s both;
    }

    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .pwz-mobile-cta .pwz-header-cta {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .pwz-header .pwz-container {
        padding: 0 12px;
    }

    .pwz-header-inner {
        padding: 12px 0;
    }

    .pwz-header-nav {
        width: 260px;
        max-width: 85%;
        padding: 60px 20px 20px;
    }

    .pwz-logo-image {
        max-height: 38px;
    }

    .pwz-header-menu a {
        font-size: 14px;
        padding: 14px 0;
    }

    .pwz-menu-toggle {
        padding: 8px;
    }

    .pwz-menu-toggle span {
        width: 22px;
    }
}

