/* =============================================================================
   WOW Wishlist — Stylesheet v2.1
   Design tokens live in assets/core.css (WOW Plugins → Стилове).
   ============================================================================= */

/* ---------------------------------------------------------------------------
   Toggle button
   --------------------------------------------------------------------------- */
.wishlist-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--wow-toggle-padding);
  color: var(--wow-color-inactive);
  font-family: var(--wow-font-family);
  font-size: var(--wow-font-size);
  font-weight: var(--wow-font-weight-btn);
  text-transform: var(--wow-text-transform-btn);
  letter-spacing: var(--wow-letter-spacing-btn);
  line-height: 1;
  transition: color var(--wow-transition), background var(--wow-transition), transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.wishlist-btn:hover { color: var(--wow-color-primary-hover); }
.wishlist-btn:active { transform: scale(0.92); }
.wishlist-btn:focus-visible { outline: 2px solid var(--wow-color-primary); outline-offset: 2px; }

.wishlist-btn.is-active { color: var(--wow-color-primary); }

.wishlist-btn .wow-icon { fill: transparent; transition: fill var(--wow-transition); }
.wishlist-btn.is-active .wow-icon,
.wishlist-btn.is-active svg,
.wishlist-btn.is-active .wishlist-icon { fill: currentColor; }

.wishlist-btn.is-active .wow-icon { animation: wow-pop 0.35s ease; }

@keyframes wow-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* Text style: outlined pill */
.wow-wl-btn--text,
.wow-wl-btn--icon_text {
  border: 1px solid currentColor;
  border-radius: var(--wow-btn-radius);
  padding: var(--wow-btn-padding);
  font-size: var(--wow-font-size-sm);
}

/* ---------------------------------------------------------------------------
   Header counter
   --------------------------------------------------------------------------- */
.wow-wc__link {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  text-decoration: none;
  color: inherit;
  position: relative;
}

.wow-wc__icon { display: inline-flex; align-items: center; line-height: 1; }

.wishlist-header-count,
.wow-wc__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.45em;
  height: 1.45em;
  padding: 0 0.35em;
  background: var(--wow-color-primary);
  color: var(--wow-color-on-primary);
  font-family: var(--wow-font-family);
  font-size: var(--wow-font-size-badge);
  font-weight: var(--wow-font-weight-badge);
  border-radius: var(--wow-badge-radius);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: opacity var(--wow-transition), transform var(--wow-transition);
}

.wishlist-header-count.is-empty:not(.wow-show-empty),
.wow-wc__badge.is-empty:not(.wow-show-empty),
.wow-wc__count.is-empty:not(.wow-show-empty) {
  opacity: 0;
  transform: scale(0.6);
  pointer-events: none;
}

#wishlist-count { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------------------
   List
   --------------------------------------------------------------------------- */
#wishlist-products,
.wow-wl-list {
  display: flex;
  flex-direction: column;
}

.wishlist-row {
  display: grid;
  grid-template-columns: calc(var(--ww-thumb-size, var(--wow-thumb-size)) + 8px) 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: var(--ww-row-gap, var(--wow-row-padding));
  border-bottom: 1px solid var(--ww-row-border, var(--wow-color-border));
  animation: wow-fadein 0.2s ease both;
  transition: opacity var(--wow-transition);
}

.wishlist-row:first-child { border-top: 1px solid var(--ww-row-border, var(--wow-color-border)); }
.wishlist-row.is-removing { opacity: 0.35; pointer-events: none; }
.wishlist-row.is-out-of-stock .wishlist-thumb { opacity: 0.55; }

@keyframes wow-fadein {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.wishlist-image {
  display: block;
  border-radius: var(--wow-thumb-radius);
  overflow: hidden;
  line-height: 0;
}

.wishlist-thumb,
.wishlist-thumb--placeholder {
  display: block;
  width: var(--ww-thumb-size, var(--wow-thumb-size));
  height: var(--ww-thumb-size, var(--wow-thumb-size));
  object-fit: cover;
  border-radius: var(--ww-thumb-radius, var(--wow-thumb-radius));
}

.wishlist-thumb--placeholder { background: var(--wow-color-placeholder); }

.wishlist-content { min-width: 0; }

.wishlist-title {
  display: block;
  font-family: var(--wow-font-family);
  font-size: var(--ww-title-size, var(--wow-font-size));
  font-weight: var(--ww-title-weight, var(--wow-font-weight-title));
  letter-spacing: var(--wow-letter-spacing-title);
  text-transform: var(--ww-title-transform, var(--wow-text-transform-title));
  color: var(--ww-title-color, var(--wow-color-text));
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--wow-transition);
}

.wishlist-title:hover { color: var(--wow-color-primary); }

.wishlist-price {
  display: block;
  margin-top: 3px;
  font-size: 0.95em;
  font-weight: 600;
}
.wishlist-price ins { text-decoration: none; }
.wishlist-price del { opacity: 0.5; font-weight: 400; margin-right: 4px; }

.wishlist-variation {
  display: block;
  font-size: 0.8em;
  color: var(--wow-color-muted);
  margin-top: 2px;
  line-height: 1.4;
}
.wishlist-variation--none { font-style: italic; }

.wishlist-in-cart-tag,
.wishlist-stock-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
  margin-top: 0.35rem;
  margin-right: 0.35rem;
  padding: 0.2em 0.55em;
  font-family: var(--wow-font-family);
  font-size: var(--wow-font-size-sm);
  font-weight: var(--wow-font-weight-tag);
  border-radius: 999px;
}
.wishlist-in-cart-tag { background: #d1fae5; color: #065f46; }
.wishlist-stock-tag   { background: #f3f4f6; color: #6b7280; }

.wishlist-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: flex-end;
}

.wishlist-addcart,
.wishlist-remove,
.wow-wl-footer button,
.wow-wl-shared__save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  font-family: var(--wow-font-family);
  font-size: var(--wow-font-size-sm);
  font-weight: var(--wow-font-weight-btn);
  text-transform: var(--wow-text-transform-btn);
  line-height: 1.2;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: var(--wow-btn-radius);
  padding: var(--wow-btn-padding);
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--wow-transition), color var(--wow-transition), border-color var(--wow-transition), opacity var(--wow-transition);
}

.wishlist-addcart {
  background: var(--ww-atc-bg, var(--wow-color-primary));
  color: var(--ww-atc-color, var(--wow-color-on-primary));
  font-size: var(--ww-atc-size, var(--wow-font-size-sm));
  font-weight: var(--ww-atc-weight, var(--wow-font-weight-btn));
  text-transform: var(--ww-atc-transform, var(--wow-text-transform-btn));
  border-radius: var(--ww-atc-radius, var(--wow-btn-radius));
  padding: var(--ww-atc-padding, var(--wow-btn-padding));
}
.wishlist-addcart:hover { background: var(--wow-color-primary-hover); color: var(--wow-color-on-primary); }

.wishlist-addcart--view {
  background: transparent;
  color: var(--wow-color-text);
  border-color: var(--wow-color-border);
}
.wishlist-addcart--view:hover { background: transparent; color: var(--wow-color-primary); border-color: currentColor; }

.wishlist-addcart.is-in-cart,
.wishlist-addcart.is-in-cart:hover,
.wishlist-addcart.is-in-cart:focus {
  background: var(--ww-incart-bg, var(--wow-color-success)) !important;
  color: var(--ww-incart-color, #fff) !important;
  border-color: var(--ww-incart-bg, var(--wow-color-success)) !important;
  cursor: default;
}

.wishlist-addcart:disabled,
.wow-wl-footer button:disabled { opacity: 0.65; cursor: progress; }
.is-loading { position: relative; }

.wishlist-remove {
  background: transparent;
  color: var(--ww-rm-color, var(--wow-color-muted));
  border-color: var(--ww-rm-border, var(--wow-color-border));
  font-size: var(--ww-rm-size, var(--wow-font-size-sm));
  font-weight: var(--ww-rm-weight, var(--wow-font-weight-btn));
  text-transform: var(--ww-rm-transform, var(--wow-text-transform-btn));
  border-radius: var(--ww-rm-radius, var(--wow-btn-radius));
  padding: var(--ww-rm-padding, var(--wow-btn-padding));
}
.wishlist-remove:hover { color: var(--wow-color-danger); border-color: currentColor; }

.wishlist-empty,
.wishlist-error,
.wishlist-loading {
  padding: 2rem 0;
  margin: 0;
  color: var(--wow-color-muted);
  font-size: var(--wow-font-size);
}
.wishlist-error { color: var(--wow-color-danger); }

/* Footer: add all / share / clear */
.wow-wl-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.25rem;
}
.wow-wl-footer [hidden] { display: none !important; }

.wow-wl-addall {
  background: var(--wow-color-primary);
  color: var(--wow-color-on-primary);
}
.wow-wl-addall:hover { background: var(--wow-color-primary-hover); }

.wow-wl-share,
#wishlist-clear,
.wow-wl-clear {
  background: transparent;
  color: var(--wow-color-muted);
  border-color: var(--wow-color-border) !important;
}
.wow-wl-share:hover { color: var(--wow-color-primary); border-color: currentColor !important; }
#wishlist-clear:hover,
.wow-wl-clear:hover { color: var(--wow-color-danger); border-color: currentColor !important; }
.wow-wl-clear { margin-left: auto; }

/* Legacy markup: clear button outside the footer */
.wow-wp > #wishlist-clear { margin-top: 1.25rem; }
#wishlist-clear[hidden] { display: none !important; }

/* Shared list banner */
.wow-wl-shared {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.8rem 1rem;
  background: var(--wow-color-primary-light);
  border-radius: var(--wow-notice-radius);
}
.wow-wl-shared[hidden] { display: none; }
.wow-wl-shared__title { font-family: var(--wow-font-family); }
.wow-wl-shared__save { background: var(--wow-color-primary); color: var(--wow-color-on-primary); }

@media (max-width: 480px) {
  .wishlist-row {
    grid-template-columns: calc(var(--ww-thumb-size, var(--wow-thumb-size)) - 16px) 1fr;
  }
  .wishlist-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: flex-end;
  }
  .wow-wl-clear { margin-left: 0; }
}

/* ---------------------------------------------------------------------------
   Notices (shared by all modules)
   --------------------------------------------------------------------------- */
.wow-notices {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: var(--wow-z-notice);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.6rem;
  pointer-events: none;
}

body:has(.wow-compare-bar.is-visible) .wow-notices { bottom: calc(1.5rem + 84px); }

.wow-notice {
  width: min(360px, calc(100vw - 2rem));
  background: var(--wow-notice-bg);
  border-left: 4px solid var(--wow-notice-accent);
  border-radius: var(--wow-notice-radius);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.13);
  padding: 0.9rem 1rem;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}
.wow-notice.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }

.wow-notice--wishlist { --wow-notice-accent: var(--wow-color-primary); }
.wow-notice--cart     { --wow-notice-accent: var(--wow-color-success); }
.wow-notice--remove   { --wow-notice-accent: #888; }
.wow-notice--info     { --wow-notice-accent: #3b82f6; }
.wow-notice--error    { --wow-notice-accent: var(--wow-color-danger); background: #fff5f5; }

.wow-notice__inner { display: flex; align-items: flex-start; gap: 0.7rem; }
.wow-notice__icon {
  font-size: 1.3rem;
  line-height: 1.2;
  flex-shrink: 0;
  color: var(--wow-notice-accent);
}
.wow-notice__body { flex: 1; min-width: 0; }

.wow-notice__title {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--wow-color-text-notice);
  line-height: 1.4;
}
.wow-notice__title em { font-style: normal; color: var(--wow-notice-accent); }

.wow-notice__text {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #666;
}

.wow-notice__action {
  align-self: center;
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--wow-color-border);
  border-radius: var(--wow-btn-radius);
  padding: 0.3em 0.7em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--wow-notice-accent);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.wow-notice__action:hover { border-color: currentColor; }

.wow-notice__close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  color: #bbb;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.wow-notice__close:hover { color: #555; }

@media (max-width: 480px) {
  .wow-notices { right: 1rem; left: 1rem; bottom: 1rem; align-items: stretch; }
  .wow-notice { width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .wishlist-row, .wishlist-btn.is-active .wow-icon { animation: none; }
  .wow-notice { transition: opacity 0.2s ease; transform: none; }
}
