/* ============================================
   Voltaic Brasil — Header Component v1.0
   ============================================ */

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 24px 48px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    transition: var(--transition);
}

header.scrolled {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    padding: 16px 48px;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--white);
    text-decoration: none;
    position: relative;
    z-index: 1001;
}

nav {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 40px;
    z-index: 1001;
}

nav a {
    color: var(--white);
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.5px;
    opacity: 0.8;
    transition: var(--transition);
}

nav a:hover {
    opacity: 1;
}

nav a.active {
    opacity: 0.8;
}

/* Header Icons */
.header-icons {
    position: absolute;
    right: 48px;
    display: flex;
    gap: 8px;
    align-items: center;
    z-index: 1001;
}

.header-icons .dropdown {
    position: relative;
}

.header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    opacity: 0.8;
    transition: var(--transition);
    cursor: none;
}

.header-icon:hover {
    opacity: 1;
    transform: scale(1.1);
}

.header-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0) invert(1);
    transition: var(--transition);
}

header:has(.dropdown-vehicles:hover) .header-icon img,
header:has(.dropdown-engenharia:hover) .header-icon img,
header:has(.dropdown-sobre:hover) .header-icon img,
header:has(.dropdown-redes:hover) .header-icon img,
header:has(.mega-menu:hover) .header-icon img,
header:has(.mega-menu-active) .header-icon img {
    filter: brightness(0) invert(0);
}

/* Dropdown */
.dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    min-width: 180px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-menu a {
    display: block;
    padding: 12px 24px;
    white-space: nowrap;
    color: var(--gray-light);
    text-align: center;
}

.dropdown-menu a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
}

/* Mega Menu */
.mega-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 1);
    padding: 80px 48px 40px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        visibility 0.4s;
    z-index: 998;
}

header:has(.dropdown-vehicles:hover) .mega-menu-vehicles,
.mega-menu-vehicles:hover,
.mega-menu-vehicles.mega-menu-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

header:has(.dropdown-engenharia:hover) .mega-menu-engenharia,
.mega-menu-engenharia:hover,
.mega-menu-engenharia.mega-menu-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

header:has(.dropdown-sobre:hover) .mega-menu-sobre,
.mega-menu-sobre:hover,
.mega-menu-sobre.mega-menu-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

header:has(.dropdown-redes:hover) .mega-menu-redes,
.mega-menu-redes:hover,
.mega-menu-redes.mega-menu-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mega-menu-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

header:has(.dropdown-vehicles:hover) .mega-menu-item,
header:has(.dropdown-engenharia:hover) .mega-menu-item,
header:has(.dropdown-sobre:hover) .mega-menu-item,
header:has(.dropdown-redes:hover) .mega-menu-item,
.mega-menu:hover .mega-menu-item,
.mega-menu.mega-menu-active .mega-menu-item {
    opacity: 1;
    transform: translateY(0);
}

header:has(.dropdown-vehicles:hover) .mega-menu-item:nth-child(1),
header:has(.dropdown-engenharia:hover) .mega-menu-item:nth-child(1),
header:has(.dropdown-sobre:hover) .mega-menu-item:nth-child(1),
header:has(.dropdown-redes:hover) .mega-menu-item:nth-child(1),
.mega-menu:hover .mega-menu-item:nth-child(1),
.mega-menu.mega-menu-active .mega-menu-item:nth-child(1) {
    transition-delay: 0.05s;
}

header:has(.dropdown-vehicles:hover) .mega-menu-item:nth-child(2),
header:has(.dropdown-engenharia:hover) .mega-menu-item:nth-child(2),
header:has(.dropdown-sobre:hover) .mega-menu-item:nth-child(2),
header:has(.dropdown-redes:hover) .mega-menu-item:nth-child(2),
.mega-menu:hover .mega-menu-item:nth-child(2),
.mega-menu.mega-menu-active .mega-menu-item:nth-child(2) {
    transition-delay: 0.1s;
}

header:has(.dropdown-vehicles:hover) .mega-menu-item:nth-child(3),
header:has(.dropdown-engenharia:hover) .mega-menu-item:nth-child(3),
header:has(.dropdown-sobre:hover) .mega-menu-item:nth-child(3),
header:has(.dropdown-redes:hover) .mega-menu-item:nth-child(3),
.mega-menu:hover .mega-menu-item:nth-child(3),
.mega-menu.mega-menu-active .mega-menu-item:nth-child(3) {
    transition-delay: 0.15s;
}

header:has(.dropdown-vehicles:hover) .mega-menu-item:nth-child(4),
header:has(.dropdown-engenharia:hover) .mega-menu-item:nth-child(4),
header:has(.dropdown-sobre:hover) .mega-menu-item:nth-child(4),
header:has(.dropdown-redes:hover) .mega-menu-item:nth-child(4),
.mega-menu:hover .mega-menu-item:nth-child(4),
.mega-menu.mega-menu-active .mega-menu-item:nth-child(4) {
    transition-delay: 0.2s;
}

.mega-menu-grid {
    display: flex;
    justify-content: center;
    gap: 48px;
    max-width: 1200px;
    margin: 0 auto;
}

.mega-menu-item {
    text-align: center;
    padding: 20px;
    border-radius: 12px;
    transition: all 0.3s ease;
    min-width: 140px;
}

.mega-menu-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.mega-menu-image {
    width: 120px;
    height: 100px;
    background: transparent;
    border-radius: 0;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 11px;
    transition: transform 0.3s ease;
}

.mega-menu-item:hover .mega-menu-image {
    transform: scale(1.05);
}

.mega-menu-image img {
    max-width: 100%;
    max-height: 120px;
    height: 120px;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.mega-menu-item:hover .mega-menu-image img {
    transform: scale(1.05);
}

.mega-menu-title {
    font-size: 14px;
    font-weight: 600;
    color: #000;
    margin-bottom: 12px;
}

.mega-menu-links {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.mega-menu-links a {
    font-size: 12px;
    color: #666;
    text-decoration: none;
    padding: 4px 0;
    transition: color 0.3s ease;
}

.mega-menu-links a:hover {
    color: #000;
    text-decoration: underline;
}

/* Engenharia Mega Menu - List Style */
.mega-menu-engenharia {
    z-index: 998;
}

.mega-menu-list-grid {
    display: flex;
    justify-content: center;
    gap: 80px;
    max-width: 1200px;
    margin: 0 auto;
}

.mega-menu-list-column {
    min-width: 160px;
}

.mega-menu-list-title {
    font-size: 12px;
    font-weight: 400;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    padding-bottom: 8px;
}

.mega-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mega-menu-list li {
    margin-bottom: 12px;
}

.mega-menu-list a {
    font-size: 14px;
    font-weight: 500;
    color: #000;
    text-decoration: none;
    transition: color 0.3s ease;
}

.mega-menu-list a:hover {
    text-decoration: underline;
}

/* When mega menu is open - change colors */
header:has(.dropdown-vehicles:hover) nav a,
header:has(.dropdown-engenharia:hover) nav a,
header:has(.dropdown-sobre:hover) nav a,
header:has(.dropdown-redes:hover) nav a,
header:has(.mega-menu:hover) nav a,
header:has(.mega-menu-active) nav a {
    color: var(--black);
}

header:has(.dropdown-vehicles:hover) .logo img,
header:has(.dropdown-engenharia:hover) .logo img,
header:has(.dropdown-sobre:hover) .logo img,
header:has(.dropdown-redes:hover) .logo img,
header:has(.mega-menu:hover) .logo img,
header:has(.mega-menu-active) .logo img {
    filter: brightness(0);
}

header:has(.dropdown-vehicles:hover) .header-icon img,
header:has(.dropdown-engenharia:hover) .header-icon img,
header:has(.dropdown-sobre:hover) .header-icon img,
header:has(.dropdown-redes:hover) .header-icon img,
header:has(.mega-menu:hover) .header-icon img,
header:has(.mega-menu-active) .header-icon img {
    filter: brightness(0) invert(0);
}

header:has(.dropdown-vehicles:hover) .dropdown-menu a,
header:has(.dropdown-engenharia:hover) .dropdown-menu a,
header:has(.mega-menu:hover) .dropdown-menu a,
header:has(.mega-menu-active) .dropdown-menu a {
    color: var(--gray-light);
}

header:has(.dropdown-vehicles:hover) .dropdown-menu a:hover,
header:has(.dropdown-engenharia:hover) .dropdown-menu a:hover,
header:has(.mega-menu:hover) .dropdown-menu a:hover,
header:has(.mega-menu-active) .dropdown-menu a:hover {
    color: var(--white);
}

/* ============================================
   MOBILE MENU BUTTON
   ============================================ */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    position: absolute;
    right: 20px;
    z-index: 1002;
    padding: 4px;
}

.mobile-menu-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--white);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   MOBILE NAV OVERLAY & DRAWER
   ============================================ */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-nav-overlay.active {
    opacity: 1;
}

.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 380px;
    height: 100vh;
    height: 100dvh;
    background: var(--dark);
    z-index: 1003;
    overflow-y: auto;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    -webkit-overflow-scrolling: touch;
}

.mobile-nav.active {
    right: 0;
}

.mobile-nav-content {
    padding: 80px 28px 40px;
}

.mobile-nav-link {
    display: block;
    color: var(--white);
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: color 0.3s ease;
}

.mobile-nav-link:hover {
    color: var(--gray-light);
}

.mobile-nav-link.active {
    color: var(--white);
    font-weight: 700;
}

/* Mobile Accordion */
.mobile-accordion {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-accordion-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background: none;
    border: none;
    color: var(--white);
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 500;
    padding: 16px 0;
    cursor: pointer;
    transition: color 0.3s ease;
}

.mobile-accordion-trigger:hover {
    color: var(--gray-light);
}

.mobile-accordion-trigger svg {
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.mobile-accordion-trigger.active svg {
    transform: rotate(180deg);
}

.mobile-accordion-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-accordion-panel a {
    display: block;
    color: var(--gray-light);
    text-decoration: none;
    font-size: 15px;
    font-weight: 400;
    padding: 10px 0 10px 16px;
    transition: color 0.3s ease;
}

.mobile-accordion-panel a:hover {
    color: var(--white);
}

.mobile-panel-label {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 14px 0 4px 16px;
}

.mobile-nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 16px 0;
}

.mobile-social-label {
    font-size: 12px;
    font-weight: 400;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.mobile-social-icons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mobile-social-icons a {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    text-decoration: none;
    transition: background 0.3s ease;
}

.mobile-social-icons a:hover {
    background: rgba(255, 255, 255, 0.12);
}

.mobile-social-icons img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.mobile-social-icons .social-name {
    color: var(--white);
    font-size: 16px;
    font-weight: 500;
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */
@media (max-width: 768px) {
    header {
        padding: 16px 20px;
    }

    header.scrolled {
        padding: 12px 20px;
    }

    nav {
        display: none;
    }

    .header-icons {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .mobile-nav-overlay {
        display: block;
    }

    .mobile-nav {
        display: block;
    }

    .mega-menu {
        display: none !important;
    }
}

@media (max-width: 380px) {
    .mobile-nav {
        width: 100%;
        max-width: 100%;
    }
}
