/**
 * Product Action Icons — base styles.
 *
 * Scoped to .wb-ic (the island marker) and .wb-ic__btn (the button).
 * These rules survive React island hydration because the classes are
 * re-emitted by WsFavoriteIcon / WsAddToCartIcon on every render.
 *
 * The Elementor style-tab selectors (primary_color, secondary_color,
 * size, rotate, etc.) are printed as {{WRAPPER}} CSS by Elementor and
 * override these base rules via cascade — no inline styles.
 */

/* ---- Container: the island marker div ---- */

.wb-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1; /* above stretched-link overlays in loop cards */
}

/* ---- Two-icon wrapper (action_type = both) ---- */

.wb-ic-set {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1;
}

/* ---- Button: 44×44 touch target, inline-flex centered ---- */

.wb-ic__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.3s ease, background-color 0.3s ease,
              border-color 0.3s ease, opacity 0.3s ease;
}

.wb-ic__btn i,
.wb-ic__btn svg {
  width: 1em;
  height: 1em;
  font-size: inherit;
  line-height: 1;
  pointer-events: none;
}

/* ---- View: stacked (solid background) ---- */

.elementor-view-stacked .wb-ic__btn {
  background-color: #444444;
  color: #ffffff;
}

/* ---- View: framed (border ring) ---- */

.elementor-view-framed .wb-ic__btn {
  border: 3px solid currentColor;
}

/* ---- Shape: rounded / circle (only when view != default) ---- */

.elementor-shape-rounded .wb-ic__btn {
  border-radius: 10%;
}

.elementor-shape-circle .wb-ic__btn {
  border-radius: 50%;
}

/* ---- Favorite state ---- */

.wb-ic--fav .wb-ic__btn {
  color: #888888;
}

.wb-ic--fav.is-favorited .wb-ic__btn {
  color: #d9363e;
}

/* ---- Cart states ---- */

.wb-ic--cart .wb-ic__btn {
  color: #444444;
}

.wb-ic--cart.wb-ic--loading .wb-ic__btn {
  opacity: 0.7;
  pointer-events: none;
}

.wb-ic--cart.wb-ic--added .wb-ic__btn {
  color: #2e8b57;
}

.wb-ic--cart.wb-ic--error .wb-ic__btn {
  animation: wb-ic-shake 0.4s ease;
}

@keyframes wb-ic-shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-4px); }
  40%      { transform: translateX(4px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}

.wb-ic--cart .wb-ic__btn[data-disabled="1"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ---- Editor mode: neutral cursor, no hover effects ---- */

.elementor-edit-mode .wb-ic__btn {
  cursor: default;
  pointer-events: none;
}

/* ---- Editor: empty-product warning box ---- */

.wb-ic--empty {
  display: inline-block;
  padding: 8px 12px;
  border: 1px dashed #ccc;
  border-radius: 4px;
  font-size: 13px;
  color: #999;
  background: #fafafa;
}

/* ---- Mobile: smaller touch target ---- */

@media (max-width: 767px) {
  .wb-ic__btn {
    width: 36px;
    height: 36px;
  }
}
