/* Menu */
nav {
        position: relative; /* Cria contexto de empilhamento */
        z-index: 1000; /* Acima de main, section, etc. */
        max-width: 1200px;
        margin: 10px auto;
        padding: 0 10px;
}

nav ul {
        list-style: none;
        padding: 0;
        margin: 0;
        display: flex;
        justify-content: space-between;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 12px;
        backdrop-filter: blur(10px);
        box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

nav li {
        position: relative;
        flex: 1;
        text-align: center;
}

nav li a {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        height: 80px;
        padding: 1em;
        color: #FFFFFF;
        text-decoration: none;
        font-size: 1.4em;
        background: transparent;
        transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        position: relative;
        z-index: 100;
}

nav li a i {
        font-size: 20px;
        margin-bottom: 2px;
        transform: translateY(20px);
        transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

nav li a span {
        opacity: 0;
        transform: translateY(40px);
        transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

nav li a:hover {
        background: rgba(255, 255, 255, 0.2);
        box-shadow: inset 0 0 0 3px #FFDF00;
        transform: translateY(-5px);
}

nav li a:hover i {
        transform: translateY(0);
}

nav li a:hover span {
        opacity: 1;
        transform: translateY(0);
        background: linear-gradient(45deg, #FFDF00, #009B3A);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
}

nav li a.has-submenu::after {
    content: "";
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid rgba(0, 155, 58, 0.2); /* Seta pra baixo */
    position: absolute;
    left: 50px; /* Colado à esquerda do texto <span> */
    top: 75%; /* Alinha com o centro do texto <span> */
    transform: translateY(-50%);
    transition: border-top-color 0.3s ease;
}

nav li a.has-submenu:hover::after {
/*    border-top-color: #FFDF00; /* Amarelo no hover */
    opacity: 0.7;
}

nav .sub-menu {
    position: absolute;
    top: 100%; /* Abaixo do item */
    left: 0; /* Alinha à esquerda do <a class="has-submenu"> */
    right: 0; /* Estica até a direita do <a> */
    width: 100%; /* Ocupa a largura do <a> */
    display: block; /* Sobrescreve flex do nav ul */
    background: rgba(0, 59, 135, 0.95);
    border-radius: 0 0 8px 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 9999;
}

nav li:hover .sub-menu {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

nav .sub-menu li {
    display: block; /* Cada <li> em uma linha */
    text-align: left; /* Texto à esquerda */
}

nav .sub-menu li a {
        height: 50px;
        font-size: 1.1em;
        font-weight: 500;
        padding: 0.8em 1.4em;
        align-items: center;
        background: transparent;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        color: #FFFFFF;
}

nav .sub-menu li a:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: translateX(5px);
        box-shadow: inset 3px 0 0 0 #FFDF00;
}

nav .sub-menu li a span {
        opacity: 1;
        transform: translateY(0);
        background: none;
        -webkit-background-clip: initial;
        -webkit-text-fill-color: #FFFFFF;
}

nav .sub-menu li a:hover span {
        background: linear-gradient(45deg, #FFDF00, #009B3A);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
}

nav > ul > li:nth-child(1) > a { background: rgba(0, 155, 58, 0.8); } /* Verde */
nav > ul > li:nth-child(2) > a { background: rgba(255, 223, 0, 0.8); } /* Amarelo */
nav > ul > li:nth-child(3) > a { background: rgba(0, 59, 135, 0.8); } /* Azul */
nav > ul > li:nth-child(4) > a { background: rgba(255, 255, 255, 0.9); } /* Branco */

nav > ul > li > ul > li:nth-child(1) > a { background: rgba(0, 155, 58, 0.8); } /* Verde */
nav > ul > li > ul > li:nth-child(2) > a { background: rgba(255, 223, 0, 0.8); } /* Amarelo */
nav > ul > li > ul > li:nth-child(3) > a { background: rgba(0, 59, 135, 0.8); } /* Azul */
nav > ul > li > ul > li:nth-child(4) > a { background: rgba(255, 255, 255, 0.9); } /* Branco */
nav > ul > li > ul > li:nth-child(5) > a { background: rgba(0, 155, 58, 0.8); } /* Verde */
nav > ul > li > ul > li:nth-child(6) > a { background: rgba(255, 223, 0, 0.8); } /* Amarelo */
nav > ul > li > ul > li:nth-child(7) > a { background: rgba(0, 59, 135, 0.8); } /* Azul */
nav > ul > li > ul > li:nth-child(8) > a { background: rgba(255, 255, 255, 0.9); } /* Branco */
