/* =============================================================================
   FILE: public/css/wishlist.css
   Wishlist / Save for Later — Day 14 (B5)
   Heart icon on product cards + wishlist drawer/page styles.
   ============================================================================= */

:root {
  --wish-red:       #C0392B;
  --wish-red-soft:  #F9ECEB;
  --wish-grey:      #BDB5AE;
  --wish-radius:    10px;
  --wish-transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------------------------------------------------------------------------
   Heart Button — overlaid on every product card
   --------------------------------------------------------------------------- */
.wish-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--wish-grey);
  box-shadow: 0 2px 8px rgba(44, 34, 24, 0.12);
  transition: color var(--wish-transition),
              background var(--wish-transition),
              transform var(--wish-transition);
  z-index: 10;
  padding: 0;
  line-height: 1;
}

.wish-btn:hover {
  background: var(--wish-red-soft);
  color: var(--wish-red);
  transform: scale(1.08);
}

.wish-btn.wish-btn--active {
  color: var(--wish-red);
  background: var(--wish-red-soft);
}

/* Pulse on add */
@keyframes wish-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.3); }
  70%  { transform: scale(0.9); }
  100% { transform: scale(1); }
}

.wish-btn--popping {
  animation: wish-pop 350ms ease-out forwards;
}

/* Make product card position:relative if not already */
.product-card {
  position: relative;
}

/* ---------------------------------------------------------------------------
   Wishlist Count Badge — small counter in nav area
   --------------------------------------------------------------------------- */
.wish-nav-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  color: var(--wish-grey);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background var(--wish-transition), color var(--wish-transition);
}

.wish-nav-badge:hover { background: var(--wish-red-soft); color: var(--wish-red); }

.wish-nav-count {
  background: var(--wish-red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 5px;
  min-width: 16px;
  text-align: center;
  display: none;
}

.wish-nav-count.visible { display: inline-block; }

/* ---------------------------------------------------------------------------
   Wishlist Drawer — slides in from right
   --------------------------------------------------------------------------- */
.wish-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 360px;
  max-width: 100vw;
  height: 100vh;
  background: #fff;
  box-shadow: -4px 0 32px rgba(44, 34, 24, 0.14);
  z-index: 8000;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 320ms cubic-bezier(0.4, 0, 0.2, 1);
}

.wish-drawer.open { transform: translateX(0); }

.wish-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid #EDE7DF;
}

.wish-drawer__title {
  font-size: 1rem;
  font-weight: 700;
  color: #2C2218;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wish-drawer__close {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #7A6E65;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  border-radius: 6px;
  transition: background var(--wish-transition);
}

.wish-drawer__close:hover { background: #F5F2EF; }

.wish-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.wish-drawer__empty {
  text-align: center;
  padding: 48px 20px;
  color: #7A6E65;
}

.wish-drawer__empty-icon { font-size: 2.5rem; margin-bottom: 12px; }
.wish-drawer__empty-text { font-size: 0.875rem; line-height: 1.5; }

/* ---------------------------------------------------------------------------
   Wishlist Item Card
   --------------------------------------------------------------------------- */
.wish-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #F0EBE5;
  align-items: flex-start;
}

.wish-item:last-child { border-bottom: none; }

.wish-item__img {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: #F9F3EE;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #8B6F5E;
  overflow: hidden;
}

.wish-item__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.wish-item__body { flex: 1; min-width: 0; }

.wish-item__name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #2C2218;
  margin: 0 0 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wish-item__price {
  font-size: 0.8rem;
  color: #8B6F5E;
  margin: 0 0 8px;
}

.wish-item__actions {
  display: flex;
  gap: 6px;
}

.wish-item__add-btn {
  font-size: 0.72rem;
  background: #8B6F5E;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
  font-weight: 600;
  transition: background var(--wish-transition);
}

.wish-item__add-btn:hover { background: #6B5244; }

.wish-item__remove-btn {
  font-size: 0.72rem;
  background: none;
  color: var(--wish-grey);
  border: 1px solid var(--wish-grey);
  border-radius: 6px;
  padding: 5px 8px;
  cursor: pointer;
  transition: color var(--wish-transition), border-color var(--wish-transition);
}

.wish-item__remove-btn:hover { color: var(--wish-red); border-color: var(--wish-red); }

/* Overlay */
.wish-overlay {
  position: fixed;
  inset: 0;
  background: rgba(44, 34, 24, 0.3);
  z-index: 7999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 320ms ease;
}

.wish-overlay.visible { opacity: 1; pointer-events: auto; }

@media (max-width: 420px) {
  .wish-drawer { width: 100vw; }
}
