.bottom-nav {
    position: fixed;
    bottom: -2.1rem;
    left: 0;
    right: 0;
    background: rgb(231, 229, 183);
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 4px 0 0 0;
    border-top: 2px solid #4cc9fd;
    height: 16rem;
    transform: translateY(calc(100% - 3rem));
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 1rem 1rem 0 0;
}

.bottom-nav.expanded {
    transform: translateY(0);
    bottom: 0;
}

.nav-container {
    display: flex;
    align-items: flex-start;
    margin: 0 auto;
    position: relative;    
    justify-content: center;  
    flex-flow: row wrap;
    flex-direction: row; 
    flex-wrap: wrap; 
    align-content: flex-start;
    /* background-color: #f5fbbb; */
    height: 100%;
    padding: 2rem 1rem;
    gap: 0.2rem;
}

.flex-container > div{
    background: #ffecb3;
    border: 3px solid #ffcc80;
    border-radius: 5px;
    padding: 8px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #6c757d;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 0.8rem;
    min-width: 7rem;
    opacity: 0;
    transform: translateY(0px);
    transition: all 0.3s ease;
}

.bottom-nav.expanded .nav-item {
    opacity: 1;
    transform: translateY(0);
}

.nav-item:hover {
    color: #ff0000ff;
    text-decoration: none;
    background: rgba(13, 110, 253, 0.1);
}

.nav-item.active {
    color: #cf0c0cff;
}

.nav-item i {
    font-size: 22px;
    margin-bottom: 4px;
}

.nav-item span {
    font-size: 0.8rem;
    font-weight: 700;
    text-align: center;
    color: #4d4d4dff;
}


.nav-center {
    position: absolute;
    top: -2.3rem;
}

.nav-center-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.8rem;
    height: 3.8rem;
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(14, 164, 233, 0.09);
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 3px solid white;
    cursor: pointer;
    position: relative;
    animation: pulse 0.3s infinite;
}

/* Animación de pulso latente */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(216, 216, 216, 0.02);
    }
    0% {
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(147, 155, 158, 0.03);
    }
    0% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(184, 184, 184, 0);
    }
}

.nav-center-btn::after {
    animation-delay: 1.5s;
}

@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

.nav-center-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
    color: white;
    text-decoration: none;
    animation-play-state: paused;
}

/* Pausa las animaciones cuando está expandido */
.bottom-nav.expanded .nav-center-btn {
    animation-play-state: paused;
}

.bottom-nav.expanded .nav-center-btn::before,
.bottom-nav.expanded .nav-center-btn::after {
    animation-play-state: paused;
    opacity: 0;
}

.nav-center-btn i {
    font-size: 1.6rem;
    transition: transform 0.3s ease;
}

.bottom-nav.expanded .nav-center-btn i {
    transform: rotate(180deg);
}

.nav-center-label {
    position: absolute;
    bottom: -0.6rem;
    left: 50%;
    transform: translateX(-50%);

    color: #6c757d;
    font-weight: 500;
    white-space: nowrap;
    display: none;
}

/* Overlay para cerrar el nav al hacer click fuera */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Espaciado para evitar que el contenido se superponga */
body {
    padding-bottom: 1.5rem;
}

/* Animación sutil */
.nav-item, .nav-center-btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animaciones escalonadas para los elementos del nav */
.bottom-nav.expanded .nav-item:nth-child(1) {
    transition-delay: 0.1s;
    border: solid 1px rgba(255, 0, 0, 0.733);
    background-color: rgba(255, 0, 0, 0.123);
}

.bottom-nav.expanded .nav-item:nth-child(2) {
    transition-delay: 0.15s;
}

.bottom-nav.expanded .nav-item:nth-child(4) {
    transition-delay: 0.15s;
}

.bottom-nav.expanded .nav-item:nth-child(5) {
    transition-delay: 0.1s;
}

/* Responsive */
@media (max-width: 576px) {
    .nav-item span {
        font-size: 0.7rem;
        line-height: 0.7rem;
    }
    
    .nav-item i {
        font-size: 1.6rem;
    }
    
    .nav-center-btn {
        width: 3.5rem;
        height: 3.5rem;
    }

    .nav-center-btn i {
        font-size: 1.5rem;
    }
    .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-decoration: none;
        color: #6c757d;
        transition: all 0.3s ease;
        padding: 0.45rem;
        border-radius: 0.8rem;
        min-width: 3.5rem;
        opacity: 0;
        transform: translateY(10px);
        transition: all 0.3s ease;
    }

    .nav-item .numero {
        font-size: 0.8rem;
        line-height: 1.3rem;
        width: 1.4rem;
        border-radius: 0.4rem;
        height: 1.4rem;
        background-color: #666;
        font-weight: 700;
        color: #fff;
        display: block;
        margin: 0.3rem auto;
    }
}