/* ==========================================================================
   Favorites (wishlist) — header heart + badge, product-card heart states.
   Drawer styles land in Block 2.
   ========================================================================== */

/* Header heart trigger (.masthead-buttons > .favorites-mini). */
.favorites-mini {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: var(--color-black);
  transition: color 0.16s ease;
}

.favorites-mini:hover,
.favorites-mini.is-active {
  color: var(--color-accent);
}

/* Count badge — shared circle style with the mini-cart's .cart-count
   (same size / offset / ring), so both header counters match and line up. */
.favorites-mini__count {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  color: var(--color-white);
  background: var(--color-accent);
  border-radius: 999px;
  box-shadow: 0 0 0 2px var(--color-white);
}

/* Product-card heart — gray by default (style.css .wish-button), accent + filled
   once the product is in the favourites list. */
.wish-button > a {
  cursor: pointer;
}

.wish-button > a.is-active {
  color: var(--color-accent);
}

.wish-button > a.is-active:hover {
  color: var(--color-black);
}

/* ==========================================================================
   Favorites drawer — right slide-in panel (opened by the header heart).
   Slide/overlay driven by .is-open (no display:none animation).
   ========================================================================== */
.favorites-drawer__overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.favorites-drawer.is-open .favorites-drawer__overlay {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.favorites-drawer__panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 10001;
  width: 420px;
  max-width: 92vw;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--color-white);
  box-shadow: -10px 0 40px -12px rgba(0, 0, 0, 0.25);
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.favorites-drawer.is-open .favorites-drawer__panel {
  transform: translateX(0);
}

.favorites-drawer__head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--color-gray-light);
}

.favorites-drawer__title {
  font-size: 18px;
  font-weight: 600;
}

.favorites-drawer__close {
  display: inline-flex;
  padding: 6px;
  font-size: 22px;
  color: var(--color-gray-dark);
  background: none;
  border: 0;
  cursor: pointer;
  transition: color 0.16s ease;
}

.favorites-drawer__close:hover {
  color: var(--color-black);
}

.favorites-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 24px 24px;
}

/* Empty + loading states */
.favorites-drawer__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 64px 16px;
  text-align: center;
  color: var(--color-gray-dark);
}

.favorites-drawer__empty .iconify {
  font-size: 48px;
  opacity: 0.5;
}

.favorites-drawer__loading {
  display: flex;
  justify-content: center;
  padding: 48px 0;
}

.favorites-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--color-gray-light);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: favorites-spin 0.7s linear infinite;
}

@keyframes favorites-spin {
  to {
    transform: rotate(360deg);
  }
}

/* List items */
.favorites-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--color-gray-light);
}

.favorites-item__media {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
}

.favorites-item__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.favorites-item__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.favorites-item__name {
  font-weight: 500;
  line-height: 1.35;
  color: var(--color-black);
  transition: color 0.16s ease;
}

.favorites-item__name:hover {
  color: var(--color-accent);
}

.favorites-item__price {
  font-weight: 600;
  color: var(--color-black);
}

.favorites-item__price del {
  margin-right: 8px;
  font-weight: 400;
  color: var(--color-gray-dark);
}

.favorites-item__remove {
  flex-shrink: 0;
  display: inline-flex;
  padding: 4px;
  font-size: 18px;
  color: var(--color-gray);
  background: none;
  border: 0;
  cursor: pointer;
  transition: color 0.16s ease;
}

.favorites-item__remove:hover {
  color: var(--color-accent);
}

/* WC appends a "view cart" link after a successful add — redundant here. */
.favorites-item .added_to_cart {
  display: none;
}

/* Lock the page behind the open drawer. */
body.favorites-open {
  overflow: hidden;
}

/* ==========================================================================
   Favorites inline block (My-Account «Обране» tab) — reuses .favorites-item.
   ========================================================================== */
.favorites-page__loading {
  display: flex;
  justify-content: center;
  padding: 48px 0;
}

.favorites-page__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 64px 16px;
  text-align: center;
  color: var(--color-gray-dark);
}

.favorites-page__empty .iconify {
  font-size: 48px;
  opacity: 0.5;
}

/* Drop the row divider on the first item so the list sits flush with the tab. */
.favorites-page__list .favorites-item:first-child {
  padding-top: 0;
}
