/* =========================================================================
   GenVerde · Widget de Estadísticas (flotante, reutilizable)
   CSS3 puro · BEM · sin frameworks · iconos SVG en línea
   Paleta GenVerde: verde #008A3D/#005F2B/#00C853 · rojo (likes) #ef4444/#dc2626
   Panel: #0c1f15 (verde muy oscuro, a juego con el sitio) · Fuente: Inter
   ========================================================================= */

.stats-widget,
.stats-widget * {
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.stats-widget svg { display: block; }

/* ---------- Botón flotante ---------- */
.stats-widget__toggle {
  position: fixed;
  bottom: 100px;
  left: 30px;
  z-index: 9998;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #008A3D 0%, #005F2B 100%);
  box-shadow: 0 8px 24px rgba(0, 138, 61, 0.45);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.3s ease;
}
.stats-widget__toggle svg { width: 24px; height: 24px; }
.stats-widget__toggle:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 30px rgba(0, 138, 61, 0.55);
}
.stats-widget__toggle.active {
  background: linear-gradient(135deg, #00C853 0%, #059669 100%);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.5);
}

/* ---------- Badge de likes ---------- */
.stats-widget__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  border: 2px solid #0c1f15;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.5);
}

/* ---------- Panel ---------- */
.stats-widget__panel {
  position: fixed;
  bottom: 170px;
  left: 30px;
  z-index: 9998;
  width: 300px;
  max-width: calc(100vw - 60px);
  background: #0c1f15;
  color: #e2f0e8;
  border: 1px solid rgba(0, 200, 83, 0.12);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  padding: 18px;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transform-origin: bottom left;
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.stats-widget__panel.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* ---------- Header ---------- */
.stats-widget__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.stats-widget__header-icon {
  display: inline-flex;
  color: #00C853;
}
.stats-widget__header-icon svg { width: 20px; height: 20px; }
.stats-widget__header h3 {
  margin: 0;
  flex: 1;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}
.stats-widget__close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.stats-widget__close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #fff;
}

/* ---------- Contenido ---------- */
.stats-widget__content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.stats-widget__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}
.stats-widget__item--small { padding: 8px 12px; }

.stats-widget__icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: #fff;
}
.stats-widget__icon svg { width: 20px; height: 20px; }
.stats-widget__icon--visits {
  background: linear-gradient(135deg, #008A3D 0%, #005F2B 100%);
}
.stats-widget__icon--likes {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.stats-widget__info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.stats-widget__value {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
}
.stats-widget__label {
  font-size: 12px;
  color: #94a3b8;
}

.stats-widget__mini {
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
  padding: 2px 0;
}
.stats-widget__mini strong { color: #e2f0e8; }

/* ---------- Acciones ---------- */
.stats-widget__actions { margin-top: 4px; }
.stats-widget__like-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border: 2px solid #ef4444;
  border-radius: 12px;
  background: transparent;
  color: #ef4444;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.stats-widget__like-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.stats-widget__like-btn:hover { background: rgba(239, 68, 68, 0.12); }
.stats-widget__like-btn.liked {
  background: #ef4444;
  color: #fff;
}
.stats-widget__like-btn.liked svg { fill: currentColor; }  /* corazón sólido */
.stats-widget__like-btn.animate svg { animation: stats-heartbeat 0.6s ease; }

@keyframes stats-heartbeat {
  0%   { transform: scale(1); }
  25%  { transform: scale(1.3); }
  40%  { transform: scale(0.95); }
  60%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* ---------- Footer ---------- */
.stats-widget__footer {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  color: #64748b;
  text-align: center;
}

/* ---------- Toast ---------- */
.stats-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 9999;
  background: #0c1f15;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 22px;
  border: 1px solid rgba(0, 200, 83, 0.15);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.stats-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.stats-toast svg { width: 16px; height: 16px; color: #ef4444; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .stats-widget__toggle {
    width: 50px;
    height: 50px;
    left: 16px;
    bottom: 90px;
  }
  .stats-widget__toggle svg { width: 22px; height: 22px; }
  .stats-widget__panel {
    left: 16px;
    right: 16px;
    bottom: 150px;
    width: auto;
    max-width: 300px;
  }
  .stats-toast {
    left: 16px;
    right: 16px;
    transform: translateY(20px);
    justify-content: center;
  }
  .stats-toast.show { transform: translateY(0); }
}
