/* Product Watch storefront styles (#2124). */

/* ── product detail button ───────────────────────────────────────── */

/* Purchase actions are one explicit full-width stack at every breakpoint. */
.pw-purchase-stack {
  --pw-cta-min-height: 86px;
  --pw-cta-padding: 10px 16px;
  --pw-cta-line-gap: 4px;
  --pw-watch-min-height: 64px;
  display: flex;
  flex: 1 1 100%;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  gap: 12px;
}

.pw-purchase-stack .wrap-addcart {
  flex: none;
  width: 100%;
}

.pw-purchase-stack .wrap-addcart .add-to-cart-style {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--pw-cta-line-gap);
  box-sizing: border-box;
  min-height: var(--pw-cta-min-height);
  padding: var(--pw-cta-padding);
  border-radius: 0;
}

.pw-purchase-stack .wrap-addcart .add-to-cart-style strong,
.pw-purchase-stack .wrap-addcart .add-to-cart-style span {
  margin: 0;
  line-height: 1.35;
}

.pw-watch-wrap {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
}

.pw-watch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  min-height: var(--pw-watch-min-height);
  padding: var(--pw-cta-padding);
  border: 1px solid #333333;
  border-radius: 0;
  background: #fff;
  color: #333333;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.pw-watch-btn:hover:not(:disabled) {
  background: #f7f7f7;
}

.pw-watch-btn:focus-visible {
  outline: 3px solid rgba(255, 49, 93, .22);
  outline-offset: 2px;
}

.pw-watch-btn:disabled {
  cursor: wait;
  opacity: .62;
}

.pw-watch-btn--active {
  background: #fff;
  border-color: #f96359;
  color: #f96359;
}

.pw-watch-btn--active:hover:not(:disabled) {
  background: #fff5f4;
}

.pw-watch-btn__icon {
  font-size: 18px;
  line-height: 1;
}

.pw-watch-btn__copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--pw-cta-line-gap);
  min-width: 0;
  line-height: 1.25;
}

.pw-watch-btn__title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.pw-watch-helper {
  display: block;
  color: currentColor;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
}

/* ── customer watchlist ──────────────────────────────────────────── */

#jh-product-watch {
  --pw-accent: #ff315d;
  --pw-accent-dark: #d91f4b;
  --pw-accent-soft: #fff1f5;
  --pw-text: #20222a;
  --pw-muted: #687080;
  --pw-border: #e8eaf0;
  --pw-success: #248a52;
  --pw-success-bg: #eaf8f0;
  --pw-warning: #a96300;
  --pw-warning-bg: #fff5df;
  position: relative;
  color: var(--pw-text);
  font-family: Mulish, Arial, sans-serif;
}

#jh-product-watch *,
#jh-product-watch *::before,
#jh-product-watch *::after {
  box-sizing: border-box;
}

#jh-product-watch .pw-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#jh-product-watch .pw-skeleton {
  display: grid;
  gap: 10px;
  min-height: 220px;
}

#jh-product-watch .pw-skeleton__row {
  position: relative;
  overflow: hidden;
  height: 96px;
  border-radius: 12px;
  background: #eef0f4;
}

#jh-product-watch .pw-skeleton__row::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .72), transparent);
  animation: pw-shimmer 1.25s infinite;
}

@keyframes pw-shimmer {
  100% { transform: translateX(100%); }
}

#jh-product-watch .pw-alert {
  margin: 14px 0;
  padding: 13px 15px;
  border-radius: 12px;
  border: 1px solid #ffd5df;
  background: #fff5f7;
  color: #8f2440;
  font-size: 14px;
  line-height: 1.5;
}

#jh-product-watch .pw-login-required,
#jh-product-watch .pw-no-email {
  margin: 14px 0;
  padding: 24px 20px;
  border-radius: 12px;
  border: 1px solid #e3e6ee;
  background: #f8f9fc;
  text-align: center;
}

#jh-product-watch .pw-login-required h2,
#jh-product-watch .pw-no-email h2 {
  margin: 0 0 8px;
  font-size: 18px;
  color: #1f2430;
}

#jh-product-watch .pw-login-required p,
#jh-product-watch .pw-no-email p {
  margin: 0 0 16px;
  font-size: 14px;
  color: #5b6270;
  line-height: 1.5;
}

#jh-product-watch .pw-login-required a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 16px;
  border-radius: 12px;
  background: var(--pw-accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

#jh-product-watch .pw-usage {
  display: grid;
  grid-template-columns: auto minmax(90px, 180px) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 17px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--pw-accent-soft);
}

#jh-product-watch .pw-usage[hidden] { display: none; }

#jh-product-watch .pw-usage__summary {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--pw-muted);
  font-size: 13px;
  white-space: nowrap;
}

#jh-product-watch .pw-usage__summary strong {
  color: var(--pw-text);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

#jh-product-watch .pw-usage__track {
  overflow: hidden;
  height: 5px;
  border-radius: 999px;
  background: #e4dfe1;
}

#jh-product-watch .pw-usage__track > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--pw-accent);
  transition: width .2s ease;
}

#jh-product-watch .pw-usage__track > .pw-usage__bar--warning { background: var(--pw-warning); }
#jh-product-watch .pw-usage__track > .pw-usage__bar--full { background: #b42318; }

#jh-product-watch .pw-usage__remaining {
  color: var(--pw-muted);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

#jh-product-watch .pw-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 34px 22px;
  padding: 17px 17px 0 0;
}

#jh-product-watch .pw-card {
  position: relative;
  min-width: 0;
  background: #fff;
}

#jh-product-watch .pw-card__link {
  display: block;
  color: inherit;
  text-decoration: none;
}

#jh-product-watch .pw-card__media {
  overflow: hidden;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #fff;
  border-right: 1px solid var(--pw-border);
  color: #8a909d;
  font-size: 12px;
}

#jh-product-watch .pw-card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

#jh-product-watch .pw-card__info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 0 0;
}

#jh-product-watch .pw-card__title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

#jh-product-watch .pw-card__price {
  color: var(--pw-accent-dark);
  font-size: 14px;
  font-weight: 800;
}

#jh-product-watch .pw-status {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

#jh-product-watch .pw-status--instock {
  background: #57AFFF;
  color: #fff;
}

#jh-product-watch .pw-status--preorder {
  background: #36b056;
  color: #fff;
}

#jh-product-watch .pw-status--order {
  background: #ff860d;
  color: #fff;
}

#jh-product-watch .pw-status--soldout {
  background: #f85149;
  color: #fff;
}

#jh-product-watch .pw-card__unwatch {
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  transform: translate(50%, -50%);
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #4a4a4a;
  color: #fff;
  font: inherit;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

#jh-product-watch .pw-card__unwatch:hover:not(:disabled) {
  background: #f96359;
}

#jh-product-watch .pw-card__unwatch:disabled {
  cursor: wait;
  opacity: .62;
}

#jh-product-watch .pw-card__unwatch:focus-visible {
  outline: 3px solid rgba(255, 49, 93, .22);
  outline-offset: 2px;
}

#jh-product-watch .pw-empty {
  padding: 38px 20px;
  text-align: center;
  border: 1px dashed #d9dce4;
  border-radius: 14px;
  background: #fafbfc;
}

#jh-product-watch .pw-empty h2 {
  margin: 0 0 7px;
  font-size: 18px;
}

#jh-product-watch .pw-empty p {
  margin: 0;
  color: var(--pw-muted);
}

#jh-product-watch .pw-footer {
  display: flex;
  justify-content: center;
  padding-top: 18px;
}

#jh-product-watch .pw-more {
  min-width: 210px;
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid var(--pw-border);
  border-radius: 12px;
  background: #fff;
  color: var(--pw-text);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

#jh-product-watch .pw-more:hover:not(:disabled) {
  border-color: #cfd3dd;
  background: #fafbfc;
}

#jh-product-watch .pw-more:disabled {
  cursor: wait;
  opacity: .62;
}

@media (max-width: 767px) {
  #jh-product-watch .pw-usage { grid-template-columns: 1fr auto; }

  #jh-product-watch .pw-usage__track {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  #jh-product-watch .pw-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 34px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #jh-product-watch .pw-skeleton__row::after {
    animation: none;
  }
}

/* Fallback toast (only when Haravan jquery.toast is unavailable). */
.pw-toast {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999999;
  max-width: 320px;
  padding: 12px 16px;
  background: #f96359;
  color: #ffffff;
  font-size: 13px;
  line-height: 1.4;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.pw-toast--show {
  opacity: 1;
  transform: translateY(0);
}
