/* ==================== FONDO OSCURO (BACKDROP) ==================== */
.overlay-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: none;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.overlay-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* ==================== PANELES LATERALES (CARRITO & NOTIFICACIONES) ==================== */
.side-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    height: 100%;
    background: #0a0a0a;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100000;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
}

@media (max-width: 768px) {
    .side-panel {
        width: 100%;
        max-width: 100%;
        border-left: none;
    }
}

.side-panel.active {
    transform: translateX(0);
}

.panel-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(20, 20, 20, 0.95);
}

.panel-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-close {
    background: none;
    border: none;
    color: #999;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.panel-close:hover {
    color: #fff;
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

/* ==================== MENU FLOTANTE DE PERFIL (Compacto & Premium) ==================== */
.profile-popover {
    position: fixed;
    /* Fixed para que no dependa del padre */
    top: 70px;
    /* Debajo del navbar (ajustado) */
    right: 20px;
    width: 260px;
    /* Ancho reducido (BeatStars style) */
    background: rgba(15, 15, 15, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    /* Radio ligeramente menor */
    padding: 0;
    z-index: 100000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.98);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    /* Transición más rápida */
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
    /* Sombra más fuerte */
    backdrop-filter: blur(20px);
    overflow: hidden;
}

.profile-popover.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Estilos internos del Profile Popover */
.popover-header {
    padding: 10px 14px;
    /* Padding reducido agresivamente */
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.03);
}

.popover-avatar {
    width: 32px;
    height: 32px;
    /* Avatar más pequeño */
    border-radius: 50%;
    background: #7209b7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: 0.85rem;
}

.popover-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    /* Super compacto (estilo BeatStars) */
    color: #ccc;
    text-decoration: none;
    font-size: 0.8rem;
    /* Fuente más chica */
    transition: background 0.15s;
    font-weight: 500;
    line-height: 1.2;
}

.popover-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.popover-link i {
    width: 16px;
    text-align: center;
    color: #8b5cf6;
    font-size: 0.8rem;
}

.popover-link.logout {
    color: #ef4444;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 4px;
    padding-top: 10px;
    padding-bottom: 10px;
}

.popover-link.logout:hover {
    background: rgba(239, 68, 68, 0.1);
}

.popover-link.logout i {
    color: #ef4444;
}


/* Custom Scrollbar for Popover - Hidden but functional (BeatStars Style) */
.popover-scroll-content::-webkit-scrollbar {
    width: 0px;
    /* Oculto visualmente */
    background: transparent;
}

.popover-scroll-content {
    max-height: 80vh;
    /* Mucho más espacio vertical */
    overflow-y: auto;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
}

/* ==================== ESTILOS NOTIFICACIONES ==================== */
.notif-item {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 12px;
}

.notif-icon {
    width: 36px;
    height: 36px;
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notif-text h4 {
    font-size: 0.9rem;
    color: #fff;
    margin-bottom: 4px;
}

.notif-text p {
    font-size: 0.8rem;
    color: #888;
    line-height: 1.3;
}

/* ==================== ESTILOS CARRITO (Reutilizados) ==================== */
/* (Ya tienes estilos de carrito en marketplace.css, pero aquí aseguramos básicos) */
.cart-total-section {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    background: rgba(20, 20, 20, 0.95);
}

.btn-checkout-global {
    width: 100%;
    padding: 16px;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.btn-checkout-global:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

.btn-checkout-global:active {
    transform: translateY(0);
}

#logout-overlay {
    display: none;
    /* Oculto por defecto */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.5s ease;
    /* La magia de la suavidad */
}

#logout-overlay.active {
    opacity: 1;
}

/* ==================== GLOBAL GUEST AUTH MODAL (Subtle & Professional) ==================== */
.guest-auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 100000;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.guest-auth-modal.active {
    display: flex;
    opacity: 1;
}

.guest-auth-card {
    background: #0A0A0A;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 40px;
    width: 400px;
    max-width: 90vw;
    text-align: center;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8);
    transform: translateY(10px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.guest-auth-modal.active .guest-auth-card {
    transform: translateY(0);
}

.guest-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.guest-modal-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.guest-auth-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #fff;
    letter-spacing: -0.5px;
}

.guest-auth-text {
    color: rgba(255, 255, 255, 0.5);
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 32px;
}

.guest-auth-btns {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.guest-btn-primary {
    background: #FFFFFF;
    color: #000;
    padding: 14px 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 15px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.guest-btn-primary:hover {
    background: #f0f0f0;
    transform: translateY(-1px);
}

.guest-btn-secondary {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 12px 24px;
    border-radius: 12px;
    margin-top: 4px;
}

.guest-btn-secondary:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}