/* ==========================================
   NAVBAR - Estilo Purple Admin Horizontal
   MENÚ DE SOLO ICONOS EN DESKTOP
   ========================================== */
.navbar {
    background: linear-gradient(135deg, #c084fc 0%, #a855f7 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.2);
    position: sticky;
    top: 65px; /* Debajo del topbar */
    z-index: 1000;
    overflow: visible;
    transition: all 0.3s ease;
}

/* Tooltips mejorados para iconos (nativo del navegador) */
.nav-dropdown-toggle[title]:hover::after,
.nav-direct-item[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.nav-dropdown-toggle[title]:hover::before,
.nav-direct-item[title]:hover::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-bottom-color: rgba(0, 0, 0, 0.9);
    pointer-events: none;
    z-index: 10000;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    height: 45px;
    overflow: visible;
    position: relative;
}

/* ==========================================
   MENU
   ========================================== */
.navbar-menu {
    flex: 1;
    display: flex;
    gap: 0.25rem;
    align-items: center;
    overflow: visible;
}

/* Items del menú principal */
.navbar-menu > .nav-item,
.navbar-menu > a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 14px;
    color: #ffffff !important;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 4px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.navbar-menu > .nav-item:hover,
.navbar-menu > a:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #e4c9ff !important;
}

.navbar-menu > .nav-item.active,
.navbar-menu > a.active {
    color: #ffffff !important;
    border-bottom: 3px solid #ffffff;
    font-weight: 600;
}

.navbar-menu > .nav-item i,
.navbar-menu > a i {
    font-size: 1.125rem;
    color: #ffffff;
}

.navbar-menu > .nav-item:hover i,
.navbar-menu > a:hover i,
.navbar-menu > .nav-item.active i,
.navbar-menu > a.active i {
    color: #e4c9ff;
}

/* ==========================================
   DROPDOWNS
   ========================================== */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 14px;
    border: none;
    border-radius: 4px;
    background-color: transparent;
    color: #ffffff !important;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

/* Link directo en la navbar (items sin padre) */
.nav-direct-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 14px;
    border-radius: 4px;
    color: #ffffff !important;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-direct-item:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #e4c9ff !important;
}

.nav-direct-item i {
    font-size: 1.125rem;
}

.nav-dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #e4c9ff !important;
}

.nav-dropdown.active .nav-dropdown-toggle {
    color: #ffffff !important;
    border-bottom: 3px solid #ffffff;
    font-weight: 600;
}

.nav-dropdown-toggle .menu-icon {
    font-size: 1.125rem;
    color: #ffffff;
}

.nav-dropdown-toggle:hover .menu-icon,
.nav-dropdown.active .nav-dropdown-toggle .menu-icon {
    color: #e4c9ff;
}

.nav-dropdown-toggle .menu-title {
    color: #ffffff;
}

.nav-dropdown-toggle:hover .menu-title,
.nav-dropdown.active .nav-dropdown-toggle .menu-title {
    color: #e4c9ff;
}

.nav-dropdown-toggle .menu-arrow {
    font-size: 12px;
    margin-left: 4px;
    transition: transform 0.3s ease;
    color: #ffffff;
}

.nav-dropdown-toggle:hover .menu-arrow,
.nav-dropdown.active .nav-dropdown-toggle .menu-arrow {
    color: #e4c9ff;
}

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

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0;
    min-width: 220px;
    background-color: #ffffff;
    border: none;
    border-radius: 4px;
    box-shadow: 1px 0px 20px rgba(0, 0, 0, 0.08);
    -webkit-box-shadow: 1px 0px 20px rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 999;
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
    padding: 25px;
}

/* Scrollbar para Chrome/Safari/Edge */
.nav-dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.nav-dropdown-menu::-webkit-scrollbar-track {
    background: transparent;
}

.nav-dropdown-menu::-webkit-scrollbar-thumb {
    background-color: #d1d5db;
    border-radius: 3px;
}

.nav-dropdown-menu::-webkit-scrollbar-thumb:hover {
    background-color: var(--color-primary);
}

.nav-dropdown.active .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.nav-dropdown-item {
    display: block;
    position: relative;
    padding: 10px 20px 10px 20px;
    color: #1f2937 !important;
    text-decoration: none;
    font-size: 13px;
    font-weight: 400;
    transition: all 0.2s;
    border-radius: 4px;
}

.nav-dropdown-item::before {
    position: absolute;
    content: "";
    width: 6px;
    height: 2px;
    border-radius: 100%;
    background: #c3bdbd;
    top: 18px;
    left: 0;
}

.nav-dropdown-item:hover {
    background-color: rgba(147, 51, 234, 0.08);
    color: var(--color-primary) !important;
}

.nav-dropdown-item:hover::before {
    background: var(--color-primary);
}

.nav-dropdown-item i {
    margin-right: 10px;
    font-size: 14px;
    color: #6b7280;
}

.nav-dropdown-item:hover i {
    color: var(--color-primary);
}

.nav-dropdown-item.active {
    color: var(--color-primary) !important;
    font-weight: 600;
}

/* ==========================================
   SUBMENUS ANIDADOS
   ========================================== */
.nav-submenu {
    position: relative;
    margin-left: 0;
}

.nav-submenu-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    background-color: transparent;
    color: #1f2937 !important;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.nav-submenu-toggle:hover {
    background-color: rgba(147, 51, 234, 0.08);
    color: var(--color-primary) !important;
}

.nav-submenu-toggle .menu-icon {
    font-size: 14px;
    color: #6b7280;
    margin-right: 10px;
}

.nav-submenu-toggle:hover .menu-icon {
    color: var(--color-primary);
}

.nav-submenu-toggle .menu-arrow {
    font-size: 10px;
    margin-left: auto;
    transition: transform 0.3s ease;
    color: #6b7280;
}

.nav-submenu.active .nav-submenu-toggle .menu-arrow {
    transform: rotate(180deg);
}

.nav-submenu-menu {
    display: none;
    padding-left: 20px;
    margin-top: 4px;
}

.nav-submenu.active .nav-submenu-menu {
    display: block;
}

/* ==========================================
   MEGA MENU - Estilo Purple Admin
   Agregar clase "mega-menu" a un nav-dropdown
   ========================================== */

/* Contenedor mega-menu ocupa todo el ancho */
.nav-dropdown.mega-menu {
    position: relative;
}

.nav-dropdown.mega-menu .nav-dropdown-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    border-radius: 4px;
    border: none;
    box-shadow: 1px 0px 20px rgba(0, 0, 0, 0.08);
    -webkit-box-shadow: 1px 0px 20px rgba(0, 0, 0, 0.08);
    max-height: 600px;
    overflow-y: auto;
    padding: 25px;
    margin-top: 0;
}

/* Grid de columnas para mega-menu */
.mega-menu-grid {
    display: flex;
    gap: 3rem;
    max-width: 1400px;
    margin: 0 auto;
}

.mega-menu-column {
    flex: 1;
    min-width: 0;
}

/* Tamaños específicos de columnas */
.mega-menu-column.col-2 { flex: 0 0 16.666%; }
.mega-menu-column.col-3 { flex: 0 0 25%; }
.mega-menu-column.col-4 { flex: 0 0 33.333%; }
.mega-menu-column.col-5 { flex: 0 0 41.666%; }
.mega-menu-column.col-6 { flex: 0 0 50%; }

/* Encabezados de categoría en mega-menu */
.mega-menu-heading {
    font-size: 0.875rem;
    font-weight: 600;
    text-align: left;
    color: var(--color-primary);
    padding: 0 0 1rem 0;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--color-border-secondary);
}

/* Sublistas dentro del mega-menu */
.mega-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

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

.mega-menu-list li a {
    display: block;
    padding: 8px 12px;
    color: #6b7280;
    font-size: 13px;
    font-weight: 400;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.mega-menu-list li a:hover {
    color: var(--color-primary);
    background-color: rgba(147, 51, 234, 0.08);
    padding-left: 16px;
}

.mega-menu-list li a.active {
    color: var(--color-primary);
    font-weight: 600;
}

/* Subdivisión de columnas dentro del mega-menu */
.mega-menu-row {
    display: flex;
    gap: 2rem;
}

.mega-menu-col-6 {
    flex: 0 0 calc(50% - 1rem);
}

.mega-menu-col-12 {
    flex: 0 0 100%;
}

/* ==========================================
   ANIMACIONES
   ========================================== */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* SOLO activar en click (clase .active), NO en hover - touch friendly */
.nav-dropdown.active .nav-dropdown-menu {
    animation: slideDown 0.3s ease;
}
