/***
MENÚ
***/
button.opennav {
	cursor: pointer;
    position: relative;
    width: 30px;
    height: 25px;
	margin: 5px 10px;
}
button.opennav:hover > span,
button.opennav:hover > span:after,
button.opennav:hover > span:before {
    background-color: var(--violet);
}
button.opennav > span,
button.opennav > span:after,
button.opennav > span:before {
  transition: all 500ms ease-in-out;
  border-radius: 1px;
  top: 2.5px;
  height:3px;
  width: 30px;
  position: absolute;
  background-color: var(--white);
  display: block;
  content: "";
  border-radius: 5px;
}
button.opennav > span:before {
  top: 8px;
}
button.opennav > span:after {
 top: 16px;
}
button.opennav.active > span {
  background-color: transparent !important;
}

button.opennav.active > span:before,
button.opennav.active > span:after {
  top:8px;
}
button.opennav.active > span:after {
    transform: rotate(-45deg);
}
button.opennav.active > span:before {
    transform: rotate(45deg);
}

/* Pantalla Completa del Menú Overlay */
nav .launcher-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(29, 53, 87, 0.95);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto; 
    padding: 40px 20px;
    box-sizing: border-box;
}

nav .launcher-overlay.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 9999;
}

nav .launcher-content {
    width: 100%;
    max-width: 750px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* Secciones de Páginas Principales */
nav .category-section {
    width: 100%;
    animation: slideUp .35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

nav .category-title {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
    margin: 0 0 12px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 6px;
    pointer-events: none; /* TRUCO: Los clics pasan a través del título hacia el fondo */
}

/* Rejilla contenedora */
nav .apps-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); 
    gap: 20px 14px;
    background-color: rgba(255, 255, 255, 0.04);
    padding: 24px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    pointer-events: none; /* TRUCO: La caja ignora los clics, permitiendo tocar el fondo en zonas vacías */
}

@media (max-width: 680px) {
    nav .apps-grid { grid-template-columns: repeat(4, 1fr); padding: 20px; }
}

@media (max-width: 480px) {
    nav .apps-grid { grid-template-columns: repeat(3, 1fr); padding: 16px 12px; gap: 16px 8px; }
    nav .launcher-overlay { padding: 30px 12px; }
}

@media (max-width: 350px) {
    nav .apps-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Elementos de Subpágina */
nav .app-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    width: 100%;
    text-align: center;
    background: none;
    border: none;
    outline: none;
    padding: 0;
    pointer-events: auto; /* CRITICAL: Le devolvemos la capacidad de hacer clic solo al botón de la app */
}

nav .app-icon {
    width: var(--icon-size);
    height: var(--icon-size);
    border-radius: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 8px;
    transition: var(--transition);
    box-shadow: 0 5px 14px rgba(0,0,0,0.2);
    color: var(--white);
}

nav .app-icon span {
    width: 40px;
    height: 40px;
    padding: 5px;
    fill: currentColor;
}

nav .app-icon span svg {
    width: 100%;
    height: 100%;
}
nav .app-item:hover .app-icon {
    transform: scale(1.1);
    box-shadow: 0 8px 18px rgba(0,0,0,0.3);
}


nav .app-label {
    color: var(--white);
    font-size: var(--font-size-label);
    font-weight: 500;
    width: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    line-height: 1.5;
}

@keyframes slideUp {
    from { transform: translateY(15px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

nav .category-section:nth-child(1) { animation-delay: 0.03s; }
nav .category-section:nth-child(2) { animation-delay: 0.06s; }
nav .category-section:nth-child(3) { animation-delay: 0.09s; }
nav .category-section:nth-child(4) { animation-delay: 0.12s; }
nav .category-section:nth-child(5) { animation-delay: 0.15s; }