/* =====================================================================
   OS-STAGE-13-FAVORITES — heart button + favorites page styling.

   Two contexts:
   1. Heart on tenant cards (.fav-btn, already in DOM from earlier stages —
      we just turn it from a placeholder into a working toggle).
   2. Topbar heart icon (#osFavBtn — replaces the old bell).
   3. /favorites.php page (.os-favorites-grid, .os-fav-empty).
   ===================================================================== */

/* --- 1. Heart on cards ----------------------------------------------- */
.os-card .fav-btn {
  position: absolute;
  top: 10px; right: 10px;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 0;
  background: rgba(255,255,255,0.92);
  color: #1C2A44;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  transition: transform 140ms ease, background 140ms ease, color 140ms ease;
  -webkit-tap-highlight-color: transparent;
}
.os-card .fav-btn:hover { background: #fff; }
.os-card .fav-btn:active { transform: scale(0.92); }

/* IMPORTANT: parent <a class="click-target"> wraps the card. Heart sits
   over the link — make heart a positioning sibling-of-link so its tap
   doesn't bubble into the navigation. JS calls stopPropagation, but
   pointer-events:auto over the link is enough on its own visually. */
.os-card .fav-btn svg {
  width: 18px; height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  transition: fill 140ms ease, stroke 140ms ease;
}

/* Filled state — coral fill + scale pop animation. */
.os-card .fav-btn.is-fav {
  color: #E07856;
}
.os-card .fav-btn.is-fav svg {
  fill: #E07856;
  stroke: #E07856;
  animation: osFavPop 320ms ease;
}
@keyframes osFavPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.30); }
  100% { transform: scale(1); }
}

/* --- 2. Topbar heart icon (replaces bell) ---------------------------- */
.os-topbar #osFavBtn {
  position: relative;
}
.os-topbar #osFavBtn svg {
  transition: fill 140ms ease, stroke 140ms ease;
}
.os-topbar #osFavBtn.has-favs svg {
  fill: #E07856;
  stroke: #E07856;
}
.os-topbar #osFavBtn .fav-badge {
  position: absolute;
  top: -2px; right: -4px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #E07856;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  pointer-events: none;
}
.os-topbar #osFavBtn.has-favs .fav-badge {
  display: inline-flex;
}

/* --- 3. /favorites.php page ----------------------------------------- */
.os-favpage {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 80px;
  font-family: inherit;
}
.os-favpage h1 {
  font-size: 22px;
  margin: 0 0 6px;
  color: #1C2A44;
}
.os-favpage .sub {
  color: #5a6478;
  margin: 0 0 18px;
  font-size: 14px;
}
.os-favorites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.os-favorites-grid .os-fav-card {
  position: relative;
  display: block;
  background: #fff;
  border: 1px solid #ECE9E2;
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 3px rgba(28,42,68,0.06);
  transition: transform 140ms ease, box-shadow 140ms ease;
}
.os-favorites-grid .os-fav-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(28,42,68,0.12);
}
.os-favorites-grid .os-fav-card .logo-wrap {
  aspect-ratio: 1 / 1;
  background: #F7F5F0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.os-favorites-grid .os-fav-card img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.os-favorites-grid .os-fav-card .placeholder-letter {
  font-size: 48px; font-weight: 700; color: #1C2A44; opacity: 0.5;
}
.os-favorites-grid .os-fav-card .body {
  padding: 10px 12px 14px;
  text-align: center;
}
.os-favorites-grid .os-fav-card .name {
  font-size: 14px; font-weight: 600; margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: #1C2A44;
}
.os-favorites-grid .os-fav-card .remove {
  position: absolute;
  top: 8px; right: 8px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.94);
  border: 0;
  color: #E07856;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  transition: transform 120ms ease;
}
.os-favorites-grid .os-fav-card .remove:active { transform: scale(0.9); }

.os-fav-empty {
  text-align: center;
  padding: 50px 20px;
  color: #5a6478;
}
.os-fav-empty .heart-big {
  font-size: 56px;
  display: block;
  margin-bottom: 14px;
  opacity: 0.55;
}
.os-fav-empty h2 {
  font-size: 18px; color: #1C2A44; margin: 0 0 6px;
}
.os-fav-empty p { margin: 0 0 20px; font-size: 14px; }
.os-fav-empty .btn {
  display: inline-block;
  background: #1C2A44; color: #fff;
  padding: 12px 22px; border-radius: 999px;
  text-decoration: none; font-weight: 600;
  font-size: 14px;
}

/* Toast for "Saved to favorites" feedback. */
.os-fav-toast {
  position: fixed;
  bottom: 96px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1C2A44;
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
  z-index: 99996;
  max-width: 84vw;
  text-align: center;
}
.os-fav-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
