/**
 * Nexcore Header Pro - Frontend Styles V2
 * REESCRITO DO ZERO - PROFISSIONAL
 * @package Plugin Nexcore
 */

/* ==========================================
   RESET & BASE
   ========================================== */
.nexcore-header-pro * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.nexcore-header-pro {
    position: relative;
    width: 100%;
    z-index: 999;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: #ffffff;
}

/* FORÇA container widget transparente */
.elementor-widget-nexcore-header-pro>.elementor-widget-container {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* ==========================================
   CONTAINER
   ========================================== */
.nexcore-header-container {
    width: 100%;
    margin: 0 auto;
    padding: 0 30px;
}

.nexcore-container-boxed .nexcore-header-container {
    max-width: 1200px;
}

.nexcore-container-full .nexcore-header-container {
    max-width: 100%;
}

/* ==========================================
   HEADER INNER LAYOUT
   ========================================== */
.nexcore-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    position: relative;
    min-height: 80px;
    transition: min-height 0.3s ease;
}

/* Layout Default */
.nexcore-layout-default .nexcore-header-inner {
    justify-content: space-between;
}

.nexcore-layout-default .nexcore-logo-section {
    flex: 0 0 auto;
}

.nexcore-layout-default .nexcore-menu-section {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
}

.nexcore-layout-default .nexcore-actions-section {
    flex: 0 0 auto;
}

/* Layout Centered */
.nexcore-layout-centered .nexcore-header-inner {
    flex-direction: column;
    gap: 20px;
}

/* Layout Split */
.nexcore-layout-split .nexcore-header-inner {
    justify-content: space-between;
}

.nexcore-layout-split .nexcore-menu-section {
    order: 0;
    flex: 1;
}

.nexcore-layout-split .nexcore-logo-section {
    order: 1;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nexcore-layout-split .nexcore-actions-section {
    order: 2;
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

/* ==========================================
   LOGO SYSTEM - REESCRITO (CORRIGE BUGS)
   ========================================== */
.nexcore-logo-section {
    display: flex !important;
    align-items: center;
    position: relative;
}

.nexcore-logo {
    display: inline-flex !important;
    align-items: center;
    position: relative;
}

.nexcore-logo a {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.nexcore-logo a:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

/* LOGOS: Normal e Sticky */
.nexcore-logo img {
    display: block;
    height: auto;
    transition: all 0.3s ease;
}

/* Estado NORMAL do header - LOGO NORMAL VISÍVEL */
.nexcore-logo-normal {
    display: block !important;
}

/* Logo sticky SEMPRE escondido por padrão */
.nexcore-logo-sticky {
    display: none !important;
}

/* Estado STICKY do header */
.nexcore-header-pro.nexcore-sticky .nexcore-logo-normal {
    display: none !important;
}

.nexcore-header-pro.nexcore-sticky .nexcore-logo-sticky {
    display: block !important;
}

/* Se NÃO tiver logo sticky, mostra o normal */
.nexcore-header-pro.nexcore-sticky .nexcore-logo:not(.has-sticky-logo) .nexcore-logo-normal {
    display: block !important;
}

/* Logo Texto */
.nexcore-logo-text {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.5px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ==========================================
   MENU DESKTOP
   ========================================== */
.nexcore-desktop-nav {
    display: flex;
    align-items: center;
}

.nexcore-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
    gap: 8px;
}

.nexcore-menu>li {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.nexcore-menu>li>a {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.3px;
    position: relative;
    color: #333333;
    padding: 12px 16px;
    border-radius: 6px;
}

.nexcore-menu>li>a:hover {
    background: rgba(0, 0, 0, 0.05);
}

.nexcore-menu>li.current-menu-item>a {
    background: rgba(34, 113, 177, 0.1);
    color: #2271b1;
}

/* ==========================================
   SUBMENU - REESCRITO (CORRIGE BUGS)
   ========================================== */
.nexcore-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 240px;
    background: #ffffff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    list-style: none;
    padding: 8px;
    margin: 8px 0 0 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    pointer-events: none;
}

/* Mostra submenu com delay para não fechar rápido */
.nexcore-menu li:hover>.sub-menu,
.nexcore-menu li.submenu-open>.sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: all;
    transition-delay: 0s;
}

/* Mantém submenu aberto por mais tempo */
.nexcore-menu li:hover>.sub-menu {
    transition-delay: 0.15s;
}

.nexcore-menu .sub-menu li {
    display: block;
    width: 100%;
    position: relative;
}

.nexcore-menu .sub-menu a {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: 6px;
}

.nexcore-menu .sub-menu a:hover {
    background: #f0f4f8;
    color: #2271b1;
    padding-left: 20px;
}

/* Sub-submenu */
.nexcore-menu .sub-menu .sub-menu {
    left: 100%;
    top: 0;
    margin: 0 0 0 8px;
}

/* ==========================================
   ACTIONS SECTION
   ========================================== */
.nexcore-actions-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Botão CTA */
.nexcore-cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
    border: 2px solid transparent;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.nexcore-cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ==========================================
   STICKY HEADER
   ========================================== */
.nexcore-sticky-placeholder {
    display: none;
}

.nexcore-header-pro.nexcore-sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.nexcore-header-pro.nexcore-sticky .nexcore-header-inner {
    min-height: 70px;
}

/* ==========================================
   MOBILE MENU BUTTON
   ========================================== */
.nexcore-mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 0;
    z-index: 1001;
    transition: all 0.3s ease;
    border-radius: 8px;
    position: relative;
}

.nexcore-mobile-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

.nexcore-mobile-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: #333333;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
}

.nexcore-mobile-toggle span:nth-child(2) {
    margin: 5px 0;
}

/* Animação hamburger para X */
.nexcore-mobile-toggle.active {
    z-index: 10000;
}

.nexcore-mobile-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nexcore-mobile-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.nexcore-mobile-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ==========================================
   MOBILE MENU OVERLAY - LUXURY EDITORIAL
   ========================================== */
.nexcore-mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 400px;
    /* Wider for editorial feel */
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    /* Almost opaque */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 9999;
    transition: right 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    /* Elegant slow ease */
    overflow-y: auto;
    box-shadow: -20px 0 50px rgba(0, 0, 0, 0.05);
    /* Very subtle shadow */
    display: flex;
    flex-direction: column;
}

.nexcore-mobile-menu.active {
    right: 0;
}

/* Template: Fullscreen */
.nexcore-mobile-template-fullscreen {
    width: 100% !important;
    max-width: 100% !important;
    right: -100% !important;
}

.nexcore-mobile-template-fullscreen.active {
    right: 0 !important;
}

/* Template: Dropdown (Desce do topo) */
.nexcore-mobile-template-dropdown {
    top: -100vh !important;
    right: 0 !important;
    left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 90vh;
    transition: top 0.5s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.nexcore-mobile-template-dropdown.active {
    top: 0 !important;
}

/* Posicionamento: Esquerda (Sidebar) */
.nexcore-mobile-menu-left:not(.nexcore-mobile-template-dropdown) {
    right: auto !important;
    left: -100% !important;
    transition: left 0.6s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.nexcore-mobile-menu-left:not(.nexcore-mobile-template-dropdown).active {
    left: 0 !important;
    right: auto !important;
}

/* Header do menu mobile */
.nexcore-mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 40px 40px 20px;
    padding: 20px 0;
}

.nexcore-mobile-menu-list {
    list-style: none;
    padding: 0 40px;
    /* Indented list */
    margin: 0;
}

.nexcore-mobile-menu-list li {
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    /* Very subtle separator */
    margin: 0;
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.5s ease;
    position: relative;
}

.nexcore-mobile-menu-list>li:last-child {
    border-bottom: none;
}

/* Staggered Animation */
.nexcore-mobile-menu.active .nexcore-mobile-menu-list li {
    opacity: 1;
    transform: translateY(0);
}

.nexcore-mobile-menu.active .nexcore-mobile-menu-list li:nth-child(1) {
    transition-delay: 0.1s;
}

.nexcore-mobile-menu.active .nexcore-mobile-menu-list li:nth-child(2) {
    transition-delay: 0.15s;
}

.nexcore-mobile-menu.active .nexcore-mobile-menu-list li:nth-child(3) {
    transition-delay: 0.2s;
}

.nexcore-mobile-menu.active .nexcore-mobile-menu-list li:nth-child(4) {
    transition-delay: 0.25s;
}

.nexcore-mobile-menu.active .nexcore-mobile-menu-list li:nth-child(5) {
    transition-delay: 0.3s;
}

.nexcore-mobile-menu.active .nexcore-mobile-menu-list li:nth-child(6) {
    transition-delay: 0.35s;
}

.nexcore-mobile-menu.active .nexcore-mobile-menu-list li:nth-child(7) {
    transition-delay: 0.4s;
}

/* Links do menu - EDITORIAL STYLE */
.nexcore-mobile-menu-list>li>a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    /* No side padding, just vertical */
    color: #1d1d1d;
    text-decoration: none;
    font-size: 14px;
    text-transform: uppercase;
    /* Uppercase */
    letter-spacing: 1.5px;
    /* Tracked out */
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}

.nexcore-mobile-menu-list>li>a:hover {
    color: #2271b1;
    padding-left: 10px;
    /* Slight movement */
    letter-spacing: 2px;
    /* Expand slightly */
}

.nexcore-mobile-menu-list .current-menu-item>a {
    color: #2271b1;
}

/* Submenu mobile - Minimalist */
.nexcore-mobile-menu-list .sub-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: none;
    background: transparent;
    border-left: 1px solid rgba(0, 0, 0, 0.05);
}

.nexcore-mobile-menu-list li.submenu-open>.sub-menu {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nexcore-mobile-menu-list .sub-menu li {
    border: none;
    margin: 0;
    padding: 0;
    opacity: 1;
    transform: none;
}

.nexcore-mobile-menu-list .sub-menu a {
    font-size: 15px;
    text-transform: none;
    letter-spacing: 0;
    padding: 12px 0 12px 20px;
    display: flex;
    align-items: center;
}

/* NOVO TOGGLE BUTTON - ALINHAMENTO DINÂMICO */
.nexcore-submenu-toggle {
    position: absolute;
    top: 0;
    right: 0;
    width: 44px;
    height: 50px;
    /* Será ajustado pelo padding do link pai */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    background: transparent;
    border-radius: 4px;
    transition: all 0.3s ease;
}

/* Garante que o toggle ocupe a altura do link pai */
.nexcore-mobile-menu-list li {
    position: relative;
}

.nexcore-mobile-menu-list>li>.nexcore-submenu-toggle {
    height: 60px;
    /* Altura aproximada do link pai top-level */
}

.nexcore-mobile-menu-list .sub-menu li>.nexcore-submenu-toggle {
    height: 44px;
    /* Altura aproximada do sublink */
}

.nexcore-submenu-toggle:hover {
    background: rgba(0, 0, 0, 0.03);
}

.nexcore-submenu-toggle::after {
    content: '+';
    font-size: 20px;
    font-weight: 300;
    color: #999;
    transition: all 0.3s ease;
}

.nexcore-submenu-toggle.active::after {
    transform: rotate(45deg);
    color: #2271b1;
}

/* ==========================================
   MOBILE MENU: IMAGEM & SOCIAIS
   ========================================== */
.nexcore-mobile-menu-image {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 0 40px;
    margin-bottom: 20px;
}

.nexcore-mobile-menu-image img {
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.nexcore-image-bottom {
    margin-top: auto;
    /* Push to bottom if flex container allows */
    margin-bottom: 20px;
    padding-top: 20px;
}

/* Footer do Menu (CTA + Sociais) */
.nexcore-mobile-menu-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    padding: 20px 40px 40px;
    gap: 20px;
}

/* Redes Sociais */
.nexcore-mobile-socials {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 0;
    flex-wrap: wrap;
}

.nexcore-social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.03);
    color: #333;
    font-size: 18px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.nexcore-social-icon:hover {
    background: #2271b1;
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(34, 113, 177, 0.3);
}

.nexcore-social-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Ajuste CTA quando houver sociais */
.nexcore-mobile-menu-cta {
    border-top: none;
    /* Remove border if inside footer */
    padding-bottom: 10px;
}

.nexcore-mobile-menu-cta .nexcore-cta-button {
    width: 100%;
    text-align: center;
    justify-content: center;
    padding: 16px 24px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    border-radius: 4px;
    /* Sharper corners */
    box-shadow: 0 10px 30px rgba(34, 113, 177, 0.25);
    background: #2271b1;
    color: #fff;
    border: none;
}

.nexcore-mobile-menu-cta .nexcore-cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(34, 113, 177, 0.35);
    background: #1a5c91;
}

/* Overlay escuro */
.nexcore-mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    /* Very light overlay */
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.6s ease;
    backdrop-filter: blur(8px);
    /* Strong blur */
    -webkit-backdrop-filter: blur(8px);
}

.nexcore-mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 1024px) {

    .nexcore-desktop-nav,
    .nexcore-actions-section .nexcore-cta-button,
    .nexcore-search-form {
        display: none !important;
    }

    .nexcore-mobile-toggle {
        display: flex !important;
    }

    .nexcore-header-inner {
        min-height: 70px !important;
    }

    .nexcore-header-container {
        padding: 0 20px;
    }

    /* Botão CTA dentro do menu mobile */
    .nexcore-mobile-menu-cta .nexcore-cta-button {
        width: 100%;
        text-align: center;
        display: block;
        padding: 14px 20px;
        font-size: 15px;
        white-space: normal;
        word-wrap: break-word;
        box-sizing: border-box;
    }
}

.nexcore-show {
    display: block !important;
}