/*=====================================================
    Estilos para la Barra de Navegación Superior
======================================================*/

/* Contenedor principal del navbar */
.navBar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    height: 40px;
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.navBar.navBar-change {
    width: calc(100% - 280px);
    left: 280px;
}

.navBar-options {
    line-height: 60px;
    height: 38px;
    padding: 0 20px;
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Botón menú lateral */
.navBar-options .fa-exchange-alt {
    width: 50px;
    height: 50px;
    color: rgb(252, 254, 253);
    font-size: 20px;
    cursor: pointer;
    user-select: none;
    text-align: center;
    outline: none;
    margin-left: 10px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.navBar-options .fa-exchange-alt:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

/* Lista de opciones del navbar */
.navBar-options-list {
    right: 9px;
    line-height: 60px;
    height: 60px;
    margin: 0;
    padding: 0;
}

.navBar-options-list .noLink {
    cursor: inherit;
}

.navBar-options-list ul {
    height: 45px;
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.navBar-options-list ul li {
    height: 45px;
    line-height: 45px;
    cursor: pointer;
    padding: 0 7px;
    font-size: 21px;
    user-select: none;
    outline: none;
}

/* Enlaces del navbar */
.navBar-options-list ul li a,
.navBar-options-list ul li button {
    color: rgb(252, 254, 253);
    margin-right: 15px;
    font-size: 20px;
    padding: 8px 12px;
    border-radius: 6px;
    display: inline-block;
    transition: all 0.3s ease;
    font-weight: 600;
    text-decoration: none;
    border: none;
    background: transparent;
    cursor: pointer;
}

/* Estilos específicos para cada tipo de botón */
/* Nueva Venta - Verde/Emeralda (acción positiva, venta) */
.navBar-link-venta {
    background-color: rgba(16, 185, 129, 0.25) !important;
    color: rgb(252, 254, 253) !important;
}

.navBar-link-venta:hover {
    color: #10b981 !important;
    background-color: rgba(16, 185, 129, 0.4) !important;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* Pago/Transacción - Púrpura/Índigo (dinero, transacción) */
.navBar-link-pago {
    background-color: rgba(99, 102, 241, 0.25) !important;
    color: rgb(252, 254, 253) !important;
}

.navBar-link-pago:hover {
    color: #818cf8 !important;
    background-color: rgba(99, 102, 241, 0.4) !important;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* Cliente - Azul (información, contacto) */
.navBar-link-cliente {
    background-color: rgba(59, 130, 246, 0.25) !important;
    color: rgb(252, 254, 253) !important;
}

.navBar-link-cliente:hover {
    color: #60a5fa !important;
    background-color: rgba(59, 130, 246, 0.4) !important;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* Cerrar Caja - Rojo/Naranja (acción de cierre, advertencia) */
.navBar-link-cerrar-caja {
    background-color: rgba(239, 68, 68, 0.3) !important;
    color: rgb(252, 254, 253) !important;
}

.navBar-link-cerrar-caja:hover {
    color: #f87171 !important;
    background-color: rgba(239, 68, 68, 0.45) !important;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

/* Abrir Caja - Verde Esmeralda (acción positiva, inicio) */
.navBar-link-abrir-caja {
    background-color: rgba(16, 185, 129, 0.3) !important;
    color: rgb(252, 254, 253) !important;
}

.navBar-link-abrir-caja:hover {
    color: #34d399 !important;
    background-color: rgba(16, 185, 129, 0.45) !important;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* Cerrar Sesión - Rojo Oscuro (salida, peligro) */
.navBar-link-exit {
    background-color: rgba(220, 38, 38, 0.2) !important;
    color: rgb(252, 254, 253) !important;
}

.navBar-link-exit:hover {
    color: #fca5a5 !important;
    background-color: rgba(220, 38, 38, 0.35) !important;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

/* Texto dentro de los enlaces */
.navBar-options-list ul li a span,
.navBar-options-list ul li button span {
    margin-left: 5px;
    font-size: 12px;
    font-weight: 600;
}

/* Usuario */
.navBar-user-info {
    color: rgb(252, 254, 253);
    font-size: 14px;
    font-weight: 600;
    margin-right: 15px;
    padding: 8px 12px;
    border-radius: 6px;
    display: inline-block;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Imagen de perfil */
.navBar-options-list ul li img {
    border: 2px solid rgb(252, 254, 253);
    border-radius: 50%;
    width: 42px;
    height: 42px;
    margin-top: 9px;
    margin-bottom: 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: block;
}

.navBar-options-list ul li img:hover {
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/*=====================================================
    Estilos Móviles - Botón de menú y menú desplegable
======================================================*/

/* Botón hamburguesa para móvil - Fijado en esquina superior derecha */
.navBar-mobile-toggle {
    display: none;
    position: fixed;
    top: 8px;
    right: 10px;
    width: 44px;
    height: 44px;
    background-color: rgba(99, 102, 241, 0.9);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 50%;
    color: rgb(252, 254, 253);
    font-size: 20px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
    z-index: 1001;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.navBar-mobile-toggle:hover,
.navBar-mobile-toggle:active {
    background-color: rgba(99, 102, 241, 1);
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.navBar-mobile-toggle.active {
    background-color: rgba(239, 68, 68, 0.9);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* Menú móvil desplegable - Estilo similar a navlateral */
.navBar-mobile-menu {
    display: none;
    position: fixed;
    top: 40px;
    left: 0;
    right: 0;
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 999;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0;
    opacity: 0;
    transform: translateY(-100%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.navBar-mobile-menu.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    animation: slideDownNavbar 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideDownNavbar {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.navBar-mobile-menu ul {
    display: flex;
    flex-direction: column;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
}

.navBar-mobile-menu ul li {
    width: 100%;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navBar-mobile-menu ul li:last-child {
    border-bottom: none;
}

.navBar-mobile-menu ul li a,
.navBar-mobile-menu ul li button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 16px 20px;
    min-height: 56px;
    font-size: 16px;
    border-radius: 0;
    margin: 0;
    transition: all 0.3s ease;
    background-color: transparent;
    border-left: 4px solid transparent;
    position: relative;
}

.navBar-mobile-menu ul li a:hover,
.navBar-mobile-menu ul li button:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-left-color: rgba(255, 255, 255, 0.5);
    transform: translateX(4px);
    box-shadow: none;
}

.navBar-mobile-menu ul li a i,
.navBar-mobile-menu ul li button i {
    font-size: 22px;
    margin-right: 15px;
    width: 24px;
    text-align: center;
}

/* Mostrar texto en móvil junto al ícono */
.navBar-mobile-menu ul li a span,
.navBar-mobile-menu ul li button span {
    display: inline-block;
    font-size: 15px;
    font-weight: 500;
    flex: 1;
}

/* Usuario en móvil */
.navBar-mobile-menu .navBar-user-info {
    width: 100%;
    text-align: center;
    margin: 0;
    padding: 16px 20px;
    background-color: rgba(255, 255, 255, 0.1);
    border-left: 4px solid rgba(255, 255, 255, 0.3);
    font-size: 14px;
}

/* Imagen de perfil en móvil */
.navBar-mobile-menu .navBar-profile-img {
    width: 50px;
    height: 50px;
    margin: 0 auto;
    display: block;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Media queries para móvil */
@media (max-width: 768px) {
    .navBar {
        width: 100% !important;
        left: 0 !important;
    }
    
    .navBar.navBar-change {
        width: 100% !important;
        left: 0 !important;
    }
    
    /* Ocultar menú desktop */
    .navBar-options-list {
        display: none;
    }
    
    /* Mostrar botón móvil fijado */
    .navBar-mobile-toggle {
        display: flex !important;
    }
    
    /* Ajustar altura del navbar en móvil */
    .navBar-options {
        height: 40px;
        padding: 0 10px;
    }
    
    .navBar-options .fa-exchange-alt {
        width: 40px;
        height: 40px;
        font-size: 18px;
        margin-left: 5px;
    }
    
    /* Estilo del menú móvil similar a navlateral */
    .navBar-mobile-menu {
        top: 40px;
        height: auto;
        max-height: calc(100vh - 40px);
        background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-dark) 100%);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    }
    
    .navBar-mobile-menu.active {
        display: block;
    }
    
    /* Overlay de fondo cuando el menú está abierto */
    .navBar-mobile-overlay {
        display: none;
        position: fixed;
        top: 40px;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 998;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .navBar-mobile-overlay.active {
        display: block;
        opacity: 1;
    }
}

/* Media queries para tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .navBar {
        width: 100% !important;
        left: 0 !important;
    }
    
    .navBar.navBar-change {
        width: calc(100% - 280px) !important;
        left: 280px !important;
    }
}

/* Desktop - mantener comportamiento actual */
@media (min-width: 1025px) {
    .navBar-mobile-toggle {
        display: none;
    }
    
    .navBar-mobile-menu {
        display: none !important;
    }
}

