:root{
  --epf-icon-size: 18px;
  --epf-count-size: 13px;
  --epf-gap: 6px;

  --epf-color: #111111;
  --epf-color-liked: #b30000;

  --epf-bg: transparent;
  --epf-bg-liked: transparent;

  --epf-pad-x: 0px;
  --epf-pad-y: 0px;

  --epf-border-width: 0px;
  --epf-border-color: transparent;
  --epf-radius: 0px;

  /* Loop positioning (used for the overlay inside the product card) */
  --epf-loop-bottom: 10px;
  --epf-loop-left: 10px;
  --epf-loop-z: 1;

  /* Backward compatible (older versions used top/right) */
  --epf-loop-top: 10px;
  --epf-loop-right: 10px;

  /* Count colors */
  --epf-count-color: #111111;
  --epf-count-color-liked: #b30000;

  /* Heart outline */
  --epf-heart-stroke: #111111;        /* unliked outline */
  --epf-heart-stroke-liked: #e11d48;  /* liked outline */
}

/* Core like button */
.epf-like{
  -webkit-tap-highlight-color: transparent;
  appearance: none;
  touch-action: manipulation;
  user-select: none;
  outline: none;
  display: inline-flex;
  align-items: center;
  gap: var(--epf-gap);

  background: var(--epf-bg);
  border: var(--epf-border-width) solid var(--epf-border-color);
  padding: var(--epf-pad-y) var(--epf-pad-x);
  border-radius: var(--epf-radius);

  cursor: pointer;
  line-height: 1;
  color: var(--epf-color);
  font: inherit;
}

.epf-like__icon{
  font-size: var(--epf-icon-size);
  line-height: 1;
}

/* count uses its own colors (not inherited from the button) */
.epf-like__count{
  font-size: var(--epf-count-size);
  line-height: 1;
  color: var(--epf-count-color);
}

/* Hide count when empty (we set it to "" for 0 and for "just liked" user) */
.epf-like__count:empty{
  display: none;
}

.epf-like.is-liked .epf-like__count{
  color: var(--epf-count-color-liked);
}

.epf-like.is-liked{
  color: var(--epf-color-liked);
  background: var(--epf-bg-liked);
}

.epf-like.is-busy{
  opacity: 0.6;
  pointer-events: none;
}

/* Loop overlay: anchor to the content row (Kadence row) */
.epf-like--loop{
  position: absolute;
  bottom: var(--epf-loop-bottom);
  right: var(--epf-loop-right, var(--epf-loop-left));
  top: auto;
  left: auto;
  z-index: var(--epf-loop-z);
}

/* We add .epf-like-anchor to the content row (or a safe fallback) via JS */
.epf-like-anchor{
  position: relative;
}

/* If theme uses the image link directly */
a.woocommerce-loop-image-link.woocommerce-loop-product__link,
.woocommerce-loop-image-link,
.kwt-image-wrap{
  position: relative;
}

/* Single */
.epf-single-like-wrap{
  margin: 8px 0 16px;
}

/* Favorites page */
.epf-favorites__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.epf-favorites__title {
  margin: 0;
}

.epf-favorites__status{
  margin: 8px 0 16px;
  opacity: 0.75;
}

.epf-favorites__content ul.products{
  margin-top: 0;
}

/* Remove bullet points from product grid - match product loop page */
.epf-favorites__content ul.products,
.epf-shared-grid ul.products {
  list-style: none !important;
  padding-left: 0 !important;
  margin-left: 0 !important;
}

/* Favorites grid: 2 products per row on mobile */
@media (max-width: 767px) {
  .epf-favorites__content ul.products,
  .epf-shared-grid ul.products {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px !important;
  }

  .epf-favorites__content ul.products li.product,
  .epf-shared-grid ul.products li.product {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}

.epf-favorites__content ul.products li,
.epf-shared-grid ul.products li {
  list-style: none !important;
  list-style-type: none !important;
}

.epf-favorites__content ul.products li::before,
.epf-shared-grid ul.products li::before,
.epf-favorites__content ul.products li::marker,
.epf-shared-grid ul.products li::marker {
  content: none !important;
  display: none !important;
}

/* Hide product action wrap (variation select) in favorites grid - matches product loop page */
.epf-favorites__content .product-action-wrap,
.epf-shared-grid .product-action-wrap {
  display: none !important;
}

/* Share button in favorites header */
.epf-favorites .epf-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  border-radius: 0;
  border: 0;
  background: transparent;
  color: #111;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.2s ease;
}

.epf-favorites .epf-share-btn:hover {
  opacity: 0.7;
}

.epf-favorites .epf-share-btn__icon {
  width: 27px;
  height: 27px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.epf-favorites .epf-share-btn__icon svg {
  width: 27px;
  height: 27px;
  display: block;
}

/* Hide share button when no favorites */
.epf-favorites[data-epf-has-items="false"] .epf-share-btn {
  display: none;
}

/* Empty state container - hidden by default, shown when no items */
.epf-favorites__empty {
  display: none;
}

.epf-favorites[data-epf-has-items="false"] .epf-favorites__empty {
  display: block;
}

/* Hide status when showing empty state */
.epf-favorites[data-epf-has-items="false"] .epf-favorites__status {
  display: none;
}

/* Empty state styling */
.epf-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  max-width: 400px;
  margin: 0 auto;
}

.epf-empty-state__icon {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  color: #ccc;
}

.epf-empty-state__icon svg {
  width: 48px;
  height: 48px;
}

.epf-empty-state__headline {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 8px 0;
  color: #111;
}

.epf-empty-state__text {
  font-size: 14px;
  color: #666;
  margin: 0 0 24px 0;
  line-height: 1.5;
}

.epf-empty-state__cta {
  display: inline-block;
  padding: 12px 24px;
  background: #111;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s ease;
}

.epf-empty-state__cta:hover,
.epf-empty-state__cta:focus {
  background: #333;
  color: #fff;
}

@media (max-width: 480px) {
  .epf-empty-state {
    padding: 40px 16px;
  }

  .epf-empty-state__icon {
    width: 100px;
    height: 100px;
  }

  .epf-empty-state__icon svg {
    width: 40px;
    height: 40px;
  }

  .epf-empty-state__headline {
    font-size: 18px;
  }
}

/* Prevent theme/browser active/focus styles bleeding into the icon */
.epf-like:focus,
.epf-like:focus-visible,
.epf-like:active{
  outline: none !important;
  box-shadow: none !important;
  border-color: var(--epf-border-color) !important;
}

.epf-like:not(.is-liked):focus,
.epf-like:not(.is-liked):focus-visible,
.epf-like:not(.is-liked):active{
  background: var(--epf-bg) !important;
}

.epf-like.is-liked:focus,
.epf-like.is-liked:focus-visible,
.epf-like.is-liked:active{
  background: var(--epf-bg-liked) !important;
  border-color: var(--epf-border-color) !important;
}

/* Heart outline */
.epf-like {
  --epf-heart-stroke-current: var(--epf-heart-stroke, var(--epf-border-color));
}
.epf-like.is-liked {
  --epf-heart-stroke-current: var(--epf-heart-stroke-liked, var(--epf-heart-stroke, var(--epf-border-color)));
}

.epf-like__icon {
  -webkit-text-stroke: 1px var(--epf-heart-stroke-current);
  text-shadow:
    1px 0 var(--epf-heart-stroke-current),
   -1px 0 var(--epf-heart-stroke-current),
    0 1px var(--epf-heart-stroke-current),
    0 -1px var(--epf-heart-stroke-current);
}
