/* Probador Virtual — Optic Josdan
 * Marca: Urbanist, turquesa #03C8D0, tinta #181818.
 * El turquesa se usa en tres lugares: acción principal, modelo seleccionado y botón de foto.
 * Pulido con unslop by Damir Sokolovsky (@heydamir), CC BY 4.0.
 */
.pvj-app, .pvj-try-wrap {
  --pvj-accent: var(--e-global-color-accent, #03C8D0);   /* bordes, íconos, selección */
  --pvj-accent-ink: #00808A;                              /* relleno con texto blanco (4.6:1) */
  --pvj-accent-ink-hover: #006F78;
  --pvj-ink: var(--e-global-color-secondary, #181818);    /* texto principal */
  --pvj-text-2: #525252;                                  /* texto secundario */
  --pvj-text-3: #737373;                                  /* meta y notas */
  --pvj-line: rgba(24, 24, 24, .1);
  --pvj-bg: #fafafa;
  --pvj-raised: #f4f4f5;
  --pvj-font: var(--e-global-typography-primary-font-family, "Urbanist"), "Urbanist", system-ui, sans-serif;
  --pvj-ease: cubic-bezier(.22, 1, .36, 1);
  --pvj-shadow-sm: 0 1px 2px rgba(0, 0, 0, .06);
  --pvj-shadow-md: 0 8px 24px rgba(0, 0, 0, .08);
}

/* ---------- Botón en la ficha de producto ---------- */
.pvj-try-wrap { margin: 16px 0 8px; width: 100%; }
.pvj-try-wrap .pvj-try-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; margin: 0; padding: 0 32px; border-radius: 24px; cursor: pointer;
  border: 1px solid var(--pvj-accent); background: #fff; color: var(--pvj-ink);
  font-family: var(--pvj-font); font-size: 16px; font-weight: 500; line-height: 1; letter-spacing: 0;
  text-transform: none; text-decoration: none; box-shadow: none;
  transition: background-color 160ms var(--pvj-ease), color 160ms var(--pvj-ease), border-color 160ms var(--pvj-ease), transform 120ms var(--pvj-ease);
}
.pvj-try-wrap .pvj-try-btn svg { width: 18px; height: 18px; color: var(--pvj-accent-ink); flex: none; transition: color 160ms var(--pvj-ease); }
.pvj-try-wrap .pvj-try-btn:hover, .pvj-try-wrap .pvj-try-btn:focus {
  background: var(--pvj-accent-ink); border-color: var(--pvj-accent-ink); color: #fff; box-shadow: none;
}
.pvj-try-wrap .pvj-try-btn:hover svg, .pvj-try-wrap .pvj-try-btn:focus svg { color: #fff; }
.pvj-try-wrap .pvj-try-btn:focus-visible { outline: 2px solid var(--pvj-accent-ink); outline-offset: 2px; }
.pvj-try-wrap .pvj-try-btn:active { transform: scale(.98); }
@media (max-width: 767px) { .pvj-try-wrap .pvj-try-btn { width: 100%; } }

/* ---------- Contenedor ---------- */
.pvj-app {
  position: relative; max-width: 1100px; margin: 0 auto;
  background: #fff; color: var(--pvj-ink);
  border: 1px solid var(--pvj-line); border-radius: 20px; overflow: hidden;
  font-family: var(--pvj-font); font-variant-numeric: tabular-nums;
  display: flex; flex-direction: column;
  height: min(820px, 92vh); height: min(820px, 92svh);
  box-shadow: var(--pvj-shadow-md);
}
.pvj-app *, .pvj-app *::before, .pvj-app *::after { box-sizing: border-box; }
.pvj-app [hidden] { display: none !important; }
.pvj-app button { font-family: inherit; cursor: pointer; }
.pvj-app h2 { font-family: var(--pvj-font); }
.pvj-app svg { width: 18px; height: 18px; flex: none; }

.pvj-app.is-fullscreen {
  position: fixed; inset: 0; z-index: 999999; max-width: none;
  height: 100vh; height: 100dvh; border-radius: 0; border: 0;
}
html.pvj-lock, html.pvj-lock body { overflow: hidden !important; }

/* Ventana sobre la ficha de producto */
.pvj-modal {
  position: fixed; inset: 0; z-index: 999998; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(24, 24, 24, .5);
  animation: pvj-fade 240ms var(--pvj-ease);
}
.pvj-modal .pvj-app { width: 100%; max-width: 960px; margin: 0; animation: pvj-rise 320ms var(--pvj-ease); }
@media (max-width: 900px) {
  .pvj-modal { padding: 0; }
  .pvj-modal .pvj-app { position: fixed; inset: 0; max-width: none; height: 100vh; height: 100dvh; border-radius: 0; border: 0; }
}
@keyframes pvj-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pvj-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pvj-modal, .pvj-modal .pvj-app { animation: none; } }

/* ---------- Escenario ---------- */
.pvj-app .pvj-stage { position: relative; flex: 1; min-height: 0; background: var(--pvj-bg); }
.pvj-app.is-active .pvj-stage { background: #1c1c1d; }
.pvj-app .pvj-canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pvj-app .pvj-video { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ---------- Pantalla inicial ---------- */
.pvj-app .pvj-intro { position: absolute; inset: 0; display: flex; padding: 24px; background: #fff; overflow-y: auto; }
.pvj-app .pvj-intro-card { width: 100%; max-width: 360px; margin: auto; text-align: center; }
.pvj-app .pvj-logo { display: block; height: 40px; width: auto; margin: 0 auto 16px; }
.pvj-app .pvj-intro-product { width: 100%; max-width: 296px; margin: 0 auto 16px; }
.pvj-app .pvj-intro-product img { display: block; width: 100%; height: min(160px, 20vh); object-fit: contain; mix-blend-mode: multiply; }
.pvj-app .pvj-intro-product img:not([src]) { visibility: hidden; }
.pvj-app .pvj-intro h2 { color: var(--pvj-ink); margin: 0 0 8px; font-size: 28px; font-weight: 600; line-height: 1.15; letter-spacing: 0; }
.pvj-app .pvj-intro p { color: var(--pvj-text-2); margin: 0 0 24px; font-size: 15px; line-height: 1.5; }
.pvj-app .pvj-intro .pvj-privacy { color: var(--pvj-text-3); font-size: 13px; line-height: 1.5; margin: 16px 0 0; }
.pvj-app .pvj-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  height: 48px; padding: 0 20px; margin: 0 0 8px; border-radius: 24px;
  border: 1px solid var(--pvj-accent-ink); background: var(--pvj-accent-ink); color: #fff;
  font-size: 16px; font-weight: 500; line-height: 1;
  transition: background-color 160ms var(--pvj-ease), border-color 160ms var(--pvj-ease), color 160ms var(--pvj-ease), transform 120ms var(--pvj-ease);
}
.pvj-app .pvj-btn:hover, .pvj-app .pvj-btn:focus { background: var(--pvj-accent-ink-hover); border-color: var(--pvj-accent-ink-hover); color: #fff; }
.pvj-app .pvj-btn-ghost, .pvj-app .pvj-btn-ghost:focus { background: #fff; color: var(--pvj-ink); border-color: var(--pvj-line); }
.pvj-app .pvj-btn-ghost:hover { background: var(--pvj-raised); color: var(--pvj-ink); border-color: var(--pvj-line); }
.pvj-app .pvj-btn:active { transform: scale(.98); }
.pvj-app .pvj-intro-close { position: absolute; top: 16px; right: 16px; z-index: 2; }

/* ---------- Producto actual ---------- */
.pvj-app .pvj-top {
  position: absolute; top: 16px; left: 16px; right: 76px; display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 8px 8px 8px 16px; border-radius: 16px;
  background: rgba(255, 255, 255, .96); box-shadow: var(--pvj-shadow-md);
}
.pvj-app .pvj-info { flex: 1; min-width: 0; }
.pvj-app .pvj-name { font-weight: 500; font-size: 15px; line-height: 20px; color: var(--pvj-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pvj-app .pvj-price { color: var(--pvj-text-2); font-size: 14px; line-height: 20px; font-weight: 400; }
.pvj-app .pvj-link {
  flex: none; display: inline-flex; align-items: center; height: 36px; padding: 0 16px; border-radius: 18px;
  background: var(--pvj-raised); border: 1px solid var(--pvj-line); color: var(--pvj-ink) !important;
  font-size: 13px; font-weight: 500; text-decoration: none !important;
  transition: background-color 160ms var(--pvj-ease);
}
.pvj-app .pvj-link:hover { background: #ebebec; }

/* ---------- Herramientas ---------- */
.pvj-app .pvj-tools { position: absolute; top: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; }
.pvj-app .pvj-tool {
  width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; padding: 0;
  background: rgba(255, 255, 255, .96); color: var(--pvj-ink); box-shadow: var(--pvj-shadow-md);
  transition: background-color 160ms var(--pvj-ease), color 160ms var(--pvj-ease), transform 120ms var(--pvj-ease);
}
.pvj-app .pvj-tool:active { transform: scale(.96); }
.pvj-app .pvj-shot { background: var(--pvj-accent); color: var(--pvj-ink); }

.pvj-app .pvj-adjust {
  position: absolute; right: 76px; top: 88px; width: 232px; padding: 16px; border-radius: 16px;
  background: #fff; box-shadow: var(--pvj-shadow-md);
  display: flex; flex-direction: column; gap: 16px; font-size: 14px; font-weight: 500; color: var(--pvj-ink);
}
.pvj-app .pvj-adjust label { display: flex; flex-direction: column; gap: 8px; }
.pvj-app .pvj-adjust input[type=range] { width: 100%; accent-color: var(--pvj-accent-ink); }
.pvj-app .pvj-reset {
  height: 36px; background: #fff; border: 1px solid var(--pvj-line); color: var(--pvj-ink); border-radius: 18px;
  padding: 0 16px; font-size: 14px; font-weight: 500;
  transition: background-color 160ms var(--pvj-ease);
}

.pvj-app .pvj-status {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px);
  padding: 8px 16px; border-radius: 16px; background: rgba(255, 255, 255, .96); color: var(--pvj-ink);
  box-shadow: var(--pvj-shadow-md); font-size: 14px; line-height: 20px; font-weight: 400; text-align: center;
}

.pvj-app.pvj-flash .pvj-stage::after { content: ""; position: absolute; inset: 0; background: #fff; opacity: .7; }

/* ---------- Carrusel de modelos ---------- */
.pvj-app .pvj-bar {
  flex: none; background: #fff; border-top: 1px solid var(--pvj-line);
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
}
.pvj-app .pvj-chips { display: flex; gap: 8px; overflow-x: auto; padding: 0 16px 12px; scrollbar-width: none; }
.pvj-app .pvj-chips::-webkit-scrollbar, .pvj-app .pvj-list::-webkit-scrollbar { display: none; }
.pvj-app .pvj-chip {
  flex: none; height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--pvj-line);
  background: #fff; color: var(--pvj-text-2); font-size: 14px; font-weight: 400; line-height: 1; white-space: nowrap;
  transition: background-color 160ms var(--pvj-ease), color 160ms var(--pvj-ease), border-color 160ms var(--pvj-ease);
}
.pvj-app .pvj-chip.is-active { background: var(--pvj-ink); border-color: var(--pvj-ink); color: #fff; font-weight: 500; }
.pvj-app .pvj-list { display: flex; gap: 8px; overflow-x: auto; padding: 0 16px; scroll-snap-type: x proximity; scrollbar-width: none; }
.pvj-app .pvj-item {
  flex: none; width: 96px; padding: 0; border: 0; background: transparent; color: var(--pvj-text-3);
  scroll-snap-align: center; display: flex; flex-direction: column; gap: 4px; align-items: center;
}
.pvj-app .pvj-thumb {
  width: 96px; height: 72px; border-radius: 12px; background: #fff; display: grid; place-items: center;
  overflow: hidden; border: 1px solid var(--pvj-line);
  transition: border-color 160ms var(--pvj-ease);
}
.pvj-app .pvj-thumb img { width: 100%; height: 100%; object-fit: contain; }
.pvj-app .pvj-item:hover .pvj-thumb { border-color: rgba(24, 24, 24, .24); }
.pvj-app .pvj-item.is-active .pvj-thumb { border: 2px solid var(--pvj-accent); }
.pvj-app .pvj-item-name { font-size: 12px; font-weight: 400; line-height: 16px; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pvj-app .pvj-empty { padding: 12px 16px; color: var(--pvj-text-3); font-size: 14px; }

@media (max-width: 600px) {
  .pvj-app .pvj-name { font-size: 14px; }
  .pvj-app .pvj-item, .pvj-app .pvj-thumb { width: 84px; }
  .pvj-app .pvj-thumb { height: 64px; }
  .pvj-app .pvj-intro h2 { font-size: 24px; }
}

/* Neutraliza los estilos globales de botones e imágenes del tema (Hello Elementor) y de WooCommerce */
.pvj-app button, .pvj-app button:hover, .pvj-app button:focus {
  text-transform: none; letter-spacing: 0; text-decoration: none; box-shadow: none;
}
.pvj-app .pvj-tool, .pvj-app .pvj-tool:hover, .pvj-app .pvj-tool:focus { box-shadow: var(--pvj-shadow-md); }
.pvj-app button:focus-visible, .pvj-app .pvj-link:focus-visible { outline: 2px solid var(--pvj-accent-ink); outline-offset: 2px; }
.pvj-app .pvj-item, .pvj-app .pvj-item:hover, .pvj-app .pvj-item:focus {
  background: transparent; border: 0; padding: 0; color: var(--pvj-text-3); border-radius: 0;
}
.pvj-app .pvj-item.is-active, .pvj-app .pvj-item.is-active:hover, .pvj-app .pvj-item.is-active:focus { color: var(--pvj-ink); }
.pvj-app .pvj-chip:hover, .pvj-app .pvj-chip:focus { background: var(--pvj-raised); color: var(--pvj-ink); border-color: var(--pvj-line); }
.pvj-app .pvj-chip.is-active:hover, .pvj-app .pvj-chip.is-active:focus { background: var(--pvj-ink); border-color: var(--pvj-ink); color: #fff; }
.pvj-app .pvj-tool, .pvj-app .pvj-tool:focus { border: 0; padding: 0; border-radius: 50%; background: rgba(255, 255, 255, .96); color: var(--pvj-ink); }
.pvj-app .pvj-tool:hover { background: #fff; color: var(--pvj-accent-ink); }
.pvj-app .pvj-shot, .pvj-app .pvj-shot:focus { background: var(--pvj-accent); color: var(--pvj-ink); }
.pvj-app .pvj-shot:hover { background: #02b6bd; color: var(--pvj-ink); }
.pvj-app .pvj-reset:hover, .pvj-app .pvj-reset:focus { background: var(--pvj-raised); color: var(--pvj-ink); border-color: var(--pvj-line); }
.pvj-app img { max-width: none; }
.pvj-app .pvj-intro-product img, .pvj-app .pvj-thumb img { max-width: 100%; }
