:root {
  --pv-ink: #171512;
  --pv-muted: #716b64;
  --pv-line: #ddd5ca;
  --pv-surface: #fbf9f5;
  --pv-soft: #f1ede6;
  --pv-gold: #c9a96e;
}

.pv-hurik-hook {
  width: 0;
  height: 0;
  min-width: 0;
  min-height: 0;
}

.pv-hurik-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2147482700;
  background: rgba(17,16,14,.28);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  transition: opacity .22s ease, visibility .22s ease;
}

.pv-hurik-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.pv-hurik-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 2147482800;

  width: var(--pv-panel-width, min(50vw, 760px));
  height: 100dvh;

  min-width: min(480px, 100vw);
  max-width: 100vw;

  overflow: hidden;

  border-left: 1px solid var(--pv-line);
  border-radius: 18px 0 0 18px;

  background: var(--pv-surface);
  color: var(--pv-ink);

  box-shadow: -26px 0 70px rgba(0,0,0,.17);

  transform: translateX(102%);
  visibility: hidden;

  transition:
    transform .30s cubic-bezier(.2,.8,.2,1),
    visibility .30s;
}

.pv-hurik-panel.is-open {
  transform: translateX(0);
  visibility: visible;
}

@media (min-width: 992px) {
  body.hurik-tryon-open .pv-hurik-backdrop {
    display: none;
  }

  body.hurik-tryon-open #wrapper {
    width: calc(100% - var(--pv-panel-width, min(50vw, 760px))) !important;
    max-width: calc(100% - var(--pv-panel-width, min(50vw, 760px))) !important;
    margin-right: var(--pv-panel-width, min(50vw, 760px)) !important;
    transition:
      width .30s cubic-bezier(.2,.8,.2,1),
      max-width .30s cubic-bezier(.2,.8,.2,1),
      margin-right .30s cubic-bezier(.2,.8,.2,1);
  }
}

body.hurik-tryon-open .hurik-action-buttons {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.pv-hurik-panel-head {
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 15px 10px 17px;
  border-bottom: 1px solid var(--pv-line);
  background: rgba(251,249,245,.98);
}

.pv-hurik-panel-title {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.pv-hurik-title-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--pv-line);
  border-radius: 10px;
  background: #fff;
}

.pv-hurik-title-icon svg {
  width: 20px;
  height: 20px;
}

.pv-hurik-title-copy {
  min-width: 0;
}

.pv-hurik-title-copy strong {
  display: block;
  font-size: 17px;
  line-height: 1.15;
  font-weight: 850;
}

.pv-hurik-title-copy span {
  display: block;
  max-width: min(44vw, 470px);
  margin-top: 3px;
  overflow: hidden;
  color: var(--pv-muted);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 650;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.pv-hurik-close {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  padding: 0;
  border: 1px solid var(--pv-line);
  border-radius: 50%;
  background: #fff;
  color: var(--pv-ink);
  font-size: 27px;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, transform .14s ease;
}

@media (hover:hover) and (pointer:fine) {
  .pv-hurik-close:hover,
  .pv-hurik-choice:hover,
  .btn-upload:hover,
  .btn-action.btn-primary:hover,
  .pv-hurik-camera-capture:hover,
  .pv-hurik-camera-retake:hover {
    background: var(--pv-gold);
    border-color: var(--pv-gold);
    color: var(--pv-ink);
  }
}

.pv-hurik-close:active,
.pv-hurik-choice:active,
.btn-upload:active,
.btn-action:active {
  transform: scale(.97);
}

.pv-hurik-panel-body {
  position: relative;
  height: calc(100dvh - 74px);
  overflow: hidden;
  padding: 14px;
}

/* Portada */
.pv-hurik-start {
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: 12px;
  max-width: 760px;
  margin: 0 auto;
}

.pv-hurik-hero {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--pv-line);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 28%, #fff 0, #f3efe8 56%, #ebe6de 100%);
}

.pv-hurik-demo-rotator {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  perspective: 900px;
  cursor: grab;
  touch-action: pan-y;
}

.pv-hurik-demo-rotator.is-dragging {
  cursor: grabbing;
}

.pv-hurik-demo-mannequin,
.pv-hurik-demo-garment {
  position: absolute;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  transform:
    perspective(900px)
    rotateY(var(--pv-demo-rotate, 0deg));
  transform-origin: center center;
  transition: transform .13s ease-out;
}

.pv-hurik-demo-mannequin {
  inset: 3% 16% 3%;
  width: 68%;
  height: 94%;
  object-fit: contain;
}

.pv-hurik-demo-garment {
  left: 50%;
  object-fit: contain;
  transform:
    translateX(-50%)
    perspective(900px)
    rotateY(var(--pv-demo-rotate, 0deg));
}

.pv-family-upper .pv-hurik-demo-garment {
  top: 18%;
  width: 42%;
  height: 47%;
}

.pv-family-lower .pv-hurik-demo-garment {
  top: 49%;
  width: 39%;
  height: 42%;
}

.pv-family-face .pv-hurik-demo-garment {
  top: 10%;
  width: 22%;
  height: 12%;
}

.pv-family-head .pv-hurik-demo-garment {
  top: 4%;
  width: 30%;
  height: 20%;
}

.pv-hurik-product-chip {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: calc(100% - 24px);
  padding: 6px 8px;
  border: 1px solid rgba(23,21,18,.10);
  border-radius: 10px;
  background: rgba(255,255,255,.91);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.pv-hurik-product-chip img {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 7px;
  object-fit: cover;
}

.pv-hurik-product-chip span {
  overflow: hidden;
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.pv-hurik-rotate-hint {
  position: absolute;
  left: 50%;
  bottom: 10px;
  z-index: 6;
  padding: 6px 9px;
  border: 1px solid rgba(23,21,18,.12);
  border-radius: 999px;
  background: rgba(255,255,255,.88);
  color: var(--pv-muted);
  font-size: 10px;
  font-weight: 700;
  transform: translateX(-50%);
}

.pv-hurik-start-copy h2 {
  margin: 0 0 4px;
  font-size: 23px;
  line-height: 1.1;
  font-weight: 880;
  letter-spacing: -.025em;
}

.pv-hurik-start-copy p {
  margin: 0;
  color: var(--pv-muted);
  font-size: 12px;
  line-height: 1.4;
}

.pv-hurik-start-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.pv-hurik-choice {
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid var(--pv-line);
  border-radius: 12px;
  background: #fff;
  color: var(--pv-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 770;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, transform .14s ease;
}

.pv-hurik-choice svg {
  width: 20px;
  height: 20px;
}

/* Engine */
.pv-hurik-engine[hidden],
.pv-hurik-loader[hidden] {
  display: none !important;
}

.pv-hurik-engine {
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
}

.probador-mode-selector {
  display: none;
}

.probador-workspace {
  min-height: 0;
  height: 100%;
}

.probador-canvas-panel {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--pv-line);
  border-radius: 16px;
  background: var(--pv-soft);
}

.probador-photo-mode,
.probador-camera-mode,
.canvas-wrapper,
.camera-wrapper,
.pv-hurik-render-host {
  width: 100%;
  height: 100%;
}

.upload-area,
.camera-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px;
  text-align: center;
}

.upload-area svg,
.camera-placeholder svg {
  width: 38px;
  height: 38px;
  color: var(--pv-muted);
}

.upload-area strong,
.camera-placeholder strong {
  font-size: 17px;
  font-weight: 830;
}

.camera-placeholder span {
  max-width: 340px;
  color: var(--pv-muted);
  font-size: 11px;
  line-height: 1.4;
}

.btn-upload {
  min-height: 42px;
  margin-top: 8px;
  padding: 8px 15px;
  border: 1px solid var(--pv-ink);
  border-radius: 10px;
  background: var(--pv-ink);
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
}

.canvas-wrapper,
.camera-wrapper {
  position: absolute;
  inset: 0;
}

.pv-hurik-render-host canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
}

#live-video {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.pv-hurik-camera-actions {
  position: absolute;
  left: 50%;
  bottom: 14px;
  z-index: 12;
  display: flex;
  gap: 8px;
  transform: translateX(-50%);
}

.pv-hurik-camera-capture,
.pv-hurik-camera-retake {
  min-height: 43px;
  padding: 8px 17px;
  border: 1px solid var(--pv-ink);
  border-radius: 10px;
  background: var(--pv-ink);
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 780;
  cursor: pointer;
}

.pv-hurik-result-title {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 12;
  padding: 7px 10px;
  border: 1px solid rgba(23,21,18,.10);
  border-radius: 999px;
  background: rgba(255,255,255,.90);
  font-size: 11px;
  font-weight: 760;
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.canvas-loading,
.pv-hurik-loader {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(251,249,245,.94);
  font-size: 12px;
  font-weight: 720;
}

.canvas-loading.hidden {
  display: none;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #ddd5ca;
  border-top-color: var(--pv-gold);
  border-radius: 50%;
  animation: pv-spin .8s linear infinite;
}

@keyframes pv-spin {
  to { transform: rotate(360deg); }
}

.pv-hurik-result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-action {
  min-height: 45px;
  border: 1px solid var(--pv-line);
  border-radius: 11px;
  background: #fff;
  color: var(--pv-ink);
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
}

.btn-action.btn-primary {
  border-color: var(--pv-ink);
  background: var(--pv-ink);
  color: #fff;
}

.pv-hurik-engine-support {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.pv-hurik-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 2147482900;
  max-width: 320px;
  padding: 10px 13px;
  border-radius: 9px;
  background: var(--pv-ink);
  color: #fff;
  font-size: 12px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .18s ease, visibility .18s ease, transform .18s ease;
}

.pv-hurik-toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

@media (max-width: 991px) {
  .pv-hurik-panel {
    inset: 0;
    width: 100vw;
    height: 100dvh;
    min-width: 0;
    max-width: none;
    border-radius: 0;
    transform: translateY(102%);
  }

  .pv-hurik-panel.is-open {
    transform: translateY(0);
  }

  .pv-hurik-panel-head {
    height: 68px;
    padding: 9px 11px;
  }

  .pv-hurik-panel-body {
    height: calc(100dvh - 68px);
    padding:
      10px
      10px
      calc(84px + env(safe-area-inset-bottom));
  }

  body.hurik-tryon-open .hurik-action-buttons {
    position: fixed !important;
    left: 8px !important;
    right: 8px !important;
    bottom: calc(8px + env(safe-area-inset-bottom)) !important;
    z-index: 2147482860 !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
  }

  .pv-hurik-title-copy span {
    max-width: 56vw;
  }

  .pv-hurik-start {
    gap: 9px;
  }

  .pv-hurik-choice {
    min-height: 50px;
    padding: 8px 9px;
    font-size: 11px;
  }
}
