/* ===============================
   NAVBAR - Navegação Principal
   =============================== */

/* Compensação global para navbar fixa */
body {
    padding-top: 80px;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--primary-color);
    transition: all 0.3s ease;
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    width: 100%;
    box-sizing: border-box;
}

/* Logo */
.navbar-brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.navbar-logo {
    height: 32px;
    width: auto;
    transition: opacity 0.3s ease;
}

.navbar-logo:hover {
    opacity: 0.8;
}

/* Menu */
.navbar-menu {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: center;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0 1.25rem;
    color: white;
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 25px;
    transition: all 0.3s ease;
    white-space: nowrap;
    height: 45px;
    cursor: pointer;
    box-sizing: border-box;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Hover específico para dropdowns - mesma cor que outros links */
.nav-item-dropdown > .nav-link.nav-dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nav-arrow {
    transition: transform 0.3s ease;
    color: white;
    margin-left: 0.25rem;
}

.nav-item-dropdown.active .nav-arrow {
    transform: rotate(180deg);
}

.nav-item-dropdown:hover .nav-arrow {
    transform: translateY(2px);
}

.nav-item-dropdown.active:hover .nav-arrow {
    transform: rotate(180deg) translateY(-2px);
}

/* Dropdown Menu */
.dropdown-menu {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: white;
    border-radius: 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    padding: 3rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
    pointer-events: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-width: 1400px;
    width: 100%;
}

/* Dropdown aberto via clique */
.nav-item-dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* Header do dropdown - escondido no desktop */
.dropdown-header {
    display: none;
}

.dropdown-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    color: #374151;
    text-decoration: none;
    border-radius: 0;
    transition: all 0.3s ease;
    background: #f9fafb;
    border: 2px solid transparent;
    border-left: 4px solid transparent;
}

.dropdown-item:hover {
    background: white;
    border-left-color: var(--primary-color);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.dropdown-item svg {
    color: var(--primary-color);
}

.dropdown-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 8px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.dropdown-item:hover .dropdown-item-icon {
    background: var(--primary-color);
    transform: scale(1.1);
}

.dropdown-item:hover .dropdown-item-icon svg {
    color: white;
}

.dropdown-item-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.dropdown-item-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    color: #111827;
}

.dropdown-item-description {
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.5;
    color: #6b7280;
}

/* CTAs */
.navbar-cta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

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

.navbar-cta-desktop {
    display: flex;
}

/* Botões específicos da Navbar */
.navbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 25px;
    transition: all 0.3s ease;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    height: 45px;
    box-sizing: border-box;
}

.navbar-btn-outline {
    background: transparent;
    color: white;
    border: 1.5px solid white;
}

.navbar-btn-outline:hover {
    background: white;
    color: var(--primary-color);
    border-color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.navbar-btn-primary {
    background: var(--secondary-color);
    color: white;
    box-shadow: 0 2px 8px rgba(252, 125, 85, 0.3);
}

.navbar-btn-primary:hover {
    background: #ff9580;
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.navbar-btn svg {
    width: 16px;
    height: 16px;
}

/* Mobile Toggle */
.navbar-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    z-index: 1001;
    width: 40px;
    height: 40px;
    position: relative;
}

.navbar-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
    position: absolute;
}

.navbar-toggle span:nth-child(1) {
    top: 12px;
}

.navbar-toggle span:nth-child(2) {
    top: 19px;
}

.navbar-toggle span:nth-child(3) {
    top: 26px;
}

.navbar-toggle.active span:nth-child(1) {
    top: 19px;
    transform: rotate(45deg);
}

.navbar-toggle.active span:nth-child(2) {
    opacity: 0;
}

.navbar-toggle.active span:nth-child(3) {
    top: 19px;
    transform: rotate(-45deg);
}

/* Responsive */
@media (max-width: 1024px) {
    .navbar-container {
        padding: 0 1.5rem;
    }
    
    .navbar-cta-desktop .btn-secondary {
        display: none;
    }
}

@media (max-width: 1024px) {
    /* Ajustar compensação para altura mobile */
    body {
        padding-top: 60px;
    }
    
    .navbar-container {
        height: 60px;
        padding: 0 1rem;
    }
    
    .navbar-toggle {
        display: flex;
    }
    
    .navbar-menu {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--tertiary-color) 100%);
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: stretch;
        padding: 0;
        overflow-y: auto;
        overflow-x: hidden;
        opacity: 0;
        visibility: hidden;
        transform: translateX(100%);
        transition: all 0.3s ease;
        width: 100%;
        max-width: 100vw;
    }
    
    .navbar-menu.active {
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
    }
    
    .navbar-nav {
        flex-direction: column;
        width: 100%;
        gap: 0;
        padding: 0;
        position: relative;
    }
    
    .nav-item {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        background: transparent;
        transition: opacity 0.3s ease;
    }
    
    /* Quando um dropdown está ativo, esconder outros itens */
    .navbar-nav:has(.nav-item-dropdown.active) .nav-item:not(.nav-item-dropdown.active) {
        opacity: 0;
        pointer-events: none;
    }
    
    .nav-link {
        width: 100%;
        padding: 1rem 1.5rem;
        justify-content: space-between;
        border-radius: 0;
        height: auto;
        color: white;
        font-size: 1.125rem;
        font-weight: 500;
    }
    
    .nav-link:hover {
        background: rgba(255, 255, 255, 0.1);
        color: white;
    }
    
    /* Seta para direita nos dropdowns mobile */
    .nav-item-dropdown .nav-link {
        position: relative;
    }
    
    .nav-item-dropdown .nav-arrow {
        transform: rotate(-90deg);
        color: rgba(255, 255, 255, 0.7);
    }
    
    /* Dropdown Mobile - Submenu em tela cheia */
    .dropdown-menu {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--tertiary-color) 100%);
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1002;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        overflow-x: hidden;
        width: 100%;
        max-width: 100vw;
        padding-top: 60px;
        grid-template-columns: 1fr;
        min-width: 100%;
        padding: 0;
        padding-top: 60px;
        gap: 0;
        border-radius: 0;
    }
    
    .nav-item-dropdown.active .dropdown-menu {
        transform: translateX(0);
    }
    
    /* Animação de fechamento */
    .nav-item-dropdown.closing .dropdown-menu {
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    /* Esconder menu principal quando submenu está ativo */
    .nav-item-dropdown.active ~ .nav-item,
    .nav-item-dropdown.active ~ .navbar-cta-mobile {
        display: none;
    }
    
    /* Header do Submenu */
    .dropdown-header {
        display: none;
        align-items: center;
        justify-content: space-between;
        padding: 1rem 1.5rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        background: rgba(0, 0, 0, 0.1);
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 60px;
        z-index: 10;
        backdrop-filter: blur(10px);
    }
    
    .dropdown-back,
    .dropdown-close {
        background: none;
        border: none;
        padding: 0.5rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        transition: all 0.2s ease;
    }
    
    .dropdown-back:hover,
    .dropdown-close:hover {
        color: white;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 50%;
    }
    
    .dropdown-back svg,
    .dropdown-close svg {
        color: inherit;
    }
    
    .dropdown-title {
        font-size: 1.125rem;
        font-weight: 600;
        color: white;
        margin: 0;
        flex: 1;
        text-align: center;
    }
    
    .dropdown-close {
        opacity: 0;
        pointer-events: none;
    }
    
    .dropdown-item {
        padding: 1.25rem 1.5rem;
        background: transparent;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        border: none;
        border-radius: 0;
        display: flex;
        align-items: center;
        gap: 1rem;
        transition: all 0.3s ease;
    }
    
    .dropdown-item:hover {
        background: rgba(255, 255, 255, 0.1);
        transform: translateX(5px);
        box-shadow: none;
    }
    
    .dropdown-item:last-child {
        border-bottom: none;
    }
    
    .dropdown-item-icon {
        width: 48px;
        height: 48px;
        flex-shrink: 0;
        background: rgba(255, 255, 255, 0.15);
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
    }
    
    .dropdown-item:hover .dropdown-item-icon {
        background: white;
        transform: scale(1.1);
    }
    
    .dropdown-item-icon svg {
        color: white;
        transition: color 0.3s ease;
    }
    
    .dropdown-item:hover .dropdown-item-icon svg {
        color: var(--primary-color);
    }
    
    .dropdown-item-content {
        flex: 1;
    }
    
    .dropdown-item-title {
        font-size: 1.0625rem;
        font-weight: 500;
        color: white;
    }
    
    /* Esconder descrições no mobile */
    .dropdown-item-description {
        display: none;
    }
    
    /* Mostrar header no mobile quando submenu ativo */
    .nav-item-dropdown.active .dropdown-header {
        display: flex;
    }
    
    /* Esconder seta no mobile quando dropdown ativo */
    .nav-item-dropdown.active .nav-arrow {
        display: none;
    }
    
    /* CTAs Mobile - Dentro do menu */
    .navbar-cta-desktop {
        display: none;
    }
    
    .navbar-cta-mobile {
        display: flex;
        width: 100%;
        flex-direction: column;
        gap: 0.75rem;
        padding: 1.5rem;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        margin-top: auto;
        background: transparent;
    }
    
    .navbar-cta-mobile .navbar-btn {
        width: 100%;
        justify-content: center;
        font-size: 1rem;
        font-weight: 600;
    }
    
    .navbar-cta-mobile .navbar-btn-outline {
        background: white;
        color: var(--primary-color);
        border: 1.5px solid white;
    }
    
    .navbar-cta-mobile .navbar-btn-outline:hover {
        background: rgba(255, 255, 255, 0.9);
        color: var(--primary-color);
        border-color: white;
    }
    
    .navbar-cta-mobile .navbar-btn-primary {
        background: var(--secondary-color);
        color: white;
        border: 1.5px solid var(--secondary-color);
    }
    
    .navbar-cta-mobile .navbar-btn-primary:hover {
        background: #ff8a80;
        border-color: #ff8a80;
    }
}

/* Scrolled State */
.navbar.scrolled {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
