/**
 * BreakColorUI Wishlist — shared styles
 */

/* --- Toggle button base ------------------------------------------- */

.bkf-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  position: relative;
  z-index: 2;
  line-height: 1;
  font: inherit;
  color: inherit;
}

.bkf-toggle:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  border-radius: 50%;
}

/* --- Icon wrapper (keeps filled icon positioned over outline) ----- */

.bkf-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* --- Icons -------------------------------------------------------- */

.bkf-icon {
  width: 22px;
  height: 22px;
  transition: opacity 0.2s ease;
}

.bkf-icon-outline {
  color: #666;
}

.bkf-icon-filled {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #e53e3e;
  opacity: 0;
}

/* Hover — not favorited: change outline color */
.bkf-toggle:hover .bkf-icon-outline {
  color: #e53e3e;
}

/* Hover — favorited: change filled color */
.bkf-toggle.bkf-active:hover .bkf-icon-filled {
  color: #b91c1c;
}

/* Active state */
.bkf-toggle.bkf-active .bkf-icon-outline {
  opacity: 0;
}

.bkf-toggle.bkf-active .bkf-icon-filled {
  opacity: 1;
}

/* --- Heart pop animation ------------------------------------------ */

@keyframes bkf-heart-pop {
  0%   { transform: translate(-50%, -50%) scale(1); }
  30%  { transform: translate(-50%, -50%) scale(1.35); }
  60%  { transform: translate(-50%, -50%) scale(0.95); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

@media (prefers-reduced-motion: no-preference) {
  .bkf-toggle.bkf-animating .bkf-icon-filled {
    animation: bkf-heart-pop 0.35s ease;
  }
}

/* --- Icon set switching (heart shown by default) ------------------ */

.bkf-icon-set {
  display: contents;
}

.bkf-icon-set-star,
.bkf-icon-set-bookmark,
.bkf-icon-set-custom {
  display: none;
}

/* --- Loop toggle (overlay on product image) ----------------------- */

.bkf-loop-toggle {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  background: none;
  border: none;
  padding: 0;
}

.bkf-loop-toggle .bkf-icon {
  width: 24px;
  height: 24px;
}

/* --- Counter badge ------------------------------------------------ */

.bkf-counter-wrap,
.bkf-counter-wrap:hover,
.bkf-counter-wrap:focus,
.bkf-counter-wrap:visited {
  text-decoration: none;
}

.bkf-counter-wrap {
  display: flex;
  align-items: center;
  position: relative;
  color: #4b5563;
  padding: 13px;
}

.bkf-counter-wrap:hover .bkf-counter-badge {
  background-color: var(--bde-woo-base-primary-color-hover);
  color: var(--bde-woo-base-text-on-primary-color);
}

.bkf-counter-icon {
  display: inline-block;
  position: relative;
  width: 28px;
  height: 28px;
}

.bkf-counter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: var(--bde-woo-typography__size-standard);
  font-family: var(--bde-woo-typography__size-standard-font-family);
  color: var(--bde-woo-base-text-on-primary-color);
  line-height: 1;
  background-color: var(--bde-woo-base-primary-color);
  border-radius: 100px;
  margin-left: var(--bde-woo-base-standard-gaps);
  padding: 4px 8px;
  font-weight: var(--bde-woo-typography-font-weight-medium);
  transition: var(--bde-woo-base-transition);
  flex-shrink: 0;
}

/* --- Favorites List: Header --------------------------------------- */

.bkf-favorites-header {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.bkf-favorites-header-text {
  font-size: 16px;
  font-weight: 500;
  color: var(--bde-woo-base-text-color, #374151);
}

.bkf-header-count {
  font-weight: 700;
}

/* --- Favorites List: Actions bar ---------------------------------- */

.bkf-favorites-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.bkf-share-btn,
.bkf-add-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid var(--bde-woo-base-primary-color, #4b5563);
  border-radius: 6px;
  background: none;
  color: var(--bde-woo-base-primary-color, #4b5563);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  line-height: 1;
  text-decoration: none;
}

.bkf-share-btn:hover,
.bkf-add-all-btn:hover {
  background-color: var(--bde-woo-base-primary-color, #4b5563);
  color: var(--bde-woo-base-text-on-primary-color, #fff);
}

.bkf-share-wrap {
  position: relative;
  display: inline-block;
}

.bkf-share-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
  min-width: 200px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .1);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bkf-share-menu[hidden] { display: none; }

@media (max-width: 767px) {
  .bkf-share-menu {
    position: fixed;
    top: auto;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: min(320px, calc(100vw - 24px));
    min-width: 0;
    z-index: 9999;
  }
}

.bkf-share-menu-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1.2;
  transition: background-color .15s ease, color .15s ease;
}

.bkf-share-menu-item:hover,
.bkf-share-menu-item:focus-visible {
  background-color: rgba(0, 0, 0, .05);
  color: inherit;
}

.bkf-btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Share copied tooltip */
.bkf-share-btn[data-copied]::after {
  content: attr(data-copied);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: #fff;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  animation: bkf-tooltip-in 0.2s ease;
}

@keyframes bkf-tooltip-in {
  from { opacity: 0; transform: translateX(-50%) translateY(4px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Add all loading state */
.bkf-add-all-btn.bkf-loading {
  opacity: 0.6;
  pointer-events: none;
}

/* --- Favorites List: Variation badges ----------------------------- */

.bkf-variation-badges {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.bkf-variation-badge,
.bkf-variation-more {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
  background: var(--hcl-neutral-3, #f3f4f6);
  color: var(--hcl-neutral-12, #1f2937);
  transition: background 0.15s ease;
}

.bkf-variation-badge a {
  color: inherit;
  text-decoration: none;
  display: inline-block;
}

.bkf-variation-badge:hover {
  background: var(--hcl-neutral-4, #e5e7eb);
}

.bkf-variation-badges .bkf-badge-hidden {
  display: none;
}

.bkf-variation-badges.bkf-expanded .bkf-badge-hidden {
  display: inline-block;
}

.bkf-variation-badges.bkf-expanded .bkf-variation-more {
  display: none;
}

.bkf-variation-more {
  padding: 0;
  background: transparent;
}

.bkf-variation-more-btn {
  background: var(--hcl-neutral-4, #e5e7eb);
  color: var(--hcl-neutral-12, #1f2937);
  border: 0;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
  transition: background 0.15s ease;
}

.bkf-variation-more-btn:hover {
  background: var(--hcl-neutral-5, #d1d5db);
}

/* --- Card removal animation on favorites page ---------------------- */

.bde-favorites-list li.product.bkf-removing {
  transition: opacity 0.3s ease, transform 0.3s ease;
  opacity: 0;
  transform: scale(0.95);
}

/* --- Empty state -------------------------------------------------- */

.bkf-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 20px;
  color: #888;
  font-size: 16px;
  gap: 12px;
}

.bkf-empty-icon svg {
  display: block;
  width: 48px;
  height: 48px;
  fill: currentColor;
}

.bkf-empty-icon {
  line-height: 0;
  color: inherit;
}

/* --- Consent modal ------------------------------------------------
 * Customisable via CSS variables — override any of these in your theme
 * or Breakdance Global Settings → Custom CSS to restyle without editing
 * the plugin. All defaults inherit from Breakdance button tokens when set.
 * ------------------------------------------------------------------- */

.bkf-consent-modal {
  /* Surface */
  --bkf-consent-bg: #fff;
  --bkf-consent-fg: #111827;
  --bkf-consent-muted: #4b5563;
  --bkf-consent-radius: 14px;
  --bkf-consent-radius-mobile: 16px;
  --bkf-consent-backdrop: rgba(15, 23, 42, 0.45);
  --bkf-consent-shadow: 0 20px 50px -12px rgba(15, 23, 42, 0.35);
  --bkf-consent-max-width: 440px;
  --bkf-consent-z: 100000;

  /* Primary button (accept) — follow BD tokens when present. */
  --bkf-consent-accept-bg: var(--bde-button-primary-background-color, #111827);
  --bkf-consent-accept-fg: var(--bde-button-primary-text-color, #fff);
  --bkf-consent-accept-bg-hover: var(--bde-button-primary-background-color-hover, #000);
  --bkf-consent-accept-fg-hover: var(--bde-button-primary-text-color-hover, #fff);
  --bkf-consent-accept-border: var(--bde-button-primary-border-color, transparent);
  --bkf-consent-accept-border-hover: var(--bde-button-primary-border-color-hover, transparent);

  /* Ghost button (dismiss) — BD secondary tokens when present. */
  --bkf-consent-dismiss-bg: var(--bde-button-secondary-background-color, #fff);
  --bkf-consent-dismiss-fg: var(--bde-button-secondary-text-color, #374151);
  --bkf-consent-dismiss-bg-hover: var(--bde-button-secondary-background-color-hover, #f9fafb);
  --bkf-consent-dismiss-fg-hover: var(--bde-button-secondary-text-color-hover, #111827);
  --bkf-consent-dismiss-border: var(--bde-button-secondary-border-color, #d1d5db);
  --bkf-consent-dismiss-border-hover: var(--bde-button-secondary-border-color-hover, #9ca3af);

  --bkf-consent-btn-radius: var(--bde-button-border-radius, 10px);
  --bkf-consent-btn-font-weight: var(--bde-button-font-weight, 600);

  position: fixed;
  inset: 0;
  z-index: var(--bkf-consent-z);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.bkf-consent-modal--open {
  opacity: 1;
  pointer-events: auto;
}

.bkf-consent-modal__backdrop {
  position: absolute;
  inset: 0;
  background: var(--bkf-consent-backdrop);
  backdrop-filter: blur(2px);
}

.bkf-consent-modal__card {
  position: relative;
  background: var(--bkf-consent-bg);
  color: var(--bkf-consent-fg);
  border-radius: var(--bkf-consent-radius-mobile) var(--bkf-consent-radius-mobile) 0 0;
  padding: 26px 24px 22px;
  max-width: var(--bkf-consent-max-width);
  width: calc(100% - 24px);
  margin: 0 12px;
  box-shadow: 0 -10px 40px -10px rgba(15, 23, 42, 0.25);
  transform: translateY(20px);
  transition: transform 0.22s cubic-bezier(.2,.9,.3,1);
}

.bkf-consent-modal--open .bkf-consent-modal__card {
  transform: translateY(0);
}

@media (min-width: 640px) {
  .bkf-consent-modal {
    align-items: center;
  }
  .bkf-consent-modal__card {
    border-radius: var(--bkf-consent-radius);
    box-shadow: var(--bkf-consent-shadow);
    padding: 28px 28px 24px;
  }
}

.bkf-consent-modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--bkf-consent-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.15s ease, color 0.15s ease;
}
.bkf-consent-modal__close:hover {
  background: rgba(0,0,0,.06);
  color: var(--bkf-consent-fg);
}

.bkf-consent-modal__title {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 8px;
  line-height: 1.3;
  color: var(--bkf-consent-fg);
}

.bkf-consent-modal__body {
  font-size: 14px;
  line-height: 1.55;
  color: var(--bkf-consent-muted);
  margin: 0 0 20px;
}

.bkf-consent-modal__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.bkf-consent-modal__btn {
  flex: 1 1 140px;
  padding: 11px 18px;
  border-radius: var(--bkf-consent-btn-radius);
  font-size: 14px;
  font-weight: var(--bkf-consent-btn-font-weight);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  font-family: inherit;
}

.bkf-consent-modal__btn--primary {
  background: var(--bkf-consent-accept-bg);
  color: var(--bkf-consent-accept-fg);
  border-color: var(--bkf-consent-accept-border);
}
.bkf-consent-modal__btn--primary:hover {
  background: var(--bkf-consent-accept-bg-hover);
  color: var(--bkf-consent-accept-fg-hover);
  border-color: var(--bkf-consent-accept-border-hover);
}

.bkf-consent-modal__btn--ghost {
  background: var(--bkf-consent-dismiss-bg);
  color: var(--bkf-consent-dismiss-fg);
  border-color: var(--bkf-consent-dismiss-border);
}
.bkf-consent-modal__btn--ghost:hover {
  background: var(--bkf-consent-dismiss-bg-hover);
  color: var(--bkf-consent-dismiss-fg-hover);
  border-color: var(--bkf-consent-dismiss-border-hover);
}

.bkf-consent-modal__footer {
  text-align: center;
  margin-top: 14px;
  font-size: 12px;
}

.bkf-consent-manage {
  color: var(--bkf-consent-muted);
  text-decoration: underline;
}
.bkf-consent-manage:hover { color: var(--bkf-consent-fg); }

/* --- Toast (generic, bottom-right) -------------------------------- */

.bkf-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 10px;
  background: #222;
  color: #fff;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.12);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
}

.bkf-toast--visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.bkf-toast--error {
  background: #fdecec;
  color: #7a1f1f;
  border: 1px solid #f5c2c2;
}

.bkf-toast--info {
  background: #eef4fb;
  color: #1f3a5a;
  border: 1px solid #c8dcef;
}

@media (prefers-reduced-motion: reduce) {
  .bkf-toast {
    transition: opacity 0.01s linear;
    transform: none;
  }
  .bkf-toast--visible {
    transform: none;
  }
}
