/* NYLA Virtual Try-On v2 — Maybelline-style experience. */

.nyla-tryon.nyt2 {
  --nyt-h: 620px;
  --nyt-accent: #111;
  --nyt-r: 14px;
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #fff;
  border-radius: var(--nyt-r);
  box-shadow: 0 10px 40px rgba(0,0,0,.14);
  overflow: hidden;
}
.nyla-tryon.nyt2 *, .nyla-tryon.nyt2 *::before, .nyla-tryon.nyt2 *::after { box-sizing: border-box; }
.nyla-tryon.nyt2 [hidden] { display: none !important; }
/* Low-specificity button reset so component rules below can restyle freely. */
.nyt2 button { font-family: inherit; cursor: pointer; border: 0; background: none; padding: 0; color: inherit; -webkit-tap-highlight-color: transparent; }

/* ── Stage ── */
.nyt2 .nyt-stage {
  position: relative;
  width: 100%;
  height: var(--nyt-h);
  max-height: 78vh;
  background: #0c0c0e;
  overflow: hidden;
}
.nyt2 .nyt-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; pointer-events: none; }
.nyt2 .nyt-canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }

/* ── Top bar ── */
.nyt2 .nyt-topbar {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px; z-index: 6;
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.nyt2.is-live .nyt-topbar { opacity: 1; pointer-events: auto; }
.nyt2 .nyt-top-group { display: flex; gap: 10px; }
.nyt2 .nyt-icon {
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(14,14,16,.62); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: transform .15s, background .15s;
}
.nyt2 .nyt-icon svg { width: 21px; height: 21px; }
.nyt2 .nyt-icon:active { transform: scale(.92); }
@media (hover:hover) { .nyt2 .nyt-icon:hover { background: rgba(14,14,16,.85); } }

/* ── Compare ── */
.nyt2 .nyt-cmp { position: absolute; inset: 0; z-index: 5; pointer-events: none; --x: 50%; }
.nyt2 .nyt-cmp-line { position: absolute; top: 0; bottom: 0; left: var(--x); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 8px rgba(0,0,0,.5); }
.nyt2 .nyt-cmp-knob {
  position: absolute; top: 50%; left: var(--x);
  transform: translate(-50%, -50%);
  width: 46px; height: 46px; border-radius: 50%;
  background: #fff; color: #111;
  display: flex; align-items: center; justify-content: center; gap: 2px;
  font-size: 13px; font-weight: 700;
  box-shadow: 0 2px 12px rgba(0,0,0,.4);
  pointer-events: auto; cursor: ew-resize; touch-action: none;
  user-select: none; -webkit-user-select: none;
}
.nyt2 .nyt-cmp-tag {
  position: absolute; top: 64px;
  font-size: 10px; font-weight: 700; letter-spacing: .12em;
  color: #fff; background: rgba(14,14,16,.55);
  padding: 5px 9px; border-radius: 99px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.nyt2 .nyt-cmp-l { left: 12px; }
.nyt2 .nyt-cmp-r { right: 12px; }

/* ── Hint chip ── */
.nyt2 .nyt-hint-chip {
  position: absolute; top: 68px; left: 50%; transform: translateX(-50%);
  background: rgba(14,14,16,.6); color: #fff;
  font-size: 12.5px; padding: 7px 14px; border-radius: 99px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  z-index: 5; white-space: nowrap;
}

/* ── Product card ── */
.nyt2 .nyt-pcard {
  position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 6;
  display: flex; align-items: center; gap: 11px;
  background: rgba(12,12,14,.78); color: #fff;
  border-radius: 12px; padding: 10px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  animation: nyt-card-in .28s ease;
}
@keyframes nyt-card-in { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.nyt2 .nyt-pc-img { width: 54px; height: 54px; border-radius: 9px; object-fit: cover; background: #fff; flex: 0 0 auto; display: block; }
.nyt2 .nyt-pc-info { flex: 1 1 auto; min-width: 0; }
.nyt2 .nyt-pc-name { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nyt2 .nyt-pc-shade { font-size: 12.5px; opacity: .85; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nyt2 .nyt-pc-price { font-size: 14px; font-weight: 700; margin-top: 3px; }
.nyt2 .nyt-pc-oos { display: inline-block; background: #e0265e; color: #fff; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 99px; margin-left: 4px; vertical-align: 1px; }
.nyt2 .nyt-pc-actions { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.nyt2 .nyt-pc-x { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.nyt2 .nyt-pc-x svg { width: 15px; height: 15px; }
.nyt2 .nyt-pc-buy {
  background: #fff; color: #111;
  font-size: 12.5px; font-weight: 800; letter-spacing: .05em;
  padding: 11px 16px; border-radius: 9px;
  transition: transform .15s;
  white-space: nowrap;
}
.nyt2 .nyt-pc-buy:active { transform: scale(.95); }
.nyt2 .nyt-pc-buy[disabled] { opacity: .55; cursor: default; }

/* ── Overlays ── */
.nyt2 .nyt-overlay {
  position: absolute; inset: 0; z-index: 8;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 26px;
  background: radial-gradient(120% 100% at 50% 0%, #232327 0%, #0c0c0e 70%);
  color: #fff;
}
.nyt2 .nyt-brand { font-size: 42px; font-weight: 800; letter-spacing: .34em; margin-right: -.34em; }
.nyt2 .nyt-tag { font-size: 12px; letter-spacing: .42em; margin: 8px 0 30px; opacity: .75; margin-right: -.42em; }
.nyt2 .nyt-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  width: min(290px, 86%);
  background: #fff; color: #111;
  font-size: 14.5px; font-weight: 700;
  padding: 14px 20px; border-radius: 99px;
  margin-top: 12px; transition: transform .15s;
}
.nyt2 .nyt-cta:active { transform: scale(.96); }
.nyt2 .nyt-cta svg { width: 19px; height: 19px; }
.nyt2 .nyt-cta-ghost { background: transparent; color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.55); }
.nyt2 .nyt-privacy { font-size: 11.5px; opacity: .55; margin: 26px 0 0; max-width: 300px; line-height: 1.5; }
.nyt2 .nyt-err-msg { font-size: 14px; line-height: 1.55; max-width: 320px; opacity: .9; }
.nyt2 .nyt-err-actions { display: flex; flex-direction: column; align-items: center; width: 100%; }
.nyt2 .nyt-spin {
  width: 44px; height: 44px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.18); border-top-color: #fff;
  animation: nyt-spin .8s linear infinite; margin-bottom: 18px;
}
@keyframes nyt-spin { to { transform: rotate(360deg); } }
.nyt2 .nyt-load-msg { font-size: 13.5px; opacity: .8; }

/* ── Capture flash ── */
.nyt2 .nyt-flash { position: absolute; inset: 0; background: #fff; z-index: 9; animation: nyt-flash .45s ease forwards; pointer-events: none; }
@keyframes nyt-flash { 0% { opacity: .9; } 100% { opacity: 0; } }

/* ── Bottom panel ── */
.nyt2 .nyt-panel { background: #fff; padding: 4px 0 0; }
.nyt2 .nyt-cats { display: flex; justify-content: center; gap: 26px; padding: 11px 16px 2px; }
.nyt2 .nyt-cat {
  font-size: 12.5px; font-weight: 800; letter-spacing: .14em;
  color: #9a9a9f; padding: 7px 2px; position: relative;
}
.nyt2 .nyt-cat.is-active { color: #111; }
.nyt2 .nyt-cat.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 2.5px; background: #111; border-radius: 2px;
}

/* intensity */
.nyt2 .nyt-int-row { display: flex; align-items: center; gap: 12px; padding: 10px 18px 4px; transition: opacity .2s; }
.nyt2 .nyt-int-row.is-off { opacity: .35; pointer-events: none; }
.nyt2 .nyt-int-label { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #6e6e74; }
.nyt2 .nyt-int-val { font-size: 12.5px; font-weight: 700; color: #111; min-width: 40px; text-align: right; font-variant-numeric: tabular-nums; }
.nyt2 .nyt-int {
  -webkit-appearance: none; appearance: none;
  flex: 1; height: 5px; border-radius: 99px;
  --fill: 80%;
  background: linear-gradient(to right, #111 var(--fill), #e4e4e8 var(--fill));
  outline: none;
}
.nyt2 .nyt-int::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff; border: 2px solid #111;
  box-shadow: 0 1px 6px rgba(0,0,0,.25); cursor: grab;
}
.nyt2 .nyt-int::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 2px solid #111;
  box-shadow: 0 1px 6px rgba(0,0,0,.25); cursor: grab;
}

/* chips */
.nyt2 .nyt-chips {
  display: flex; gap: 9px; overflow-x: auto; padding: 10px 16px 12px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.nyt2 .nyt-chips::-webkit-scrollbar { display: none; }
.nyt2 .nyt-chip { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.nyt2 .nyt-chip-sw {
  width: 46px; height: 46px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid transparent;
  outline: 1.5px solid rgba(0,0,0,.08); outline-offset: -1.5px;
  transition: transform .15s, border-color .15s, box-shadow .15s;
  color: #6e6e74;
}
.nyt2 .nyt-chip-sw svg { width: 22px; height: 22px; }
.nyt2 .nyt-chip.is-sel .nyt-chip-sw {
  border-color: #111; transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,.18);
}
.nyt2 .nyt-chip:active .nyt-chip-sw { transform: scale(.93); }
.nyt2 .nyt-chip-num { font-size: 10.5px; font-weight: 700; color: #8b8b90; }
.nyt2 .nyt-chip.is-sel .nyt-chip-num { color: #111; }
.nyt2 .nyt-chip.is-oos .nyt-chip-sw { opacity: .45; }

/* bottom tabs */
.nyt2 .nyt-bottom-tabs { display: flex; }
.nyt2 .nyt-btab {
  flex: 1; padding: 14px 0 15px;
  font-size: 12px; font-weight: 800; letter-spacing: .16em;
  background: #0e0e10; color: #87878d;
}
.nyt2 .nyt-btab.is-active { color: #fff; box-shadow: inset 0 -3px 0 #fff; }

/* ── Fullscreen modal (product pages) ── */
.nyt-modal {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(8,8,10,.55);
  display: none;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.nyt-modal.is-open { display: flex; align-items: center; justify-content: center; }
.nyt-modal .nyt-modal-inner {
  position: relative; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
}
.nyt-modal .nyla-tryon.nyt2 { width: min(480px, 100%); max-height: 100%; overflow-y: auto; }
.nyt-modal .nyt-modal-close { display: none; }
@media (max-width: 560px) {
  .nyt-modal .nyt-modal-inner { padding: 0; }
  .nyt-modal .nyla-tryon.nyt2 { width: 100%; height: 100%; max-height: none; border-radius: 0; display: flex; flex-direction: column; }
  .nyt-modal .nyla-tryon.nyt2 .nyt-stage { flex: 1 1 auto; height: auto; max-height: none; }
}
html.nyt-noscroll, html.nyt-noscroll body { overflow: hidden !important; }

/* ── Product-page launcher button (kept from v1, same classnames) ── */
.nyt-aibtn-wrap {
  --nyt-g1: #ff6ec4; --nyt-g2: #7873f5; --nyt-g3: #4ade80; --nyt-g4: #f9d423;
  display: inline-block; position: relative; border-radius: 999px; padding: 2px;
  background: linear-gradient(115deg, var(--nyt-g1), var(--nyt-g2), var(--nyt-g3), var(--nyt-g4), var(--nyt-g1));
  background-size: 300% 300%;
  animation: nyt-aiflow 6s linear infinite;
  margin: 10px 0 0;
}
@keyframes nyt-aiflow { 0% { background-position: 0% 50%; } 100% { background-position: 300% 50%; } }
.nyt-aibtn {
  display: inline-flex; align-items: center; gap: 8px;
  background: #0f0f11; color: #fff;
  border: 0; border-radius: 999px;
  padding: 12px 22px; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: transform .15s;
}
.nyt-aibtn:active { transform: scale(.97); }
.nyt-aibtn-spark { font-size: 15px; }
