/* Barra de navegación simple y limpia - Estilo Dashboard */
.header {
    background-color: #ffffff !important;
    padding: 10px 0 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
    border-bottom: 3px solid #2ecc71 !important;
    position: relative;
    z-index: 1000;
    width: 100%;
}

.header .container-fluid {
    max-width: 100%;
    padding: 0 15px;
}

.header .row {
    margin: 0;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo img {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    max-width: 100%;
    height: auto;
    transition: all 0.3s ease;
}

.logo a {
    display: inline-block;
    max-width: 100%;
}

.navigation .nav-link {
    color: #1E392A !important;
    font-weight: 500;
    padding: 8px 12px !important;
    transition: all 0.2s ease;
    font-size: 14px;
    margin: 0 2px;
    display: inline-flex !important;
    align-items: center !important;
    flex-direction: row !important;
    white-space: nowrap !important;
}

.navigation .nav-link:hover {
    background-color: rgba(46, 204, 113, 0.1);
    color: #1E392A !important;
    border-radius: 5px;
}

.navigation .nav-link.active {
    color: #2ecc71 !important;
    font-weight: 600;
}

.navigation .nav-link i {
    margin-right: 8px !important;
    margin-bottom: 0 !important;
    font-size: 16px;
    display: inline-block !important;
}

/* Estilos para el nombre de usuario */
.navigation .nav-link .pr-6px {
    margin-right: 6px;
    display: inline-block;
}

.navigation .nav-link span {
    white-space: nowrap;
}

.cart-counter {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545 !important;
    color: #ffffff !important;
    font-size: 10px;
    padding: 2px 6px;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    border-radius: 50%;
}

.navigation .navbar-nav {
    align-items: center;
    gap: 5px;
}

.navigation .navbar-collapse {
    display: flex !important;
    flex-basis: auto;
}

/* Asegurar que el navbar no se rompa */
.navigation {
    width: 100%;
}

.logo_section {
    /* Ocultamos la sección del logo */
    display: none !important;
}

/*-------------------------------------------------------------------
   MEJORAS RESPONSIVE PARA NAVBAR
---------------------------------------------------------------------*/

/* Desktop y pantallas grandes - OCULTAR MENÚ MÓVIL */
@media (min-width: 992px) {
    .mobile-menu-toggle {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    .mobile-menu-drawer,
    .mobile-menu-overlay {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        left: -100% !important;
    }

    .mobile-menu-drawer.active {
        display: none !important;
        left: -100% !important;
    }

    .logo img {
        max-width: 180px;
        height: auto;
    }

    /* ASEGURAR que la navegación desktop SE MUESTRE */
    .navigation.navbar {
        display: flex !important;
    }

    .navbar-collapse {
        display: flex !important;
    }

    /* Centramos la navegación en desktop al no tener logo */
    .navigation.navbar {
        justify-content: center !important;
        width: 100%;
    }
}

/* Tablets y móviles */
@media (max-width: 991px) {
    .header {
        padding: 12px 0 !important;
    }

    .logo img {
        max-width: 150px;
        height: auto;
    }

    /* Ocultar navegación desktop en móviles */
    .navigation.navbar {
        display: none !important;
    }
}

/* Tablets medianas */
@media (max-width: 768px) {
    .header {
        padding: 10px 0 !important;
    }

    .logo img {
        max-width: 130px;
    }
}

/* Móviles pequeños */
@media (max-width: 576px) {
    .header {
        padding: 8px 0 !important;
    }

    .logo img {
        max-width: 110px;
    }
}

/* Pantallas extra grandes (TVs y monitores 4K) */
@media (min-width: 1400px) {
    .header {
        padding: 15px 0 !important;
    }

    .header .container-fluid {
        max-width: 1600px;
        margin: 0 auto;
    }

    .logo img {
        max-width: 220px;
    }

    .navigation .nav-link {
        padding: 12px 18px !important;
        font-size: 17px;
    }

    .navigation .nav-link i {
        font-size: 19px;
        margin-right: 10px !important;
    }

    .cart-counter {
        font-size: 12px;
        padding: 3px 7px;
    }
}

/* Pantallas ultra anchas (TVs 4K y 8K) */
@media (min-width: 1920px) {
    .header {
        padding: 20px 0 !important;
    }

    .header .container-fluid {
        max-width: 1800px;
    }

    .logo img {
        max-width: 250px;
    }

    .navigation .nav-link {
        padding: 14px 20px !important;
        font-size: 18px;
    }

    .navigation .nav-link i {
        font-size: 20px;
        margin-right: 12px !important;
    }
}

/* Tablets en modo portrait */
@media (min-width: 768px) and (max-width: 991px) and (orientation: portrait) {
    .header {
        padding: 12px 0 !important;
    }

    .logo img {
        max-width: 160px;
    }

    .mobile-menu-toggle {
        font-size: 28px;
    }
}

/*-------------------------------------------------------------------
   MOBILE MENU DRAWER (Estilo tipo app móvil)
---------------------------------------------------------------------*/

/* Botón hamburguesa */
.mobile-menu-toggle {
    background: transparent;
    border: none;
    color: #1E392A;
    font-size: 24px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1000;
}

.mobile-menu-toggle:hover {
    color: #2ecc71;
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

.mobile-menu-toggle i {
    transition: transform 0.3s ease;
}

/* Animación del icono hamburguesa a X */
.mobile-menu-toggle .fa-times {
    animation: rotateIn 0.3s ease;
}

@keyframes rotateIn {
    from {
        transform: rotate(-90deg);
        opacity: 0;
    }
    to {
        transform: rotate(0);
        opacity: 1;
    }
}

/* Overlay oscuro de fondo */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

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

/* Prevenir scroll del body cuando el menú está abierto */
body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Drawer lateral - SE ABRE DESDE LA IZQUIERDA */
.mobile-menu-drawer {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    max-width: 85%;
    height: 100%;
    background: #1E392A;
    z-index: 999;
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.mobile-menu-drawer.active {
    left: 0;
}

/* Animación de entrada para el drawer */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Header del drawer - ESTILO OSCURO TIPO SPOTIFY */
.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: #1E392A;
}

.mobile-menu-logo {
    height: 35px;
    width: auto;
    filter: brightness(0) invert(1);
}

.mobile-menu-close {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 28px;
    padding: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-menu-close:hover {
    color: #2ecc71;
    transform: scale(1.1);
}

/* Contenido del menú - LISTA VERTICAL TIPO SPOTIFY */
.mobile-menu-content {
    padding: 10px 0;
}

/* Lista vertical en lugar de grid */
.mobile-menu-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
}

.mobile-menu-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    text-decoration: none;
    color: #b3b3b3;
    transition: all 0.3s ease;
    padding: 16px 20px;
    border-left: 3px solid transparent;
    background: transparent;
}

.mobile-menu-item:hover {
    background: rgba(46, 204, 113, 0.1);
    color: #ffffff;
    text-decoration: none;
    border-left-color: #2ecc71;
}

.mobile-menu-item.active {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    border-left-color: #2ecc71;
    font-weight: 600;
}

.mobile-menu-icon {
    width: 28px;
    height: 28px;
    background: transparent;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    margin-bottom: 0;
    position: relative;
    box-shadow: none;
}

.mobile-menu-icon i {
    font-size: 20px;
    color: inherit;
}

.mobile-menu-item span {
    font-size: 15px;
    font-weight: 400;
    text-align: left;
    color: inherit;
    flex: 1;
}

/* Badge del carrito en móvil - ESTILO MINIMALISTA */
.mobile-cart-badge {
    position: static;
    background: #2ecc71;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: auto;
    min-width: 24px;
    text-align: center;
}

/* Animaciones mejoradas */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

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

/* Animación para los items del menú cuando se abre */
.mobile-menu-drawer.active .mobile-menu-item {
    animation: fadeInUp 0.4s ease forwards;
    opacity: 0;
}

.mobile-menu-drawer.active .mobile-menu-item:nth-child(1) { animation-delay: 0.1s; }
.mobile-menu-drawer.active .mobile-menu-item:nth-child(2) { animation-delay: 0.15s; }
.mobile-menu-drawer.active .mobile-menu-item:nth-child(3) { animation-delay: 0.2s; }
.mobile-menu-drawer.active .mobile-menu-item:nth-child(4) { animation-delay: 0.25s; }
.mobile-menu-drawer.active .mobile-menu-item:nth-child(5) { animation-delay: 0.3s; }
.mobile-menu-drawer.active .mobile-menu-item:nth-child(6) { animation-delay: 0.35s; }
.mobile-menu-drawer.active .mobile-menu-item:nth-child(7) { animation-delay: 0.4s; }
.mobile-menu-drawer.active .mobile-menu-item:nth-child(8) { animation-delay: 0.45s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 375px) {
    .mobile-menu-drawer {
        width: 90%;
        max-width: 90%;
    }

    .mobile-menu-item {
        padding: 14px 15px;
    }

    .mobile-menu-item span {
        font-size: 14px;
    }

    .mobile-menu-icon {
        width: 24px;
        height: 24px;
        margin-right: 12px;
    }

    .mobile-menu-icon i {
        font-size: 18px;
    }
}

/* Tablets en orientación landscape */
@media (min-width: 768px) and (max-width: 991px) and (orientation: landscape) {
    .mobile-menu-drawer {
        width: 320px;
    }

    .mobile-menu-header {
        padding: 15px;
    }

    .mobile-menu-item {
        padding: 12px 18px;
    }
}

/* Móviles en orientación landscape */
@media (max-width: 767px) and (orientation: landscape) {
    .mobile-menu-drawer {
        width: 280px;
    }

    .mobile-menu-content {
        padding: 5px 0;
    }

    .mobile-menu-item {
        padding: 10px 15px;
    }

    .mobile-menu-item span {
        font-size: 14px;
    }
}

/* Smooth scroll para evitar jump al abrir menú */
.mobile-menu-drawer::-webkit-scrollbar {
    width: 6px;
}

.mobile-menu-drawer::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.mobile-menu-drawer::-webkit-scrollbar-thumb {
    background: rgba(46, 204, 113, 0.3);
    border-radius: 3px;
}

.mobile-menu-drawer::-webkit-scrollbar-thumb:hover {
    background: rgba(46, 204, 113, 0.5);
}

/*-------------------------------------------------------------------
   REGLAS FINALES DE SEGURIDAD - OCULTAR MENÚ MÓVIL EN DESKTOP
---------------------------------------------------------------------*/
@media screen and (min-width: 992px) {
    /* Forzar ocultamiento total del menú móvil en desktop */
    button.mobile-menu-toggle,
    #mobileMenuBtn,
    .mobile-menu-toggle {
        display: none !important;
        visibility: hidden !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
    }

    div.mobile-menu-drawer,
    #mobileMenuDrawer,
    div.mobile-menu-overlay,
    #mobileMenuOverlay {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        transform: translateX(-100%) !important;
        pointer-events: none !important;
        position: fixed !important;
        left: -9999px !important;
    }

    /* Forzar visibilidad de navegación desktop */
    nav.navigation.navbar,
    .navigation.navbar,
    .navbar-collapse {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .navbar-nav {
        display: flex !important;
        flex-direction: row !important;
    }
}
