/* ============================================
   EXTRAS: Favoritos, Nuevos, Compartir, Agentes
   ============================================ */

/* Corazon sobre la foto */
.card-img-wrap { position: relative; }
.kx-fav-btn {
  position: absolute;
  top: .6rem;
  right: .6rem;
  z-index: 3;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform .15s ease, background .15s ease, color .15s ease;
}
.kx-fav-btn:hover { transform: scale(1.08); background: rgba(0, 0, 0, .75); }
.kx-fav-btn:focus-visible { outline: 2px solid var(--primary-color, #00f2ff); outline-offset: 2px; }
.kx-fav-btn.is-fav { color: #ff4d6d; }
.kx-fav-btn.is-fav svg { fill: currentColor; }

/* Fila de acciones debajo de "Ver Producto" */
.kx-card-actions {
  display: flex;
  gap: .4rem;
  margin-top: .5rem;
}
.kx-act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  min-height: 34px;
  padding: 0 .65rem;
  border: 1px solid var(--border, rgba(255, 255, 255, .1));
  border-radius: 8px;
  background: transparent;
  color: var(--text, #fff);
  font: inherit;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.kx-act:hover { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .25); }
.kx-act:focus-visible { outline: 2px solid var(--primary-color, #00f2ff); outline-offset: 2px; }
.kx-act-wa:hover { color: #25d366; }
.kx-act-agents { flex: 1; }

/* Pill de Favoritos */
.kx-fav-pill { display: inline-flex; align-items: center; gap: .35rem; }
.kx-fav-pill svg { width: 14px; height: 14px; }
.kx-fav-pill.is-fav-active { color: #ff4d6d; border-color: #ff4d6d; }
.kx-fav-pill.is-fav-active svg { fill: currentColor; }

/* Estado vacio de favoritos */
.kx-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text, #fff);
}
.kx-empty-icon { color: #ff4d6d; margin-bottom: .75rem; }
.kx-empty-icon svg { width: 40px; height: 40px; }
.kx-empty h3 { margin: 0 0 .4rem; font-size: 1.2rem; }
.kx-empty p { margin: 0 auto; max-width: 380px; opacity: .7; }

/* Etiqueta NUEVO */
.kx-new-badge { background: #16a34a; }

/* Modal "Ver en todos los agentes" */
.kx-modal { position: fixed; inset: 0; z-index: 10000; display: none; }
.kx-modal.open { display: flex; align-items: center; justify-content: center; padding: 1rem; }
.kx-modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .65); }
.kx-modal-box {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 1.25rem;
  border: 1px solid var(--border, rgba(255, 255, 255, .1));
  border-radius: 14px;
  background: var(--bg-card-2, #0f172a);
  color: var(--text, #fff);
  box-shadow: var(--shadow-md, 0 16px 40px rgba(0, 0, 0, .6));
}
.kx-modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.kx-modal-head h3 { margin: 0; font-size: 1.1rem; }
.kx-modal-sub { margin: .25rem 0 0; font-size: .85rem; opacity: .7; }
.kx-modal-close {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
  color: inherit;
  cursor: pointer;
}
.kx-agent-list { display: flex; flex-direction: column; gap: .5rem; }
.kx-agent-row {
  display: flex;
  align-items: center;
  gap: .4rem;
  border: 1px solid var(--border, rgba(255, 255, 255, .1));
  border-radius: 10px;
  padding: .25rem;
}
.kx-agent-row.is-current { border-color: var(--primary-color, #00f2ff); }
.kx-agent-open {
  flex: 1;
  display: flex;
  align-items: center;
  gap: .65rem;
  min-height: 42px;
  padding: 0 .5rem;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}
.kx-agent-open:hover { background: rgba(255, 255, 255, .06); }
.kx-agent-logo { width: 24px; height: 24px; border-radius: 5px; object-fit: contain; }
.kx-agent-logo-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .12);
  font-size: .8rem;
}
.kx-agent-tag {
  margin-left: auto;
  padding: .15rem .5rem;
  border-radius: 999px;
  background: var(--primary-color, #00f2ff);
  color: #000;
  font-size: .7rem;
  font-weight: 700;
}
.kx-agent-copy {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.kx-agent-copy:hover { background: rgba(255, 255, 255, .06); }
.kx-muted { opacity: .7; margin: .5rem 0; }
body.kx-no-scroll { overflow: hidden; }

/* Aviso flotante */
.kx-toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  z-index: 10001;
  transform: translate(-50%, 20px);
  padding: .65rem 1rem;
  border-radius: 10px;
  background: #111;
  color: #fff;
  font-size: .9rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.kx-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Tema claro */
[data-theme="light"] .kx-act { color: #0f172a; border-color: rgba(15, 23, 42, .15); }
[data-theme="light"] .kx-act:hover { background: rgba(15, 23, 42, .05); }
[data-theme="light"] .kx-modal-box { background: #fff; color: #0f172a; }
[data-theme="light"] .kx-agent-row { border-color: rgba(15, 23, 42, .12); }
[data-theme="light"] .kx-agent-open:hover,
[data-theme="light"] .kx-agent-copy:hover,
[data-theme="light"] .kx-modal-close { background: rgba(15, 23, 42, .05); }

@media (prefers-reduced-motion: reduce) {
  .kx-fav-btn, .kx-act, .kx-toast { transition: none; }
}

/* Filas con scroll del inicio: ancho fijo por tarjeta (como el esqueleto de carga) */
.rs-product-scroll > .product-card {
  flex: 0 0 240px;
  scroll-snap-align: start;
}
@media (max-width: 600px) {
  .rs-product-scroll > .product-card { flex-basis: 70vw; }
}

/* Sin paginacion en la vista de favoritos */
body.kx-fav-mode #paginationContainer { display: none; }
