:root {
    --primary: #e94560;
    --primary-dark: #c73e54;
    --secondary: #0f3460;
    --dark: #1a1a2e;
    --light: #f5f5f5;
    --white: #ffffff;
    --success: #00b894;
    --warning: #fdcb6e;
    --danger: #d63031;
    --gray: #636e72;
    --shadow: 0 5px 20px rgba(0,0,0,0.1);
    --radius: 12px;
    --transition: all 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; background: var(--light); color: #333; line-height: 1.6; }
a { text-decoration: none; color: inherit; transition: var(--transition); }
img { max-width: 100%; height: auto; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

/* Botones */
.btn-primary, .btn-outline, .btn-lg {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.75rem 1.5rem; border-radius: 50px; font-weight: 600; cursor: pointer;
    transition: var(--transition); border: none; font-size: 1rem;
}
.btn-primary { background: linear-gradient(135deg, var(--primary), #ff6b6b); color: white; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(233,69,96,0.3); }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }
.btn-lg { padding: 1rem 2.5rem; font-size: 1.1rem; }
.btn-block { width: 100%; }

/* Badges */
.badge { display: inline-block; padding: 0.25rem 0.75rem; border-radius: 20px; font-size: 0.8rem; font-weight: 500; background: #eee; color: #333; }
.badge-hot { background: linear-gradient(135deg, #ff6b6b, #ee5a24); color: white; }

/* Header Dashboard */
.dashboard-header { background: var(--white); padding: 1rem 0; box-shadow: 0 2px 10px rgba(0,0,0,0.05); position: sticky; top: 0; z-index: 90; }
.header-content { display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.5rem; font-weight: 800; color: var(--dark); display: flex; align-items: center; gap: 0.5rem; }
.logo i { color: var(--primary); }
.user-info { display: flex; align-items: center; gap: 1rem; }
.saldo-badge {
    background: linear-gradient(135deg, #f1c40f, #f39c12); color: var(--dark);
    padding: 0.4rem 1rem; border-radius: 50px; font-weight: 700;
    display: inline-flex; align-items: center; gap: 0.5rem;
}
.user-name { font-weight: 600; }
.btn-logout { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--light); color: var(--danger); transition: var(--transition); }
.btn-logout:hover { background: var(--danger); color: white; }
.btn-admin { padding: 0.4rem 0.8rem; background: linear-gradient(135deg, #6c5ce7, #a29bfe); color: white; border-radius: 8px; font-size: 0.9rem; font-weight: 500; }

/* Banner */
.promo-banner {
    background: linear-gradient(135deg, var(--primary), #ff6b6b); color: white;
    padding: 1rem 1.5rem; border-radius: var(--radius); margin: 1.5rem 0;
    display: flex; align-items: center; gap: 0.75rem;
}

/* Layout Dashboard */
.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; }
@media (max-width: 992px) { .dashboard-grid { grid-template-columns: 1fr; } }

.card { background: var(--white); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); margin-bottom: 1.5rem; }
.card h2, .card h3 { margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 2px solid #f0f0f0; color: var(--dark); }

/* Productos Grid */
.productos-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.producto-card {
    background: var(--white); border-radius: var(--radius); padding: 1.25rem;
    text-align: center; box-shadow: var(--shadow); transition: var(--transition);
    border: 2px solid transparent; position: relative;
}
.producto-card:hover { transform: translateY(-5px); border-color: var(--primary); box-shadow: var(--shadow); }
.producto-header { position: absolute; top: -10px; right: -10px; }
.producto-card h3 { font-size: 1.1rem; margin: 0.5rem 0; }
.producto-card .precio { font-size: 1.5rem; font-weight: 800; color: var(--primary); margin: 0.75rem 0; }
.producto-card .precio small { font-size: 0.9rem; font-weight: 400; color: var(--gray); }
.btn-comprar {
    background: linear-gradient(135deg, var(--primary), #ff6b6b); color: white;
    border: none; padding: 0.8rem 1.2rem; border-radius: 50px; font-weight: 600;
    cursor: pointer; width: 100%; transition: var(--transition);
}
.btn-comprar:hover { transform: scale(1.02); box-shadow: 0 5px 15px rgba(233,69,96,0.4); }

/* Formularios */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.4rem; font-weight: 500; display: flex; align-items: center; gap: 0.5rem; }
.form-group input, .form-group select { width: 100%; padding: 0.85rem; border: 2px solid #eee; border-radius: 10px; font-size: 1rem; transition: var(--transition); }
.form-group input:focus, .form-group select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(233,69,96,0.1); }
.form-group small { display: block; margin-top: 0.3rem; color: var(--gray); }

/* Verificación ID */
.btn-verificar { transition: var(--transition); }
.btn-verificar:hover { background: #5b4cdb; }
.btn-verificar:disabled { opacity: 0.6; cursor: not-allowed; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.3); border-top-color: white; border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
#resultado-verificacion { min-height: 20px; font-weight: 500; }

/* Modal */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 1000; align-items: center; justify-content: center; }
.modal-content { background: var(--white); padding: 2rem; border-radius: var(--radius); max-width: 500px; width: 90%; position: relative; animation: slideUp 0.3s ease; }
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-close { position: absolute; top: 1rem; right: 1.5rem; font-size: 1.8rem; cursor: pointer; color: var(--gray); }
.modal-close:hover { color: var(--danger); }
.modal-precio { font-size: 1.5rem; text-align: center; margin: 1rem 0; color: var(--primary); font-weight: 700; }
.saldo-actual { background: #f8f9fa; padding: 1rem; border-radius: 8px; margin: 1rem 0; text-align: center; }
.btn-confirm {
    background: linear-gradient(135deg, var(--success), #00cec9); color: white;
    width: 100%; padding: 1rem; border: none; border-radius: 10px;
    font-size: 1.1rem; font-weight: 600; cursor: pointer; margin-top: 1rem;
    transition: var(--transition);
}
.btn-confirm:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0,184,148,0.3); }

/* Historial */
.historial-list { display: flex; flex-direction: column; gap: 0.75rem; }
.historial-item { display: flex; justify-content: space-between; align-items: center; padding: 0.85rem; background: #f8f9fa; border-radius: 8px; border-left: 4px solid var(--gray); }
.historial-item.estado-exitosa { border-left-color: var(--success); }
.historial-item.estado-pendiente { border-left-color: var(--warning); }
.historial-item.estado-fallida { border-left-color: var(--danger); }
.item-info strong { display: block; }
.item-info small { color: var(--gray); }
.item-meta { text-align: right; }
.item-meta .monto { font-weight: 700; display: block; color: var(--danger); }
.item-meta .estado { font-size: 0.8rem; padding: 0.2rem 0.5rem; border-radius: 4px; background: #eee; text-transform: uppercase; }

/* Alerts */
.alert { padding: 1rem 1.5rem; border-radius: 10px; margin-bottom: 1.5rem; display: flex; align-items: center; gap: 0.75rem; font-weight: 500; }
.alert-success { background: #d4edda; color: #155724; border-left: 4px solid #28a745; }
.alert-error { background: #f8d7da; color: #721c24; border-left: 4px solid #dc3545; }

/* Utilidades */
.empty-state { text-align: center; padding: 2rem; color: var(--gray); background: #f8f9fa; border-radius: var(--radius); }
.payment-info { background: #e8f4fd; padding: 1rem; border-radius: 8px; font-size: 0.9rem; color: var(--secondary); }

/* Responsive */
@media (max-width: 768px) {
    .header-content { flex-wrap: wrap; gap: 0.5rem; }
    .saldo-badge { font-size: 0.9rem; padding: 0.3rem 0.8rem; }
    .modal-content { padding: 1.5rem; margin: 1rem; }
    .promo-banner { flex-direction: column; text-align: center; }
}