/* Fibra — «Улюблені»: header heart, card/product hearts, side panel, cabinet section.
   Loaded after shop-style.css / nav.css; reuses .cart-drawer / .cart-item / .btn / .stock-badge. */

/* ── header button (next to the cart) ── */
.fav-btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: #fff; color: #374151; cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.fav-btn:hover { border-color: var(--primary); color: var(--primary); }
.fav-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(26, 86, 219, .35); }
.fav-btn__ic { display: inline-flex; }
.fav-btn svg { width: 22px; height: 22px; display: block; }
.fav-btn .fav-heart__path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.fav-btn.is-filled { color: var(--primary); border-color: var(--primary); background: #EEF2FF; }
.fav-btn.is-filled .fav-heart__path { fill: currentColor; }
.fav-badge {
  position: absolute; top: -7px; right: -7px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--primary); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
  display: none;
}
.fav-badge.is-visible { display: block; }
@media (max-width: 640px) {
  .fav-btn { width: 38px; height: 38px; }
  .fav-btn svg { width: 20px; height: 20px; }
}

/* ── hearts on cards / product page ── */
.fav-heart {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0;
  border: 1px solid var(--border); border-radius: 50%;
  background: #fff; color: #6B7280; cursor: pointer;
  transition: color .15s, border-color .15s, transform .12s;
  -webkit-tap-highlight-color: transparent;
}
.fav-heart svg { width: 20px; height: 20px; display: block; }
.fav-heart .fav-heart__path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.fav-heart:hover { color: var(--primary); border-color: var(--primary); }
.fav-heart:active { transform: scale(.92); }
.fav-heart:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(26, 86, 219, .35); }
.fav-heart.is-on { color: var(--primary); border-color: var(--primary); background: #EEF2FF; }
.fav-heart.is-on .fav-heart__path { fill: currentColor; }
/* card: in the body's top-right corner — never on the photo, badges, dots or price */
.product-card.has-fav .card-body { position: relative; }
.product-card.has-fav .card-name { padding-right: 44px; }
.fav-heart--card { position: absolute; top: 12px; right: 12px; z-index: 2; }
/* product page: next to the title */
.product-page .pp-head.has-fav { position: relative; }
.product-page .pp-head.has-fav .pp-title { padding-right: 52px; }
.fav-heart--page { position: absolute; top: 0; right: 0; width: 42px; height: 42px; }
.fav-heart--page svg { width: 24px; height: 24px; }

/* ── panel (cart drawer look) ── */
.fav-drawer .cart-drawer__panel { display: flex; flex-direction: column; }
.fav-item { align-items: flex-start; }
.fav-item__name { color: var(--text); text-decoration: none; display: block; }
.fav-item__name:hover { color: var(--primary); }
.fav-item__price { margin-top: 4px; font-size: 14px; font-weight: 700; color: var(--text); }
.fav-item__promo { color: var(--promo-red, #F31B1B); }
.fav-item__old { color: var(--text-muted); font-weight: 500; margin-left: 4px; }
.fav-item__promo-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--promo-yellow, #FFD629); color: var(--promo-ink, #181818); font-size: 11px; font-weight: 700; vertical-align: middle; }
.fav-item__stock { display: inline-block; margin: 6px 0 0; }
.fav-item__add { margin-top: 8px; }
.fav-item__add.is-done { background: var(--success, #10B981); }
.fav-item__add:disabled { opacity: .6; cursor: not-allowed; }
.fav-item.is-missing .cart-item__name { color: var(--text-muted); font-weight: 600; }
.fav-item__thumb--missing { background: var(--bg); border: 1px dashed var(--border); }
.fav-note { font-size: 12.5px; color: var(--text-muted); line-height: 1.45; padding: 12px 2px 4px; }
.fav-empty__go { text-decoration: none; margin-bottom: 8px; }
.fav-empty { padding: 32px 8px; }

/* ── toast ── */
.fav-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px);
  z-index: 650; background: #111827; color: #fff; font-size: 13.5px; font-weight: 600;
  padding: 11px 18px; border-radius: 10px; box-shadow: 0 10px 30px rgba(17, 24, 39, .3);
  opacity: 0; visibility: hidden; transition: opacity .2s, transform .2s, visibility .2s;
  max-width: calc(100vw - 32px); text-align: center;
}
.fav-toast.is-open { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

/* ── cabinet section ── */
.acct-fav__row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.acct-fav__ic { display: inline-flex; color: var(--primary); }
.acct-fav__ic svg { width: 24px; height: 24px; }
.acct-fav__ic .fav-heart__path { fill: currentColor; }
.acct-fav__text { flex: 1 1 200px; font-weight: 600; }
.acct-fav__row .btn { text-decoration: none; white-space: nowrap; }
