/* Estilos base para el header con clases únicas */
.header-custom {
    display: flex;
    align-items: center;
    padding: 17px 12px;
    background: linear-gradient(135deg, #0d001a, #2e004d, #6a0072);
    position: relative;
    width: 100%;
    box-shadow: 0 4px 20px rgba(106, 0, 114, 0.3);
    z-index: 100;
    /* Asegura que no haya overflow oculto innecesario */
}

/* Logo */
.header-custom .logo-custom img {
    width: 140px;
    height: auto;
    filter: drop-shadow(0 2px 8px rgba(255, 0, 255, 0.2));
}

/* Carrito: justo después del logo */
.cart-container-custom {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 16px;
}

.cart-icon-custom {
    width: 42px;
    height: 42px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23FF00FF"><path d="M7 18c0 0.55.45 1 1 1h8c0.55 0 1-.45 1-1v-6H7v6zm4-9c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h2c0.55 0 1-.45 1-1v-6c0-.55-.45-1-1-1h-2z"/></svg>') no-repeat center / contain;
    background-color: transparent;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.cart-icon-custom:hover {
    transform: scale(1.1);
}

.cart-count-custom {
    position: absolute;
    top: -8px;
    right: -8px;
    background: radial-gradient(circle, #ff00ff, #cc00cc);
    color: white;
    font-size: 0.9rem;
    font-weight: bold;
    border-radius: 50%;
    padding: 4px 8px;
    min-width: 24px;
    text-align: center;
    box-shadow: 0 0 8px rgba(255, 0, 255, 0.7);
    z-index: 2;
    animation: pulseGlow 2s infinite alternate;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 6px rgba(255, 0, 255, 0.5); }
    100% { box-shadow: 0 0 14px rgba(255, 0, 255, 0.9), 0 0 20px rgba(255, 0, 255, 0.4); }
}

/* Menú hamburguesa */
.menu-toggle-custom {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 10;
}

.menu-toggle-custom .bar {
    width: 28px;
    height: 4px;
    background: #ff00ff;
    border-radius: 2px;
    transition: all 0.4s ease;
}

.menu-toggle-custom.active .bar:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}
.menu-toggle-custom.active .bar:nth-child(2) {
    opacity: 0;
}
.menu-toggle-custom.active .bar:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* Navegación — CORRECCIÓN CLAVE: NO usa flex:1 ni margin-left:auto */
.navigation-custom {
    display: flex;
    z-index: 9999;
    margin-left: 16px; /* ← Ahora sí: 16px después del carrito, sin empuje */
    flex: 0 1 auto; /* ← No crece más de lo necesario */
}

.navigation-custom ul {
    list-style: none;
    display: flex;
    gap: 14px; /* aún más compacto */
    align-items: center;
    flex-wrap: nowrap;
    font-weight: 500;
    font-size: 1.05rem;
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    letter-spacing: 0.1px;
}

.navigation-custom li {
    white-space: nowrap;
}

.navigation-custom a {
    color: #f8f8f8;
    text-decoration: none;
    position: relative;
    padding-bottom: 6px;
    transition: color 0.3s ease, transform 0.3s ease;
}

.navigation-custom a:hover {
    color: #ff00ff;
    transform: translateY(-1px);
}

.navigation-custom a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ff00ff, transparent);
    border-radius: 2px;
    transition: width 0.4s ease;
}

.navigation-custom a:hover::after {
    width: 100%;
}

.navigation-custom a::before {
    content: '';
    position: absolute;
    top: -4px;
    right: -4px;
    width: 6px;
    height: 6px;
    background: #ff00ff;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.navigation-custom a:hover::before {
    opacity: 0.7;
    animation: sparkle 1.2s infinite;
}

@keyframes sparkle {
    0%, 100% { transform: translate(0, 0); opacity: 0.7; }
    50% { transform: translate(-2px, -2px); opacity: 1; }
}

/* Media Queries — ajustados */
@media (max-width: 768px) {
    .header-custom {
        padding: 16px 12px;
        justify-content: space-between;
        position: relative;
    }

    .navigation-custom {
        display: none;
        flex-direction: column;
        gap: 20px;
        position: absolute;
        top: 100%;
        left: 16px;
        right: 16px;
        background: rgba(13, 0, 26, 0.95);
        padding: 28px 20px;
        border-radius: 12px;
        box-shadow: 0 12px 30px rgba(106, 0, 114, 0.4);
        backdrop-filter: blur(10px);
        z-index: 9999;
        margin-top: 12px;
    }

    .navigation-custom ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        padding: 0;
    }

    .cart-container-custom {
        position: absolute;
        top: 50%;
        right: 60px;
        transform: translateY(-50%);
        margin-left: 0;
    }

    .menu-toggle-custom {
        display: flex;
        position: absolute;
        top: 50%;
        right: 16px;
        transform: translateY(-50%);
        z-index: 10;
    }

    .navigation-custom.active {
        display: flex;
    }
}

@media (max-width: 468px) {
    .header-custom {
        padding: 14px 10px;
    }

    .logo-custom img {
        width: 110px;
    }

    .cart-container-custom {
        right: 52px;
    }

    .menu-toggle-custom {
        right: 12px;
    }

    .navigation-custom {
        padding: 24px 16px;
        border-radius: 10px;
        margin-top: 10px;
    }

    .navigation-custom ul {
        gap: 16px;
    }

    .navigation-custom a {
        font-size: 1rem;
    }
}