/* ==========================================================================
   CARRITO.CSS - ESTILOS PARA LA CESTA DE COMPRAS Y CHECKOUT
   ========================================================================== */

:root {
    --primary: #111827;
    --secondary: #d97706;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --danger: #ef4444;
    --success: #10b981;
    --whatsapp: #25D366;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Poppins', sans-serif; }
body { background-color: var(--bg-color); color: var(--text-main); padding-bottom: 140px; }

/* NAVBAR SIMPLE */
.header-cart { background: var(--card-bg); padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; box-shadow: var(--shadow-sm); position: sticky; top: 0; z-index: 100; }
.btn-back { color: var(--primary); text-decoration: none; font-size: 1.2rem; display: flex; align-items: center; gap: 8px; font-weight: 600; }
.header-title { font-weight: 700; font-size: 1.1rem; color: var(--primary); }

.container { max-width: 600px; margin: 20px auto; padding: 0 15px; }

/* ESTADOS VACÍOS Y ALERTAS */
.empty-cart { text-align: center; padding: 50px 20px; background: var(--card-bg); border-radius: 16px; border: 1px dashed var(--border-color); margin-top: 20px; }
.empty-cart i { font-size: 4rem; color: #cbd5e1; margin-bottom: 15px; }
.empty-cart h3 { color: var(--primary); margin-bottom: 10px; }
.empty-cart p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 20px; }
.btn-primary { background: var(--secondary); color: white; padding: 12px 25px; border-radius: 10px; text-decoration: none; font-weight: 700; display: inline-block; transition: 0.2s; }
.btn-primary:hover { background: #b45309; }

.alert-auth { background: #fffbeb; border: 1px solid #fde68a; padding: 15px; border-radius: 12px; display: flex; align-items: center; gap: 15px; margin-bottom: 20px; color: #92400e; }
.alert-auth i { font-size: 1.5rem; color: #d97706; }
.alert-auth a { color: #b45309; font-weight: 700; text-decoration: underline; }

/* LISTA DE PRODUCTOS */
.cart-list { display: flex; flex-direction: column; gap: 15px; }
.cart-item { background: var(--card-bg); border-radius: 16px; padding: 15px; display: flex; align-items: center; justify-content: space-between; box-shadow: var(--shadow-sm); border: 1px solid var(--border-color); }
.item-info { flex: 1; }
.item-title { font-weight: 600; font-size: 0.95rem; line-height: 1.3; margin-bottom: 5px; color: var(--primary); }
.item-meta { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }
.item-price { font-weight: 800; color: var(--secondary); font-size: 1.1rem; margin-top: 5px; }
.btn-remove { background: #fef2f2; color: var(--danger); border: none; width: 40px; height: 40px; border-radius: 10px; font-size: 1.1rem; cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center; }
.btn-remove:hover { background: var(--danger); color: white; }

/* BARRA DE PAGO INFERIOR (ESTILO APP) */
.checkout-bar { position: fixed; bottom: 0; left: 0; width: 100%; background: var(--card-bg); border-top: 1px solid var(--border-color); padding: 15px 20px 25px 20px; box-shadow: 0 -4px 15px rgba(0,0,0,0.05); z-index: 1000; }
.checkout-container { max-width: 600px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.totals-row { display: flex; justify-content: space-between; font-size: 0.95rem; color: var(--text-muted); }
.totals-row.grand-total { font-size: 1.3rem; font-weight: 800; color: var(--primary); border-top: 1px dashed var(--border-color); padding-top: 10px; margin-top: 5px; }
.btn-checkout { background: var(--primary); color: var(--secondary); border: none; width: 100%; padding: 16px; border-radius: 12px; font-size: 1.1rem; font-weight: 700; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 10px; transition: 0.2s; text-transform: uppercase; letter-spacing: 1px; }
.btn-checkout:hover { background: var(--primary-dark); }
.btn-checkout:disabled { background: #cbd5e1; color: white; cursor: not-allowed; }

/* MODAL DE ANIMACIÓN Y ÉXITO */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.9); z-index: 4000; display: none; justify-content: center; align-items: center; backdrop-filter: blur(5px); }
.success-card { background: var(--card-bg); padding: 40px 30px; border-radius: 24px; width: 90%; max-width: 400px; text-align: center; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5); animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
@keyframes popIn { 0% { transform: scale(0.8); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* Animación de Carga a Éxito */
.status-icon { height: 80px; display: flex; justify-content: center; align-items: center; margin-bottom: 20px; }
.spinner { font-size: 4rem; color: var(--secondary); animation: spin 1s linear infinite; }
@keyframes spin { 100% { transform: rotate(360deg); } }
.check-mark { font-size: 5rem; color: var(--success); display: none; animation: popIn 0.3s ease-out; }

.success-card h2 { color: var(--primary); margin-bottom: 10px; font-size: 1.5rem; }
.success-card p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 15px; }
.folio-box { background: #f1f5f9; border: 2px dashed #cbd5e1; font-size: 1.8rem; font-weight: 800; color: var(--primary); padding: 10px; border-radius: 12px; margin-bottom: 25px; letter-spacing: 2px; }

.btn-whatsapp { background: var(--whatsapp); color: white; border: none; width: 100%; padding: 15px; border-radius: 12px; font-size: 1rem; font-weight: 700; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 10px; transition: 0.2s; text-decoration: none; }
.btn-whatsapp:hover { background: #1da851; transform: translateY(-2px); }
.btn-return { background: transparent; color: var(--text-muted); border: none; width: 100%; padding: 15px; font-weight: 600; cursor: pointer; margin-top: 10px; }
.btn-return:hover { color: var(--primary); text-decoration: underline; }