/* ============================================================
   Wishlist & Compare (2026-07-16)
   Card icons · header badge · compare tray · /wishlist/ · /compare/
   Mobile-first: 44px tap targets, icons always visible on touch.
   ============================================================ */

/* ---- card icons (stack under the quick-view circle) ---- */
.op-cw-icon {
  position: absolute;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--op-white);
  box-shadow: var(--op-shadow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(-4px);
  transition: all var(--op-transition);
  z-index: 3;
  color: var(--op-text-secondary);
}
.op-cw-icon--wish { top: 3.4rem; }
.op-cw-icon--comp { top: 6.05rem; }
ul.products li.product:hover .op-cw-icon { opacity: 1; transform: translateY(0); }
.op-cw-icon:hover { background: var(--op-primary); color: var(--op-white); }
.op-cw-icon.is-active { opacity: 1; transform: translateY(0); background: var(--op-primary); color: var(--op-white); }
.op-cw-icon--wish.is-active { background: var(--op-danger); }
.op-cw-icon--wish.is-active svg { fill: currentColor; }

/* Touch devices: no hover — keep icons visible and big enough to tap */
@media (hover: none), (max-width: 768px) {
  .op-quick-view-btn { display: none; } /* quick view is hover-only anyway */
  .op-cw-icon { opacity: 1; transform: none; width: 40px; height: 40px; }
  .op-cw-icon--wish { top: 0.6rem; }
  .op-cw-icon--comp { top: 3.6rem; }
}

/* ---- single product buttons ---- */
.op-cw-single { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 0.9rem 0 0; }
.op-cw-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.55rem 1.05rem;
  border: 1px solid var(--op-border);
  border-radius: 999px;
  background: var(--op-white);
  color: var(--op-text);
  font-size: var(--op-text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--op-transition);
}
.op-cw-btn:hover { border-color: var(--op-primary); color: var(--op-primary); }
.op-cw-btn.is-active { background: var(--op-primary-light); border-color: var(--op-primary); color: var(--op-primary-dark); }

/* ---- header wishlist badge ---- */
.op-header-wish { position: relative; }
.op-wish-count {
  position: absolute;
  top: -6px;
  left: calc(50% + 4px);
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--op-danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- compare tray ---- */
#opCompareTray {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 14px;
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--op-accent-dark, #0F2236);
  color: #fff;
  border-radius: 999px;
  padding: 0.55rem 0.7rem 0.55rem 1.1rem;
  box-shadow: 0 10px 30px rgba(6, 18, 30, 0.35);
  font-size: var(--op-text-sm);
  max-width: calc(100vw - 24px);
}
#opCompareTray .op-tray-go {
  background: var(--op-primary);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}
#opCompareTray .op-tray-go.is-disabled { opacity: 0.5; pointer-events: none; }
#opCompareTray .op-tray-clear {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  font-size: var(--op-text-sm);
  padding: 0.5rem 0.6rem;
  min-height: 40px;
}
#opCompareTray .op-tray-clear:hover { color: #fff; }

/* ---- toast ---- */
#opCWToast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  bottom: 78px;
  z-index: 9999;
  background: var(--op-text, #1E293B);
  color: #fff;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  font-size: var(--op-text-sm);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  max-width: calc(100vw - 32px);
  text-align: center;
}
#opCWToast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- shared page bits ---- */
.op-cw-page { padding: 1.5rem 0 3.5rem; }
.op-cw-page__head { margin-bottom: 1.25rem; }
.op-cw-page__head h1 { margin: 0 0 0.35rem; }
.op-cw-page__head p { color: var(--op-text-secondary); margin: 0; }
.op-cw-loading { color: var(--op-text-secondary); }
.op-cw-empty {
  text-align: center;
  padding: 3rem 1rem;
  background: var(--op-bg);
  border: 1px dashed var(--op-border);
  border-radius: var(--op-radius-lg, 12px);
}
.op-cw-empty p { color: var(--op-text-secondary); margin: 0 0 1rem; }

/* ---- wishlist grid ---- */
.op-cw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
}
.op-cw-card {
  background: var(--op-white);
  border: 1px solid var(--op-border);
  border-radius: var(--op-radius-lg, 12px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.op-cw-card__img { display: block; aspect-ratio: 1; background: #fff; }
.op-cw-card__img img { width: 100%; height: 100%; object-fit: contain; }
.op-cw-card__body { padding: 0.9rem; display: flex; flex-direction: column; gap: 0.3rem; flex: 1; }
.op-cw-card__name { color: var(--op-text); text-decoration: none; font-weight: 600; font-size: var(--op-text-sm); }
.op-cw-card__name:hover { color: var(--op-primary); }
.op-cw-sku { color: var(--op-text-muted); font-size: 0.72rem; }
.op-cw-price { color: var(--op-text); font-weight: 700; }
.op-cw-stock { font-size: 0.75rem; font-weight: 600; }
.op-cw-stock--in { color: #067647; }
.op-cw-stock--out { color: var(--op-danger); }
.op-cw-card__actions { display: flex; gap: 0.5rem; margin-top: auto; padding-top: 0.6rem; }
.op-cw-card__actions .op-btn { flex: 1; justify-content: center; min-height: 42px; display: inline-flex; align-items: center; }
.op-cw-remove { border: 1px solid var(--op-border); background: var(--op-white); border-radius: var(--op-radius); cursor: pointer; color: var(--op-text-secondary); }
.op-cw-remove:hover { color: var(--op-danger); border-color: var(--op-danger); }

/* ---- compare table ---- */
.op-cmp-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 0.5rem; }
.op-cmp-table { min-width: calc(140px + var(--op-cmp-cols) * 215px); }
.op-cmp-row {
  display: grid;
  grid-template-columns: 140px repeat(var(--op-cmp-cols), minmax(200px, 1fr));
  border-bottom: 1px solid var(--op-border-light);
}
.op-cmp-row:nth-child(even) { background: var(--op-bg); }
.op-cmp-label {
  padding: 0.75rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--op-text-muted);
  position: sticky;
  left: 0;
  background: var(--op-white);
  border-right: 1px solid var(--op-border-light);
  z-index: 1;
  display: flex;
  align-items: center;
}
.op-cmp-cell { padding: 0.75rem; font-size: var(--op-text-sm); color: var(--op-text); }
.op-cmp-cell small { display: block; color: var(--op-text-muted); font-size: 0.7rem; }
.op-cmp-head { position: relative; text-align: center; }
.op-cmp-head a { text-decoration: none; color: var(--op-text); }
.op-cmp-head img { width: 120px; height: 120px; object-fit: contain; margin: 0 auto 0.4rem; display: block; }
.op-cmp-name { display: block; font-weight: 600; font-size: var(--op-text-sm); }
.op-cmp-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--op-border);
  background: var(--op-white);
  color: var(--op-text-secondary);
  font-size: 16px;
  cursor: pointer;
}
.op-cmp-remove:hover { color: var(--op-danger); border-color: var(--op-danger); }
.op-cmp-actions { display: flex; flex-direction: column; gap: 0.45rem; }
.op-cmp-actions .op-btn { justify-content: center; min-height: 42px; display: inline-flex; align-items: center; text-align: center; }

/* ---- small screens ---- */
@media (max-width: 640px) {
  .op-cw-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.7rem; }
  .op-cw-card__actions { flex-direction: column; }
  .op-cmp-row { grid-template-columns: 104px repeat(var(--op-cmp-cols), minmax(168px, 1fr)); }
  .op-cmp-table { min-width: calc(104px + var(--op-cmp-cols) * 176px); }
  .op-cmp-head img { width: 90px; height: 90px; }
  #opCompareTray { bottom: 10px; width: calc(100vw - 20px); justify-content: space-between; }
}
