/**
 * CIO Codex Modern Menu Styles
 * 
 * Estilos modernos para o menu principal do tema CIO Codex
 * Localização: /cio-codex/themes/cio-codex-theme/assets/css/cio-codex-menu.css
 */

/* ============================================
   VARIÁVEIS E CORES
   ============================================ */
:root {
    --cio-primary: #00bfff;
    --cio-primary-dark: #0099cc;
    --cio-bg-dark: #000000f2;
    --cio-bg-light: #070a17;
    --cio-panel-bg: #000000ed;
    --cio-text-primary: #ffffff;
    --cio-text-secondary: #b0b8d4;
    --cio-border: #1f2c46;
    --cio-hover-bg: #1a2040;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   HEADER
   ============================================ */
.cio-codex-header {
    background: var(--cio-bg-dark);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.cio-codex-header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    gap: 30px;
}

/* ============================================
   LOGO
   ============================================ */
.cio-codex-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
.adminbar-button{
    display:none !important;
}
.cio-codex-logo a,
.cio-codex-logo img {
    display: block;
    height: 80px;
    width: auto;
    transition: var(--transition-smooth);
}

.cio-codex-logo a:hover {
    opacity: 0.8;
}

/* ============================================
   MENU WRAPPER
   ============================================ */
.cio-codex-menu-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
}

/* ============================================
   MENU PRINCIPAL
   ============================================ */
.cio-codex-primary-nav {
    width: 100%;
}

.cio-codex-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 5px;
    justify-content: center;
    flex-wrap: wrap;
}

.cio-codex-menu > li {
    position: relative;
}

/* ============================================
   LINKS DO MENU
   ============================================ */
.menu-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    color: var(--cio-text-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: var(--transition-smooth);
    position: relative;
    border-radius: 4px;
}

.menu-link::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 18px;
    right: 18px;
    height: 2px;
    background: var(--cio-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-link:hover {
    color: var(--cio-primary);
    background: rgba(0, 191, 255, 0.08);
}

.menu-link:hover::after {
    transform: scaleX(1);
}

/* Item ativo */
.menu-link.active,
.cio-codex-menu > li.active > .menu-link {
    color: var(--cio-primary);
    background: rgba(0, 191, 255, 0.1);
}

.menu-link.active::after,
.cio-codex-menu > li.active > .menu-link::after {
    transform: scaleX(1);
}

/* ============================================
   ÍCONE DO MENU
   ============================================ */
.menu-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    transition: var(--transition-smooth);
}

.cio-chevron {
    transition: var(--transition-smooth);
}

.menu-link:hover .cio-chevron {
    transform: translateY(1px);
}

.menu-link[aria-expanded="true"] .cio-chevron {
    transform: rotate(180deg);
}

/* ============================================
   MEGA MENU PANEL
   ============================================ */
.cio-codex-mega-menu-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    width: min(1185px, calc(100vw - 32px));
    background: var(--cio-panel-bg);
    border: 1px solid var(--cio-border);
    border-radius: 0 0 24px 24px;
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.55);
    padding: 24px 24px 28px;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -10px);
    transition: var(--transition-smooth);
    pointer-events: none;
    z-index: 2000;
}

/* Mostrar mega menu */
.cio-codex-menu > li.mega-parent:hover > .cio-codex-mega-menu-panel,
.cio-codex-menu > li.mega-parent:focus-within > .cio-codex-mega-menu-panel,
.cio-codex-menu > li.mega-parent.active > .cio-codex-mega-menu-panel {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
    pointer-events: auto;
}

.cio-codex-mega-menu-inner {
    width: 100%;
}

.cio-codex-mega-template-content {
    width: 100%;
    overflow: hidden;
    border-radius: 0 0 18px 18px;
}

.cio-codex-mega-template-content > .elementor,
.cio-codex-mega-template-content > .elementor > .elementor-element,
.cio-codex-mega-template-content .e-con-boxed > .e-con-inner {
    max-width: 100% !important;
}

.cio-codex-mega-template-content .elementor-widget-wrap,
.cio-codex-mega-template-content .elementor-widget-container {
    max-width: 100%;
}

/* Corrige offset inline do Premium Nav dentro do template Elementor do mega menu */
.cio-codex-mega-template-content .premium-mega-content-container {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
}

/* ============================================
   LISTA DO MEGA MENU
   ============================================ */
.cio-codex-mega-menu-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 22px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.cio-codex-mega-menu-list > li,
.cio-codex-mega-menu-list > li.mega-column {
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 14px 14px 10px;
    background: rgba(255, 255, 255, 0.02);
}

.mega-heading-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 12px;
    font-size: 16px;
    letter-spacing: 0.2px;
    text-decoration: none;
    transition: var(--transition-smooth);
}

.mega-heading-link:hover {
    color: var(--cio-primary);
}

.mega-heading-link .menu-icon {
    width: 14px;
    height: 14px;
}

/* ============================================
   SUBMENU
   ============================================ */
.cio-codex-submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cio-codex-submenu li {
    display: block;
}

.cio-codex-submenu a {
    display: block;
    padding: 8px 0 8px 12px;
    color: var(--cio-text-secondary);
    text-decoration: none;
    font-size: 13px;
    transition: var(--transition-smooth);
    position: relative;
}

.cio-codex-submenu a::before {
    content: "";
    position: absolute;
    left: 0;
    width: 3px;
    height: 3px;
    background: var(--cio-primary);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: var(--transition-smooth);
}

.cio-codex-submenu a:hover {
    color: var(--cio-primary);
    padding-left: 16px;
}

.cio-codex-submenu a:hover::before {
    opacity: 1;
}

/* ============================================
   DROPDOWN PADRÃO (NÃO MEGA)
   ============================================ */
.cio-codex-dropdown-menu,
.cio-codex-dropdown-submenu {
    list-style: none;
    margin: 0;
    padding: 8px;
    background: var(--cio-panel-bg);
    border: 1px solid var(--cio-border);
    border-radius: 12px;
    min-width: 260px;
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.45);
}

.cio-codex-menu > li > .cio-codex-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: var(--transition-smooth);
    pointer-events: none;
    z-index: 2000;
}

.cio-codex-menu > li.has-submenu:not(.mega-parent):hover > .cio-codex-dropdown-menu,
.cio-codex-menu > li.has-submenu:not(.mega-parent):focus-within > .cio-codex-dropdown-menu,
.cio-codex-menu > li.has-submenu:not(.mega-parent).active > .cio-codex-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.cio-codex-dropdown-menu > li {
    position: relative;
}

.dropdown-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--cio-text-primary);
    text-decoration: none;
    font-size: 14px;
    line-height: 1.2;
    transition: var(--transition-smooth);
}

.dropdown-link:hover {
    color: var(--cio-primary);
    background: rgba(0, 191, 255, 0.1);
}

.cio-codex-dropdown-submenu {
    position: absolute;
    left: calc(100% + 8px);
    top: -8px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-8px);
    transition: var(--transition-smooth);
    pointer-events: none;
}

.cio-codex-dropdown-menu > li:hover > .cio-codex-dropdown-submenu,
.cio-codex-dropdown-menu > li:focus-within > .cio-codex-dropdown-submenu,
.cio-codex-dropdown-menu > li.active > .cio-codex-dropdown-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
}

/* ============================================
   AÇÕES DO HEADER
   ============================================ */
.cio-codex-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Botão Premium */
.cio-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-smooth);
    cursor: pointer;
    border: none;
    white-space: nowrap;
}

.cio-btn-primary {
    background: var(--cio-primary);
    color: var(--cio-bg-dark);
}

.cio-btn-primary:hover {
    background: var(--cio-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 191, 255, 0.3);
}

/* Ícones do header */
.cio-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: var(--cio-text-primary);
    text-decoration: none;
    border-radius: 4px;
    transition: var(--transition-smooth);
}

.cio-header-icon:hover {
    background: var(--cio-hover-bg);
    color: var(--cio-primary);
}

.cio-header-icon svg {
    width: 20px;
    height: 20px;
}

/* Seletor de idioma (GTranslate) no header */
.cio-header-gtranslate {
    display: flex;
    align-items: center;
}

.cio-header-gtranslate .gt_switcher_wrapper,
.cio-header-gtranslate .gt_switcher {
    margin: 0 !important;
}

/* ============================================
   MENU TOGGLE (MOBILE)
   ============================================ */
.cio-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    transition: var(--transition-smooth);
}

.cio-menu-toggle:hover {
    background: var(--cio-hover-bg);
}

.cio-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--cio-text-primary);
    border-radius: 1px;
    transition: var(--transition-smooth);
}

.cio-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.cio-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.cio-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ============================================
   RESPONSIVO
   ============================================ */

/* Tablet */
@media (max-width: 1024px) {
    .cio-codex-header-container {
        height: 60px;
        gap: 20px;
    }

    .cio-codex-menu {
        gap: 2px;
    }

    .menu-link {
        padding: 10px 14px;
        font-size: 13px;
    }

    .cio-codex-mega-menu-panel {
        width: min(100vw - 24px, 980px);
    }

    .cio-codex-mega-menu-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .cio-codex-header-container {
        height: 56px;
        gap: 10px;
    }

    .cio-codex-menu-wrapper {
        display: none;
    }

    .cio-menu-toggle {
        display: flex;
    }

    .cio-btn-primary {
        padding: 8px 14px;
        font-size: 12px;
    }

    /* Mobile Menu */
    .cio-codex-menu-wrapper.mobile-open {
        display: block;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: var(--cio-bg-light);
        border-bottom: 1px solid var(--cio-border);
        max-height: calc(100vh - 56px);
        overflow-y: auto;
        z-index: 999;
    }

    .cio-codex-menu-wrapper.mobile-open .cio-codex-menu {
        flex-direction: column;
        gap: 0;
        justify-content: flex-start;
    }

    .cio-codex-menu-wrapper.mobile-open .cio-codex-menu > li {
        border-bottom: 1px solid var(--cio-border);
    }

    .cio-codex-menu-wrapper.mobile-open .menu-link {
        padding: 14px 20px;
        border-radius: 0;
        width: 100%;
        justify-content: space-between;
    }

    .cio-codex-menu-wrapper.mobile-open .menu-link::after {
        display: none;
    }

    .cio-codex-menu-wrapper.mobile-open .cio-codex-mega-menu-panel {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        pointer-events: auto;
        border: none;
        box-shadow: none;
        background: var(--cio-hover-bg);
        padding: 0;
        min-width: auto;
        max-width: none;
        border-radius: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        width: 100%;
    }

    .cio-codex-menu-wrapper.mobile-open .cio-codex-menu > li.active > .cio-codex-mega-menu-panel,
    .cio-codex-menu-wrapper.mobile-open .cio-codex-menu > li.active > .cio-codex-dropdown-menu {
        max-height: 500px;
    }

    .cio-codex-menu-wrapper.mobile-open .cio-codex-dropdown-menu,
    .cio-codex-menu-wrapper.mobile-open .cio-codex-dropdown-submenu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        pointer-events: auto;
        border: none;
        box-shadow: none;
        border-radius: 0;
        background: var(--cio-hover-bg);
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .cio-codex-menu-wrapper.mobile-open .cio-codex-mega-menu-list {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 16px 20px;
    }

    .cio-codex-menu-wrapper.mobile-open .cio-codex-mega-template-content {
        border-radius: 0;
    }

    .cio-codex-menu-wrapper.mobile-open .cio-codex-mega-menu-list > li {
        border-bottom: 1px solid var(--cio-border);
        padding-bottom: 12px;
        margin-bottom: 12px;
    }

    .cio-codex-menu-wrapper.mobile-open .cio-codex-mega-menu-list > li:last-child {
        border-bottom: none;
        margin-bottom: 0;
    }

    .cio-codex-menu-wrapper.mobile-open .cio-codex-submenu {
        gap: 0;
    }

    .cio-codex-menu-wrapper.mobile-open .mega-heading-link,
    .cio-codex-menu-wrapper.mobile-open .dropdown-link {
        padding: 12px 20px;
    }

    .cio-codex-menu-wrapper.mobile-open .cio-codex-submenu a {
        padding: 8px 28px;
    }

    .cio-codex-menu-wrapper.mobile-open .cio-codex-dropdown-menu > li.active > .cio-codex-dropdown-submenu {
        max-height: 320px;
    }
}

/* Extra Small */
@media (max-width: 480px) {
    .cio-codex-header-container {
        padding: 0 12px;
    }

    .cio-codex-logo img {
        height: 40px;
    }

    .cio-btn-primary {
        display: none;
    }

    .cio-header-icon {
        width: 32px;
        height: 32px;
    }

    .cio-header-icon svg {
        width: 18px;
        height: 18px;
    }
}

/* ============================================
   ANIMAÇÕES
   ============================================ */

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.cio-codex-mega-menu-panel {
    animation: slideDown 0.3s ease;
}

.cio-codex-submenu li {
    animation: slideIn 0.3s ease;
}

/* ============================================
   ACESSIBILIDADE
   ============================================ */

.menu-link:focus,
.cio-header-icon:focus,
.cio-btn:focus {
    outline: 2px solid var(--cio-primary);
    outline-offset: 2px;
}

.cio-menu-toggle:focus {
    outline: 2px solid var(--cio-primary);
    outline-offset: 2px;
}

/* Reduzir movimento para usuários que preferem */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0s !important;
    }
}

/* ============================================
   ESTILOS DE PRODUTOS DINÂMICOS
   ============================================ */
.cio-codex-mega-menu-list .product-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--cio-border);
    border-radius: 16px;
    padding: 14px;
    background: var(--cio-hover-bg);
    transition: var(--transition-smooth);
}

.cio-codex-mega-menu-list .product-card:hover {
    background: rgba(0, 191, 255, 0.05);
    border-color: var(--cio-primary);
}

.product-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-image {
    width: 100%;
    max-height: 100px; /* Ajuste para caber a imagem */
    height: auto; /* Permite que a altura se ajuste */
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--cio-text-primary);
    margin-bottom: 5px;
    line-height: 1.3;
}

.product-description {
    font-size: 12px;
    color: var(--cio-text-secondary);
    line-height: 1.5;
    margin-bottom: 0;
    flex-grow: 1;
}

@media (max-width: 768px) {
    .cio-codex-mega-menu-list .product-card {
        padding: 10px;
    }

    .product-image {
        height: 100px;
    }

    .product-title {
        font-size: 14px;
    }

    .product-description {
        font-size: 12px;
    }
}
