/* ============================================
   RETROFASE HEADER MENU - USER & CART ONLY
   ============================================
   
   Solo iconos de usuario y carrito con sus funcionalidades
   - Fondo transparente
   - Sin "saltar al contenido"
   - Dropdown igual en desktop y móvil
   
   ============================================ */

/* ============================================
   1. CONTENEDOR PRINCIPAL
   ============================================ */

.retrofase-header-menu {
    width: 100%;
    max-width: 1472px;
    height: 83px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 94px;
    background: transparent;
    opacity: 1;
    position: relative;
    z-index: 9999;
    overflow: visible;
}

/* ============================================
   2. USER Y CART CONTAINER
   ============================================ */

.retrofase-menu-right {
    display: flex;
    align-items: center;
    gap: 30px;
}

/* ============================================
   3. USER AVATAR
   ============================================ */

.retrofase-user-avatar {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10000;
}

.user-avatar-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    pointer-events: none;
}

.user-avatar-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.user-name {
    font-family: 'Open Sans', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: #333333;
    display: none;
    white-space: nowrap;
    pointer-events: none;
    padding-top: 20px;
}

.retrofase-user-avatar.logged-in .user-name {
    display: block;
}

/* ============================================
   4. DROPDOWN DE USUARIO (CONSISTENTE)
   ============================================ */

.user-dropdown {
    position: fixed;
    top: auto;
    right: auto;
    background: #EAEBED;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 10px 0;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999999;
}

.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown a {
    display: block;
    padding: 12px 20px;
    font-family: 'Open Sans', sans-serif;
    font-size: 16px;
    color: #333333;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.user-dropdown a:hover {
    background: #F5F5F5;
    color: #e3ba5d;
    border-left-color: #e3ba5d;
    padding-left: 23px;
}

/* ============================================
   5. CART ICON
   ============================================ */

.retrofase-cart-icon {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.cart-icon-img {
    width: 20px;
    height: 20px;
    pointer-events: none;
}

.cart-icon-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cart-count {
    position: absolute;
    top: -4px;
    right: 14px;
    background: #e3ba5d;
    color: #ffffff;
    font-family: 'Open Sans', sans-serif;
    font-weight: 700;
    font-size: 10px;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
}

.cart-count.active,
.cart-count.has-items {
    opacity: 1;
    transform: scale(1);
}

/* Animación de agregar producto */
@keyframes cartPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
}

.cart-icon-img.pulse {
    animation: cartPulse 0.4s ease;
}

/* ============================================
   6. RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1400px) {
    .retrofase-header-menu {
        max-width: 100%;
        padding: 0 50px;
    }
}

@media (max-width: 1200px) {
    .retrofase-header-menu {
        padding: 0 30px;
    }
    
    .retrofase-menu-right {
        gap: 20px;
    }
}

@media (max-width: 992px) {
    .retrofase-header-menu {
        height: auto;
        padding: 15px 20px;
    }
    
    /* Ocultar nombre de usuario en móvil */
    .user-name {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .retrofase-header-menu {
        padding: 12px 15px;
    }
}

@media (max-width: 576px) {
    .retrofase-header-menu {
        padding: 10px 12px;
    }
    
    .retrofase-menu-right {
        gap: 15px;
    }
}

/* ============================================
   7. ACCESIBILIDAD
   ============================================ */

.retrofase-cart-icon:focus,
.retrofase-user-avatar:focus {
    outline: 2px solid #e3ba5d;
    outline-offset: 2px;
}

/* ============================================
   8. LOADING STATE
   ============================================ */

.retrofase-header-menu.loading {
    opacity: 0.6;
    pointer-events: none;
}

.retrofase-header-menu.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #e3ba5d;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ============================================
   9. UTILITIES
   ============================================ */

html {
    scroll-behavior: smooth;
}

.retrofase-user-avatar,
.retrofase-cart-icon {
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ============================================
   FIN DE ESTILOS
   ============================================ */