/* ============================================ */
/* HEADER / NAVEGACION SUPERIOR                 */
/* Barra fija con logo, buscador, carrito       */
/* ============================================ */

.site-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    line-height: 1;
}

.site-logo span {
    font-weight: 900;
    font-size: 1.38rem;
    letter-spacing: -0.04em;
    line-height: 1;
    font-family: 'Inter', sans-serif;
    color: #f8fafc;
    
}

.site-logo__img {
    width: 100px;
    height: auto;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 0 12px rgba(103, 232, 249, 0.18));
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(var(--bg-dark-rgb), 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    z-index: var(--z-fixed);
    transition: all var(--transition-normal);
    will-change: transform, background;
    transform: translateZ(0);
}

.header.scrolled {
    background: var(--bg-dark);
    border-bottom-color: rgba(255, 255, 255, 0.04);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.header__container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* ── LOGO ────────────────────────────────────── */
.header__logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    transition: all var(--transition-normal);
}

.header__logo i {
    color: var(--color-secondary);
    font-size: 1.8rem;
    animation: logoPulse 2s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 5px var(--color-secondary-glow)); }
    50% { transform: scale(1.1); filter: drop-shadow(0 0 15px var(--color-secondary-glow)); }
}

.header__logo:hover {
    color: var(--color-secondary);
}

/* ── BUSCADOR ────────────────────────────────── */
.header__search {
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 460px;
    margin: 0 24px;
    position: relative;
}

.header__search-input {
    width: 100%;
    height: 44px;
    padding: 0 var(--space-xl) 0 var(--space-lg);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 999px;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all var(--transition-normal);
    outline: none;
}

.header__search-input::placeholder {
    color: var(--text-muted);
}

.header__search-input:focus {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(var(--color-secondary-rgb), 0.4);
    box-shadow: 0 0 0 3px rgba(var(--color-secondary-rgb), 0.1);
}

.header__search-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
}

.header__search-btn:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
    transform: translateY(-50%) scale(1.1);
}

/* ── ACCIONES DEL HEADER ─────────────────────── */
.header__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.header__menu-btn {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* ── DROPDOWN USUARIO ────────────────────────── */
.header__user {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    width: 42px;
    height: 42px;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.header__user::after {
    content: "";
    position: absolute;
    top: 6px;
    right: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid rgba(10, 14, 18, 0.95);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.header__user:hover {
    background: rgba(255, 255, 255, .055);
    border-color: rgba(255, 255, 255, .1);
}

.header__user.has-avatar {
    overflow: hidden;
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

.header__user-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    background: rgba(0, 0, 0, 0.12);
    border-radius: 50%;
}

.header__user i,
.header__user svg,
.header__actions svg,
.header__actions i {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.header__user-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.header__user-arrow {
    font-size: 0.7rem;
    transition: transform var(--transition-normal);
}

.header__user.open .header__user-arrow {
    transform: rotate(180deg);
}

/* Menu dropdown */
.header__dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: var(--space-sm);
    min-width: 220px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-normal);
    z-index: var(--z-dropdown);
    overflow: hidden;
}

.header__user.open .header__dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.header__dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.header__dropdown-item:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
    padding-left: var(--space-lg);
}

.header__dropdown-item i {
    width: 20px;
    text-align: center;
}

.header__dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: var(--space-xs) 0;
}

.header__dropdown-item--logout:hover {
    color: var(--color-error);
}

/* ── CARRITO ─────────────────────────────────── */
.header__cart {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    color: var(--text-secondary);
    font-size: 1.2rem;
    transition: all var(--transition-normal);
}

.header__cart:hover {
    background: rgba(255, 255, 255, .055);
    border-color: rgba(255, 255, 255, .1);
    color: var(--text-primary);
}

.header__cart-count {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: var(--color-secondary);
    color: #fff;
    border: 2px solid var(--bg-dark);
    box-shadow: 0 3px 10px rgba(var(--color-secondary-rgb), .45);
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-bounce {
    animation: cartBounce 0.5s ease;
}

@keyframes cartBounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* ── NAV DESKTOP ────────────────────────────── */
.header__nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.header__nav-link {
    font-size: 0.88rem;
    font-weight: 650;
    color: var(--text-muted);
    position: relative;
    padding: 7px 0;
    transition: color var(--transition-normal);
}

.header__nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    height: 2px;
    width: 0;
    background: var(--color-secondary);
    transition: width var(--transition-normal);
}

.header__nav-link:hover,
.header__nav-link--active {
    color: var(--text-primary);
}

.header__nav-link:hover::after,
.header__nav-link--active::after {
    width: 100%;
}

/* ── SEARCH TOGGLE (mobile) ──────────────────── */
.header__search-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    transition: all var(--transition-normal);
}

.header__search-toggle:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}

@media (max-width: 1024px) {
    .header__search-toggle {
        display: flex;
    }
}

/* ── MENU HAMBURGUESA ────────────────────────── */
.header__menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 42px;
    height: 42px;
    gap: 5px;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
}

.header__menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition-normal);
}

.header__menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.header__menu-btn.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.header__menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}
