/* ============================================
   WOLF HEADER - Estilos del Header Completo
   ============================================ */

.wolf-header {
    background: var(--waeg-black);
    color: var(--waeg-white);
    position: sticky;
    top: 0;
    z-index: var(--waeg-z-header);
    box-shadow: var(--waeg-shadow-dark);
}

.wolf-header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px 30px;
    gap: 40px;
    position: relative; /* Para centrar logo en móvil */
}

/* ============================================
   LOGO
   ============================================ */

.wolf-header-logo {
    flex-shrink: 0;
}

.wolf-header-logo a {
    display: block;
    text-decoration: none;
}

.wolf-header-logo img {
    display: block;
    max-width: 100%;
    height: auto;
}

.wolf-header-site-name {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* ============================================
   NAVEGACIÓN (Mega Menu + Navbar)
   ============================================ */

.wolf-header-nav {
    display: flex;
    align-items: center;
    gap: 30px;
    flex: 1;
}

/* Botón del Mega Menu */
.wolf-header-megamenu-trigger {
    flex-shrink: 0;
}

.wolf-megamenu-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: 2px solid #fff;
    color: #fff;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.wolf-megamenu-btn:hover {
    background: #fff;
    color: #000;
}

.wolf-megamenu-btn svg {
    width: 20px;
    height: 20px;
}

/* Navbar Items */
.wolf-header-navbar {
    display: flex !important; /* Forzar display en móvil */
    align-items: center;
    gap: 25px;
    flex: 1;
    visibility: visible !important;
    opacity: 1 !important;
}

.wolf-navbar-item {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
}

.wolf-navbar-item:hover {
    color: var(--waeg-accent);
}

.wolf-navbar-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--waeg-accent);
    transition: width var(--waeg-transition);
}

.wolf-navbar-item:hover::after {
    width: 80%;
}

/* ============================================
   ACCIONES (Búsqueda, Usuario, Carrito)
   ============================================ */

.wolf-header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.wolf-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
    position: relative;
    text-decoration: none;
}

.wolf-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--waeg-accent);
}

.wolf-action-btn svg {
    width: 22px;
    height: 22px;
}

/* Contador del carrito */
.wolf-cart-count {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--waeg-danger);
    color: var(--waeg-white);
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

/* ============================================
   MEGA MENU CONTAINER
   ============================================ */

.wolf-megamenu-container {
    background: #fff;
    color: #000;
    border-top: 1px solid #ddd;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.wolf-megamenu-container.active {
    display: block !important;
    animation: wolf-slideDown 0.3s ease;
}

@keyframes wolf-slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   RESPONSIVE - TABLET
   ============================================ */

@media (max-width: 1024px) {
    .wolf-header-container {
        padding: 12px 20px;
        gap: 20px;
    }

    .wolf-header-nav {
        gap: 15px;
    }

    .wolf-navbar-item {
        font-size: 13px;
        padding: 6px 10px;
    }

    .wolf-header-actions {
        gap: 10px;
    }

    .wolf-action-btn {
        width: 40px;
        height: 40px;
    }
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */

@media (max-width: 767px) {
    /* FORZAR visibilidad del contenedor principal */
    .wolf-header {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 1000 !important; /* Header siempre encima */
        position: sticky !important;
        top: 0 !important;
    }

    .wolf-header-container {
        padding: 8px 10px;
        gap: 0; /* Sin gap para controlar el spacing manualmente */
        flex-wrap: nowrap; /* Una sola línea */
        align-items: center;
        justify-content: space-between;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .wolf-header-logo {
        order: 2; /* Logo en el centro */
        flex: 1; /* Toma todo el espacio central */
        text-align: center;
        position: relative; /* Cambiar de absolute a relative */
        z-index: 10 !important;
        margin: 0 50px; /* Espacio para hamburger (izq) e iconos (der) */
    }

    .wolf-header-logo a,
    .wolf-header-logo img {
        pointer-events: auto; /* Permitir clicks en logo */
    }

    .wolf-header-logo img {
        max-width: 70px; /* Logo más pequeño en móvil */
        height: auto;
    }

    .wolf-header-actions {
        order: 3; /* Acciones a la derecha */
        margin-left: 0;
        gap: 5px; /* Reducir espacio entre iconos */
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 100 !important; /* Por encima del logo */
        flex-shrink: 0; /* No encoger */
    }

    /* HAMBURGER - FORZAR MÁXIMA VISIBILIDAD */
    .wolf-header-nav {
        order: 1 !important; /* Mega menu a la izquierda */
        width: auto !important;
        flex: 0 0 auto !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        z-index: 1000 !important;
    }

    .wolf-header-megamenu-trigger {
        width: auto !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        z-index: 1001 !important;
    }

    .wolf-megamenu-btn {
        width: 44px !important;
        height: 44px !important;
        padding: 8px !important;
        min-width: 44px !important;
        background: transparent !important;
        border: 2px solid #fff !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        color: #fff !important;
        position: relative !important;
        z-index: 1002 !important;
        cursor: pointer !important;
        pointer-events: auto !important;
    }

    /* Crear hamburger icon con CSS puro */
    .wolf-megamenu-btn::before {
        content: "";
        position: absolute;
        width: 20px;
        height: 2px;
        background: #fff;
        box-shadow: 0 6px 0 #fff, 0 12px 0 #fff;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
    }

    .wolf-megamenu-btn svg {
        display: none !important; /* Ocultar SVG, usar CSS */
    }

    .wolf-megamenu-btn span {
        display: none; /* Ocultar texto "PRODUCTOS" en móvil */
    }

    .wolf-header-navbar {
        display: none !important; /* Ocultar navbar en móvil */
    }

    .wolf-navbar-item {
        display: none;
    }

    .wolf-navbar-item:last-child {
        border-bottom: none;
    }

    .wolf-navbar-item::after {
        display: none;
    }

    .wolf-action-btn {
        width: 36px;
        height: 36px;
        padding: 6px;
    }

    .wolf-action-btn svg {
        width: 18px;
        height: 18px;
    }

    .wolf-cart-count {
        width: 16px;
        height: 16px;
        font-size: 10px;
        top: -4px;
        right: -4px;
    }

    /* Mega Menu Container en móvil */
    .wolf-megamenu-container {
        position: fixed !important;
        top: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        overflow: hidden !important;
        z-index: 9999 !important;
        background: rgba(0, 0, 0, 0.8) !important; /* Backdrop oscuro */
        display: none !important;
    }

    .wolf-megamenu-container.active {
        display: flex !important;
        flex-direction: column !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Contenido del mega menu scrolleable */
    .wolf-megamenu-container > * {
        width: 100% !important;
        max-height: 100% !important;
        overflow-y: auto !important;
        background: #000 !important;
    }

    /* Forzar visibilidad del mega menu interno */
    .wolf-megamenu-container .category-mega-menu,
    .wolf-megamenu-container .waeg-mega-menu {
        display: block !important;
        position: static !important;
        visibility: visible !important;
        width: 100% !important;
        height: auto !important;
    }

    /* Anular modo navbar/dropdown en móvil */
    .wolf-megamenu-container .waeg-mega-menu.navbar-mode .waeg-mega-menu-grid {
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        min-width: 100% !important;
        width: 100% !important;
    }

    .wolf-megamenu-container .waeg-mega-menu-grid {
        position: static !important;
        max-width: 100% !important;
        width: 100% !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        display: flex !important;
        border: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* ============================================
   INTEGRACIÓN CON MEGA MENU EXISTENTE
   ============================================ */

.wolf-megamenu-container .category-mega-menu {
    margin: 0;
    padding: 20px;
}

.wolf-megamenu-container .category-mega-menu-grid {
    max-width: 1400px;
    margin: 0 auto;
}
