/* Parlay virtual try-on. Everything is scoped under .ptry-root (created by parlay-tryon-loader.js). */
.ptry-root {
  --ptry-ink: #111;
  --ptry-paper: #fff;
  --ptry-accent: #111;
  position: fixed; inset: 0; z-index: 2147483000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 10, 10, .62);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  font-family: inherit; color: var(--ptry-ink);
  -webkit-tap-highlight-color: transparent;
}
.ptry-root *, .ptry-root *::before, .ptry-root *::after { box-sizing: border-box; }

/* ---- consent / message cards ---- */
.ptry-card {
  width: min(92vw, 400px); padding: 28px 24px 22px; border-radius: 18px;
  background: var(--ptry-paper); color: var(--ptry-ink); text-align: center;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .35);
}
.ptry-title { margin: 0 0 10px; font-size: 20px; line-height: 1.25; font-weight: 600; letter-spacing: -.01em; }
.ptry-text { margin: 0 0 20px; font-size: 14.5px; line-height: 1.5; opacity: .78; }
.ptry-row { display: flex; gap: 10px; }
.ptry-row .ptry-btn { flex: 1; }
.ptry-btn {
  appearance: none; -webkit-appearance: none; cursor: pointer; font: inherit; font-size: 15px; font-weight: 600;
  min-height: 46px; padding: 0 18px; border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, .18); background: transparent; color: var(--ptry-ink);
}
.ptry-btn-primary { background: var(--ptry-accent); border-color: var(--ptry-accent); color: #fff; }
.ptry-btn:focus-visible, .ptry-icon:focus-visible, .ptry-swatch:focus-visible, .ptry-lens:focus-visible, .ptry-shutter:focus-visible {
  outline: 2px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 4px rgba(0, 0, 0, .6);
}
.ptry-wait { background: transparent; box-shadow: none; color: #fff; }
.ptry-wait-text { margin: 14px 0 0; font-size: 14.5px; opacity: .9; }
.ptry-spinner {
  width: 30px; height: 30px; margin: 0 auto; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .28); border-top-color: #fff; animation: ptry-spin .8s linear infinite;
}
@keyframes ptry-spin { to { transform: rotate(360deg); } }

/* ---- the try-on stage ---- */
.ptry-stage {
  position: relative; overflow: hidden; background: #0c0c0c; color: #fff;
  width: 100vw; height: 100vh; height: 100dvh;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
@media (min-width: 760px) and (min-height: 560px) {
  .ptry-stage { width: min(94vw, 1180px); height: min(90vh, 780px); border-radius: 22px; box-shadow: 0 30px 100px rgba(0, 0, 0, .5); }
}
.ptry-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; transform: scaleX(-1); opacity: 0; transition: opacity .35s ease; }
.ptry-stage.is-live .ptry-canvas { opacity: 1; }
/* The camera feed is drawn inside the canvas; the <video> only has to stay "visible" enough to keep playing on iOS. */
.ptry-video { position: absolute; left: 0; top: 0; width: 2px; height: 2px; opacity: 0; pointer-events: none; }

.ptry-top, .ptry-bottom { position: absolute; left: 0; right: 0; z-index: 3; display: flex; align-items: center; pointer-events: none; }
.ptry-top > *, .ptry-bottom > * { pointer-events: auto; }
.ptry-top {
  top: 0; justify-content: flex-end; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) calc(14px + env(safe-area-inset-right, 0px)) 28px calc(18px + env(safe-area-inset-left, 0px));
  background: linear-gradient(to bottom, rgba(0, 0, 0, .42), rgba(0, 0, 0, 0));
}
.ptry-icon {
  appearance: none; -webkit-appearance: none; cursor: pointer; width: 44px; height: 44px; border-radius: 50%; border: 0; padding: 0;
  display: grid; place-items: center; color: #fff; background: rgba(20, 20, 20, .45);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.ptry-icon svg { width: 20px; height: 20px; }

.ptry-bottom {
  bottom: 0; flex-direction: column; gap: 14px;
  padding: 44px calc(14px + env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) calc(14px + env(safe-area-inset-left, 0px));
  background: linear-gradient(to top, rgba(0, 0, 0, .5), rgba(0, 0, 0, 0));
}
.ptry-options { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 18px; max-width: 100%; }
.ptry-swatches, .ptry-lenses { display: flex; align-items: center; gap: 10px; }
.ptry-swatch {
  appearance: none; -webkit-appearance: none; cursor: pointer; width: 38px; height: 38px; padding: 0; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .55); background-clip: padding-box; position: relative;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
}
.ptry-swatch[aria-pressed="true"] { border-color: #fff; box-shadow: 0 0 0 2px #fff, 0 2px 10px rgba(0, 0, 0, .35); }
.ptry-lenses { padding: 4px; border-radius: 999px; background: rgba(20, 20, 20, .45); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); gap: 2px; }
.ptry-lens {
  appearance: none; -webkit-appearance: none; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; color: #fff;
  min-height: 36px; padding: 0 14px 0 10px; border: 0; border-radius: 999px; background: transparent;
  display: inline-flex; align-items: center; gap: 7px;
}
.ptry-lens i { width: 14px; height: 14px; border-radius: 50%; display: inline-block; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5); }
.ptry-lens[aria-pressed="true"] { background: #fff; color: #111; }
.ptry-shutter {
  appearance: none; -webkit-appearance: none; cursor: pointer; width: 66px; height: 66px; padding: 0; border-radius: 50%;
  border: 3px solid #fff; background: transparent; position: relative;
}
.ptry-shutter::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: #fff; transition: transform .12s ease; }
.ptry-shutter:active::after { transform: scale(.9); }
.ptry-shutter[disabled] { opacity: .4; cursor: default; }
/* shutter centred, "Add to cart" beside it */
.ptry-actions { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; width: 100%; max-width: 560px; }
.ptry-cart {
  appearance: none; -webkit-appearance: none; cursor: pointer; justify-self: start; font: inherit; font-size: 14.5px; font-weight: 600; line-height: 1;
  min-height: 48px; max-width: 100%; padding: 0 18px; border: 0; border-radius: 999px; background: #fff; color: #111;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .35); transition: background-color .15s ease, color .15s ease, transform .12s ease;
}
.ptry-cart[hidden] { display: none; }
.ptry-cart:active { transform: scale(.97); }
.ptry-cart-price { font-weight: 500; opacity: .62; }
.ptry-cart-price:empty { display: none; }
.ptry-cart[data-state="busy"] { cursor: progress; opacity: .85; }
.ptry-cart[data-state="done"] { background: #1f7a45; color: #fff; }
.ptry-cart[data-state="error"] { background: #b3261e; color: #fff; }
.ptry-cart[data-state="soldout"] { background: rgba(20, 20, 20, .55); color: rgba(255, 255, 255, .8); cursor: default; box-shadow: none; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.ptry-cart:focus-visible { outline: 2px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 4px rgba(0, 0, 0, .6); }
@media (max-width: 430px) {
  .ptry-actions { gap: 10px; }
  .ptry-cart { font-size: 13.5px; padding: 0 14px; min-height: 46px; }
  .ptry-cart-price { display: none; }
}

/* status: hints over the video, and full-panel messages for errors */
.ptry-hint {
  position: absolute; z-index: 2; left: 50%; top: 22%; transform: translate(-50%, 0); max-width: min(84%, 340px);
  padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 500; text-align: center; line-height: 1.3;
  background: rgba(20, 20, 20, .6); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  opacity: 0; transition: opacity .25s ease; pointer-events: none;
}
.ptry-hint.is-on { opacity: 1; }
/* size calibration */
.ptry-measure, .ptry-toast {
  position: absolute; z-index: 2; left: 50%; top: 20%; transform: translate(-50%, 0); width: max-content; max-width: min(88%, 360px);
  display: flex; align-items: center; gap: 12px; padding: 12px 18px 12px 14px; border-radius: 18px; text-align: left;
  background: rgba(20, 20, 20, .66); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  opacity: 0; transition: opacity .25s ease; pointer-events: none;
}
.ptry-measure.is-on, .ptry-toast.is-on { opacity: 1; }
.ptry-toast { flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 18px; }
.ptry-measure strong, .ptry-toast strong { display: block; font-size: 14.5px; font-weight: 600; line-height: 1.25; }
.ptry-measure span, .ptry-toast span { display: block; font-size: 12.5px; line-height: 1.35; opacity: .8; }
.ptry-ring { width: 40px; height: 40px; flex: none; transform: rotate(-90deg); }
.ptry-ring circle { fill: none; stroke: rgba(255, 255, 255, .25); stroke-width: 4; }
.ptry-ring .ptry-ring-fill { stroke: #fff; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset .12s linear; }
.ptry-size {
  position: absolute; z-index: 3; left: calc(18px + env(safe-area-inset-left, 0px)); top: calc(18px + env(safe-area-inset-top, 0px));
  display: none; align-items: center; gap: 8px; font-size: 12.5px;
}
.ptry-size.is-on { display: flex; }
.ptry-size-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-weight: 600;
  background: rgba(20, 20, 20, .5); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.ptry-size-badge::before { content: "\2713"; font-size: 11px; }
.ptry-size.is-approx .ptry-size-badge::before { content: "\2248"; }
.ptry-size-again {
  appearance: none; -webkit-appearance: none; cursor: pointer; font: inherit; font-size: 12.5px; color: #fff; background: none; border: 0;
  padding: 8px 6px; text-decoration: underline; text-underline-offset: 3px; opacity: .9; text-shadow: 0 1px 6px rgba(0, 0, 0, .6);
}
.ptry-size-again:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.ptry-panel {
  position: absolute; inset: 0; z-index: 4; display: none; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 32px; text-align: center; background: #0c0c0c;
}
.ptry-panel.is-on { display: flex; }
.ptry-panel h2 { margin: 12px 0 0; font-size: 19px; font-weight: 600; }
.ptry-panel p { margin: 4px 0 14px; max-width: 320px; font-size: 14.5px; line-height: 1.5; opacity: .8; }
.ptry-panel .ptry-btn { color: #fff; border-color: rgba(255, 255, 255, .4); }
.ptry-flash { position: absolute; inset: 0; z-index: 5; background: #fff; opacity: 0; pointer-events: none; }
.ptry-flash.is-on { animation: ptry-flash .35s ease-out; }
@keyframes ptry-flash { from { opacity: .85; } to { opacity: 0; } }

.ptry-debug {
  position: absolute; z-index: 6; left: 8px; top: 108px; padding: 8px 10px; border-radius: 8px; font: 11px/1.45 ui-monospace, Menlo, monospace;
  background: rgba(0, 0, 0, .6); color: #b9f6c2; white-space: pre; pointer-events: auto;
}
.ptry-debug label { display: block; color: #fff; }
.ptry-debug input { width: 150px; vertical-align: middle; }

@media (prefers-reduced-motion: reduce) {
  .ptry-spinner { animation-duration: 2s; }
  .ptry-flash.is-on { animation: none; }
  .ptry-cart, .ptry-canvas, .ptry-hint, .ptry-measure, .ptry-toast, .ptry-ring .ptry-ring-fill { transition: none; }
}
