/* STICKY HEADER BASE */
.sticky-header-clone {
    position: fixed;
    top: -100%;
    left: 0;
    width: 100%;
    background: #0033ff;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    opacity: 0;
    visibility: hidden;
}

.sticky-header-clone.active {
    top: 0;
    opacity: 1;
    visibility: visible;
}

/* ESPACIO PARA STICKY */
body.sticky-active {
    padding-top: 60px;
}

/* HEADER ORIGINAL */
.sticky-header {
    transition: transform 0.3s ease;
}

.sticky-header.hide {
    transform: translateY(-100%);
}

/* VISIBILIDAD POR DISPOSITIVO */
.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

/* HEADER MÓVIL - ESTILO OPTIMIZADO */
@media (max-width: 991.98px) {
    .mobile-header-wrap {
        width: 100%;
        height: 100%;
        margin: 0 auto;
        padding: 0 15px;
    }

    .sticky-header-clone.mobile-only {
        height: 60px;
        background: white;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        border-bottom: 1px solid #f0f0f0;
    }

    .header-inner-mobile {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 100%;
        position: relative;
    }

    /* Botón menú izquierdo */
    .mobile-nav-toggle {
        background: transparent;
        border: none;
        color: #333;
        font-size: 1.4rem;
        padding: 5px 10px;
        position: absolute;
        left: 5px;
        z-index: 10;
    }

    /* Contenedor logo */
    .mobile-logo-wrapper {
        position: absolute;
        left: 0;
        right: 0;
        text-align: center;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        pointer-events: none;
    }

    .mobile-main-logo {
        max-height: 35px;
        width: auto;
        max-width: 150px;
    }

    /* Botón búsqueda derecho */
    .mobile-search-trigger {
        background: transparent;
        border: none;
        color: #333;
        font-size: 1.3rem;
        padding: 5px 10px;
        position: absolute;
        right: 5px;
        z-index: 10;
    }

    /* Contenedor buscador */
    .mobile-search-wrapper {
        position: fixed;
        top: 60px;
        left: 0;
        width: 100%;
        background: white;
        padding: 15px;
        display: none;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        z-index: 1000;
    }

    .search-active .mobile-search-wrapper {
        display: block;
        animation: slideDown 0.3s ease-out;
    }

    /* MENÚ DE CATEGORÍAS MÓVIL */
    .mobile-categories-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 350px;
        height: 100vh;
        background: white;
        z-index: 1100;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        transition: all 0.3s ease;
        overflow-y: auto;
    }

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

    .mobile-menu-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px;
        background: #0033ff;
        color: white;
    }

    .mobile-menu-header h3 {
        margin: 0;
        font-size: 1.2rem;
    }

    .close-menu-btn {
        background: none;
        border: none;
        color: white;
        font-size: 1.3rem;
    }

    .mobile-categories-list {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .mobile-category-item {
        border-bottom: 1px solid #eee;
    }

    .mobile-category-link {
        display: block;
        padding: 15px;
        color: #333;
        text-decoration: none;
        font-weight: 500;
    }

    .mobile-submenu {
        list-style: none;
        padding: 0;
        margin: 0;
        background: #f9f9f9;
        display: none;
    }

    .mobile-category-item.active .mobile-submenu {
        display: block;
    }

    .mobile-submenu-item a {
        display: block;
        padding: 12px 15px 12px 30px;
        color: #555;
        text-decoration: none;
    }

    .no-categories {
        padding: 20px;
        text-align: center;
        color: #777;
    }

    /* OVERLAY PARA FONDO OSCURO */
    .mobile-menu-overlay {

        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1099;
        display: none;
    }

    .menu-open .mobile-menu-overlay {
        display: block;
    }

    @keyframes slideDown {
        from {
            transform: translateY(-20px);
            opacity: 0;
        }

        to {
            transform: translateY(0);
            opacity: 1;
        }
    }
}
