/* ============================
   PANEL DE USUARIO (slide-in) — Mis compras / perfil / direcciones /
   favoritos / notificaciones
============================ */
.upanel-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 3200; opacity: 0; pointer-events: none; transition: opacity .25s;
}
.upanel-overlay.show { opacity: 1; pointer-events: auto; }

.upanel {
  position: fixed; top: 0; right: 0; width: 420px; max-width: 100vw; height: 100vh;
  background: var(--white); border-left: 1px solid var(--gray-100);
  z-index: 3201; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .3s cubic-bezier(.4,0,.2,1);
  box-shadow: -8px 0 30px rgba(0,0,0,.12);
}
.upanel.open { transform: translateX(0); }

.upanel-header {
  display: flex; align-items: center; gap: 12px; padding: 18px 20px;
  border-bottom: 1px solid var(--gray-100); flex-shrink: 0;
}
.upanel-close {
  width: 34px; height: 34px; border-radius: 50%; background: var(--gray-50); border: none;
  color: var(--gray-700); font-size: .9rem; display: flex; align-items: center; justify-content: center;
}
.upanel-close:hover { background: var(--gray-100); color: var(--red); }
.upanel-title { flex: 1; font-size: 1.02rem; font-weight: 800; }

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

/* Mis compras */
.upanel-order {
  background: var(--gray-50); border: 1px solid var(--gray-100);
  border-radius: 12px; padding: 16px; margin-bottom: 12px;
}
.upanel-order-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.upanel-order-num { font-size: .85rem; font-weight: 800; }
.upanel-order-date { font-size: .74rem; color: var(--gray-500); margin-bottom: 8px; }
.upanel-order-status { font-size: .7rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.status-proceso { background: #fff4e0; color: #c47f0a; }
.status-enviado { background: #e8f1fc; color: #2563eb; }
.status-entregado { background: #e6f7ee; color: #1e8449; }
.status-cancelado { background: #fdeaea; color: var(--red-dark); }
.upanel-order-items { font-size: .8rem; color: var(--gray-700); margin-bottom: 8px; line-height: 1.6; }
.upanel-order-total { font-size: .9rem; font-weight: 800; }

/* Mi perfil */
.upanel-field { margin-bottom: 16px; }
.upanel-field label { display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: var(--gray-500); margin-bottom: 6px; }
.upanel-field input {
  width: 100%; background: var(--gray-50); border: 1px solid var(--gray-300); border-radius: 8px;
  padding: 10px 13px; font-family: inherit; font-size: .86rem;
}
.upanel-field input:disabled { color: var(--gray-500); }
.upanel-field input:focus { border-color: var(--red); outline: none; }
.upanel-save-btn {
  width: 100%; padding: 13px; background: var(--red); color: var(--white); border: none;
  border-radius: 8px; font-size: .88rem; font-weight: 800; margin-top: 4px;
}
.upanel-save-btn:hover { background: var(--red-dark); }

/* Direcciones */
.upanel-add-btn {
  width: 100%; padding: 12px; background: #fff2f0; border: 1.5px dashed #ffc9c4;
  border-radius: 10px; color: var(--red); font-size: .85rem; font-weight: 700; margin-top: 4px;
}
.upanel-add-btn:hover { background: #ffe4e1; }

/* Favoritos */
.upanel-fav-list { display: flex; flex-direction: column; gap: 10px; }
.upanel-fav-card {
  background: var(--gray-50); border: 1px solid var(--gray-100); border-radius: 12px;
  overflow: hidden; display: flex; align-items: center;
}
.upanel-fav-card:hover { border-color: var(--red); }
.upanel-fav-img { width: 68px; min-width: 68px; height: 68px; display: flex; align-items: center; justify-content: center; color: var(--gray-300); font-size: 1.3rem; overflow: hidden; }
.upanel-fav-img img { width: 100%; height: 100%; object-fit: cover; }
.upanel-fav-info { padding: 10px; flex: 1; }
.upanel-fav-info h5 { font-size: .83rem; font-weight: 700; margin-bottom: 4px; line-height: 1.3; }
.upanel-fav-info span { font-size: .8rem; font-weight: 800; color: var(--red); }
.upanel-fav-remove { background: none; border: none; color: var(--red); padding: 12px; font-size: 1rem; flex-shrink: 0; }
.upanel-fav-remove:hover { color: var(--red-dark); transform: scale(1.15); }

/* Notificaciones */
.upanel-notif { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--gray-100); }
.upanel-notif:last-child { border-bottom: none; }

/* Empty state */
.upanel-empty { text-align: center; padding: 50px 20px; color: var(--gray-500); }
.upanel-empty i { font-size: 2.3rem; margin-bottom: 14px; display: block; color: var(--gray-300); }
.upanel-empty p { font-size: .86rem; }

@media (max-width: 460px) {
  .upanel { width: 100vw; }
}
