/**
 * Virtual Try-On Plugin - Estilos
 * Archivo: assets/css/virtual-tryon.css
 * Version: 1.0.0
 */

/* ============================================
   BOTÓN DE PRUEBA VIRTUAL
   ============================================ */

.vto-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff !important;
  border: none;
  padding: 16px 32px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin: 20px 0;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.vto-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s;
}

.vto-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
  color: #ffffff !important;
}

.vto-button:hover::before {
  left: 100%;
}

.vto-button:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.vto-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Animación para el icono de gafas */
.vto-icon {
  display: inline-block;
  animation: vto-wiggle 2s infinite ease-in-out;
}

@keyframes vto-wiggle {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px) rotate(-10deg); }
  75% { transform: translateX(4px) rotate(10deg); }
}

/* Variante estilo Lafam (elegante y minimalista) */
.vto-button.lafam-style {
  background: #000000;
  border: 2px solid #000000;
  border-radius: 0;
  letter-spacing: 2px;
  box-shadow: none;
}

.vto-button.lafam-style:hover {
  background: #ffffff;
  color: #000000 !important;
  border-color: #000000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* ============================================
   MODAL
   ============================================ */

.vto-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 999999;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.vto-modal.active {
  display: flex;
  opacity: 1;
}

.vto-modal-content {
  position: relative;
  width: 90%;
  max-width: 900px;
  background: #ffffff;
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform 0.3s ease;
  max-height: 90vh;
  overflow-y: auto;
}

.vto-modal.active .vto-modal-content {
  transform: scale(1);
}

/* Botón cerrar */
.vto-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 45px;
  height: 45px;
  background: #f5f5f5;
  border: none;
  border-radius: 50%;
  font-size: 28px;
  color: #333;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
}

.vto-close:hover {
  background: #e0e0e0;
  transform: rotate(90deg);
  color: #000;
}

/* ============================================
   LOADING
   ============================================ */

.vto-loading {
  text-align: center;
  padding: 60px 20px;
}

.vto-loading p {
  font-size: 18px;
  color: #333;
  margin-bottom: 25px;
  font-weight: 500;
}

.vto-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: vto-spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes vto-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ============================================
   VIDEO CONTAINER
   ============================================ */

#vto-video-container {
  position: relative;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  border-radius: 15px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

#vto-webcam {
  width: 100%;
  height: auto;
  display: block;
  transform: scaleX(-1); /* Efecto espejo */
}

#vto-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transform: scaleX(-1); /* Efecto espejo */
}

/* Overlay de instrucciones */
.vto-instructions {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 500;
  pointer-events: none;
  animation: vto-fade-in 0.5s ease;
}

@keyframes vto-fade-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* ============================================
   CONTROLES
   ============================================ */

.vto-controls {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 30px;
  flex-wrap: wrap;
}

.vto-btn {
  padding: 14px 28px;
  border: none;
  border-radius: 25px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.vto-btn-primary {
  background: #667eea;
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.vto-btn-primary:hover {
  background: #5568d3;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.vto-btn-secondary {
  background: #f5f5f5;
  color: #333;
  border: 2px solid #ddd;
}

.vto-btn-secondary:hover {
  background: #e8e8e8;
  border-color: #ccc;
  transform: translateY(-2px);
}

.vto-btn:active {
  transform: translateY(0);
}

.vto-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ============================================
   NOTIFICACIONES
   ============================================ */

.vto-notification {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: white;
  padding: 16px 24px;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1000000;
  animation: vto-slide-up 0.4s ease;
  max-width: 350px;
}

@keyframes vto-slide-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.vto-notification.success {
  border-left: 4px solid #4caf50;
}

.vto-notification.error {
  border-left: 4px solid #f44336;
}

.vto-notification.info {
  border-left: 4px solid #2196f3;
}

.vto-notification-icon {
  font-size: 24px;
}

.vto-notification-text {
  flex: 1;
  font-size: 14px;
  color: #333;
}

.vto-notification-close {
  background: none;
  border: none;
  font-size: 20px;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.vto-notification-close:hover {
  background: #f5f5f5;
  color: #333;
}

/* ============================================
   CAPTURA DE FOTO
   ============================================ */

.vto-captured-photo {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.vto-captured-photo.active {
  display: flex;
}

.vto-captured-photo img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.vto-photo-actions {
  margin-top: 20px;
  display: flex;
  gap: 15px;
}

/* ============================================
   BADGES Y ELEMENTOS ADICIONALES
   ============================================ */

.vto-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 15px;
  animation: vto-pulse 2s infinite;
}

@keyframes vto-pulse {
  0%, 100% {
      transform: scale(1);
      box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
  }
  50% {
      transform: scale(1.05);
      box-shadow: 0 0 20px 10px rgba(102, 126, 234, 0);
  }
}

.vto-badge-icon {
  font-size: 16px;
}

/* Aviso de privacidad */
.vto-privacy-notice {
  background: #f9f9f9;
  border-left: 4px solid #667eea;
  padding: 12px 16px;
  margin: 15px 0;
  border-radius: 4px;
}

.vto-privacy-notice p {
  margin: 0;
  font-size: 13px;
  color: #666;
  line-height: 1.6;
}

/* ============================================
   RESPONSIVE - MÓVILES
   ============================================ */

@media (max-width: 768px) {
  .vto-button {
    width: 100%;
    max-width: 100%;
    font-size: 14px;
    padding: 14px 24px;
    margin: 15px 0;
  }
    
  .vto-modal-content {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
    padding: 20px;
  }
    
  .vto-close {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    font-size: 24px;
  }
    
  #vto-video-container {
    border-radius: 10px;
  }
  
  .vto-controls {
    flex-direction: column;
    gap: 10px;
  }
  
  .vto-btn {
    width: 100%;
    justify-content: center;
  }
  
  .vto-notification {
    bottom: 20px;
    right: 20px;
    left: 20px;
    max-width: calc(100% - 40px);
  }
    
  .vto-loading {
    padding: 40px 20px;
  }
  
  .vto-loading p {
    font-size: 16px;
  }
  
  .vto-instructions {
    font-size: 12px;
    padding: 10px 20px;
    bottom: 10px;
  }
}

@media (max-width: 480px) {
  .vto-button {
    font-size: 13px;
    padding: 12px 20px;
  }
  
  .vto-modal-content {
    padding: 15px;
  }
  
  .vto-btn {
    font-size: 14px;
    padding: 12px 20px;
  }
}

/* ============================================
   MODO OSCURO
   ============================================ */

@media (prefers-color-scheme: dark) {
  .vto-modal {
    background: rgba(0, 0, 0, 0.98);
  }
  
  .vto-modal-content {
    background: #1a1a1a;
    color: #ffffff;
  }
  
  .vto-loading p {
    color: #ffffff;
  }
  
  .vto-close {
    background: #2a2a2a;
    color: #ffffff;
  }
  
  .vto-close:hover {
    background: #3a3a3a;
  }
    
  .vto-btn-secondary {
    background: #2a2a2a;
    color: #ffffff;
    border-color: #3a3a3a;
  }
    
  .vto-btn-secondary:hover {
    background: #3a3a3a;
    border-color: #4a4a4a;
  }
    
  .vto-privacy-notice {
    background: #2a2a2a;
    border-left-color: #667eea;
  }
    
  .vto-privacy-notice p {
    color: #cccccc;
  }
}

/* ============================================
   ANIMACIONES DE ENTRADA
   ============================================ */

.vto-fade-in {
  animation: vto-fade-in 0.5s ease;
}

.vto-slide-up {
  animation: vto-slide-up 0.4s ease;
}

.vto-zoom-in {
  animation: vto-zoom-in 0.3s ease;
}

@keyframes vto-zoom-in {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ============================================
   UTILIDADES
   ============================================ */

.vto-hidden {
  display: none !important;
}

.vto-visible {
  display: block !important;
}

.vto-text-center {
  text-align: center;
}

.vto-mt-20 {
  margin-top: 20px;
}

.vto-mb-20 {
  margin-bottom: 20px;
}

/* ============================================
   ACCESIBILIDAD
   ============================================ */

.vto-button:focus,
.vto-btn:focus,
.vto-close:focus {
  outline: 3px solid #667eea;
  outline-offset: 2px;
}

.vto-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ============================================
   ADMIN - Columna en lista de productos
   ============================================ */

.wp-admin .vto-enabled-col {
  width: 60px;
  text-align: center;
}

/**
 * AGREGAR al final del archivo virtual-tryon.css
 * O REEMPLAZAR la sección del botón (líneas 10-80)
 */

/* ============================================
   BOTÓN DE PRUEBA VIRTUAL - DISEÑO ACTUALIZADO
   ============================================ */

.vto-button-wrapper {
  margin: 20px 0 !important;
  width: 100% !important;
  display: flex !important;
  justify-content: center !important; /* Centrar el botón */
}

.vto-button {
  /* Layout */
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  width: auto !important;
  min-width: 250px !important;
  
  /* Colores y fondo (Teal de la imagen sugerida) */
  background: #009aa0 !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 6px 20px rgba(0, 154, 160, 0.3) !important;
  
  /* Espaciado y forma (Pill shape) */
  padding: 14px 34px !important;
  border-radius: 50px !important;
  
  /* Tipografía */
  font-size: 16px !important;
  font-weight: 800 !important; /* Bold intenso */
  letter-spacing: 1.5px !important;
  text-transform: uppercase !important;
  font-family: 'Segoe UI', Roboto, sans-serif !important;
  
  /* Interacción */
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  text-decoration: none !important;
  
  /* Posicionamiento */
  position: relative !important;
  overflow: hidden !important;
}

/* Restaurar y forzar el efecto de brillo (sweep) al pasar el cursor */
.vto-button::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: -100% !important;
  width: 100% !important;
  height: 100% !important;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  ) !important;
  transition: left 0.5s ease !important;
  display: block !important;
}

.vto-button:hover::before {
  left: 100% !important;
}

.vto-button .vto-icon {
  font-size: 22px !important;
  margin-right: 5px !important;
}

/* Hover effect */
.vto-button:hover {
  background: #00878c !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 25px rgba(0, 154, 160, 0.5) !important;
  color: #ffffff !important;
}

/* Active/Click effect */
.vto-button:active {
  transform: translateY(0) !important;
  box-shadow: 0 2px 10px rgba(0, 154, 160, 0.3) !important;
}

/* Disabled state */
.vto-button:disabled {
  opacity: 0.6 !important;
  cursor: not-allowed !important;
  transform: none !important;
}

/* Focus state (accesibilidad) */
.vto-button:focus {
  outline: 3px solid rgba(99, 102, 241, 0.4) !important;
  outline-offset: 2px !important;
}

/* ============================================
   ALINEACIÓN CON BOTÓN DE AÑADIR AL CARRITO
   ============================================ */

/* Alinear horizontalmente con el botón de añadir al carrito */
form.cart {
  display: flex !important;
  flex-direction: column !important;
  gap: 15px !important;
}

/* Contenedor de cantidad y botón añadir al carrito */
form.cart .quantity {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
}

/* Asegurar que ambos botones estén en la misma línea */
form.cart button.single_add_to_cart_button,
form.cart .vto-button-wrapper {
  display: inline-block !important;
  vertical-align: middle !important;
  margin: 0 !important;
}

/* Contenedor flex para botones lado a lado */
.vto-buttons-container {
  display: flex !important;
  gap: 12px !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  margin-top: 15px !important;
}

/* ============================================
   RESPONSIVE - MÓVILES
   ============================================ */

@media (max-width: 768px) {
  .vto-button {
    width: 100% !important;
    justify-content: center !important;
    padding: 14px 20px !important;
    font-size: 14px !important;
  }
  
  .vto-button-wrapper {
    width: 100% !important;
    margin: 15px 0 !important;
  }
  
  /* En móvil, poner botones uno debajo del otro */
  .vto-buttons-container {
    flex-direction: column !important;
  }
}

@media (max-width: 480px) {
  .vto-button {
    font-size: 13px !important;
    padding: 12px 18px !important;
  }
}

/* ============================================
   COMPATIBILIDAD CON TEMAS DE WOOCOMMERCE
   ============================================ */

/* Reset de estilos del tema */
.vto-button,
button.vto-button,
a.vto-button {
  background-image: none !important;
  text-shadow: none !important;
  line-height: normal !important;
  height: auto !important;
  min-height: auto !important;
}

/* Asegurar que el botón sea visible */
.vto-button-wrapper {
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
  clear: none !important;
}

/* Override de temas populares */
.woocommerce .vto-button,
.woocommerce-page .vto-button {
  background: #6366F1 !important;
  color: #ffffff !important;
}

/* ============================================
   VARIANTE: Botón secundario (si prefieres)
   ============================================ */

.vto-button.secondary-style {
  background: transparent !important;
  border: 2px solid #6366F1 !important;
  color: #6366F1 !important;
  box-shadow: none !important;
}

.vto-button.secondary-style:hover {
  background: #6366F1 !important;
  color: #ffffff !important;
}

/* ============================================
   DISEÑO BOTÓN de WhatsApp
   ============================================ */

.vto-btn-whatsapp {
  background: #25D366;
  color: white;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
}

.vto-btn-whatsapp:hover {
  background: #20BA5A;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}

/* ============================================
BOTÓN FLOTANTE - OVERLAY IMAGE
============================================ */
.vto-fixed-corner-button {
    position: fixed !important;
    top: 100px !important;
    right: 20px !important;
    z-index: 999 !important;
    animation: vto-float-in 0.6s ease-out !important;
}

.vto-corner-btn {
    background: linear-gradient(135deg, #008080 0%, #009688 100%) !important;
    box-shadow: 0 4px 20px rgba(0, 128, 128, 0.4) !important;
    border: none !important;
    padding: 14px 28px !important;
    border-radius: 50px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    transition: all 0.3s ease !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
}

.vto-corner-btn:hover {
    transform: translateY(-3px) scale(1.02) !important;
    box-shadow: 0 8px 30px rgba(0, 128, 128, 0.6) !important;
    background: linear-gradient(135deg, #009688 0%, #00a99d 100%) !important;
}

.vto-corner-btn:active {
    transform: translateY(-1px) scale(1) !important;
}

.vto-corner-btn .vto-icon {
    font-size: 20px !important;
}

@keyframes vto-float-in {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive - Móviles */
@media (max-width: 768px) {
    .vto-fixed-corner-button {
        top: auto !important;
        bottom: 30px !important;
        right: 15px !important;
        left: 15px !important;
    }
    
    .vto-corner-btn {
        width: 100% !important;
        justify-content: center !important;
        padding: 16px 24px !important;
        border-radius: 12px !important;
    }
}

/* ============================================
VIRTUAL TRY-ON 3D - NUEVOS ESTILOS
============================================ */

/* Canvas 3D superpuesto */
#vto-3d-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

/* Loading mejorado para 3D */
.vto-loading p {
    font-size: 18px;
    color: #333;
    margin-bottom: 15px;
    font-weight: 500;
}

.vto-loading small {
    display: block;
    color: #666;
    font-size: 14px;
    margin-top: 10px;
}

/* Botón con icono 3D */
.vto-button .vto-icon {
    font-size: 20px;
    display: inline-block;
}

/* Responsive mejorado */
@media (max-width: 768px) {
    #vto-3d-canvas {
        width: 100%;
        height: 100%;
    }
    
    .vto-modal-content {
        padding: 15px;
    }
}

/* Animación de carga suave */
@keyframes vto-fade-in-out {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.vto-loading.active {
    animation: vto-fade-in-out 1.5s ease-in-out infinite;
}

/* ============================================
FIN DE ACTUALIZACIONES 3D
============================================ */
/* ============================================
   FIN DE ESTILOS
   ============================================ */