.wewl-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--wewl-button-gap, .4em);
  min-height: 2.4em;
  padding: var(--wewl-button-padding-y, .55em) var(--wewl-button-padding-x, .9em);
  border: var(--wewl-button-border-width, 1px) solid var(--wewl-button-inactive-border, currentColor);
  border-radius: var(--wewl-button-radius, 3px);
  background: var(--wewl-button-inactive-bg, transparent);
  color: var(--wewl-button-inactive-color, inherit);
  font: inherit;
  font-size: var(--wewl-button-font-size, 1em);
  line-height: 1.2;
  cursor: pointer;
  touch-action: manipulation;
  text-decoration: none;
  transition: color .15s ease, background-color .15s ease, border-color .15s ease, opacity .15s ease;
}

.wewl-button:hover,
.wewl-button:focus {
  border-color: var(--wewl-button-hover-border, var(--wewl-button-inactive-border, currentColor));
  background: var(--wewl-button-hover-bg, var(--wewl-button-inactive-bg, transparent));
  color: var(--wewl-button-hover-color, var(--wewl-button-inactive-color, inherit));
  text-decoration: none;
}

.wewl-button.is-active {
  border-color: var(--wewl-button-active-border, var(--wewl-button-inactive-border, currentColor));
  background: var(--wewl-button-active-bg, var(--wewl-button-inactive-bg, transparent));
  color: var(--wewl-button-active-color, var(--wewl-button-inactive-color, inherit));
}

.wewl-button.is-active:hover,
.wewl-button.is-active:focus {
  border-color: var(--wewl-button-hover-border, var(--wewl-button-active-border, currentColor));
  background: var(--wewl-button-hover-bg, var(--wewl-button-active-bg, transparent));
  color: var(--wewl-button-hover-color, var(--wewl-button-active-color, inherit));
}

.wewl-button.is-loading,
.wewl-remove.is-loading {
  opacity: .65;
  pointer-events: none;
}

.wewl-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-width: 1em;
  min-height: 1em;
  font-size: var(--wewl-button-icon-size, 1.12em);
  line-height: 1;
  color: inherit;
  pointer-events: none;
}

.wewl-icon-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  line-height: 1;
  color: inherit;
  opacity: 1;
  visibility: visible;
  transition: opacity .12s ease, visibility .12s ease;
}

.wewl-icon-state--remove {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
}

.wewl-button.is-active .wewl-icon-state--add {
  opacity: 0;
  visibility: hidden;
}

.wewl-button.is-active .wewl-icon-state--remove {
  opacity: 1;
  visibility: visible;
}

.wewl-button--icon-fontawesome .wewl-icon i,
.wewl-button--icon-fontawesome .wewl-icon svg,
.wewl-button--icon-fontawesome .wewl-icon .svg-inline--fa {
  display: inline-block;
  width: 1em;
  height: 1em;
  line-height: 1;
  color: inherit;
  fill: currentColor;
  vertical-align: -.125em;
}

.wewl-button--icon-fontawesome .wewl-icon svg path {
  fill: currentColor;
}

.wewl-button--icon-fontawesome .wewl-icon i::before {
  display: block;
}

.wewl-label {
  line-height: 1.2;
}

.wewl-label-state {
  display: inline;
}

.wewl-label-state--remove {
  display: none;
}

.wewl-button.is-active .wewl-label-state--add,
.wewl-button[aria-pressed="true"] .wewl-label-state--add,
.wewl-button[data-in-wishlist="1"] .wewl-label-state--add,
.wewl-button[data-wewl-active="1"] .wewl-label-state--add {
  display: none;
}

.wewl-button.is-active .wewl-label-state--remove,
.wewl-button[aria-pressed="true"] .wewl-label-state--remove,
.wewl-button[data-in-wishlist="1"] .wewl-label-state--remove,
.wewl-button[data-wewl-active="1"] .wewl-label-state--remove {
  display: inline;
}

.wewl-button--display-icon .wewl-label,
.wewl-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.wewl-button--display-text .wewl-icon {
  display: none;
}

.wewl-counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5em;
  min-height: 1.5em;
  padding: .1em .35em;
  border-radius: 999px;
  font-size: .85em;
  line-height: 1;
}

.wewl-single-product-button,
.wewl-loop-product-button {
  margin-top: .75em;
}

.wewl-elementor-button-wrap {
  display: block;
}

.wewl-wishlist {
  width: 100%;
}

.wewl-empty,
.wewl-wishlist-count {
  margin: 0 0 1rem;
}

.wewl-shared-notice {
  margin: 0 0 1rem;
  padding: .75rem 1rem;
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 4px;
}

.wewl-share-box {
  margin: 1rem 0 1.25rem;
  padding: 1rem;
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 4px;
}

.wewl-share-title {
  margin: 0 0 .75rem;
  font-weight: 700;
}

.wewl-share-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .75rem;
}

.wewl-share-url {
  flex: 1 1 260px;
  min-width: 0;
  padding: .55em .65em;
  border: 1px solid rgba(0, 0, 0, .2);
  border-radius: 3px;
  font: inherit;
}

.wewl-copy-link,
.wewl-share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.35em;
  padding: .5em .75em;
  border: 1px solid currentColor;
  border-radius: 3px;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.wewl-copy-link:hover,
.wewl-copy-link:focus,
.wewl-share-button:hover,
.wewl-share-button:focus {
  text-decoration: none;
}

.wewl-share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
}

.wewl-copy-feedback {
  font-size: .9em;
  opacity: .8;
}

.wewl-wishlist-items {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.wewl-wishlist-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, .12);
}

.wewl-item-thumb img {
  display: block;
  width: 96px;
  height: auto;
}

.wewl-item-title {
  display: inline-block;
  font-weight: 600;
  text-decoration: none;
}

.wewl-item-price,
.wewl-item-stock {
  margin-top: .35rem;
}

.wewl-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: flex-end;
}

.wewl-remove {
  display: inline-flex;
  align-items: center;
  min-height: 2.4em;
  padding: .55em .8em;
  border: 1px solid currentColor;
  border-radius: 3px;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: 1.2;
  cursor: pointer;
}

.wewl-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: 1rem;
}

.wewl-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2em;
  min-height: 2.2em;
  padding: .25em .55em;
  border: 1px solid currentColor;
  border-radius: 3px;
  text-decoration: none;
}

.wewl-pagination .current {
  font-weight: 700;
}

@media (max-width: 640px) {
  .wewl-wishlist-item {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .wewl-item-thumb img {
    width: 72px;
  }

  .wewl-item-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

.wewl-share-expiry {
  margin: -.25rem 0 .75rem;
  font-size: .9em;
  opacity: .75;
}

.wewl-share-controls {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .75rem;
  padding-top: .75rem;
  border-top: 1px solid rgba(0, 0, 0, .1);
}

.wewl-share-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.35em;
  padding: .5em .75em;
  border: 1px solid currentColor;
  border-radius: 3px;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: 1.2;
  cursor: pointer;
}

.wewl-share-control--danger {
  color: #b32d2e;
}

.wewl-share-control.is-loading {
  opacity: .65;
  pointer-events: none;
}

.wewl-share-box--disabled .wewl-share-controls {
  border-top: 0;
  padding-top: 0;
}

.wewl-share-disabled {
  margin: .25rem 0 .75rem;
}

/* =====================================================================
 * Heart icon (native, dependency-free) — v0.4.0
 *
 * The heart is an inline SVG printed in the markup by PHP. fill/stroke/size
 * are also baked onto the SVG as presentation attributes, so it renders even
 * if this stylesheet is stripped, deferred or mis-combined by a cache/minify
 * plugin (the guest/incognito failure mode). The rules below only refine that
 * baseline and expose the admin colour pickers via CSS variables.
 *
 * State model:
 *   - "add"    (not in wishlist) -> outline heart, white border, no fill
 *   - "remove" (in wishlist)     -> solid heart, filled white
 * The active state is toggled by .is-active / aria-pressed / data-in-wishlist
 * / data-wewl-active, so it is correct before the JS runs and for cached pages.
 * ===================================================================== */

button.wewl-button[data-wewl-button] {
  position: relative;
  isolation: isolate;
}

button.wewl-button[data-wewl-button] .wewl-icon,
button.wewl-button[data-wewl-button] .wewl-label {
  position: relative;
  z-index: 2;
}

button.wewl-button[data-wewl-button] .wewl-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* Both state spans share the same grid cell so the heart never shifts. */
button.wewl-button[data-wewl-button] .wewl-icon-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  line-height: 1;
  pointer-events: none;
}

button.wewl-button[data-wewl-button] .wewl-icon-state--remove {
  position: absolute;
  inset: 0;
}

/* The SVG itself: always 1em, never clipped, never recoloured by templates. */
button.wewl-button[data-wewl-button] .wewl-icon-svg-heart {
  display: block;
  width: 1em;
  height: 1em;
  overflow: visible;
  vertical-align: -.125em;
}

/* Colours. Presentation attributes default to #fff; these variables let the
 * admin "Color texto/icono" pickers override it for inactive/active states. */
button.wewl-button[data-wewl-button] .wewl-icon-svg-heart--outline {
  fill: none !important;
  stroke: var(--wewl-button-inactive-icon-color, #fff) !important;
  stroke-width: 2 !important;
  stroke-linecap: round;
  stroke-linejoin: round;
}

button.wewl-button[data-wewl-button] .wewl-icon-svg-heart--solid {
  fill: var(--wewl-button-active-icon-color, #fff) !important;
  stroke: none !important;
}

/* --- State visibility (works without JS) --- */

/* Default = inactive: show outline (add), hide solid (remove). */
button.wewl-button[data-wewl-button] .wewl-icon-state--add {
  opacity: 1;
  visibility: visible;
}

button.wewl-button[data-wewl-button] .wewl-icon-state--remove {
  opacity: 0;
  visibility: hidden;
}

/* Active = in wishlist: hide outline, show solid. Multiple selectors so the
 * correct state shows whether activeness is expressed as a class, aria-pressed
 * or a data attribute (server-rendered, cached, or toggled by JS). */
button.wewl-button[data-wewl-button].is-active .wewl-icon-state--add,
button.wewl-button[data-wewl-button][aria-pressed="true"] .wewl-icon-state--add,
button.wewl-button[data-wewl-button][data-in-wishlist="1"] .wewl-icon-state--add,
button.wewl-button[data-wewl-button][data-wewl-active="1"] .wewl-icon-state--add {
  opacity: 0;
  visibility: hidden;
}

button.wewl-button[data-wewl-button].is-active .wewl-icon-state--remove,
button.wewl-button[data-wewl-button][aria-pressed="true"] .wewl-icon-state--remove,
button.wewl-button[data-wewl-button][data-in-wishlist="1"] .wewl-icon-state--remove,
button.wewl-button[data-wewl-button][data-wewl-active="1"] .wewl-icon-state--remove {
  opacity: 1;
  visibility: visible;
}

/* =====================================================================
 * Heart icon as PNG image (v1.0.0)
 * The <img> carries its own size via inline style for robustness; these
 * rules only refine centring/scaling and let the icon-size control work.
 * ===================================================================== */
button.wewl-button[data-wewl-button] .wewl-icon-png {
  display: block;
  width: 1em;
  height: 1em;
  max-width: 1em;
  max-height: 1em;
  object-fit: contain;
  pointer-events: none;
  /* PNGs are fixed white images: the admin icon-colour pickers do not tint them. */
}
