/* ============================================================
   Pure Herbs – Wishlist Styles
   ============================================================ */

/* ── Header wishlist count badge ── */
.ph-wishlist-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  background: #e74c3c;
  color: #fff;
  border-radius: 50%;
  font-size: .6rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  pointer-events: none;
  padding: 0 3px;
  line-height: 1;
}

.ph-icon-btn { position: relative; }
.ph-mobile-action-btn { position: relative; }

/* Filled heart when wishlisted */
.ph-wishlist-toggle.is-active svg,
.ph-wishlist-toggle.has-items svg {
  fill: #e74c3c;
  stroke: #e74c3c;
}

/* ── Product card wishlist button ── */
.ph-product-card__img-wrap {
  position: relative;
  display: block;
}

.ph-product-card__img-wrap > a {
  display: block;
}

.ph-wishlist-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  transition: background .2s, transform .2s, box-shadow .2s;
  color: #888;
}

.ph-wishlist-btn:hover {
  background: #fff;
  box-shadow: 0 4px 16px rgba(231,76,60,.18);
  transform: scale(1.1);
  color: #e74c3c;
}

.ph-wishlist-btn.is-wishlisted {
  background: #ffeaea;
  color: #e74c3c;
}

.ph-wishlist-btn.is-wishlisted svg {
  fill: #e74c3c;
  stroke: #e74c3c;
}

.ph-wishlist-btn svg {
  transition: fill .2s, stroke .2s, transform .25s;
}

.ph-wishlist-btn.ph-heart-pop svg {
  animation: ph-heart-pop .35s cubic-bezier(.36,.07,.19,.97);
}

@keyframes ph-heart-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.4); }
  70%  { transform: scale(.85); }
  100% { transform: scale(1); }
}

/* ── Toast notification ── */
.ph-wishlist-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1a1a1a;
  color: #fff;
  padding: 10px 20px;
  border-radius: 28px;
  font-size: .84rem;
  font-weight: 600;
  white-space: nowrap;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
}

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

/* ── Wishlist Drawer ── */
.ph-wishlist-drawer {
  position: fixed;
  inset: 0;
  z-index: 1100;
  pointer-events: none;
}

.ph-wishlist-drawer.is-open {
  pointer-events: auto;
}

.ph-wishlist-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
  opacity: 0;
  transition: opacity .3s ease;
  cursor: pointer;
}

.ph-wishlist-drawer.is-open .ph-wishlist-drawer__backdrop {
  opacity: 1;
}

.ph-wishlist-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100vw);
  background: #fff;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.4, 0, .2, 1);
  box-shadow: -8px 0 40px rgba(0,0,0,.12);
  outline: none;
}

.ph-wishlist-drawer.is-open .ph-wishlist-drawer__panel {
  transform: translateX(0);
}

/* Drawer header */
.ph-wishlist-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 18px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}

.ph-wishlist-drawer__title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ph-wishlist-drawer__title h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
}

.ph-wishlist-drawer__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  background: #e74c3c;
  color: #fff;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 800;
  padding: 0 5px;
}

.ph-wishlist-drawer__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #eee;
  background: none;
  cursor: pointer;
  color: #555;
  transition: background .2s, color .2s;
}

.ph-wishlist-drawer__close:hover { background: #f5f5f5; color: #1a1a1a; }

/* Drawer body */
.ph-wishlist-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

/* Empty state */
.ph-wishlist-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 60px 24px;
  text-align: center;
  color: #888;
}

.ph-wishlist-empty p {
  font-size: .95rem;
  color: #888;
  margin: 0;
}

.ph-wishlist-empty.is-hidden { display: none; }

/* Wishlist item list */
.ph-wishlist-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ph-wishlist-items.is-hidden { display: none; }

/* Individual wishlist item */
.ph-wishlist-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 12px;
  align-items: center;
  background: #fafafa;
  border: 1px solid #f0f0f0;
  border-radius: 14px;
  padding: 12px;
  animation: ph-wishlist-item-in .3s ease;
}

@keyframes ph-wishlist-item-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: none; }
}

.ph-wishlist-item__img {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
  background: #f0f4ee;
  display: block;
}

.ph-wishlist-item__info {}

.ph-wishlist-item__name {
  font-size: .88rem;
  font-weight: 700;
  color: #1a1a1a;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
  margin-bottom: 6px;
  text-decoration: none;
}

.ph-wishlist-item__name:hover { color: #3a7c52; }

.ph-wishlist-item__price {
  font-size: .82rem;
  font-weight: 700;
  color: #3a7c52;
  margin-bottom: 8px;
}

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

.ph-wishlist-item__cart-btn {
  font-size: .72rem;
  font-weight: 700;
  background: #3a7c52;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 5px 12px;
  cursor: pointer;
  transition: background .2s;
  white-space: nowrap;
}

.ph-wishlist-item__cart-btn:hover { background: #2d6040; }

.ph-wishlist-item__remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid #eee;
  background: none;
  cursor: pointer;
  color: #aaa;
  flex-shrink: 0;
  transition: color .2s, border-color .2s, background .2s;
  padding: 0;
}

.ph-wishlist-item__remove:hover {
  color: #e74c3c;
  border-color: #e74c3c;
  background: #ffeaea;
}

/* Mobile bottom nav wishlist icon */
.ph-bottom-nav__item--wishlist {}

@media (max-width: 768px) {
  .ph-wishlist-drawer__panel { width: 100vw; }

  .ph-wishlist-toast { bottom: 88px; }
}

/* ── Single product wishlist button ── */
.ph-single-wishlist-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 22px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  color: #555;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .2s, color .2s, background .2s, transform .15s;
  white-space: nowrap;
  vertical-align: middle;
  margin-left: 8px;
}

.ph-single-wishlist-btn:hover {
  border-color: #e74c3c;
  color: #e74c3c;
  background: #fff8f8;
  transform: translateY(-1px);
}

.ph-single-wishlist-btn.is-wishlisted {
  border-color: #e74c3c;
  color: #e74c3c;
  background: #fff0f0;
}

.ph-single-wishlist-btn.is-wishlisted svg {
  fill: #e74c3c;
  stroke: #e74c3c;
}

.ph-single-wishlist-btn svg {
  transition: fill .2s, stroke .2s;
  flex-shrink: 0;
}

/* Override the card-style absolute positioning for single product */
.woocommerce-product-gallery ~ .summary .ph-wishlist-btn,
.entry-summary .ph-wishlist-btn {
  position: static;
  width: auto;
  height: 48px;
  border-radius: 8px;
  border: 2px solid #e0e0e0;
  padding: 0 20px;
  background: #fff;
  box-shadow: none;
  color: #555;
}

@media (max-width: 768px) {
  /* On mobile the wishlist button sits at the bottom of the summary.
     Keep it compact — don't let it look like a broken card. */
  .ph-single-wishlist-btn {
    display: inline-flex;
    margin: 4px 0 0;
    margin-left: 0;
    width: auto;          /* NOT full-width */
    height: 40px;
    padding: 0 18px;
    font-size: .82rem;
    border-radius: 20px;  /* pill shape — clearly a soft action, not a primary CTA */
    border-width: 1.5px;
    align-self: flex-start;
  }

  .ph-single-wishlist-btn__label { display: inline; }

  /* Prevent mobile-app.css override from forcing full-width */
  .woocommerce div.product .ph-single-wishlist-btn {
    width: auto !important;
    margin-top: 4px !important;
  }
}
