/**
 * Icon Action Button Component
 * Reusable circular button with Material Symbols icon
 * Used for: Wishlist, Comparison, Quick View, Close, etc.
 *
 * Usage:
 * <button class="icon-action-btn" aria-label="Action">
 *     <span class="material-symbols-outlined">icon_name</span>
 * </button>
 *
 * Modifiers:
 * .icon-action-btn--sm       - 32px (small)
 * .icon-action-btn--lg       - 44px (large)
 * .icon-action-btn--rose     - Rose gold background when active
 * .icon-action-btn--dark     - Dark background
 * .icon-action-btn--ghost    - Transparent background
 *
 * States:
 * .active                    - Active/selected state
 * .animating                 - Pulse animation
 *
 * @package Kosmetix
 */

/* ============================================
   BASE BUTTON STYLES
   ============================================ */
.icon-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.3s ease;
}

.icon-action-btn:hover {
  transform: scale(1.1);
  box-shadow: var(--wp--custom--shadow--glow);
}

.icon-action-btn:focus-visible {
  outline: 2px solid var(--wp--preset--color--rose-gold);
  outline-offset: 2px;
}

/* Icon styling */
.icon-action-btn .material-symbols-outlined {
  font-size: 20px;
  color: var(--wp--preset--color--slate);
  transition: all 0.3s ease;
  line-height: 1;
}

.icon-action-btn:hover .material-symbols-outlined {
  color: var(--wp--preset--color--rose-gold);
}

/* ============================================
   SIZE MODIFIERS
   ============================================ */
.icon-action-btn--sm {
  width: 32px;
  height: 32px;
}

.icon-action-btn--sm .material-symbols-outlined {
  font-size: 18px;
}

.icon-action-btn--lg {
  width: 44px;
  height: 44px;
}

.icon-action-btn--lg .material-symbols-outlined {
  font-size: 24px;
}

/* ============================================
   COLOR VARIANTS
   ============================================ */

/* Rose Gold variant (for active states) */
.icon-action-btn--rose,
.icon-action-btn.active {
  background: var(--wp--preset--color--rose-gold);
}

.icon-action-btn--rose .material-symbols-outlined,
.icon-action-btn.active .material-symbols-outlined {
  color: var(--wp--preset--color--white);
}

.icon-action-btn--rose:hover,
.icon-action-btn.active:hover {
  background: var(--wp--preset--color--rose-gold-dark);
}

/* Dark variant */
.icon-action-btn--dark {
  background: var(--wp--preset--color--charcoal);
}

.icon-action-btn--dark .material-symbols-outlined {
  color: var(--wp--preset--color--mist);
}

.icon-action-btn--dark:hover .material-symbols-outlined {
  color: var(--wp--preset--color--white);
}

/* Ghost variant (transparent) */
.icon-action-btn--ghost {
  background: transparent;
  box-shadow: none;
}

.icon-action-btn--ghost:hover {
  background: rgba(183, 110, 121, 0.1);
  box-shadow: none;
}

/* ============================================
   SPECIAL STATES
   ============================================ */

/* Filled heart (wishlist active) */
.icon-action-btn.active .material-symbols-outlined {
  font-variation-settings: 'FILL' 1;
}

/* Pulse animation */
.icon-action-btn.animating .material-symbols-outlined {
  animation: iconPop 0.4s ease;
}

@keyframes iconPop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
  }
  100% {
    transform: scale(1);
  }
}

/* Loading state - spinner inside button */
.icon-action-btn.loading {
  pointer-events: none;
  position: relative;
}

.icon-action-btn.loading .material-symbols-outlined {
  opacity: 0;
}

.icon-action-btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid var(--wp--preset--color--blush);
  border-top-color: var(--wp--preset--color--rose-gold);
  border-radius: 50%;
  animation: iconSpin 0.8s linear infinite;
}

@keyframes iconSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ============================================
   POSITIONING HELPERS
   (Use with position: absolute on parent)
   ============================================ */
.icon-action-btn--pos-top-right {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 15;
}

.icon-action-btn--pos-top-right-2 {
  position: absolute;
  top: 56px; /* Below first button: 12px + 36px + 8px gap */
  right: 12px;
  z-index: 14;
}

.icon-action-btn--pos-top-left {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 15;
}

.icon-action-btn--pos-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 15;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 767px) {
  .icon-action-btn {
    width: 32px;
    height: 32px;
  }

  .icon-action-btn .material-symbols-outlined {
    font-size: 18px;
  }

  .icon-action-btn--pos-top-right-2 {
    top: 48px; /* Adjusted for smaller button: 12px + 32px + 4px gap */
  }
}
