/* ============================================================
   Shopping Mare Fano Italy — Wishlist Styles
   Heart icon, toast notifications, Mediterranean brutalism styling
   ============================================================ */

/* ============================================================
   HEART ICON — Product Card Overlay
   ============================================================ */

.wishlist-heart {
  /* Positioning */
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;

  /* Size and shape */
  width: 36px;
  height: 36px;
  border-radius: 50%;

  /* Appearance */
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid var(--coral);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);

  /* Layout */
  display: flex;
  align-items: center;
  justify-content: center;

  /* Interaction */
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); /* bounce easing */

  /* Accessibility */
  outline: none;
}

.wishlist-heart:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25), 0 0 0 4px rgba(255, 71, 38, 0.1);
  background: rgba(255, 255, 255, 1);
}

.wishlist-heart:focus {
  box-shadow: 0 0 0 3px var(--coral), 0 4px 12px rgba(0, 0, 0, 0.25);
}

.wishlist-heart:active {
  transform: scale(0.95);
}

/* SVG heart icon */
.wishlist-heart svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--coral);
  stroke-width: 2.5;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Filled state — product is in wishlist */
.wishlist-heart--filled svg {
  fill: var(--coral);
  stroke: var(--coral);
}

.wishlist-heart--filled {
  background: var(--coral);
  border-color: var(--coral);
}

.wishlist-heart--filled svg {
  fill: white;
  stroke: white;
}

.wishlist-heart--filled:hover {
  background: var(--coral-bright);
  border-color: var(--coral-bright);
  box-shadow: 0 4px 12px rgba(255, 71, 38, 0.4), 0 0 0 4px rgba(255, 71, 38, 0.15);
}

/* Pulse animation on click */
.wishlist-heart--pulse {
  animation: heartPulse 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes heartPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.35);
  }
  100% {
    transform: scale(1);
  }
}

/* ============================================================
   TOAST NOTIFICATION — Mediterranean Brutalism
   ============================================================ */

.wishlist-toast {
  /* Positioning */
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;

  /* Appearance — warm Mediterranean gradient */
  background: linear-gradient(135deg, var(--cream) 0%, var(--butter) 100%);
  color: var(--ink);

  /* Border and shadow — brutalist style */
  border: 2.5px solid var(--coral);
  border-radius: 50px; /* pill shape */
  box-shadow: 5px 5px 0 var(--coral), 0 4px 16px rgba(0, 0, 0, 0.15);

  /* Spacing */
  padding: 14px 28px;
  max-width: 90%;
  width: auto;

  /* Typography */
  font-family: var(--font-body), 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.01em;

  /* Layout */
  display: flex;
  align-items: center;
  gap: 10px;

  /* Interaction */
  pointer-events: auto;
  cursor: pointer;

  /* Animation */
  animation: toastSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.wishlist-toast:hover {
  box-shadow: 6px 6px 0 var(--coral), 0 6px 20px rgba(0, 0, 0, 0.2);
  transform: translateX(-50%) translateY(-2px);
}

.wishlist-toast__icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.wishlist-toast__message {
  flex: 1;
}

/* Slide in animation */
@keyframes toastSlideIn {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-30px) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

/* Exit animation */
.wishlist-toast--exit {
  animation: toastSlideOut 0.3s ease-in forwards;
}

@keyframes toastSlideOut {
  0% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-30px) scale(0.9);
  }
}

/* ============================================================
   WISHLIST COUNTER BADGE — Header Navigation
   ============================================================ */

.wishlist-counter-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  background: var(--coral);
  color: white;
  font-size: 13px;
  font-weight: 700;
  border-radius: 12px;
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  margin-left: 6px;
  transition: all 0.2s ease;
}

.wishlist-counter-badge:empty {
  display: none;
}

/* ============================================================
   MOBILE RESPONSIVE — < 768px
   ============================================================ */

@media (max-width: 768px) {
  /* Heart icon — slightly smaller on mobile */
  .wishlist-heart {
    width: 32px;
    height: 32px;
    top: 10px;
    right: 10px;
  }

  .wishlist-heart svg {
    width: 18px;
    height: 18px;
  }

  /* Toast — full width with side margins */
  .wishlist-toast {
    left: 16px;
    right: 16px;
    width: calc(100% - 32px);
    transform: none;
    font-size: 14px;
    padding: 12px 20px;
    max-width: none;
  }

  .wishlist-toast:hover {
    transform: translateY(-2px);
  }

  @keyframes toastSlideIn {
    0% {
      opacity: 0;
      transform: translateY(-30px) scale(0.9);
    }
    100% {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }

  .wishlist-toast--exit {
    animation: toastSlideOutMobile 0.3s ease-in forwards;
  }

  @keyframes toastSlideOutMobile {
    0% {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
    100% {
      opacity: 0;
      transform: translateY(-30px) scale(0.9);
    }
  }

  /* Counter badge — slightly smaller on mobile */
  .wishlist-counter-badge {
    min-width: 20px;
    height: 20px;
    font-size: 12px;
    padding: 0 6px;
    margin-left: 4px;
  }
}

/* ============================================================
   ACCESSIBILITY — High contrast mode support
   ============================================================ */

@media (prefers-contrast: high) {
  .wishlist-heart {
    border-width: 3px;
  }

  .wishlist-toast {
    border-width: 3px;
  }
}

/* ============================================================
   PRINT — Hide wishlist UI
   ============================================================ */

@media print {
  .wishlist-heart,
  .wishlist-toast,
  .wishlist-counter-badge {
    display: none !important;
  }
}
