/* ============================================================
   FARMA-PUNTOS — Design System · Frontend Dependiente
   Basado en mockups aprobados Quinfica
   Prefijo: fp-   (evita colisiones con el tema activo de WP)
   ============================================================ */

/* ── Google Fonts se encolan en PHP vía wp_enqueue_style() ── */

/* ════════════════════════════════════════════════════════════
   1. VARIABLES CSS (Design Tokens)
   Las variables :root viven en assets/css/fp-tokens.css
   y se cargan ANTES que este archivo vía wp_enqueue_style().
   Para personalizar los valores usa ⚙️ Ajustes → Apariencia.
   ════════════════════════════════════════════════════════════ */

/* ════════════════════════════════════════════════════════════
   2. RESET BÁSICO (scoped al plugin)
   ════════════════════════════════════════════════════════════ */
.fp-wrap *,
.fp-wrap *::before,
.fp-wrap *::after { box-sizing: border-box; }

.fp-wrap {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--fp-text);
  background: var(--fp-surface);
  min-height: 100vh;
}

/* ════════════════════════════════════════════════════════════
   3. TOP NAV (frontend)
   ════════════════════════════════════════════════════════════ */
.fp-topnav {
  background: var(--fp-navy);
  padding: 0 32px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(255,255,255,.06);
}

.fp-topnav-left {
  display: flex;
  align-items: center;
  gap: 32px;
}

/* Logo */
.fp-topnav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.fp-topnav-logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--fp-teal), var(--fp-blue));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
}
.fp-topnav-logo-text {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

/* Nav links */
.fp-topnav-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.fp-topnav-link {
  padding: 6px 12px;
  border-radius: var(--fp-radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--fp-text-soft);
  text-decoration: none;
  transition: var(--fp-transition);
  white-space: nowrap;
}
.fp-topnav-link:hover          { color: #fff; background: rgba(255,255,255,.08); }
.fp-topnav-link.fp-active      { color: #fff; background: rgba(255,255,255,.12); }

/* Pill de puntos — exclusivo del frontend */
.fp-points-pill {
  background: rgba(37,99,235,.25);
  border: 1px solid rgba(59,130,246,.4);
  border-radius: var(--fp-radius-full);
  padding: 4px 14px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Derecha: avatar + nombre */
.fp-topnav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.fp-topnav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--fp-text-soft);
  font-size: 13px;
}
.fp-topnav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--fp-navy-mid);
  border: 1px solid rgba(255,255,255,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

/* ════════════════════════════════════════════════════════════
   4. HERO SECTION (Dashboard)
   ════════════════════════════════════════════════════════════ */
.fp-hero {
  background: linear-gradient(135deg, var(--fp-navy) 0%, var(--fp-navy-mid) 60%, #164e8b 100%);
  padding: 36px 40px 0;
  position: relative;
  overflow: hidden;
}

/* Orbs decorativos */
.fp-hero::before {
  content: '';
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(20,184,166,.3) 0%, transparent 70%);
  top: -120px;
  right: -80px;
  pointer-events: none;
}
.fp-hero::after {
  content: '';
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(8,145,178,.25) 0%, transparent 70%);
  bottom: 0;
  left: 10%;
  pointer-events: none;
}

.fp-hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

/* Texto de bienvenida */
.fp-hero-greeting {
  font-size: 13px;
  color: rgba(255,255,255,.6);
  margin-bottom: 4px;
}
.fp-hero-name {
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 6px;
  line-height: 1.2;
}
.fp-hero-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.fp-hero-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: rgba(255,255,255,.75); /* Contraste mejorado: ratio 5.2:1 ✓ WCAG AA */
}
.fp-hero-meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255,255,255,.3);
}

/* Stats flotantes en el hero */
.fp-hero-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.fp-hero-stat {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  padding: 14px 20px;
  backdrop-filter: blur(8px);
  min-width: 130px;
}
.fp-hero-stat.fp-accent {
  background: rgba(37,99,235,.25);
  border-color: rgba(59,130,246,.4);
}
.fp-hero-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}
.fp-hero-stat-label {
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-top: 2px;
}
.fp-hero-stat-sub {
  font-size: 11px;
  color: #64a0e8;
  margin-top: 2px;
}

/* Tabs del hero (Resumen / Historial / Mis Canjes) */
.fp-hero-tabs {
  display: flex;
  gap: 4px;
  margin-top: 24px;
  position: relative;
  z-index: 1;
}
.fp-hero-tab {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,.6);
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  transition: var(--fp-transition);
  font-family: 'DM Sans', sans-serif;
}
.fp-hero-tab:hover { color: rgba(255,255,255,.9); background: rgba(255,255,255,.06); }
.fp-hero-tab.fp-active {
  background: var(--fp-surface);
  color: var(--fp-navy);
  border-color: var(--fp-border);
  border-bottom-color: var(--fp-surface);
}

/* ════════════════════════════════════════════════════════════
   5. LAYOUT PRINCIPAL DEL DASHBOARD
   ════════════════════════════════════════════════════════════ */
.fp-dashboard-body {
  padding: 28px 32px;
  background: var(--fp-surface);
}

.fp-grid-2-asym {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
}
.fp-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.fp-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ════════════════════════════════════════════════════════════
   6. CARDS (reutilizables)
   ════════════════════════════════════════════════════════════ */
.fp-card {
  background: var(--fp-white);
  border-radius: var(--fp-radius-lg);
  border: 1px solid var(--fp-border);
  overflow: hidden;
}
.fp-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--fp-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.fp-card-title    { font-size: 14px; font-weight: 700; color: var(--fp-navy); margin: 0; }
.fp-card-subtitle { font-size: 12px; color: var(--fp-text-mid); margin-top: 2px; }
.fp-card-body     { padding: 20px; }
.fp-card-footer   {
  padding: 12px 20px;
  border-top: 1px solid var(--fp-border);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ════════════════════════════════════════════════════════════
   7. MEDIDOR CIRCULAR DE PUNTOS
   ════════════════════════════════════════════════════════════ */
.fp-meter-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 20px;
}

.fp-meter-ring {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  /* El background se setea inline vía JS/PHP con el porcentaje calculado */
  background: conic-gradient(var(--fp-blue) 0% var(--meter-pct, 60%), var(--fp-surface-2) var(--meter-pct, 60%) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}
.fp-meter-ring::before {
  content: '';
  position: absolute;
  width: 108px;
  height: 108px;
  background: var(--fp-white);
  border-radius: 50%;
  z-index: 1;
}
.fp-meter-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  line-height: 1.2;
}
.fp-meter-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--fp-navy);
  display: block;
}
.fp-meter-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--fp-text-soft);
}

/* Stats al lado del medidor */
.fp-meter-stats {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.fp-meter-stat-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.fp-meter-stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}
.fp-meter-stat-label { color: var(--fp-text-mid); font-weight: 500; }
.fp-meter-stat-val   { font-weight: 700; color: var(--fp-navy); }

/* Barra de progreso */
.fp-progress-track {
  background: var(--fp-surface-2);
  border-radius: var(--fp-radius-full);
  height: 6px;
  overflow: hidden;
}
.fp-progress-track-lg { height: 8px; }
.fp-progress-fill {
  height: 100%;
  border-radius: var(--fp-radius-full);
  background: var(--fp-blue);
  transition: width .4s ease;
}
.fp-progress-fill-teal  { background: var(--fp-teal); }
.fp-progress-fill-green { background: var(--fp-green); }

/* Mini stats bajo el medidor */
.fp-mini-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--fp-border);
}
.fp-mini-stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--fp-text-soft);
  margin-bottom: 4px;
}
.fp-mini-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--fp-navy);
}
.fp-mini-stat-sub { font-size: 11px; color: var(--fp-text-mid); margin-top: 1px; }

/* ════════════════════════════════════════════════════════════
   8. TIMELINE DE MOVIMIENTOS
   ════════════════════════════════════════════════════════════ */
.fp-timeline {
  display: flex;
  flex-direction: column;
}
.fp-tl-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--fp-border);
}
.fp-tl-item:last-child { border-bottom: none; }

.fp-tl-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}
.fp-tl-dot-blue   { background: var(--fp-blue); }
.fp-tl-dot-green  { background: var(--fp-green); }
.fp-tl-dot-amber  { background: var(--fp-amber); }
.fp-tl-dot-gray   { background: var(--fp-text-soft); }
.fp-tl-dot-red    { background: var(--fp-red); }

.fp-tl-content { flex: 1; min-width: 0; }
.fp-tl-title   { font-size: 13px; font-weight: 600; color: var(--fp-text); }
.fp-tl-date    { font-size: 11px; color: var(--fp-text-soft); margin-top: 1px; }

.fp-tl-pts       { font-size: 13px; font-weight: 700; white-space: nowrap; }
.fp-tl-pts.plus  { color: var(--fp-blue);  font-weight: 700; }
.fp-tl-pts.minus { color: var(--fp-red);   font-weight: 700; }

/* ════════════════════════════════════════════════════════════
   9. BOTONES
   ════════════════════════════════════════════════════════════ */
.fp-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  border: none;
  cursor: pointer;
  transition: var(--fp-transition);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}
.fp-btn:disabled, .fp-btn.fp-disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }

.fp-btn-primary          { background: var(--fp-blue);  color: #fff; border: 1px solid var(--fp-blue); box-shadow: 0 2px 8px rgba(37,99,235,.25); }
.fp-btn-primary:hover    { background: var(--fp-teal-dark); border-color: var(--fp-teal-dark); color: #fff; box-shadow: 0 4px 12px rgba(37,99,235,.35); transform: translateY(-1px); }

.fp-btn-secondary        { background: var(--fp-teal);  color: #fff; border: 1px solid var(--fp-teal); }
.fp-btn-secondary:hover  { background: var(--fp-teal-dark); border-color: var(--fp-teal-dark); color: #fff; }

.fp-btn-outline          { background: transparent; color: var(--fp-text-mid); border: 1px solid var(--fp-border); }
.fp-btn-outline:hover    { background: var(--fp-surface); color: var(--fp-text); }

.fp-btn-ghost            { background: var(--fp-surface); color: var(--fp-text-mid); border: 1px solid var(--fp-border); }
.fp-btn-ghost:hover      { background: var(--fp-surface-2); }

.fp-btn-danger           { background: var(--fp-red); color: #fff; border: 1px solid var(--fp-red); }
.fp-btn-danger:hover     { background: #dc2626; color: #fff; }

.fp-btn-sm  { padding: 5px 12px; font-size: 12px; border-radius: 6px; }
.fp-btn-lg  { padding: 12px 24px; font-size: 15px; border-radius: 10px; }
.fp-btn-icon { padding: 7px; gap: 0; }

/* Tags / status chips */
.fp-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--fp-radius-full);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.fp-tag-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

.fp-tag-blue   { background: #ccfbf1; color: var(--fp-teal-dark); } /* alias teal por compatibilidad */
.fp-tag-teal   { background: #ccfbf1; color: var(--fp-teal-dark); }
.fp-tag-teal .fp-tag-dot { background: var(--fp-teal); }
.fp-tag-gray   { background: var(--fp-surface-2); color: var(--fp-text-mid); }
.fp-tag-gray .fp-tag-dot { background: var(--fp-text-soft); }
.fp-tag-green  { background: #f0fdf4; color: #15803d; }
.fp-tag-amber  { background: #fffbeb; color: #92400e; }
.fp-tag-red    { background: #fff1f2; color: #be123c; }
.fp-tag-purple { background: #f5f3ff; color: #5b21b6; }

.fp-status-pending  { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.fp-status-approved { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.fp-status-rejected { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }
.fp-status-info     { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* ── Alias semánticos ── */
.fp-tag-ok   { background: #f0fdf4; color: #15803d; }
.fp-tag-warn { background: #fffbeb; color: #92400e; }
.fp-tag-err  { background: #fff1f2; color: #be123c; }

/* ════════════════════════════════════════════════════════════
   12. MODAL DE CANJE
   ════════════════════════════════════════════════════════════ */
.fp-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,34,64,.5);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.fp-modal {
  background: var(--fp-white);
  border-radius: 14px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--fp-shadow-lg);
  overflow: hidden;
  animation: fp-modal-in .2s ease;
}
@keyframes fp-modal-in {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.fp-modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--fp-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.fp-modal-title { font-size: 16px; font-weight: 700; color: var(--fp-navy); margin: 0; }
.fp-modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none; background: none;
  font-size: 20px; color: var(--fp-text-soft);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--fp-transition);
}
.fp-modal-close:hover { background: var(--fp-surface-2); color: var(--fp-text); }
.fp-modal-body   { padding: 24px; }
.fp-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--fp-border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Resumen dentro del modal de canje */
.fp-checkout-summary {
  background: var(--fp-surface);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fp-checkout-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}
.fp-checkout-row-label { color: var(--fp-text-mid); }
.fp-checkout-row-val   { font-weight: 700; color: var(--fp-navy); }
.fp-checkout-divider   { height: 1px; background: var(--fp-border); }
.fp-checkout-total     { font-size: 14px; }
.fp-checkout-total .fp-checkout-row-val { color: var(--fp-blue); font-size: 16px; }

/* Formulario dentro del modal */
.fp-form-group  { margin-bottom: 16px; }
.fp-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--fp-text-mid);
  margin-bottom: 6px;
}
.fp-input, .fp-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--fp-border);
  border-radius: 8px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  color: var(--fp-text);
  background: var(--fp-white);
  transition: var(--fp-transition);
  outline: none;
}
.fp-input:focus, .fp-textarea:focus {
  border-color: var(--fp-blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.fp-textarea { resize: vertical; min-height: 80px; }

/* ════════════════════════════════════════════════════════════
   13. HISTORIAL DE CANJES
   ════════════════════════════════════════════════════════════ */
.fp-history-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--fp-border);
}
.fp-history-tab {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fp-text-mid);
  cursor: pointer;
  border: none;
  background: none;
  font-family: 'DM Sans', sans-serif;
  position: relative;
  transition: color .15s;
}
.fp-history-tab:hover { color: var(--fp-navy); }
.fp-history-tab.fp-active { color: var(--fp-blue); }
.fp-history-tab.fp-active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0; right: 0;
  height: 2px;
  background: var(--fp-blue);
  border-radius: 2px 2px 0 0;
}

.fp-redemption-card {
  background: var(--fp-white);
  border: 1px solid var(--fp-border);
  border-radius: var(--fp-radius-lg);
  padding: 16px 20px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--fp-transition);
}
.fp-redemption-card:hover { border-color: var(--fp-blue-light); box-shadow: var(--fp-shadow-sm); }

.fp-redemption-thumb {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--fp-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.fp-redemption-info { flex: 1; min-width: 0; }
.fp-redemption-name { font-size: 14px; font-weight: 700; color: var(--fp-navy); }
.fp-redemption-date { font-size: 12px; color: var(--fp-text-soft); margin-top: 2px; }
.fp-redemption-note { font-size: 12px; color: var(--fp-text-mid); margin-top: 4px; font-style: italic; }

.fp-redemption-pts-badge {
  text-align: right;
  flex-shrink: 0;
}
.fp-redemption-pts-val { font-size: 16px; font-weight: 700; color: var(--fp-blue); }
.fp-redemption-pts-label { font-size: 11px; color: var(--fp-text-soft); }

/* Bitácora de cambios de estado */
.fp-status-log {
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--fp-surface);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fp-status-log-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--fp-text-mid);
}
.fp-status-log-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fp-border);
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════
   14. LOGIN
   ════════════════════════════════════════════════════════════ */
.fp-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--fp-surface);
  padding: 24px;
}
.fp-login-card {
  background: var(--fp-white);
  border-radius: 16px;
  border: 1px solid var(--fp-border);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--fp-shadow-md);
}
.fp-login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}
.fp-login-logo-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--fp-teal), var(--fp-blue));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}
.fp-login-title   { font-size: 20px; font-weight: 700; color: var(--fp-navy); margin: 0; }
.fp-login-subtitle { font-size: 13px; color: var(--fp-text-mid); }
.fp-login-forgot { font-size: 12px; color: var(--fp-blue); text-decoration: none; float: right; margin-top: 4px; }
.fp-login-forgot:hover { text-decoration: underline; }

/* Overlay primer login */
.fp-first-login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,34,64,.65);
  backdrop-filter: blur(6px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.fp-first-login-card {
  background: var(--fp-white);
  border-radius: 16px;
  padding: 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--fp-shadow-lg);
}

/* ════════════════════════════════════════════════════════════
   15. RANKING / LEADERBOARD (Modo oscuro)
   ════════════════════════════════════════════════════════════ */
.fp-ranking-wrap {
  --rk-bg:     #0a0c10;
  --rk-bg2:    #10141c;
  --rk-bg3:    #161c28;
  --rk-border: rgba(255,255,255,.07);
  --rk-border2:rgba(255,255,255,.12);
  --rk-gold:   #f5c842;
  --rk-gold2:  #e8a800;
  --rk-teal:   #00d4aa;
  --rk-teal2:  #00b090;
  --rk-blue:   #4f8ef7;
  --rk-text:   #f0f4ff;
  --rk-text2:  #8892a4;
  --rk-text3:  #4a5568;
  --rk-green:  #22d97a;
  --rk-orange: #ff8c42;

  background: var(--rk-bg);
  min-height: 100vh;
  font-family: 'Outfit', 'DM Sans', sans-serif;
  color: var(--rk-text);
}

/* Topnav oscuro */
.fp-ranking-wrap .fp-topnav {
  background: var(--rk-bg2);
  border-bottom: 1px solid var(--rk-border);
  box-shadow: none;
}
.fp-ranking-wrap .fp-topnav-logo-icon {
  background: linear-gradient(135deg, var(--rk-teal), var(--rk-blue));
}
/* Points pill dorado en el ranking */
.fp-ranking-wrap .fp-points-pill {
  background: rgba(245,200,66,.15);
  border-color: rgba(245,200,66,.3);
  color: var(--rk-gold);
}

/* Layout ranking */
.fp-ranking-layout {
  display: flex;
  min-height: calc(100vh - 56px);
}

/* Sidebar del ranking */
.fp-ranking-sidebar {
  width: 300px;
  flex-shrink: 0;
  background: var(--rk-bg2);
  border-right: 1px solid var(--rk-border);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Card "Mis Puntos" en el ranking */
.fp-rk-points-card {
  background: linear-gradient(135deg, rgba(0,212,170,.12), rgba(79,142,247,.08));
  border: 1px solid rgba(0,212,170,.2);
  border-radius: 14px;
  padding: 18px;
  position: relative;
  overflow: hidden;
}
.fp-rk-points-card::before {
  content: '';
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,212,170,.15) 0%, transparent 70%);
  top: -40px;
  right: -20px;
  pointer-events: none;
}
.fp-rk-points-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--rk-text2);
  margin-bottom: 8px;
}
.fp-rk-points-value {
  font-family: 'Syne', sans-serif;
  font-size: 44px;
  font-weight: 800;
  color: var(--rk-text);
  line-height: 1;
  margin-bottom: 4px;
}
.fp-rk-points-pts {
  font-size: 14px;
  color: var(--rk-teal);
  font-weight: 600;
}

/* Rank badge dorado */
.fp-rk-badge-gold {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: rgba(245,200,66,.15);
  border: 1px solid rgba(245,200,66,.3);
  border-radius: var(--fp-radius-full);
  font-size: 12px;
  font-weight: 700;
  color: var(--rk-gold);
  margin-top: 10px;
}

/* Barra de progreso del ranking — con dot y glow */
.fp-rk-progress-track {
  background: rgba(255,255,255,.06);
  border-radius: var(--fp-radius-full);
  height: 6px;
  margin-top: 12px;
  position: relative;
  overflow: visible;
}
.fp-rk-progress-fill {
  height: 100%;
  border-radius: var(--fp-radius-full);
  background: linear-gradient(90deg, var(--rk-teal), var(--rk-blue));
  position: relative;
  transition: width .5s ease;
}
.fp-rk-progress-fill::after {
  content: '';
  position: absolute;
  right: -1px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 8px var(--rk-teal);
}

/* Lista de premios en sidebar del ranking */
.fp-rk-rewards-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--rk-text2);
  margin-bottom: 8px;
}
.fp-rk-reward-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--rk-bg3);
  border: 1px solid var(--rk-border);
  border-radius: 10px;
  margin-bottom: 8px;
}
.fp-rk-reward-icon { font-size: 20px; flex-shrink: 0; }
.fp-rk-reward-name { font-size: 12px; font-weight: 600; color: var(--rk-text); }
.fp-rk-reward-pts  { font-size: 11px; color: var(--rk-teal); font-weight: 700; margin-top: 1px; }

/* ── Tabla de ranking principal ── */
.fp-ranking-main {
  flex: 1;
  padding: 28px 32px;
}
.fp-rk-title {
  font-family: 'Syne', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--rk-text);
  margin-bottom: 4px;
}
.fp-rk-subtitle {
  font-size: 13px;
  color: var(--rk-text2);
  margin-bottom: 24px;
}

/* Items de ranking */
.fp-rk-list { display: flex; flex-direction: column; gap: 8px; }

.fp-rk-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--rk-bg2);
  border: 1px solid var(--rk-border);
  border-radius: 12px;
  transition: var(--fp-transition);
}
.fp-rk-item:hover { border-color: var(--rk-border2); background: var(--rk-bg3); }

/* Posición actual del dependiente */
.fp-rk-item.fp-rk-current {
  border-color: rgba(0,212,170,.35);
  background: rgba(0,212,170,.05);
  box-shadow: 0 0 0 1px rgba(0,212,170,.15);
}

/* Top 1 */
.fp-rk-item.fp-rk-pos-1 {
  background: linear-gradient(135deg, rgba(245,200,66,.08), rgba(232,168,0,.04));
  border-color: rgba(245,200,66,.2);
}

/* Posición */
.fp-rk-pos {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--rk-bg3);
  color: var(--rk-text2);
}
.fp-rk-pos-1-badge { background: rgba(245,200,66,.2); color: var(--rk-gold); }
.fp-rk-pos-2-badge { background: rgba(148,163,184,.15); color: #94a3b8; }
.fp-rk-pos-3-badge { background: rgba(167,139,250,.15); color: #a78bfa; }
.fp-rk-crown       { font-size: 16px; }

/* Info del dependiente */
.fp-rk-dep-info { flex: 1; min-width: 0; }
.fp-rk-dep-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--rk-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fp-rk-dep-code { font-size: 11px; color: var(--rk-text2); font-family: 'DM Mono', monospace; }

/* Barra relativa al #1 */
.fp-rk-bar-wrap {
  width: 120px;
  flex-shrink: 0;
}
.fp-rk-bar-track {
  background: rgba(255,255,255,.06);
  border-radius: var(--fp-radius-full);
  height: 4px;
  overflow: hidden;
}
.fp-rk-bar-fill {
  height: 100%;
  border-radius: var(--fp-radius-full);
  background: linear-gradient(90deg, var(--rk-teal), var(--rk-blue));
}
.fp-rk-item.fp-rk-pos-1 .fp-rk-bar-fill { background: linear-gradient(90deg, var(--rk-gold2), var(--rk-gold)); }

/* Puntos del ranking */
.fp-rk-saldo {
  font-family: 'Syne', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--rk-text);
  white-space: nowrap;
  text-align: right;
  min-width: 80px;
}
.fp-rk-saldo-label { font-size: 10px; color: var(--rk-text2); font-family: 'Outfit', sans-serif; font-weight: 400; }

/* ════════════════════════════════════════════════════════════
   16. BANNERS
   ════════════════════════════════════════════════════════════ */
.fp-banners {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.fp-banners::-webkit-scrollbar { display: none; }
.fp-banner-item {
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  height: 120px;
  min-width: 280px;
  background: linear-gradient(135deg, var(--fp-navy), var(--fp-navy-mid));
}
.fp-banner-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ════════════════════════════════════════════════════════════
   17. ALERTAS
   ════════════════════════════════════════════════════════════ */
.fp-alert {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.5;
}
.fp-alert-icon    { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.fp-alert-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.fp-alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.fp-alert-warn    { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }

/* ════════════════════════════════════════════════════════════
   18. LOADING / ESTADO VACÍO
   ════════════════════════════════════════════════════════════ */
.fp-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--fp-border);
  border-top-color: var(--fp-blue);
  border-radius: 50%;
  animation: fp-spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes fp-spin { to { transform: rotate(360deg); } }

.fp-empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--fp-text-soft);
}
.fp-empty-icon  { font-size: 40px; margin-bottom: 12px; }
.fp-empty-title { font-size: 15px; font-weight: 600; color: var(--fp-text-mid); margin-bottom: 6px; }
.fp-empty-desc  { font-size: 13px; }

/* ════════════════════════════════════════════════════════════
   19. PAGINACIÓN
   ════════════════════════════════════════════════════════════ */
.fp-pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
  padding: 20px 0 4px;
}
.fp-page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid var(--fp-border);
  background: var(--fp-white);
  color: var(--fp-text-mid);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--fp-transition);
  font-family: 'DM Sans', sans-serif;
}
.fp-page-btn:hover     { background: var(--fp-surface-2); }
.fp-page-btn.fp-active { background: var(--fp-blue); color: #fff; border-color: var(--fp-blue); }
.fp-page-btn:disabled  { opacity: .4; cursor: not-allowed; }

/* ════════════════════════════════════════════════════════════
   20. NOTIFICACIONES TOAST
   ════════════════════════════════════════════════════════════ */
.fp-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fp-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--fp-navy);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--fp-shadow-lg);
  min-width: 260px;
  max-width: 380px;
  animation: fp-toast-in .25s ease;
}
.fp-toast-success { background: #15803d; }
.fp-toast-error   { background: #be123c; }
@keyframes fp-toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ════════════════════════════════════════════════════════════
   21. UTILIDADES
   ════════════════════════════════════════════════════════════ */
/* ── Colores de texto ── */
.fp-text-navy    { color: var(--fp-navy); }
.fp-text-blue    { color: var(--fp-blue); }
.fp-text-teal    { color: var(--fp-teal); }
.fp-text-green   { color: var(--fp-green); }
.fp-text-red     { color: var(--fp-red); }
.fp-text-amber   { color: var(--fp-amber); }
.fp-text-purple  { color: var(--fp-purple); }
.fp-text-mid     { color: var(--fp-text-mid); }
.fp-text-soft    { color: var(--fp-text-soft); }
.fp-text-white   { color: #fff; }
.fp-text-center  { text-align: center; }
.fp-text-right   { text-align: right; }

/* ── Tipografía ── */
.fp-font-mono    { font-family: 'DM Mono', monospace; }
.fp-fw-400       { font-weight: 400; }
.fp-fw-500       { font-weight: 500; }
.fp-fw-600       { font-weight: 600; }
.fp-fw-700       { font-weight: 700; }
.fp-fw-800       { font-weight: 800; }
.fp-lh-tight     { line-height: 1.3; }
.fp-lh-relaxed   { line-height: 1.6; }
.fp-no-wrap      { white-space: nowrap; }
.fp-fs-10        { font-size: 10px; }
.fp-fs-11        { font-size: 11px; }
.fp-fs-12        { font-size: 12px; }
.fp-fs-13        { font-size: 13px; }
.fp-fs-14        { font-size: 14px; }
.fp-fs-16        { font-size: 16px; }
.fp-fs-18        { font-size: 18px; }
.fp-fs-20        { font-size: 20px; }
.fp-fs-22        { font-size: 22px; }
.fp-fs-24        { font-size: 24px; }
.fp-fs-26        { font-size: 26px; }
.fp-fs-28        { font-size: 28px; }
.fp-italic       { font-style: italic; }
.fp-uppercase    { text-transform: uppercase; letter-spacing: .05em; }

/* ── Espaciado ── */
.fp-mt-4   { margin-top: 4px; }
.fp-mt-8   { margin-top: 8px; }
.fp-mt-10  { margin-top: 10px; }
.fp-mt-12  { margin-top: 12px; }
.fp-mt-16  { margin-top: 16px; }
.fp-mt-20  { margin-top: 20px; }
.fp-mt-24  { margin-top: 24px; }
.fp-mb-2   { margin-bottom: 2px; }
.fp-mb-4   { margin-bottom: 4px; }
.fp-mb-6   { margin-bottom: 6px; }
.fp-mb-8   { margin-bottom: 8px; }
.fp-mb-10  { margin-bottom: 10px; }
.fp-mb-12  { margin-bottom: 12px; }
.fp-mb-16  { margin-bottom: 16px; }
.fp-mb-20  { margin-bottom: 20px; }
.fp-mb-24  { margin-bottom: 24px; }
.fp-p-0    { padding: 0 !important; }

/* ── Flexbox ── */
.fp-flex         { display: flex; }
.fp-flex-center  { display: flex; align-items: center; }
.fp-flex-between { display: flex; align-items: center; justify-content: space-between; }
.fp-flex-col           { display: flex; flex-direction: column; }
.fp-flex-col-gap-8     { display: flex; flex-direction: column; gap: 8px; }
.fp-flex-col-gap-12    { display: flex; flex-direction: column; gap: 12px; }
.fp-flex-wrap          { display: flex; flex-wrap: wrap; }
.fp-inline-flex        { display: inline-flex; align-items: center; }
.fp-flex-shrink-0      { flex-shrink: 0; }
.fp-gap-4              { gap: 4px; }
.fp-gap-6              { gap: 6px; }
.fp-gap-8              { gap: 8px; }
.fp-gap-10       { gap: 10px; }
.fp-gap-12       { gap: 12px; }
.fp-gap-16       { gap: 16px; }
.fp-items-start  { align-items: flex-start; }
.fp-justify-end  { justify-content: flex-end; }
.fp-justify-center { justify-content: center; }

/* ── Misceláneos ── */
.fp-w-full       { width: 100%; }
.fp-col-full        { grid-column: 1 / -1; }
.fp-ml-auto         { margin-left: auto; }
.fp-mr-auto         { margin-right: auto; }
.fp-mx-auto         { margin-left: auto; margin-right: auto; }
.fp-flex-items-end  { display: flex; align-items: flex-end; }
.fp-opacity-5       { opacity: .5; }
.fp-opacity-6       { opacity: .6; }
.fp-cursor-pointer  { cursor: pointer; }
.fp-overflow-hidden { overflow: hidden; }
.fp-truncate        { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-hidden       { display: none !important; }
.fp-hide-mobile  { } /* definido en media query @768 */
.fp-sr-only      { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.fp-divider      { height: 1px; background: var(--fp-border); margin: 20px 0; }

/* ── Texto de ayuda bajo inputs ── */
.fp-input-hint {
  font-size: 11px;
  color: var(--fp-text-soft);
  margin-top: 4px;
  line-height: 1.4;
}
.fp-input-error-msg {
  font-size: 11px;
  color: var(--fp-red);
  margin-top: 4px;
}

/* ── Fila de acciones al pie de un formulario ── */
.fp-form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
}

/* ── Topnav: estados .active (sin prefijo fp- para compatibilidad PHP) ── */
.fp-topnav-link.active { color: #fff; background: rgba(255,255,255,.14); }

/* ── Layout helpers adicionales ── */
.fp-flex-1          { flex: 1; min-width: 0; }
.fp-flex-gap-6      { gap: 6px; }
.fp-flex-gap-10     { gap: 10px; }
.fp-flex-gap-20     { gap: 20px; }
.fp-fs-20           { font-size: 20px; }

/* ── Fila de lista con separador ── */
.fp-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--fp-border);
}
.fp-list-row:last-child { border-bottom: none; }

/* ── Rank badges ── */
.fp-rank-badge { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.fp-rank-1 { background: var(--fp-amber); color: #fff; }
.fp-rank-2 { background: #94a3b8; color: #fff; }
.fp-rank-3 { background: #b87333; color: #fff; }
.fp-rank-n { background: var(--fp-surface-2); color: var(--fp-text-mid); }

/* ── Empty state compacto ── */
.fp-empty-state-sm { text-align: center; padding: 28px 16px; color: var(--fp-text-soft); }

/* ════════════════════════════════════════════════════════════
   22. RESPONSIVE (breakpoints básicos)
   ════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .fp-product-grid          { grid-template-columns: repeat(2, 1fr); }
  .fp-catalog-layout        { flex-direction: column; }
  .fp-catalog-sidebar       { width: 100%; }
  .fp-grid-2-asym           { grid-template-columns: 1fr; }
  .fp-rk-bar-wrap           { display: none; }
}

/* ════════════════════════════════════════════════════════════
   HAMBURGER MENU — Mobile (CSS-only, sin JS)
   ════════════════════════════════════════════════════════════ */

/* Botón hamburguesa — visible solo en mobile */
.fp-nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  cursor: pointer;
  background: none;
  border: none;
  border-radius: var(--fp-radius-sm);
  transition: var(--fp-transition);
  flex-shrink: 0;
  order: 10;
}
.fp-nav-hamburger:hover {
  background: rgba(255,255,255,.1);
}
.fp-nav-hamburger span,
.fp-nav-hamburger span::before,
.fp-nav-hamburger span::after {
  display: block;
  width: 20px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform .25s ease, background .25s ease;
  position: relative;
}
.fp-nav-hamburger span::before,
.fp-nav-hamburger span::after {
  content: '';
  position: absolute;
  left: 0;
}
.fp-nav-hamburger span::before { top: -6px; }
.fp-nav-hamburger span::after  { top:  6px; }

/* Estado activo: convierte en X */
.fp-nav-hamburger.fp-nav-open span {
  background: transparent;
}
.fp-nav-hamburger.fp-nav-open span::before {
  transform: rotate(45deg) translate(4px, 4px);
}
.fp-nav-hamburger.fp-nav-open span::after {
  transform: rotate(-45deg) translate(4px, -4px);
}

/* Menú desplegable mobile — oculto por defecto, visible con clase .fp-menu-open */
.fp-mobile-menu {
  display: none;
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  background: var(--fp-navy);
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 8px 0 16px;
  z-index: 9999;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
.fp-mobile-menu.fp-menu-open {
  display: block;
}
.fp-mobile-menu a {
  display: block;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 500;
  color: rgba(255,255,255,.8);
  text-decoration: none;
  border-radius: 0;
  transition: var(--fp-transition);
  min-height: 44px;
  display: flex;
  align-items: center;
}
.fp-mobile-menu a:hover,
.fp-mobile-menu a.fp-active,
.fp-mobile-menu a.active {
  background: rgba(255,255,255,.08);
  color: #fff;
}
.fp-mobile-menu-divider {
  height: 1px;
  background: rgba(255,255,255,.08);
  margin: 8px 20px;
}

/* ════════════════════════════════════════════════════════════
   MOBILE COMPLETO ≤ 768px
   ════════════════════════════════════════════════════════════ */

/* Utilidad: ocultar en mobile */
@media (max-width: 768px) {
  .fp-hide-mobile { display: none !important; }
}

/* Menú mobile — cabecera de puntos */
.fp-mobile-menu-points {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px 10px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}
.fp-mobile-menu-logout {
  color: rgba(255,255,255,.6) !important;
  font-size: 14px !important;
}
.fp-mobile-menu-logout:hover {
  color: #fff !important;
}

@media (max-width: 768px) {

  /* ── Topnav ─────────────────────────────────────────── */
  .fp-topnav {
    padding: 0 16px;
    position: sticky;
    top: 0;
    z-index: 100;
  }
  .fp-topnav-left   { gap: 10px; }
  .fp-topnav-right  { gap: 8px; }
  .fp-topnav-nav    { display: none; }
  .fp-nav-hamburger { display: flex !important; }

  /* Avatar más pequeño en mobile */
  .fp-topnav-avatar { width: 30px; height: 30px; font-size: 12px; }

  /* ── Hero ────────────────────────────────────────────── */
  .fp-hero {
    padding: 20px 16px 0;
  }
  .fp-hero-content {
    flex-direction: column;
    gap: 16px;
  }
  .fp-hero-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }
  /* Primer stat (puntos disponibles) ocupa fila completa */
  .fp-hero-stat:first-child {
    grid-column: 1 / -1;
  }
  .fp-hero-stat {
    min-width: 0;
    padding: 10px 14px;
  }
  .fp-hero-stat-value { font-size: 22px; }
  .fp-hero-stat-accent .fp-hero-stat-value { font-size: 28px; }

  /* Hero tabs */
  .fp-hero-tabs-wrap { padding: 12px 16px 0; }
  .fp-hero-tab { font-size: 13px; padding: 8px 14px; min-height: 40px; }

  /* ── Dashboard ───────────────────────────────────────── */
  .fp-dashboard-body { padding: 12px 16px 32px; }
  .fp-dashboard-section { margin-top: 16px !important; }

  /* Todos los grids → columna única */
  .fp-grid-2,
  .fp-grid-2-asym,
  .fp-grid-3 { grid-template-columns: 1fr; gap: 16px; }

  /* Medidor circular + stats al lado → columna */
  .fp-meter-wrap {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }

  /* Cards */
  .fp-card-header { flex-wrap: wrap; gap: 8px; }
  .fp-card-body   { padding: 14px 16px; }
  .fp-card-title  { font-size: 14px; }

  /* Timeline items */
  .fp-tl-item { padding: 10px 0; gap: 10px; }

  /* Mini stats */
  .fp-stat-mini { padding: 12px; }
  .fp-stat-mini-value { font-size: 20px; }

  /* ── Catálogo ─────────────────────────────────────────── */
  .fp-catalog-wrap { flex-direction: column; }
  .fp-catalog-sidebar { display: none; } /* sidebar filtros: oculto en mobile */
  .fp-product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .fp-product-card-body { padding: 10px; }

  /* ── Ranking ──────────────────────────────────────────── */
  .fp-ranking-layout  { flex-direction: column; }

  .fp-ranking-sidebar {
    position: static;
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--rk-border);
    padding: 16px;
    max-height: 240px;
    overflow-y: auto;
  }

  /* Card "Mis Puntos" compacta en mobile */
  .fp-rk-points-card {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  .fp-rk-points-card::before { display: none; }
  .fp-rk-points-value {
    font-size: 32px;
  }
  .fp-rk-points-label {
    font-size: 10px;
  }

  .fp-ranking-main { padding: 16px; }

  /* ── Tablas → scroll horizontal ──────────────────────── */
  .fp-table-wrap,
  .fp-card-body .fp-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  /* ── Modales → bottom sheet ───────────────────────────── */
  .fp-modal-overlay { align-items: flex-end; padding: 0; }
  .fp-modal {
    border-radius: 20px 20px 0 0;
    max-width: 100%;
    margin: 0;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
  }
  .fp-modal-header { padding: 16px 16px 12px; }
  .fp-modal-body   { padding: 0 16px 16px; }
  .fp-modal-footer { padding: 12px 16px; }

  /* ── Generales ────────────────────────────────────────── */
  .fp-wrap { min-height: 100dvh; }
  .fp-layout { padding: 16px; }
  .fp-page-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .fp-btn-sm { min-height: 36px; padding: 6px 12px; font-size: 12px; }
}

/* ════════════════════════════════════════════════════════════
   MOBILE ULTRA PEQUEÑO ≤ 360px
   ════════════════════════════════════════════════════════════ */
@media (max-width: 360px) {
  /* Hero stats: columna única en pantallas muy pequeñas */
  .fp-hero-stats {
    grid-template-columns: 1fr;
  }
  .fp-hero-stat:first-child {
    grid-column: 1;
  }

  /* Catálogo: 1 columna */
  .fp-product-grid {
    grid-template-columns: 1fr !important;
  }

  /* Modales: más padding bottom para safe area */
  .fp-modal-footer {
    padding-bottom: 28px;
  }
}

/* ════════════════════════════════════════════════════════════
   23. MEJORAS VISUALES FRONTEND (v1.1)
   ════════════════════════════════════════════════════════════ */

/* Topnav — logo brand y logo img (igual que admin) */
.fp-topnav-brand {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}
.fp-topnav-logo-img {
  height: 30px;
  width: auto;
  border-radius: 6px;
  object-fit: contain;
}
.fp-topnav-logo {
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, var(--fp-teal), var(--fp-blue));
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
}

/* Topnav activo */
.fp-topnav-link.active {
  color: #fff;
  background: rgba(255,255,255,.14);
}

/* Pill de puntos mejorada */
.fp-points-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--fp-radius-full);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .01em;
}

/* Hero — degradado más vibrante */
.fp-hero {
  background: linear-gradient(135deg, var(--fp-navy) 0%, var(--fp-navy-mid) 60%, #1e40af 100%);
}

/* Hero stat — más prominente */
.fp-hero-stat-value {
  font-size: 26px;
  font-weight: 800;
}
.fp-hero-stat-accent {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--fp-radius-md);
  padding: 12px 20px;
}
.fp-hero-stat-accent .fp-hero-stat-value {
  font-size: 32px;
  color: #fff;
}

/* Cards con hover lift */
.fp-card {
  transition: box-shadow .2s ease;
}
.fp-card:hover {
  box-shadow: var(--fp-shadow-md);
}

/* Product cards mejoradas */
.fp-product-card {
  border-radius: var(--fp-radius-xl);
  transition: transform .2s ease, box-shadow .2s ease;
  border: 1px solid var(--fp-border);
}
.fp-product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,.1);
}

/* Imagen placeholder del producto */
.fp-product-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--fp-surface-2), var(--fp-surface));
  color: var(--fp-text-soft);
  font-size: 36px;
}

/* Hero tab — activo más visible */
.fp-hero-tab.active {
  color: #fff;
  background: rgba(255,255,255,.18);
  border-radius: var(--fp-radius-sm);
}

/* Empty state — ilustración más grande */
.fp-empty-icon {
  font-size: 48px;
  margin-bottom: 14px;
}
.fp-empty-title {
  font-size: 16px;
  font-weight: 700;
}

/* Timeline de movimientos — dot más visible */
.fp-tl-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255,255,255,.8);
}

/* Puntos positivos/negativos */
.fp-tl-pts.plus {
  color: var(--fp-blue);
  font-weight: 700;
  font-size: 14px;
}
.fp-tl-pts.minus {
  color: var(--fp-red);
  font-weight: 700;
  font-size: 14px;
}

/* Tabla mobile — scroll horizontal suave */
@media (max-width: 768px) {
  .fp-card-body .fp-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ════════════════════════════════════════════════════════════
   MOBILE — Inputs 16px mínimo (evita zoom en iOS)
   Touch targets mínimo 44×44px
   ════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Inputs: mínimo 16px para evitar zoom automático en iOS/Safari */
  .fp-input,
  .fp-select,
  .fp-textarea,
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="search"],
  select,
  textarea {
    font-size: 16px !important;
    min-height: 44px;
  }

  /* Touch targets mínimos para botones y enlaces interactivos */
  .fp-btn {
    min-height: 44px;
    padding: 10px 18px;
  }
  .fp-page-btn {
    min-width: 44px;
    min-height: 44px;
  }
  .fp-topnav-link,
  .fp-topnav-avatar {
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .fp-hero-tab {
    min-height: 44px;
  }
  .fp-history-tab {
    min-height: 44px;
    padding: 10px 16px;
  }
  .fp-modal-close {
    width: 44px;
    height: 44px;
  }
}

/* Button primary — efecto elevación */
.fp-btn-primary {
  box-shadow: 0 2px 8px rgba(37,99,235,.3);
}
.fp-btn-primary:hover {
  box-shadow: 0 4px 12px rgba(37,99,235,.4);
  transform: translateY(-1px);
}

/* Badge de estado más compact */
.fp-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--fp-radius-full);
}

/* Progress bar animada */
@keyframes fp-progress-in {
  from { width: 0; }
}
.fp-progress-fill {
  animation: fp-progress-in .8s ease-out;
}

/* Primer login overlay mejorado */
.fp-first-login-modal {
  border-radius: var(--fp-radius-xl);
  box-shadow: 0 20px 60px rgba(0,0,0,.15);
}

/* ════════════════════════════════════════════════════════════
   ACCESIBILIDAD — Focus visible + prefers-reduced-motion
   ════════════════════════════════════════════════════════════ */

/* Focus visible para teclado — anillo consistente en todo el plugin */
.fp-btn:focus-visible,
.fp-topnav-link:focus-visible,
.fp-topnav-avatar:focus-visible,
.fp-hero-tab:focus-visible,
.fp-history-tab:focus-visible,
.fp-page-btn:focus-visible,
.fp-modal-close:focus-visible,
.fp-sidebar-item:focus-visible,
.fp-input:focus-visible,
.fp-select:focus-visible,
.fp-textarea:focus-visible,
.fp-product-card:focus-visible,
.fp-redemption-card:focus-visible {
  outline: 3px solid var(--fp-blue);
  outline-offset: 2px;
}

/* prefers-reduced-motion: deshabilitar animaciones no esenciales */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .fp-spinner {
    animation: none;
    border-top-color: var(--fp-blue);
    opacity: .7;
  }
  .fp-progress-fill {
    animation: none;
    transition: none;
  }
  .fp-modal {
    animation: none;
  }
  .fp-toast {
    animation: none;
  }
  .fp-product-card:hover,
  .fp-btn-primary:hover {
    transform: none;
  }
  .fp-card:hover {
    transform: none;
  }
}

/* ════════════════════════════════════════════════════════════
   MEJORAS ADICIONALES — Auditoría UX 2026-05-31
   ════════════════════════════════════════════════════════════ */

/* Skip to content link (accesibilidad) */
.fp-skip-link {
  position: absolute;
  top: -40px;
  left: 10px;
  background: var(--fp-navy);
  color: #fff;
  padding: 8px 16px;
  border-radius: 6px;
  z-index: 9999;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: top .15s ease;
}
.fp-skip-link:focus {
  top: 10px;
  outline: 3px solid var(--fp-blue);
  outline-offset: 2px;
}

/* Tags y badges interactivos — focus visible */
a.fp-tag:focus-visible,
button.fp-tag:focus-visible {
  outline: 3px solid var(--fp-blue);
  outline-offset: 2px;
}

/* Placeholders con contraste mejorado */
.fp-input::placeholder,
.fp-textarea::placeholder,
.fp-select::placeholder {
  color: #64748b; /* ratio 4.6:1 ✓ WCAG AA */
  opacity: 1;
}

/* Estados disabled más claros */
.fp-select:disabled,
.fp-input:disabled,
.fp-textarea:disabled {
  background: var(--fp-surface-2);
  color: var(--fp-text-soft);
  cursor: not-allowed;
  opacity: .7;
}

/* Aspect ratio para evitar layout shift */
.fp-product-thumb,
.fp-banner-item img {
  aspect-ratio: 16/9;
}

/* Indicador scroll horizontal en tablas mobile */
@media (max-width: 768px) {
  .fp-table-wrap {
    position: relative;
  }

  .fp-table-wrap::after {
    content: '';
    position: sticky;
    right: 0;
    top: 0;
    bottom: 0;
    width: 20px;
    background: linear-gradient(90deg, transparent, rgba(0,0,0,.05));
    pointer-events: none;
  }

  /* Modal: botones accesibles zona del pulgar */
  .fp-modal-footer {
    flex-direction: column-reverse;
  }

  .fp-modal-footer .fp-btn {
    width: 100%;
    justify-content: center;
  }
}
