/**
 * Retrogrados Gaming - Cart & UI Styles
 * 
 * Estilos para el sistema de carrito y componentes UI
 */

:root {
    --rg-primary-purple: #8b5cf6;
    --rg-primary-cyan: #06b6d4;
    --rg-accent-pink: #ec4899;
    --rg-dark-bg: #0a0a0f;
    --rg-card-bg: rgba(17, 17, 27, 0.8);
    --rg-glass-border: rgba(255, 255, 255, 0.1);
    --rg-text-primary: #ffffff;
    --rg-text-secondary: rgba(255, 255, 255, 0.7);
}

/* ============================================
   CART WIDGET (Flotante)
   ============================================ */

.rg-cart-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9998;
}

.rg-cart-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--rg-primary-purple), var(--rg-primary-cyan));
    border: 2px solid var(--rg-glass-border);
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 10px 40px rgba(139, 92, 246, 0.4);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rg-cart-button:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 15px 50px rgba(139, 92, 246, 0.6);
}

.rg-cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--rg-accent-pink);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    border: 2px solid var(--rg-dark-bg);
    animation: bounce 0.5s ease;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* ============================================
   CART DROPDOWN
   ============================================ */

.rg-cart-dropdown {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 400px;
    max-height: 600px;
    background: var(--rg-card-bg);
    backdrop-filter: blur(20px);
    border: 2px solid var(--rg-glass-border);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rg-cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--rg-glass-border);
}

.rg-cart-header h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--rg-primary-purple), var(--rg-primary-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.rg-cart-close {
    background: none;
    border: none;
    color: var(--rg-text-secondary);
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.rg-cart-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.rg-cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.rg-cart-empty {
    text-align: center;
    color: var(--rg-text-secondary);
    padding: 40px 20px;
}

.rg-cart-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid var(--rg-glass-border);
    transition: all 0.3s ease;
}

.rg-cart-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(-5px);
}

.rg-cart-item-info h4 {
    font-size: 1rem;
    margin: 0 0 5px 0;
    color: var(--rg-text-primary);
}

.rg-cart-item-info p {
    font-size: 0.85rem;
    color: var(--rg-text-secondary);
    margin: 0;
}

.rg-cart-item-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

.rg-quantity-control {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 5px;
}

.rg-quantity-control button {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(139, 92, 246, 0.2);
    color: var(--rg-primary-purple);
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
}

.rg-quantity-control button:hover {
    background: var(--rg-primary-purple);
    color: white;
}

.rg-quantity-control span {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
}

.rg-cart-item-price {
    font-weight: 700;
    color: var(--rg-primary-cyan);
    flex: 1;
}

.rg-btn-remove {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.rg-btn-remove:hover {
    opacity: 1;
    transform: scale(1.2);
}

.rg-cart-footer {
    padding: 20px;
    border-top: 1px solid var(--rg-glass-border);
}

.rg-cart-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 1.2rem;
    font-weight: 700;
}

.rg-cart-subtotal span:last-child {
    color: var(--rg-primary-cyan);
}

/* ============================================
   BUTTONS
   ============================================ */

.rg-btn-primary {
    background: linear-gradient(135deg, var(--rg-primary-purple), var(--rg-primary-cyan));
    border: none;
    color: white;
    padding: 15px 30px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    width: 100%;
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.3);
}

.rg-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(139, 92, 246, 0.5);
}

.rg-btn-block {
    display: block;
    width: 100%;
}

/* ============================================
   MODAL
   ============================================ */

.rg-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.rg-modal-content {
    background: var(--rg-card-bg);
    backdrop-filter: blur(20px);
    border: 2px solid var(--rg-glass-border);
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.rg-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    border-bottom: 1px solid var(--rg-glass-border);
}

.rg-modal-header h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--rg-primary-purple), var(--rg-primary-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.rg-modal-close {
    background: none;
    border: none;
    color: var(--rg-text-secondary);
    font-size: 28px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.rg-modal-close:hover {
    color: white;
    transform: rotate(90deg);
}

.rg-modal-body {
    padding: 25px;
}

/* ============================================
   FORMS
   ============================================ */

.rg-form-group {
    margin-bottom: 20px;
}

.rg-form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--rg-text-primary);
    font-weight: 600;
}

.rg-form-group input {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--rg-glass-border);
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.rg-form-group input:focus {
    outline: none;
    border-color: var(--rg-primary-cyan);
    background: rgba(255, 255, 255, 0.08);
}

.rg-auth-switch {
    text-align: center;
    margin-top: 20px;
    color: var(--rg-text-secondary);
}

.rg-auth-switch a {
    color: var(--rg-primary-cyan);
    text-decoration: none;
    font-weight: 600;
}

.rg-auth-switch a:hover {
    text-decoration: underline;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.rg-toast-container {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rg-toast {
    background: var(--rg-card-bg);
    backdrop-filter: blur(20px);
    border: 2px solid var(--rg-glass-border);
    border-radius: 12px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.rg-toast-show {
    opacity: 1;
    transform: translateX(0);
}

.rg-toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.rg-toast-success {
    border-left: 4px solid #10b981;
}

.rg-toast-success .rg-toast-icon {
    background: #10b981;
    color: white;
}

.rg-toast-error {
    border-left: 4px solid #ef4444;
}

.rg-toast-error .rg-toast-icon {
    background: #ef4444;
    color: white;
}

.rg-toast-info {
    border-left: 4px solid var(--rg-primary-cyan);
}

.rg-toast-info .rg-toast-icon {
    background: var(--rg-primary-cyan);
    color: white;
}

.rg-toast-message {
    flex: 1;
    color: var(--rg-text-primary);
}

/* ============================================
   USER MENU
   ============================================ */

.rg-user-menu {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 9997;
}

.rg-user-button {
    background: var(--rg-card-bg);
    backdrop-filter: blur(20px);
    border: 2px solid var(--rg-glass-border);
    color: white;
    padding: 10px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.rg-user-button:hover {
    border-color: var(--rg-primary-cyan);
    transform: translateY(-2px);
}

.rg-user-dropdown {
    position: absolute;
    top: 60px;
    right: 0;
    background: var(--rg-card-bg);
    backdrop-filter: blur(20px);
    border: 2px solid var(--rg-glass-border);
    border-radius: 12px;
    padding: 10px;
    min-width: 200px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.rg-user-dropdown a {
    display: block;
    color: var(--rg-text-primary);
    text-decoration: none;
    padding: 12px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.rg-user-dropdown a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--rg-primary-cyan);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .rg-cart-dropdown {
        width: calc(100% - 20px);
        left: 10px;
        right: 10px;
        bottom: 90px;
    }
    
    .rg-cart-widget {
        right: 20px;
        bottom: 20px;
    }
    
    .rg-modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .rg-toast-container {
        right: 10px;
        left: 10px;
    }
    
    .rg-toast {
        min-width: auto;
    }
    
    .rg-user-menu {
        top: 20px;
        right: 20px;
    }
}
