/* ==========================================================================
   DISFRACES PAOLA - ESTILOS DEL PROBADOR VIRTUAL IA (TRY-ON STUDIO)
   ========================================================================== */

.tryon-modal {
  max-width: 820px;
  width: 94%;
  padding: 0;
  background: #110d24;
  border: 1px solid var(--border-glow);
  box-shadow: 0 25px 70px -10px rgba(0, 0, 0, 0.85), 0 0 30px rgba(168, 85, 247, 0.25);
}

.tryon-modal-header {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(22, 17, 43, 0.7);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tryon-header-costume-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.tryon-costume-thumb {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  border: 2px solid var(--primary);
  background: #181230;
}

.tryon-header-text h3 {
  font-size: 1.15rem;
  margin-bottom: 2px;
}

.tryon-header-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.tryon-header-meta .cat-badge {
  color: var(--accent-pink);
  font-weight: 700;
}

.tryon-modal-body {
  padding: 1.75rem;
  min-height: 480px;
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   PASO 1: SUBIR FOTO DE CUERPO COMPLETO
   ========================================================================== */
.tryon-upload-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 680px) {
  .tryon-upload-layout {
    grid-template-columns: 1.2fr 1fr;
  }
}

.dropzone-container {
  border: 2px dashed rgba(168, 85, 247, 0.4);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.3s ease;
  position: relative;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.dropzone-container.dragover {
  border-color: var(--accent-pink);
  background: rgba(236, 72, 153, 0.08);
  transform: scale(1.01);
}

.dropzone-container.has-photo {
  padding: 0.5rem;
  border-style: solid;
  border-color: var(--border-glow);
}

.dropzone-icon-box {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(168, 85, 247, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 1rem;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
}

.dropzone-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.dropzone-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.upload-buttons-row {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
  max-width: 280px;
}

.btn-upload-action {
  background: var(--grad-btn);
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}

.btn-camera-mobile {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.btn-sample-model {
  background: transparent;
  color: #c084fc;
  font-size: 0.8rem;
  text-decoration: underline;
  margin-top: 0.5rem;
  cursor: pointer;
}

/* Vista previa de la foto seleccionada */
.photo-preview-box {
  position: relative;
  width: 100%;
  height: 340px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
}

.preview-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.btn-remove-photo {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.2s;
}

.btn-remove-photo:hover {
  background: #ef4444;
}

/* Guía para la foto */
.upload-instructions-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.instructions-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.tips-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  font-size: 0.82rem;
  color: #cbd5e1;
  margin-bottom: 1.5rem;
}

.tips-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.btn-generate-main {
  width: 100%;
  padding: 0.9rem;
  font-size: 1rem;
}

.btn-generate-main:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ==========================================================================
   PASO 2: ESCANEO Y PROCESAMIENTO CON IA
   ========================================================================== */
.processing-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 420px;
  text-align: center;
  padding: 1rem;
}

.scanner-viewport {
  position: relative;
  width: 240px;
  height: 340px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid var(--primary);
  box-shadow: 0 0 25px rgba(168, 85, 247, 0.4);
  margin-bottom: 1.5rem;
}

.scan-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.85);
}

/* Línea láser de escaneo animada */
.laser-beam {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, transparent, #06b6d4, #a855f7, #ec4899, transparent);
  box-shadow: 0 0 15px 3px #06b6d4, 0 0 30px 6px #a855f7;
  animation: laserScan 2.4s ease-in-out infinite alternate;
  z-index: 5;
}

@keyframes laserScan {
  0% {
    top: 2%;
    opacity: 0.8;
  }
  50% {
    opacity: 1;
  }
  100% {
    top: 96%;
    opacity: 0.8;
  }
}

/* Malla holográfica superpuesta */
.hologram-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(168, 85, 247, 0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(168, 85, 247, 0.15) 1px, transparent 1px);
  background-size: 16px 16px;
  pointer-events: none;
}

.status-label {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
  color: #fff;
  min-height: 28px;
}

.progress-bar-wrapper {
  width: 100%;
  max-width: 380px;
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 0.5rem;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--grad-magic);
  transition: width 0.3s ease;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.6);
}

.progress-percent-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
}

/* ==========================================================================
   PASO 3: RESULTADO Y COMPARADOR ANTES / DESPUÉS
   ========================================================================== */
.result-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: center;
}

.api-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-demo {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-live {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Visualizador de comparación con slider */
.comparison-wrapper {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: auto;
  aspect-ratio: 3 / 4;
  max-height: 70vh;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid var(--border-glow);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
  background: #080612;
  user-select: none;
  margin: 0 auto;
}

.comparison-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
}

.comparison-img.after {
  /* Se recorta dinámicamente con JS mediante clip-path */
  clip-path: polygon(50% 0, 100% 0, 100% 100%, 50% 100%);
  transition: clip-path 0.05s linear;
}

.comparison-label {
  position: absolute;
  top: 1rem;
  padding: 0.3rem 0.75rem;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  backdrop-filter: blur(4px);
  z-index: 10;
  pointer-events: none;
}

.comparison-label.label-before {
  left: 1rem;
}

.comparison-label.label-after {
  right: 1rem;
  background: rgba(147, 51, 234, 0.8);
}

/* Barra divisoria y botón de arrastre */
.slider-handle-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background: #fff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.8), 0 0 15px var(--primary);
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 15;
}

.slider-handle-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  color: #0f0d1a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
  border: 3px solid var(--primary);
}

/* Input de rango invisible superpuesto para touch y mouse */
.slider-input-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
  z-index: 20;
  margin: 0;
  padding: 0;
}

/* Botones de acción del resultado */
.result-actions-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  width: 100%;
  max-width: 460px;
}

@media (min-width: 480px) {
  .result-actions-grid {
    grid-template-columns: 1.2fr 1fr;
  }
}

.btn-result-whatsapp {
  background: #10b981;
  color: #fff;
}

.btn-result-whatsapp:hover {
  background: #059669;
}

.btn-result-download {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.btn-result-download:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--border-glow);
}

.btn-result-retry {
  grid-column: 1 / -1;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-decoration: underline;
  padding: 0.4rem;
}

.btn-result-retry:hover {
  color: #fff;
}
