/* ── TR Marketplace Wishlist ────────────────────────────────── */

/* ── Heart SVG ─────────────────────────────────────────────── */
.tr-heart-icon {
  width: 18px;
  height: 18px;
  display: block;
  transition: transform 0.2s ease;
  pointer-events: none;
  flex-shrink: 0;
}
.tr-heart-icon path {
  stroke: #e53e3e;
  stroke-width: 2;
  fill: transparent;
  transition: fill 0.18s ease, stroke 0.18s ease;
}
.is-wishlisted .tr-heart-icon path,
.tr-wishlist-btn:hover .tr-heart-icon path {
  fill: #e53e3e;
  stroke: #e53e3e;
}
.is-wishlisted .tr-heart-icon {
  transform: scale(1.15);
}

/* ── Positioning context for heart button ───────────────────── */
/* Covers: standard WooCommerce loop (figure.image),
   homepage featured products (.tr-product-card — already relative),
   JS-fallback injected hearts on any card */
figure.image {
  position: relative !important;
  display: block;
}
.tr-product-card {
  position: relative;  /* already set in theme.css, added for safety */
}

/* ── Loop card heart button ─────────────────────────────────── */
.tr-wishlist-btn--loop {
  position: absolute !important;
  top: 8px !important;
  right: 8px !important;
  z-index: 10 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: rgba(255, 255, 255, 0.95);
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  margin: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s, background 0.15s;
  line-height: 1;
  outline: none;
}
.tr-wishlist-btn--loop:hover,
.tr-wishlist-btn--loop.is-wishlisted {
  border-color: #e53e3e !important;
  box-shadow: 0 2px 10px rgba(229, 62, 62, 0.28);
  background: #fff;
}
.tr-wishlist-btn--loop:active {
  transform: scale(0.86);
}
.tr-wishlist-btn--loop:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* Pulse animation on toggle */
@keyframes tr-heart-pulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.35); }
  70%  { transform: scale(0.92); }
  100% { transform: scale(1); }
}
.tr-wishlist-btn--loop.is-animating .tr-heart-icon,
.tr-wishlist-btn--single.is-animating .tr-heart-icon {
  animation: tr-heart-pulse 0.42s ease forwards;
}

/* ── Single product heart button ───────────────────────────── */
.tr-wishlist-single-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 14px;
  flex-wrap: wrap;
}
.tr-wishlist-btn--single {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 500;
  color: #4a5568;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  line-height: 1;
}
.tr-wishlist-btn--single:hover {
  border-color: #e53e3e;
  color: #e53e3e;
  background: #fff5f5;
}
.tr-wishlist-btn--single.is-wishlisted {
  border-color: #e53e3e;
  color: #e53e3e;
  background: #fff5f5;
}
.tr-wishlist-label { white-space: nowrap; }
.tr-wishlist-view-link {
  font-size: .82rem;
  color: #e53e3e;
  text-decoration: underline;
  white-space: nowrap;
}
.tr-wishlist-view-link:hover { color: #c53030; }

/* Toast */
.tr-wishlist-toast {
  display: inline-block;
  font-size: .8rem;
  color: #2d3748;
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 4px 10px;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.tr-wishlist-toast.visible { opacity: 1; }

/* ── Login / register modal ─────────────────────────────────── */
.tr-wl-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  z-index: 999999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}
.tr-wl-overlay.is-open {
  opacity: 1;
  visibility: visible;
}
.tr-wl-no-scroll { overflow: hidden; }

.tr-wl-modal {
  background: #fff;
  border-radius: 16px;
  padding: 36px 32px 28px;
  max-width: 360px;
  width: calc(100% - 32px);
  text-align: center;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
  transform: translateY(12px);
  transition: transform 0.22s ease;
}
.tr-wl-overlay.is-open .tr-wl-modal { transform: translateY(0); }

.tr-wl-modal__close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  color: #a0aec0;
  cursor: pointer;
  padding: 4px 6px;
  transition: color 0.15s;
}
.tr-wl-modal__close:hover { color: #4a5568; }

.tr-wl-modal__heart {
  width: 56px;
  height: 56px;
  background: #fff5f5;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.tr-wl-modal__heart svg { width: 28px; height: 28px; }
.tr-wl-modal__heart svg path {
  stroke: #e53e3e;
  stroke-width: 1.8;
  fill: #e53e3e;
}
.tr-wl-modal__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1a202c;
  margin: 0 0 8px;
}
.tr-wl-modal__text {
  font-size: .9rem;
  color: #718096;
  margin: 0 0 24px;
  line-height: 1.5;
}
.tr-wl-modal__btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tr-wl-modal__btn {
  display: block;
  padding: 11px 20px;
  border-radius: 8px;
  font-size: .93rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  cursor: pointer;
}
.tr-wl-modal__btn--primary {
  background: #e53e3e;
  color: #fff !important;
  border: 2px solid #e53e3e;
}
.tr-wl-modal__btn--primary:hover {
  background: #c53030;
  border-color: #c53030;
  color: #fff !important;
}
.tr-wl-modal__btn--outline {
  background: #fff;
  color: #e53e3e !important;
  border: 2px solid #e53e3e;
}
.tr-wl-modal__btn--outline:hover {
  background: #fff5f5;
  border-color: #c53030;
  color: #c53030 !important;
}

/* ── Wishlist page ──────────────────────────────────────────── */
.tr-wishlist-page__title { margin-bottom: 20px; font-size: 1.3rem; }
.tr-wishlist-page__empty {
  text-align: center;
  padding: 40px 20px;
  color: #718096;
}
.tr-wishlist-page__empty p { margin-bottom: 14px; }
.tr-wishlist-page__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  list-style: none;
  padding: 0;
  margin: 0;
}
