/* WA One Page Order v1.1. Override these variables in your theme to restyle. */
.wopo {
  --wopo-ink: #16181a;
  --wopo-muted: #6b7075;
  --wopo-line: #e7e8ea;
  --wopo-field: #d3d6da;
  --wopo-soft: #f5f6f7;
  --wopo-bg: #ffffff;
  --wopo-img-bg: transparent;
  --wopo-accent: #128c4a;
  --wopo-accent-ink: #ffffff;
  --wopo-danger: #c0271d;
  --wopo-r: 8px;
  --wopo-offset: 0px;
  --wopo-top: 2147483000;
  color: var(--wopo-ink);
}
.wopo *, .wopo *::before, .wopo *::after { box-sizing: border-box; }
.wopo :focus-visible { outline: 2px solid var(--wopo-accent); outline-offset: 2px; }
.wopo [hidden] { display: none !important; }
.wopo-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wopo-muted { color: var(--wopo-muted); font-weight: 400; }
html.wopo-lock, html.wopo-lock body { overflow: hidden; }

/* Reset common theme overrides inside the plugin */
.wopo button, .wopo select, .wopo input, .wopo textarea {
  font-family: inherit; letter-spacing: normal; text-transform: none;
  min-height: 0; box-shadow: none; margin: 0;
}
.wopo button { line-height: 1.2; }

/* ---------- Catalog: 2 cols mobile, 3 tablet, 4 desktop ---------- */
.wopo-grid {
  list-style: none; margin: 0;
  padding: 0 0 calc(var(--wopo-offset) + 88px);
  display: grid; gap: 20px 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 768px) {
  .wopo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 18px; }
}
@media (min-width: 1024px) {
  .wopo-grid { grid-template-columns: repeat(var(--wopo-cols, 4), minmax(0, 1fr)); }
}

.wopo-card { display: flex; flex-direction: column; min-width: 0; margin: 0; padding: 0; }

/* Full image, never cropped: box follows the product image ratio, image is contained. */
.wopo-media {
  aspect-ratio: var(--wopo-ratio, 1);
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--wopo-r); overflow: hidden;
  background: var(--wopo-img-bg);
}
.wopo .wopo-img { display: block; width: 100%; height: 100%; max-width: 100%; object-fit: contain; border-radius: 0; margin: 0; }

.wopo .wopo-name {
  margin: 10px 0 2px; padding: 0;
  font-size: .9rem; line-height: 1.3; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wopo .wopo-price { margin: 0 0 8px; font-size: .875rem; line-height: 1.3; color: var(--wopo-muted); font-variant-numeric: tabular-nums; }
.wopo .wopo-price del { opacity: .7; margin-right: 4px; }
.wopo .wopo-price ins { text-decoration: none; color: var(--wopo-ink); font-weight: 600; }

.wopo .wopo-var {
  width: 100%; height: 36px; margin: 0 0 6px; padding: 0 28px 0 10px;
  border: 1px solid var(--wopo-field); border-radius: var(--wopo-r);
  background: var(--wopo-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236b7075' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 10px center;
  -webkit-appearance: none; appearance: none;
  color: inherit; font-size: .85rem; text-overflow: ellipsis;
}
.wopo .wopo-var.wopo-need { border-color: var(--wopo-danger); box-shadow: 0 0 0 1px var(--wopo-danger); }

.wopo-action { margin-top: auto; }
.wopo .wopo-add {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid var(--wopo-ink); border-radius: var(--wopo-r);
  background: var(--wopo-ink); color: #fff;
  font-size: .875rem; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.wopo .wopo-add:hover { opacity: .88; }

.wopo-stepper {
  display: flex; align-items: center; justify-content: space-between;
  height: 38px; border: 1px solid var(--wopo-accent); border-radius: var(--wopo-r);
  background: var(--wopo-bg);
}
.wopo .wopo-stepper button {
  width: 40px; height: 100%; padding: 0; border: 0; border-radius: var(--wopo-r);
  background: transparent; color: var(--wopo-accent); font-size: 1.15rem; font-weight: 600; cursor: pointer;
}
.wopo-stepper-n { font-size: .9rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.wopo-empty { color: var(--wopo-muted); }

/* ---------- Sticky order bar (sits above theme bottom menus) ---------- */
.wopo-bar {
  position: fixed; left: 0; right: 0; z-index: var(--wopo-top);
  bottom: calc(var(--wopo-offset) + 10px);
  display: flex; justify-content: center; pointer-events: none;
  padding: 0 12px env(safe-area-inset-bottom, 0px);
}
.wopo.is-sheet-open .wopo-bar { display: none; }
.wopo .wopo-open {
  pointer-events: auto; width: 100%; max-width: 440px; height: 52px;
  display: flex; align-items: center; gap: 10px;
  padding: 0 6px 0 16px; border: 0; border-radius: 12px;
  background: var(--wopo-ink); color: #fff; font-size: .9rem; text-align: left; cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
}
.wopo-bar-count { opacity: .7; white-space: nowrap; }
.wopo-bar-total { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.wopo-bar-cta {
  margin-left: auto; height: 40px; display: inline-flex; align-items: center;
  padding: 0 18px; border-radius: 9px;
  background: var(--wopo-accent); color: var(--wopo-accent-ink); font-weight: 600; white-space: nowrap;
}

/* ---------- Order panel: bottom sheet on mobile, side drawer on desktop ---------- */
.wopo-sheet { position: fixed; inset: 0; z-index: calc(var(--wopo-top) + 1); }
.wopo-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); }
.wopo-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 92vh; max-height: 92dvh;
  display: flex; flex-direction: column;
  background: var(--wopo-bg); border-radius: 14px 14px 0 0; outline: none;
  transform: translateY(16px); opacity: 0;
  transition: transform .2s ease, opacity .2s ease;
}
@media (min-width: 768px) {
  .wopo-panel { left: auto; top: 0; width: 420px; max-height: none; border-radius: 0; transform: translateX(16px); }
}
.wopo-sheet.is-open .wopo-panel { transform: none; opacity: 1; }
@media (prefers-reduced-motion: reduce) { .wopo-panel { transition: none; } }

.wopo-head {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 12px 12px 18px; border-bottom: 1px solid var(--wopo-line);
}
.wopo .wopo-head h2 { margin: 0; font-size: 1rem; font-weight: 700; line-height: 1.3; }
.wopo .wopo-x {
  width: 36px; height: 36px; padding: 0; border: 0; border-radius: var(--wopo-r);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--wopo-soft); color: inherit; cursor: pointer;
}
.wopo-body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: 4px 18px 16px; -webkit-overflow-scrolling: touch; }

.wopo-lines { list-style: none; margin: 0; padding: 0; }
.wopo-line {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--wopo-line);
}
.wopo-line img { width: 44px; height: 44px; object-fit: contain; border-radius: 6px; background: var(--wopo-soft); }
.wopo-line-name { display: block; font-size: .875rem; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wopo-line-opt { display: block; font-size: .8rem; color: var(--wopo-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wopo-line-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.wopo-line-price { font-size: .85rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.wopo-line-empty { padding: 18px 0; color: var(--wopo-muted); font-size: .9rem; }
.wopo-qty { display: flex; align-items: center; height: 30px; border: 1px solid var(--wopo-line); border-radius: 7px; }
.wopo .wopo-qty button { width: 30px; height: 100%; padding: 0; border: 0; background: transparent; color: inherit; font-size: 1rem; cursor: pointer; }
.wopo-qty-n { min-width: 20px; text-align: center; font-size: .85rem; font-variant-numeric: tabular-nums; }

.wopo-sum { margin: 10px 0 18px; font-size: .875rem; }
.wopo-sum > div { display: flex; justify-content: space-between; padding: 3px 0; }
.wopo-sum dt, .wopo-sum dd { margin: 0; }
.wopo-sum dt { color: var(--wopo-muted); font-weight: 400; }
.wopo-sum dd { font-variant-numeric: tabular-nums; }
.wopo-sum > .wopo-grand { margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--wopo-line); font-size: 1rem; font-weight: 700; }
.wopo-sum > .wopo-grand dt { color: inherit; font-weight: 700; }

/* ---------- Form ---------- */
.wopo .wopo-sec { margin: 0 0 8px; padding: 0; font-size: .8rem; font-weight: 700; color: var(--wopo-muted); }
.wopo-form .wopo-f { display: block; margin: 0 0 10px; font-size: .8rem; font-weight: 600; }
.wopo-form .wopo-f-short { max-width: 50%; }
.wopo-form input:not([type="radio"]), .wopo-form textarea {
  display: block; width: 100%; margin-top: 4px; padding: 0 12px; height: 42px;
  border: 1px solid var(--wopo-field); border-radius: var(--wopo-r);
  background: var(--wopo-bg); color: inherit; font-size: 16px; font-weight: 400; line-height: 1.3;
}
.wopo-form textarea { height: auto; min-height: 64px; padding: 10px 12px; resize: vertical; }
.wopo-form [aria-invalid="true"] { border-color: var(--wopo-danger); box-shadow: 0 0 0 1px var(--wopo-danger); }

.wopo-pay { margin: 16px 0 10px; padding: 0; border: 0; min-width: 0; }
.wopo-form .wopo-radio {
  display: flex; align-items: center; gap: 10px; margin: 0 0 6px; padding: 0 12px; height: 44px;
  border: 1px solid var(--wopo-field); border-radius: var(--wopo-r);
  font-size: .9rem; font-weight: 500; cursor: pointer;
}
.wopo-form .wopo-radio input { margin: 0; accent-color: var(--wopo-accent); }
.wopo-form .wopo-radio:has(input:checked) { border-color: var(--wopo-accent); box-shadow: 0 0 0 1px var(--wopo-accent); }

.wopo-note { margin: 6px 0 0; }
.wopo-note summary { cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--wopo-accent); padding: 4px 0; }
.wopo-note[open] summary { margin-bottom: 4px; }
.wopo-form .wopo-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---------- Footer with submit, always visible ---------- */
.wopo-foot {
  flex: none; padding: 10px 18px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--wopo-line); background: var(--wopo-bg);
}
.wopo-error { margin: 0 0 8px; color: var(--wopo-danger); font-size: .85rem; }
.wopo-error:empty { display: none; }

.wopo .wopo-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 48px; padding: 0 16px; border: 0; border-radius: 10px;
  background: var(--wopo-accent); color: var(--wopo-accent-ink);
  font-size: .95rem; font-weight: 700; text-decoration: none; cursor: pointer;
}
.wopo .wopo-submit { justify-content: space-between; }
.wopo .wopo-submit:disabled { opacity: .5; cursor: not-allowed; }
.wopo .wopo-submit.is-busy { opacity: .75; cursor: progress; }
.wopo-submit-total { font-variant-numeric: tabular-nums; }
.wopo .wopo-btn-ghost { margin-top: 8px; background: transparent; color: var(--wopo-ink); border: 1px solid var(--wopo-field); }

/* ---------- Done ---------- */
.wopo-step-done { padding: 28px 0 8px; text-align: center; }
.wopo-tick {
  width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--wopo-accent); color: var(--wopo-accent-ink);
}
.wopo-done-title { margin: 0 0 6px; font-size: 1.1rem; font-weight: 700; outline: none; }
.wopo-done-text { margin: 0 0 20px; font-size: .9rem; color: var(--wopo-muted); }

/* ---------- Payment options with gateway details (v1.2) ---------- */
.wopo-pay-opt { margin: 0 0 6px; }
.wopo-pay-opt .wopo-radio { margin: 0; }
.wopo-radio-title { flex: 1 1 auto; min-width: 0; }
.wopo-radio-icon { display: flex; align-items: center; gap: 4px; flex: none; }
.wopo .wopo-radio-icon img { display: inline-block; width: auto; max-height: 20px; margin: 0; float: none; }
.wopo-pay-box {
  margin: 6px 0 0; padding: 10px 12px; border-radius: var(--wopo-r);
  background: var(--wopo-soft); font-size: .8rem; line-height: 1.45; color: var(--wopo-muted);
}
.wopo-pay-box p { margin: 0 0 6px; }
.wopo-pay-box p:last-child { margin: 0; }
.wopo-pay-box img { max-height: 22px; width: auto; }

/* ---------- Guided tips ---------- */
.wopo-guide {
  position: fixed; top: 0; left: 0; z-index: calc(var(--wopo-top) + 5);
  display: flex; align-items: center; gap: 8px;
  max-width: min(260px, calc(100vw - 16px));
  padding: 8px 6px 8px 12px; border-radius: 10px;
  background: var(--wopo-ink); color: #fff;
  font-size: .8rem; font-weight: 500; line-height: 1.35;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .25);
}
.wopo-guide.is-in { animation: wopo-pop .18s ease-out; }
.wopo-guide-arrow {
  position: absolute; left: var(--ax, 50%); bottom: -5px;
  width: 11px; height: 11px; background: inherit; border-radius: 2px;
  transform: translateX(-50%) rotate(45deg);
}
.wopo-guide.is-below .wopo-guide-arrow { bottom: auto; top: -5px; }
.wopo .wopo-guide-x {
  flex: none; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer;
}
.wopo .wopo-hl { animation: wopo-ring 1.6s ease-out infinite; position: relative; z-index: 1; }
.wopo .wopo-radio.wopo-hl, .wopo .wopo-bar-cta.wopo-hl { z-index: auto; }
@keyframes wopo-ring {
  0%   { box-shadow: 0 0 0 0 rgba(18, 140, 74, .55); }
  100% { box-shadow: 0 0 0 10px rgba(18, 140, 74, 0); }
}
@keyframes wopo-pop {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .wopo-guide.is-in { animation: none; }
  .wopo .wopo-hl { animation: none; box-shadow: 0 0 0 2px var(--wopo-accent); }
}

/* =========================================================
   v1.3: rail view, filters, item details panel
   ========================================================= */
.wopo { --wopo-wall: #edecea; --wopo-rail: #9a9a9a; --wopo-hang-w: 150px; }
@media (min-width: 768px) { .wopo { --wopo-hang-w: 200px; } }

/* Grid image is now a button that opens details */
.wopo .wopo-media { width: 100%; padding: 0; border: 0; cursor: zoom-in; }

/* ---------- Toolbar: category chips + view toggle ---------- */
.wopo-tools { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.wopo-chips {
  flex: 1 1 auto; min-width: 0; display: flex; gap: 6px;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.wopo-chips::-webkit-scrollbar { display: none; }
.wopo .wopo-chip {
  flex: none; height: 32px; padding: 0 14px; border: 1px solid var(--wopo-line); border-radius: 999px;
  background: var(--wopo-bg); color: var(--wopo-ink); font-size: .8rem; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.wopo .wopo-chip[aria-pressed="true"] { background: var(--wopo-ink); border-color: var(--wopo-ink); color: #fff; }
.wopo-views { flex: none; display: flex; margin-left: auto; padding: 3px; border-radius: 10px; background: var(--wopo-soft); }
.wopo .wopo-views button {
  width: 34px; height: 30px; padding: 0; border: 0; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--wopo-muted); cursor: pointer;
}
.wopo .wopo-views button[aria-pressed="true"] { background: var(--wopo-bg); color: var(--wopo-ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

/* ---------- Rail ---------- */
.wopo-rail {
  position: relative; margin: 0 0 calc(var(--wopo-offset) + 88px);
  border-radius: 14px; overflow: hidden;
  background: var(--wopo-wall);
}
/* Soft spotlight laid over everything, so image boxes and wall stay seamless */
.wopo-rail::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(ellipse 70% 60% at 50% 0%, rgba(255, 255, 255, .5), transparent 70%);
}
.wopo-rail-scroll {
  overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; cursor: grab;
  padding: 26px 0 18px;
}
.wopo-rail-scroll::-webkit-scrollbar { display: none; }
.wopo-rail-scroll.is-drag { cursor: grabbing; scroll-snap-type: none; }
.wopo-rail-scroll.is-drag .wopo-hang-btn { pointer-events: none; }

.wopo-rail-track {
  position: relative; list-style: none; margin: 0; padding: 0 28px;
  display: flex; gap: 6px; width: max-content; min-width: 100%;
}
@media (min-width: 768px) { .wopo-rail-track { padding: 0 64px; gap: 14px; } }
/* The metal bar */
.wopo-rail-track::before {
  content: ""; position: absolute; left: 10px; right: 10px; top: 3px; height: 5px; border-radius: 3px;
  background: linear-gradient(#d9d9d9, var(--wopo-rail) 60%, #7a7a7a);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .18);
}

.wopo-hang { flex: none; width: var(--wopo-hang-w); margin: 0; padding: 0; scroll-snap-align: center; }
.wopo .wopo-hang-btn {
  position: relative; display: flex; flex-direction: column; align-items: center;
  width: 100%; padding: 0; border: 0; background: transparent; color: var(--wopo-ink);
  cursor: pointer; transform-origin: 50% 2px;
  transition: transform .25s ease, opacity .25s ease;
}
.wopo-hanger { position: relative; width: 58%; height: auto; color: #5c5c5c; margin-bottom: -14%; }
.wopo-hang-img { position: relative; display: block; width: 100%; aspect-ratio: var(--wopo-ratio, 1); background: var(--wopo-wall); }
.wopo .wopo-hang-img img {
  display: block; width: 100%; height: 100%; object-fit: contain;
  mix-blend-mode: multiply; pointer-events: none; -webkit-user-drag: none; user-select: none;
}
/* Soft floor shadow */
.wopo-hang-btn::after {
  content: ""; display: block; width: 60%; height: 10px; margin-top: 2px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .16), transparent);
}
.wopo-hang-tag {
  max-width: 100%; margin-top: 4px; padding: 0 4px;
  font-size: .75rem; font-weight: 600; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wopo-hang-badge {
  position: absolute; top: 14%; right: 12%; z-index: 2;
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--wopo-accent); color: var(--wopo-accent-ink); font-size: .72rem; font-weight: 700;
  box-shadow: 0 0 0 2px var(--wopo-wall);
}

@media (hover: hover) {
  .wopo .wopo-hang-btn:hover { animation: wopo-swing .7s ease-out; }
}
.wopo.is-peek-open .wopo-hang:not(.is-active) .wopo-hang-btn { opacity: .4; }
.wopo .wopo-hang.is-active .wopo-hang-btn { transform: translateY(-4px) scale(1.05); }
@keyframes wopo-swing {
  0% { transform: rotate(0); } 30% { transform: rotate(2.4deg); }
  60% { transform: rotate(-1.4deg); } 100% { transform: rotate(0); }
}

.wopo .wopo-rail-nav {
  position: absolute; top: 50%; z-index: 3; width: 38px; height: 38px; margin-top: -19px; padding: 0;
  display: none; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: var(--wopo-bg); color: var(--wopo-ink);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .16); cursor: pointer;
}
.wopo-rail-nav.is-prev { left: 12px; }
.wopo-rail-nav.is-next { right: 12px; }
.wopo .wopo-rail-nav:disabled { opacity: 0; pointer-events: none; }
@media (hover: hover) and (min-width: 768px) {
  .wopo-rail.has-overflow .wopo-rail-nav { display: inline-flex; }
}

/* ---------- Item details panel ---------- */
.wopo-peek { position: fixed; inset: 0; z-index: calc(var(--wopo-top) + 1); }
.wopo-peek .wopo-backdrop { background: rgba(0, 0, 0, .35); }
@media (min-width: 768px) { .wopo-peek .wopo-backdrop { background: rgba(0, 0, 0, .12); } }
.wopo.is-peek-open .wopo-bar { display: none; }

.wopo-peek-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 90vh; max-height: 90dvh;
  display: flex; flex-direction: column;
  background: var(--wopo-bg); border-radius: 14px 14px 0 0; outline: none;
  transform: translateY(16px); opacity: 0; transition: transform .2s ease, opacity .2s ease;
}
@media (min-width: 768px) {
  .wopo-peek-panel { left: auto; top: 0; width: 400px; max-height: none; border-radius: 0; transform: translateX(16px); }
}
.wopo-peek.is-open .wopo-peek-panel { transform: none; opacity: 1; }
@media (prefers-reduced-motion: reduce) { .wopo-peek-panel { transition: none; } }

.wopo-peek-nav { display: flex; align-items: center; gap: 4px; }
.wopo .wopo-peek-nav button {
  width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--wopo-r);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--wopo-soft); color: inherit; cursor: pointer;
}
.wopo .wopo-peek-nav button:disabled { opacity: .35; cursor: default; }
.wopo-peek-pos { min-width: 48px; text-align: center; font-size: .8rem; color: var(--wopo-muted); font-variant-numeric: tabular-nums; }

.wopo-peek-media {
  margin: 12px 0 14px; border-radius: 12px; overflow: hidden;
  background: var(--wopo-wall); aspect-ratio: var(--wopo-ratio, 1);
  max-height: 42vh; max-height: 42dvh; display: flex; justify-content: center;
}
.wopo-peek-img { display: block; height: 100%; width: 100%; object-fit: contain; mix-blend-mode: multiply; }
.wopo .wopo-peek-name { margin: 0; font-size: 1.1rem; font-weight: 700; line-height: 1.3; }
.wopo-peek-price { margin: 2px 0 8px; font-size: .95rem; color: var(--wopo-muted); font-variant-numeric: tabular-nums; }
.wopo-peek-price del { opacity: .7; margin-right: 4px; }
.wopo-peek-price ins { text-decoration: none; color: var(--wopo-ink); font-weight: 600; }
.wopo-peek-desc { margin: 0 0 14px; font-size: .85rem; line-height: 1.5; color: var(--wopo-muted); }
.wopo-peek-opts-wrap { margin: 6px 0 4px; }
.wopo-peek-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.wopo .wopo-opt-chip {
  position: relative; min-width: 48px; height: 40px; padding: 0 14px;
  border: 1px solid var(--wopo-field); border-radius: var(--wopo-r);
  background: var(--wopo-bg); color: var(--wopo-ink); font-size: .85rem; font-weight: 600; cursor: pointer;
}
.wopo .wopo-opt-chip[aria-checked="true"] { border-color: var(--wopo-ink); background: var(--wopo-ink); color: #fff; }
.wopo-opt-chip.is-in::after {
  content: ""; position: absolute; top: -3px; right: -3px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--wopo-accent); box-shadow: 0 0 0 2px var(--wopo-bg);
}
.wopo-shake { animation: wopo-shake .35s ease; }
@keyframes wopo-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@media (prefers-reduced-motion: reduce) {
  .wopo-shake, .wopo .wopo-hang-btn:hover { animation: none; }
  .wopo .wopo-hang-btn { transition: none; }
}

.wopo-peek-row { display: flex; gap: 8px; }
.wopo-peek-row .wopo-stepper { flex: none; width: 124px; height: 48px; border-radius: 10px; }
.wopo-peek-row .wopo-peek-checkout { flex: 1 1 auto; }
.wopo .wopo-btn-dark { background: var(--wopo-ink); color: #fff; }

/* =========================================================
   v1.4: real railing, transparent cutouts, boutique stage
   ========================================================= */
.wopo {
  --wopo-bar-1: #f2f2f2; --wopo-bar-2: #a7a7a7; --wopo-bar-3: #666;
  --wopo-hanger: #5c5c5c;
}

/* ---------- Railing: a fixed bar the hangers slide along ---------- */
.wopo-rail { --wopo-bar-top: calc(44px + var(--wopo-hang-w) * 0.0338 - 4px); }
.wopo-rail-track::before { display: none; }
.wopo-rail-scroll { position: relative; z-index: 1; padding: 44px 0 26px; }
.wopo-rail-bar {
  position: absolute; z-index: 0; left: 16px; right: 16px; top: var(--wopo-bar-top);
  height: 8px; border-radius: 4px;
  background: linear-gradient(var(--wopo-bar-1), var(--wopo-bar-2) 55%, var(--wopo-bar-3));
  box-shadow: 0 9px 12px -5px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .55);
}
/* Ceiling drop rods at both ends */
.wopo-rail-bar i {
  position: absolute; bottom: 2px; width: 4px; height: var(--wopo-bar-top); border-radius: 2px;
  background: linear-gradient(90deg, var(--wopo-bar-3), var(--wopo-bar-1), var(--wopo-bar-3));
}
.wopo-rail-bar i::after { /* end cap */
  content: ""; position: absolute; bottom: -5px; left: -4px; width: 12px; height: 12px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--wopo-bar-1), var(--wopo-bar-3));
}
.wopo-rail-bar .is-l { left: 18px; }
.wopo-rail-bar .is-r { right: 18px; }

.wopo-hanger { width: 58%; color: var(--wopo-hanger); margin-bottom: -15%; }
.wopo-hang-tag { margin-top: 6px; }

/* Image with transparent background: true silhouette shadow, no box ever */
.wopo .wopo-hang-img.is-cut { background: none; }
.wopo .wopo-hang-img.is-cut img, .wopo .wopo-media.is-cut img {
  mix-blend-mode: normal; filter: drop-shadow(0 14px 14px rgba(0, 0, 0, .35));
}
.wopo .wopo-media.is-cut { background: none; }

/* Guide highlight on a hanging item: gentle bob + name pill, no box */
.wopo .wopo-hang-btn.wopo-hl { box-shadow: none; animation: wopo-bob 1.8s ease-in-out infinite; }
.wopo .wopo-hang-btn.wopo-hl .wopo-hang-tag { padding: 2px 10px; border-radius: 999px; background: var(--wopo-accent); color: var(--wopo-accent-ink); }
@keyframes wopo-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

@media (prefers-reduced-motion: reduce) {
  .wopo .wopo-hang-btn.wopo-hl { animation: none; }
}

/* =========================================================
   v1.5: light boutique, readable panels, characters hero
   ========================================================= */
.wopo {
  --wopo-wall: #f5f3ef;
  --wopo-bar-1: #f4dfa6; --wopo-bar-2: #c39a4c; --wopo-bar-3: #7a5a22;
  --wopo-hanger: #3c3c3c;
}

/* ---------- Always-readable text in panels, fields and selects ---------- */
.wopo-panel, .wopo-peek-panel { color: var(--wopo-ink); }
.wopo select, .wopo input, .wopo textarea { color: var(--wopo-ink); }
.wopo .wopo-var { color: var(--wopo-ink); }
.wopo .wopo-var option:disabled { color: #a3a8ad; }
.wopo ::placeholder { color: #9aa0a6; opacity: 1; }
.wopo .wopo-x { color: var(--wopo-ink); }
.wopo-radio-title { color: var(--wopo-ink); }

/* ---------- Light rail ---------- */
.wopo-rail { background: var(--wopo-wall); border: 1px solid #ebe7e0; }
.wopo-rail::after {
  background:
    radial-gradient(ellipse 22% 80% at 18% 0, rgba(255, 236, 196, .22), transparent 70%),
    radial-gradient(ellipse 22% 80% at 50% 0, rgba(255, 236, 196, .26), transparent 70%),
    radial-gradient(ellipse 22% 80% at 82% 0, rgba(255, 236, 196, .22), transparent 70%);
}
.wopo-hang-pre, .wopo-badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: #fff1cc; color: #7a5300; font-size: .65rem; font-weight: 700; line-height: 1.4; vertical-align: middle;
}
.wopo-hang-pre { margin-top: 3px; }
.wopo-badge { margin-left: 4px; }

/* ---------- Characters hero ---------- */
@property --sx { syntax: '<percentage>'; inherits: true; initial-value: 50%; }
@property --sy { syntax: '<percentage>'; inherits: true; initial-value: 50%; }
.wopo-hero { margin: 0 0 18px; }
.wopo-hero-stage {
  position: relative; max-width: 980px; margin: 0 auto; perspective: 1400px;
  transition: --sx .6s ease, --sy .6s ease;
}
.wopo-hero-tilt {
  position: relative; transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .3s ease-out;
}
.wopo .wopo-hero-img {
  display: block; width: 100%; height: auto; margin: 0;
  transform-origin: var(--sx) var(--sy);
  transition: scale .6s ease;
  animation: wopo-breathe 6s ease-in-out infinite;
}
.wopo-hero-stage.has-spot .wopo-hero-img { scale: 1.035; }
@keyframes wopo-breathe { 0%, 100% { translate: 0 0; } 50% { translate: 0 -4px; } }
.wopo-hero-veil {
  position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .5s ease;
  background: radial-gradient(circle at var(--sx) var(--sy), transparent 0 12%, rgba(255, 255, 255, .72) 24%);
}
.wopo-hero-stage.has-spot .wopo-hero-veil { opacity: 1; }

.wopo .wopo-spot {
  position: absolute; left: var(--x); top: var(--y); z-index: 1;
  width: 13%; min-width: 44px; aspect-ratio: 1; padding: 0; border: 0; border-radius: 50%;
  transform: translate(-50%, -50%); background: transparent; cursor: pointer;
}
.wopo-spot-dot {
  position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  background: var(--wopo-accent); box-shadow: 0 0 0 3px rgba(255, 255, 255, .95); transition: opacity .3s ease;
}
.wopo-spot-dot::after {
  content: ""; position: absolute; inset: -3px; border-radius: 50%;
  border: 2px solid var(--wopo-accent); animation: wopo-ping 2.4s ease-out infinite;
}
@keyframes wopo-ping { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(2.6); opacity: 0; } }
.wopo-spot-tag {
  position: absolute; left: 50%; bottom: 62%; white-space: nowrap; pointer-events: none;
  padding: 5px 11px; border-radius: 999px; background: var(--wopo-ink); color: #fff;
  font-size: .75rem; font-weight: 700; line-height: 1.2;
  opacity: 0; transform: translate(-50%, 6px); transition: opacity .25s ease, transform .25s ease;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .2);
}
.wopo-spot.is-on .wopo-spot-tag, .wopo .wopo-spot:focus-visible .wopo-spot-tag { opacity: 1; transform: translate(-50%, 0); }
.wopo-spot.is-on .wopo-spot-dot { opacity: 0; }
.wopo .wopo-spot:focus-visible { outline: 2px solid var(--wopo-accent); outline-offset: 0; }
.wopo-hero-hint { margin: 6px 0 0; text-align: center; font-size: .8rem; color: var(--wopo-muted); }

.wopo-hero.is-video { position: relative; overflow: hidden; border-radius: 14px; aspect-ratio: 4 / 3; background: var(--wopo-soft); }
@media (min-width: 768px) { .wopo-hero.is-video { aspect-ratio: 16 / 7; } }
.wopo-hero-video { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .8s ease; }
.wopo-hero-video.is-on { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .wopo .wopo-hero-img, .wopo-spot-dot::after { animation: none; }
  .wopo-hero-tilt, .wopo .wopo-hero-img, .wopo-hero-veil, .wopo-hero-stage { transition: none; }
}

/* ---------- Details panel extras ---------- */
.wopo-head-actions { display: flex; gap: 6px; }
.wopo .wopo-share { position: relative; }
.wopo-share.is-copied::after {
  content: "Link copied"; position: absolute; top: 110%; right: 0; white-space: nowrap;
  padding: 4px 8px; border-radius: 6px; background: var(--wopo-ink); color: #fff; font-size: .72rem; font-weight: 600;
}
.wopo .wopo-opt-chip {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  height: auto; min-height: 44px; padding: 6px 14px; line-height: 1.15;
}
.wopo-opt-chip small { display: block; font-size: .62rem; font-weight: 600; opacity: .75; text-decoration: none; }
.wopo .wopo-opt-chip.is-oos {
  color: #a3a8ad; border-style: dashed; cursor: not-allowed; text-decoration: line-through;
  background: repeating-linear-gradient(135deg, #fafafa 0 6px, #f1f2f3 6px 12px);
}
.wopo-peek-stock { margin: 8px 0 0; font-size: .8rem; font-weight: 600; color: #b45309; }
.wopo-peek-stock:empty { display: none; }
.wopo-peek-pre { margin: 8px 0 0; font-size: .8rem; color: var(--wopo-muted); }
.wopo-peek-pre .wopo-badge { margin-left: 0; }

.wopo-sizeguide { margin: 12px 0 0; }
.wopo-sizeguide summary { cursor: pointer; width: max-content; font-size: .85rem; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.wopo-sizeguide-wrap { margin-top: 8px; overflow-x: auto; }
.wopo-sizeguide table { width: 100%; margin: 0; border-collapse: collapse; font-size: .8rem; font-variant-numeric: tabular-nums; }
.wopo-sizeguide th, .wopo-sizeguide td { padding: 7px 8px; border: 0; border-bottom: 1px solid var(--wopo-line); text-align: left; background: none; }
.wopo-sizeguide thead th { color: var(--wopo-muted); font-weight: 600; }

/* ---------- Form extras ---------- */
.wopo-f-row { display: flex; align-items: flex-end; gap: 12px; }
.wopo-f-row .wopo-f-short { flex: 0 0 50%; max-width: none; }
.wopo-state { margin-bottom: 22px; font-size: .85rem; color: var(--wopo-muted); line-height: 1.2; }
.wopo-form .wopo-check { display: flex; align-items: center; gap: 8px; margin: 12px 0 4px; font-size: .85rem; font-weight: 500; cursor: pointer; }
.wopo-form .wopo-check input { display: inline-block; flex: none; width: 18px; height: 18px; margin: 0; padding: 0; accent-color: var(--wopo-accent); }
.wopo-free-hint { margin: -10px 0 16px; font-size: .8rem; font-weight: 600; color: var(--wopo-accent); }
.wopo-free-hint:empty { display: none; }
