/**
 * Wishlist + PWA + Push Prompt CSS — GuidaScelta.it
 */

/* === WISHLIST HEART BUTTON ON PRODUCT CARDS === */

.wishlist-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.25s ease;
  padding: 0;
}

.wishlist-btn:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.wishlist-heart {
  display: block;
  width: 20px;
  height: 20px;
  position: relative;
}

.wishlist-heart::before {
  content: "\2661"; /* empty heart */
  font-size: 22px;
  line-height: 20px;
  color: #94a3b8;
  transition: color 0.2s ease;
}

.wishlist-btn.active .wishlist-heart::before {
  content: "\2665"; /* filled heart */
  color: #ef4444;
}

.wishlist-btn.active {
  background: rgba(255, 255, 255, 0.96);
}

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

.wishlist-btn.active .wishlist-heart {
  animation: wishlist-pop 0.3s ease;
}

/* === WISHLIST COUNTER BADGE IN NAV === */

.wishlist-counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  padding: 0 5px;
  margin-left: 4px;
  position: relative;
  top: -1px;
}

.wishlist-nav-link {
  display: flex;
  align-items: center;
  gap: 2px;
}

/* === TOAST NOTIFICATION === */

.wishlist-toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1a365d;
  color: #fff;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 1060;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.wishlist-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* === WISHLIST PAGE (la-mia-lista) === */

.wishlist-header {
  text-align: center;
  padding: 2rem 0;
}

.wishlist-header h1 {
  font-family: 'Montserrat', sans-serif;
  color: #1a365d;
  font-size: 1.8rem;
}

.wishlist-header .wishlist-subtitle {
  color: #64748b;
  font-size: 1rem;
}

.wishlist-card {
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.wishlist-card:hover {
  border-color: #ff9900;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.wishlist-remove-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: all 0.2s ease;
}

.wishlist-remove-btn:hover {
  background: #ef4444;
  color: #fff;
}

.wishlist-card-img {
  width: 100%;
  height: 200px;
  object-fit: contain;
  background: #f8fafc;
  padding: 1rem;
}

.wishlist-card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.wishlist-card-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: #1a365d;
  margin-bottom: 0.5rem;
}

.wishlist-card-price {
  font-size: 1.35rem;
  font-weight: 700;
  color: #ff9900;
  margin-bottom: 1rem;
}

.wishlist-card-body .btn-amazon-cta {
  margin-top: auto;
  font-size: 0.9rem;
  padding: 10px 16px;
}

/* Empty state */
.wishlist-empty {
  text-align: center;
  padding: 4rem 2rem;
}

.wishlist-empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.wishlist-empty h2 {
  color: #1a365d;
  margin-bottom: 0.75rem;
}

.wishlist-empty p {
  color: #64748b;
  max-width: 400px;
  margin: 0 auto 1.5rem;
}

.wishlist-empty-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.wishlist-empty-links a {
  display: inline-block;
  padding: 8px 18px;
  background: #f1f5f9;
  color: #1a365d;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.wishlist-empty-links a:hover {
  background: #ff9900;
  color: #fff;
}

/* === PWA INSTALL BANNER === */

.pwa-install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 2px solid #1a365d;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
  padding: 12px 16px;
  z-index: 1050;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.pwa-install-banner.visible {
  transform: translateY(0);
}

.pwa-install-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 600px;
  margin: 0 auto;
}

.pwa-install-icon img {
  border-radius: 10px;
}

.pwa-install-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.pwa-install-text strong {
  font-size: 0.9rem;
  color: #1a365d;
}

.pwa-install-text span {
  font-size: 0.75rem;
  color: #64748b;
}

.pwa-install-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pwa-install-btn {
  background: linear-gradient(180deg, #ffad33 0%, #ff9900 100%);
  color: #111;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.pwa-install-btn:hover {
  background: linear-gradient(180deg, #ffc266 0%, #ffad33 100%);
}

.pwa-install-dismiss {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
}

.pwa-install-dismiss:hover {
  color: #475569;
}

/* === PUSH NOTIFICATION SOFT-PROMPT === */

.push-prompt {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  padding: 20px;
  z-index: 1055;
  max-width: 340px;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s ease;
}

.push-prompt.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.push-prompt-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
}

.push-prompt-icon {
  font-size: 2rem;
}

.push-prompt-text strong {
  display: block;
  font-size: 1rem;
  color: #1a365d;
  margin-bottom: 4px;
}

.push-prompt-text span {
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.4;
}

.push-prompt-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.push-prompt-yes {
  background: linear-gradient(180deg, #ffad33 0%, #ff9900 100%);
  color: #111;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 10px 24px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
}

.push-prompt-yes:hover {
  background: linear-gradient(180deg, #ffc266 0%, #ffad33 100%);
}

.push-prompt-no {
  background: #f1f5f9;
  color: #64748b;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
}

.push-prompt-no:hover {
  background: #e2e8f0;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .push-prompt {
    bottom: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }

  .pwa-install-text span {
    display: none;
  }
}

/* Avoid z-index conflicts */
.cookie-banner.visible ~ .pwa-install-banner {
  bottom: 80px;
}

.sticky-cta.visible ~ .pwa-install-banner {
  bottom: 70px;
}
