/* =============================================================
   Genzee Jewels — components.css
   Reusable UI components: product card, price, stars.
   All sections that render product cards use these classes.
   ============================================================= */

/* =============================================================
   STARS
   ============================================================= */

.stars {
  display: inline-flex;
  gap: 1px;
  vertical-align: middle;
  line-height: 1;
}

.stars__icon {
  display: block;
  fill: var(--color-line);
  flex-shrink: 0;
  width: 12px;
  height: 12px;
}

.stars__icon--filled {
  fill: #FFB800;
}

.stars--sm .stars__icon {
  width: 10px;
  height: 10px;
}

/* =============================================================
   PRICE
   ============================================================= */

.price {
  display: flex;
  align-items: baseline;
  gap: 0.375rem;
  flex-wrap: wrap;
  line-height: 1.2;
}

.price__sale {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 900;
  color: var(--color-ink);
}

.price__regular {
  font-size: var(--text-sm);
  color: var(--color-muted);
  text-decoration: line-through;
}

.price__off {
  font-size: 0.6875rem;
  font-weight: 800;
  color: var(--color-hot);
}

/* Small variant — used inside product cards */
.price--sm .price__sale    { font-size: var(--text-sm); }
.price--sm .price__regular { font-size: 0.6875rem; }
.price--sm .price__off     { font-size: 0.625rem; }

/* =============================================================
   PRODUCT CARD
   ============================================================= */

.product-card {
  position: relative;
  background: var(--color-white);
  border: 0;
  border-radius: var(--r-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: none;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.product-card:hover {
  transform: none;
}

/* ── Media (image) area ───────────────────────────────────── */

.product-card__link {
  display: block;
  position: relative;
}

.product-card__media {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background-color: var(--color-paper);
}

.product-card__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card__placeholder {
  position: absolute;
  inset: 0;
}

.product-card__placeholder-svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* ── Overlay badges ───────────────────────────────────────── */

.product-card__tag {
  position: absolute;
  top: 0.625rem;
  left: 0.625rem;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border-radius: var(--r-pill);
  font-size: 0.625rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1;
  pointer-events: none;
  white-space: nowrap;
  background: var(--color-ink);
  color: var(--color-white);
  box-shadow: none;
}

.product-card__tag--hot    { background: var(--color-hot);    color: var(--color-white); }
.product-card__tag--ink    { background: var(--color-ink);    color: var(--color-white); }
.product-card__tag--butter { background: var(--color-butter); color: var(--color-ink);   }

.product-card__discount {
  position: absolute;
  top: 0.625rem;
  right: 0.625rem;
  z-index: 1;
  background: var(--color-ink);
  color: var(--color-butter);
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-family: var(--font-display);
  font-size: 0.6875rem;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
  box-shadow: none;
}

/* ── Wishlist button ──────────────────────────────────────── */

.product-card__wishlist {
  position: absolute;
  bottom: 0.625rem;
  right: 0.625rem;
  z-index: 2;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--color-white);
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  opacity: 1;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  border: none;
  cursor: pointer;
  color: var(--color-ink);
}

.product-card__wishlist:hover {
  transform: scale(1.1);
  color: var(--color-hot);
}

.product-card__wishlist:focus-visible {
  outline: 3px solid var(--color-hot);
  outline-offset: 2px;
}

.product-card__wishlist.is-saved {
  background: var(--color-hot);
  color: var(--color-white);
}

.product-card__wishlist.is-saved .product-card__wishlist-icon {
  fill: currentColor;
}

/* ── Quick-add (slides up on desktop hover) ───────────────── */

.product-card__quick-add-wrap {
  position: absolute;
  bottom: 0.625rem;
  left: 0.625rem;
  right: 0.625rem;
  z-index: 2;
  opacity: 0;
  transform: translateY(calc(100% + 0.625rem));
  transition:
    transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.1),
    opacity var(--transition-fast);
}

.product-card:hover .product-card__quick-add-wrap,
.product-card:focus-within .product-card__quick-add-wrap {
  transform: translateY(0);
  opacity: 1;
}

.product-card__quick-add,
.woocommerce .product-card a.product-card__quick-add.button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  width: 100%;
  min-height: 0;
  padding: 0.75rem;
  border: 0 !important;
  border-radius: var(--r-pill);
  background: var(--color-ink) !important;
  color: var(--color-white) !important;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  box-shadow: none;
  white-space: nowrap;
}

.product-card__quick-add-text,
.product-card__quick-add-price,
.product-card__quick-add-dot {
  display: inline-flex;
  align-items: center;
}

.product-card__quick-add:hover,
.product-card__quick-add:focus-visible,
.woocommerce .product-card a.product-card__quick-add.button:hover,
.woocommerce .product-card a.product-card__quick-add.button:focus-visible {
  background: var(--color-hot) !important;
  color: var(--color-white) !important;
}

.product-card__quick-add:focus-visible {
  outline: 3px solid var(--color-butter);
  outline-offset: 2px;
}

.product-card__mobile-cta,
.woocommerce .product-card .product-card__mobile-cta.button,
.woocommerce .product-card a.product-card__mobile-cta.button {
  display: none !important;
}

/* ── Text body ────────────────────────────────────────────── */

.product-card__body {
  padding: 0.875rem 0.875rem 1rem;
  gap: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-card__cat {
  display: block;
  font-size: 0.5625rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 0.25rem;
  line-height: 1;
}

.product-card__name {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--color-ink);
  line-height: 1.3;
  margin: 0 0 0.375rem;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.product-card__name a {
  color: inherit;
  text-decoration: none;
}

.product-card__name a:hover {
  color: var(--color-hot);
}

.product-card__name a:focus-visible {
  outline: 2px solid var(--color-hot);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Stretched-link: ::before covers the whole card making the surface clickable
   without nesting interactive elements inside <a>. */
.product-card__stretched-link::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

.product-card__meta {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 0;
  margin-bottom: 0.5rem;
}

.product-card__reviews {
  font-size: 0.625rem;
  color: var(--color-muted);
  font-weight: 600;
  line-height: 1;
}

.product-card__purchase-block {
  display: flex;
  flex-direction: column;
  margin-top: 0;
}

.product-card .price {
  min-height: 0;
  margin-top: 0;
}

.product-card__status-row {
  min-height: 0;
  margin-top: 0.5rem;
}

.product-card__low-stock {
  display: flex;
  align-items: center;
  gap: 0.3125rem;
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--color-hot);
  margin: 0;
  line-height: 1;
}

.product-card__low-stock-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-hot);
  flex-shrink: 0;
  display: inline-block;
}

/* ── Desktop: pointer devices ─────────────────────────────── */

@media (min-width: 768px) and (hover: hover) {
  .product-card__quick-add-wrap {
    display: block;
    right: calc(0.625rem + 2rem + 0.5rem);
  }

  .product-card__wishlist {
    z-index: 3;
  }
}

/* ── Mobile / touch: show inline CTA instead of hover overlay */

@media (max-width: 767px), (hover: none) {
  .product-card .product-card__quick-add-wrap {
    display: none !important;
  }

  .product-card__mobile-cta,
  .woocommerce .product-card .product-card__mobile-cta.button,
  .woocommerce .product-card a.product-card__mobile-cta.button {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 2.875rem;
    margin-top: 0.875rem;
    padding: 0.875rem 1rem;
    border: 0 !important;
    border-radius: var(--r-pill);
    background: var(--color-ink) !important;
    color: var(--color-white) !important;
    font-size: clamp(0.6875rem, 2.8vw, 0.75rem);
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-decoration: none;
    line-height: 1.1;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color var(--transition-fast);
  }

  .product-card__mobile-cta:hover,
  .product-card__mobile-cta:focus-visible,
  .woocommerce .product-card a.product-card__mobile-cta.button:hover,
  .woocommerce .product-card a.product-card__mobile-cta.button:focus-visible {
    background: var(--color-hot) !important;
    color: var(--color-white) !important;
  }

  .product-card__mobile-cta:focus-visible {
    outline: 3px solid var(--color-butter);
    outline-offset: 2px;
  }

  .product-card__wishlist {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 414px) {
  .product-card__body {
    padding: 0.75rem;
  }

  .product-card__name {
    font-size: 0.8125rem;
  }
}

@media (max-width: 359px) {
  .product-card__quick-add {
    font-size: 0.625rem;
  }

  .product-card__mobile-cta,
  .woocommerce .product-card a.product-card__mobile-cta.button {
    padding: 0.75rem 0.875rem;
    font-size: 0.6875rem;
  }
}

/* =============================================================
   WISHLIST TOAST
   Small browser-backed wishlist save/remove confirmation.
   ============================================================= */

.wishlist-toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: var(--z-toast-high);
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  max-width: min(24rem, calc(100vw - 2rem));
  padding: 0.75rem 0.875rem;
  border: 1px solid rgba(10, 10, 10, 0.12);
  border-radius: var(--r-md);
  background: var(--color-ink);
  color: var(--color-white);
  box-shadow: 0 1rem 2.5rem rgba(10, 10, 10, 0.22);
  opacity: 0;
  transform: translateY(0.75rem);
  pointer-events: none;
  transition:
    opacity var(--transition-fast),
    transform var(--transition-fast);
}

.wishlist-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.wishlist-toast__message {
  min-width: 0;
  overflow: hidden;
  font-size: 0.8125rem;
  font-weight: 800;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wishlist-toast__undo {
  flex: 0 0 auto;
  min-height: 2rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--r-pill);
  background: var(--color-white);
  color: var(--color-ink);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.wishlist-toast__undo:hover {
  background: var(--color-butter);
}

.wishlist-toast__undo:focus-visible {
  outline: 3px solid var(--color-butter);
  outline-offset: 2px;
}

@media (max-width: 479px) {
  .wishlist-toast {
    right: 0.75rem;
    bottom: 0.75rem;
    left: 0.75rem;
    max-width: none;
  }
}

/* =============================================================
   LIVE PURCHASE TOAST
   Fixed bottom-left notification used on homepage + archive.
   ============================================================= */

.live-toast {
  position: fixed;
  left: 1.25rem;
  bottom: 1.25rem;
  z-index: var(--z-toast);
  background: var(--color-white);
  border: 1px solid var(--color-line);
  border-radius: var(--r-lg);
  padding: 0.75rem 1rem 0.75rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 18.75rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  opacity: 0;
  transform: translateY(1.25rem);
  transition:
    opacity 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.1),
    transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.1);
  pointer-events: none;
}

.live-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.live-toast__icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.625rem;
  background-color: var(--toast-color, #FFE14A);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  transition: background-color 0.3s ease;
}

.live-toast__icon svg {
  fill: var(--color-ink);
}

.live-toast__content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1875rem;
}

.live-toast__name {
  display: block;
  font-size: 0.6875rem;
  font-weight: 800;
  color: var(--color-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-toast__msg {
  display: block;
  font-size: 0.6875rem;
  color: var(--color-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-toast__time {
  display: block;
  font-size: 0.5625rem;
  color: var(--color-muted);
  font-weight: 600;
}

.live-toast__close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-muted);
  padding: 0.25rem;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  flex-shrink: 0;
  line-height: 0;
  transition: color var(--transition-fast);
}

.live-toast__close:hover {
  color: var(--color-ink);
}

.live-toast__close:focus-visible {
  outline: 2px solid var(--color-ink);
  outline-offset: 2px;
}

@media (max-width: 479px) {
  .live-toast {
    left: 0.75rem;
    bottom: 0.75rem;
    max-width: calc(100vw - 1.5rem);
  }
}

@media (max-width: 414px) {
  .live-toast {
    left: 0.75rem;
    right: 0.75rem;
    max-width: none;
  }
}
