/* =====================================================================
   Wishlist — heart on book cards / detail page, the "move to list" flyout,
   and the header count. Loaded site-wide from master.blade.php.
   ===================================================================== */

/* ---- the heart: a bare icon on the title line, no pill, no label ---- */
.wl-heart {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  background: none;
  color: #e8352e;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s ease;
  line-height: 0;
}
.wl-heart svg { width: 19px; height: 19px; }
.wl-heart .wl-hp { fill: none; stroke: currentColor; stroke-width: 2; }
.wl-heart.wl-on .wl-hp { fill: currentColor; stroke: currentColor; }
.wl-heart:active { transform: scale(0.82); }
.wl-heart.wl-busy { opacity: 0.5; pointer-events: none; }
.wl-heart:focus-visible { outline: 2px solid #e8352e; outline-offset: 2px; border-radius: 4px; }

/* keep the card title + heart on one line without disturbing the card size */
.wl-titlerow { display: flex; align-items: center; gap: 8px; }
.wl-titlerow > h3,
.wl-titlerow > h4 {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* detail page: title may wrap, heart stays put */
.product-book-title.wl-titlerow > h1 { flex: 1; min-width: 0; }

/* detail-page heart: a circular button, top-right by the title */
.wl-heart.wl-heart-detail {
  width: 42px;
  height: 42px;
  border: 1.5px solid #e8352e;
  border-radius: 50%;
  background: #fff;
}
.wl-heart.wl-heart-detail svg { width: 20px; height: 20px; }
.wl-heart.wl-heart-detail.wl-on { background: #e8352e; color: #fff; }

/* ---- the flyout (position:fixed, JS-anchored, so no card can clip it) ---- */
.wl-fly {
  position: fixed;
  z-index: 12000;
  width: 240px;
  background: #fff;
  border: 1px solid rgba(37, 39, 52, 0.14);
  border-radius: 12px;
  box-shadow: 0 16px 44px rgba(37, 39, 52, 0.24);
  padding: 13px 14px;
  font-family: "Poppins", sans-serif;
  font-size: 12px;
  color: #252734;
  animation: wl-flyin 0.14s ease-out;
}
@keyframes wl-flyin { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
.wl-fly::before {
  content: "";
  position: absolute;
  top: -6px;
  left: var(--wl-arrowx, 16px);
  width: 11px; height: 11px;
  background: #fff;
  border-left: 1px solid rgba(37, 39, 52, 0.14);
  border-top: 1px solid rgba(37, 39, 52, 0.14);
  transform: rotate(45deg);
}
.wl-fly .wl-fhead {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: #252734;
  margin-bottom: 2px;
}
.wl-fly .wl-fhead svg { width: 13px; height: 13px; color: #1d7d28; flex-shrink: 0; }
.wl-fly .wl-fsub { color: #9a9ba4; font-size: 10.5px; margin-bottom: 9px; }
.wl-fly .wl-fchips { display: flex; flex-wrap: wrap; gap: 6px; }
.wl-fly .wl-fchip {
  border: 1px solid rgba(37, 39, 52, 0.14);
  background: #f4f1ec;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 10.5px;
  font-weight: 600;
  color: #252734;
  cursor: pointer;
  font-family: inherit;
}
.wl-fly .wl-fchip:hover { border-color: #0d6b61; color: #0d6b61; }
.wl-fly .wl-fchip.wl-cur { background: #0d6b61; color: #fff; border-color: #0d6b61; }
.wl-fly .wl-faddnew {
  margin-top: 9px;
  background: none;
  border: 0;
  color: #0d6b61;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}
.wl-fly .wl-fnew { margin-top: 9px; display: flex; gap: 6px; }
.wl-fly .wl-fnew[hidden] { display: none; }
.wl-fly .wl-fnew input {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(37, 39, 52, 0.14);
  border-radius: 7px;
  padding: 5px 8px;
  font-size: 11px;
  font-family: inherit;
}
.wl-fly .wl-fnew button {
  border: 0;
  background: #0d6b61;
  color: #fff;
  border-radius: 7px;
  padding: 0 11px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

/* ---- header count bump (works with the existing .wishlist-count-data span) ---- */
.wishlist-count-data.wl-bump { animation: wl-bump 0.32s ease; }
@keyframes wl-bump { 0% { transform: scale(1); } 40% { transform: scale(1.5); } 100% { transform: scale(1); } }

@media (max-width: 768px) {
  .wl-fly { width: 220px; }
  .wl-heart svg { width: 18px; height: 18px; }
}
