/* ==========================================
   MEDALLO JEANS - REVIEWS.CSS
   Estilos no-críticos cargados asíncronos
   ========================================== */

/* ==========================================
   1. COMPONENTES DE RESEÑAS
   ========================================== */

/* Grid de reseñas dinámicas */
#lista-reseñas {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

/* Card de reseña dinámica (mismo estilo que estática pero con animación) */
.review-dynamic {
  background: #fff;
  padding: 1.5rem;
  border-radius: 12px;
  border-left: 4px solid var(--accent, #d4af37);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: all 0.3s ease;
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
}

.review-dynamic:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.review-dynamic:nth-child(1) { animation-delay: 0.05s; }
.review-dynamic:nth-child(2) { animation-delay: 0.1s; }
.review-dynamic:nth-child(3) { animation-delay: 0.15s; }
.review-dynamic:nth-child(4) { animation-delay: 0.2s; }
.review-dynamic:nth-child(5) { animation-delay: 0.25s; }
.review-dynamic:nth-child(6) { animation-delay: 0.3s; }

/* ==========================================
   2. SISTEMA DE FILTROS AVANZADO
   ========================================== */

.filters-bar-advanced {
  background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border: 1px solid #e9ecef;
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.filters-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--brand-primary, #0a0e17);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.filter-box {
  position: relative;
}

.filter-label-advanced {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #666;
  margin-bottom: 0.5rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.filter-select-advanced {
  width: 100%;
  padding: 0.875rem 2.5rem 0.875rem 1rem;
  border: 2px solid #e5e5e5;
  border-radius: 10px;
  font-size: 0.95rem;
  background: #fff;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  transition: all 0.3s ease;
}

.filter-select-advanced:hover {
  border-color: #ccc;
}

.filter-select-advanced:focus {
  outline: none;
  border-color: var(--brand-secondary, #8a1538);
  box-shadow: 0 0 0 4px rgba(138, 21, 56, 0.08);
}

/* Tags de filtros activos */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e5e5;
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--brand-secondary, #8a1538);
  color: #fff;
  padding: 0.4rem 0.875rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  animation: scaleIn 0.3s ease;
}

.filter-tag button {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 0;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.filter-tag button:hover {
  background: rgba(255,255,255,0.2);
}

/* ==========================================
   3. FORMULARIO MULTI-PASO MEJORADO
   ========================================== */

.form-step {
  display: none;
  animation: fadeIn 0.5s ease;
}

.form-step.active {
  display: block;
}

.step-indicator {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.step-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  background: #e5e5e5;
  color: #666;
  transition: all 0.3s ease;
  position: relative;
}

.step-dot.active {
  background: var(--brand-secondary, #8a1538);
  color: #fff;
  transform: scale(1.1);
}

.step-dot.completed {
  background: var(--success-color, #27ae60);
  color: #fff;
}

.step-dot::after {
  content: '';
  position: absolute;
  width: 60px;
  height: 2px;
  background: #e5e5e5;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 10px;
}

.step-dot:last-child::after {
  display: none;
}

/* Grid de productos mejorado */
.product-grid-enhanced {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.product-card-enhanced {
  position: relative;
  background: #fff;
  border: 2px solid #eee;
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.product-card-enhanced::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.1), transparent);
  transition: left 0.6s;
}

.product-card-enhanced:hover::before {
  left: 100%;
}

.product-card-enhanced:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: var(--brand-secondary, #8a1538);
  box-shadow: 0 12px 30px rgba(138, 21, 56, 0.15);
}

.product-card-enhanced.selected {
  border-color: var(--brand-secondary, #8a1538);
  background: linear-gradient(135deg, #fff 0%, #fdf5f7 100%);
  box-shadow: 0 8px 25px rgba(138, 21, 56, 0.2);
}

.product-card-enhanced.selected::after {
  content: '✓';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background: var(--success-color, #27ae60);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  animation: scaleIn 0.3s ease;
}

.product-card-enhanced img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  transition: transform 0.3s ease;
}

.product-card-enhanced:hover img {
  transform: scale(1.05);
}

.product-info {
  position: relative;
}

.product-name {
  font-weight: 700;
  color: var(--brand-primary, #0a0e17);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.product-ref {
  font-size: 0.75rem;
  color: #888;
  font-weight: 500;
}

.product-badge-stock {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--success-color, #27ae60);
  color: #fff;
  font-size: 0.65rem;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* Sistema de rating interactivo */
.rating-container {
  text-align: center;
  padding: 2rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
  border-radius: 16px;
  margin: 1.5rem 0;
}

.stars-interactive {
  display: inline-flex;
  gap: 0.75rem;
  font-size: 3rem;
  margin-bottom: 1rem;
}

.star-btn {
  cursor: pointer;
  color: #ddd;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  line-height: 1;
  user-select: none;
}

.star-btn:hover,
.star-btn.hovered {
  color: var(--warning-color, #f5b301);
  transform: scale(1.2);
}

.star-btn.active {
  color: var(--warning-color, #f5b301);
  animation: starPulse 0.4s ease;
}

.rating-feedback {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--brand-primary, #0a0e17);
  min-height: 1.5em;
  transition: all 0.3s ease;
}

.rating-feedback.positive {
  color: var(--success-color, #27ae60);
}

/* Inputs mejorados */
.input-group {
  position: relative;
  margin-bottom: 1.5rem;
}

.input-label {
  position: absolute;
  left: 0;
  top: 12px;
  color: #999;
  font-size: 1rem;
  transition: all 0.3s ease;
  pointer-events: none;
}

.input-field {
  width: 100%;
  padding: 12px 0;
  border: none;
  border-bottom: 2px solid #e5e5e5;
  font-size: 1rem;
  background: transparent;
  transition: all 0.3s ease;
}

.input-field:focus {
  outline: none;
  border-bottom-color: var(--brand-secondary, #8a1538);
}

.input-field:focus + .input-label,
.input-field:not(:placeholder-shown) + .input-label {
  top: -8px;
  font-size: 0.75rem;
  color: var(--brand-secondary, #8a1538);
  font-weight: 600;
}

/* Textarea expandida */
.textarea-expandable {
  min-height: 120px;
  resize: vertical;
  line-height: 1.7;
}

.char-counter {
  text-align: right;
  font-size: 0.75rem;
  color: #999;
  margin-top: 0.5rem;
  font-weight: 500;
}

.char-counter.warning {
  color: var(--warning-color, #f39c12);
}

.char-counter.success {
  color: var(--success-color, #27ae60);
}

/* Upload de fotos */
.upload-zone {
  border: 3px dashed #ddd;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--brand-secondary, #8a1538);
  background: #fdf5f7;
}

.upload-zone i {
  font-size: 2.5rem;
  color: #ccc;
  margin-bottom: 1rem;
  display: block;
}

.upload-text {
  color: #666;
  font-size: 0.95rem;
}

.upload-text strong {
  color: var(--brand-secondary, #8a1538);
}

.preview-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.preview-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1;
}

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

.preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: background 0.2s;
}

.preview-remove:hover {
  background: var(--primary-color, #e74c3c);
}

/* ==========================================
   4. ESTADÍSTICAS Y DASHBOARD
   ========================================== */

.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--brand-primary, #0a0e17) 0%, #1a1f2e 100%);
  border-radius: 16px;
  color: #fff;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent, #d4af37);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.85rem;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-stars {
  color: var(--warning-color, #f5b301);
  font-size: 1.2rem;
  letter-spacing: 2px;
}

/* Gráfico de distribución */
.rating-distribution {
  background: #fff;
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 2rem;
}

.dist-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.dist-label {
  width: 60px;
  font-weight: 600;
  color: #666;
  font-size: 0.9rem;
}

.dist-bar-bg {
  flex: 1;
  height: 8px;
  background: #eee;
  border-radius: 4px;
  overflow: hidden;
}

.dist-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--warning-color, #f5b301), var(--accent, #d4af37));
  border-radius: 4px;
  transition: width 0.6s ease;
  min-width: 4px;
}

.dist-count {
  width: 40px;
  text-align: right;
  font-size: 0.85rem;
  color: #888;
  font-weight: 500;
}

/* ==========================================
   5. PAGINACIÓN Y CARGA
   ========================================== */

.load-more-container {
  text-align: center;
  margin-top: 3rem;
  padding: 2rem;
}

.btn-load-more {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: #fff;
  color: var(--brand-primary, #0a0e17);
  border: 2px solid var(--brand-primary, #0a0e17);
  padding: 1rem 2.5rem;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-load-more:hover {
  background: var(--brand-primary, #0a0e17);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(10, 14, 23, 0.2);
}

.btn-load-more:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-load-more .spinner {
  width: 20px;
  height: 20px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: none;
}

.btn-load-more.loading .spinner {
  display: block;
}

.btn-load-more.loading .text {
  opacity: 0.7;
}

.pagination-info {
  margin-top: 1rem;
  color: #888;
  font-size: 0.9rem;
}

/* Infinite scroll trigger */
.infinite-trigger {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
}

/* ==========================================
   6. NOTIFICACIONES Y FEEDBACK
   ========================================== */

.notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 400px;
}

.notification {
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  color: #fff;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  animation: slideInRight 0.4s ease, fadeOut 0.4s ease 4s forwards;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  backdrop-filter: blur(10px);
}

.notification.success {
  background: rgba(39, 174, 96, 0.95);
}

.notification.error {
  background: rgba(231, 76, 60, 0.95);
}

.notification.warning {
  background: rgba(243, 156, 18, 0.95);
}

.notification.info {
  background: rgba(52, 152, 219, 0.95);
}

.notification-icon {
  font-size: 1.25rem;
}

/* Toast inferior para móvil */
@media (max-width: 768px) {
  .notification-container {
    top: auto;
    bottom: 20px;
    left: 20px;
    right: 20px;
    max-width: none;
  }
  
  .notification {
    animation: slideInUp 0.4s ease, fadeOut 0.4s ease 4s forwards;
  }
}

/* ==========================================
   7. MODALES Y OVERLAYS
   ========================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: #fff;
  border-radius: 20px;
  padding: 2rem;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}

.modal.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brand-primary, #0a0e17);
}

.modal-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: #f5f5f5;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: all 0.2s;
}

.modal-close:hover {
  background: #eee;
  transform: rotate(90deg);
}

/* Lightbox para fotos */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.lightbox.active img {
  transform: scale(1);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.lightbox-nav:hover {
  background: rgba(255,255,255,0.2);
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
}

/* ==========================================
   8. UTILIDADES Y HELPERS
   ========================================== */

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 8px;
}

.skeleton-text {
  height: 1em;
  margin-bottom: 0.5em;
}

.skeleton-text:last-child {
  width: 80%;
}

/* Badges y etiquetas */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-success {
  background: #d4edda;
  color: #155724;
}

.badge-warning {
  background: #fff3cd;
  color: #856404;
}

.badge-info {
  background: #d1ecf1;
  color: #0c5460;
}

.badge-featured {
  background: linear-gradient(135deg, var(--warning-color, #f5b301), var(--accent, #d4af37));
  color: #fff;
}

/* Tooltips */
[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  padding: 0.5rem 1rem;
  background: var(--brand-primary, #0a0e17);
  color: #fff;
  font-size: 0.8rem;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
  z-index: 100;
}

[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-4px);
}

/* ==========================================
   9. ANIMACIONES
   ========================================== */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(100%); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

@keyframes starPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

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

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ==========================================
   10. RESPONSIVE ADJUSTMENTS
   ========================================== */

@media (max-width: 768px) {
  .product-grid-enhanced {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  .product-card-enhanced {
    padding: 0.75rem;
  }
  
  .product-card-enhanced img {
    height: 120px;
  }
  
  .filters-grid {
    grid-template-columns: 1fr;
  }
  
  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  .stat-value {
    font-size: 2rem;
  }
  
  .step-indicator {
    gap: 0.5rem;
  }
  
  .step-dot {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }
  
  .step-dot::after {
    width: 30px;
  }
  
  .stars-interactive {
    font-size: 2.5rem;
    gap: 0.5rem;
  }
  
  .modal {
    padding: 1.5rem;
    border-radius: 16px;
  }
}

@media (max-width: 480px) {
  .product-grid-enhanced {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  
  .product-name {
    font-size: 0.8rem;
  }
  
  .product-ref {
    font-size: 0.7rem;
  }
  
  .review-dynamic,
  .review-static {
    padding: 1.25rem;
  }
  
  .upload-zone {
    padding: 1.5rem 1rem;
  }
}


