/**
 * Dulce Lujuria - Módulo de Estilos de Variaciones de Producto (Swatches de Lujo)
 * Selector visual sin plugins para presentaciones, tamaños y sabores.
 * Estética de alta gama, micro-animaciones y accesibilidad.
 */

.dl-product-variations {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: 0.75rem 0 1.25rem 0;
  padding: 1.25rem 0;
  border-top: 1px solid var(--dl-border-subtle, rgba(255, 255, 255, 0.08));
  border-bottom: 1px solid var(--dl-border-subtle, rgba(255, 255, 255, 0.08));
  transition: border-color 0.3s ease;
}

.dl-variation-group {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.dl-variation-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.82rem;
}

.dl-variation-label {
  font-weight: 600;
  color: var(--dl-text, #f5f5f7);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.dl-variation-selected-text {
  font-weight: 500;
  color: var(--dl-primary, #e11d74);
  font-size: 0.82rem;
  transition: color 0.2s ease;
}

.dl-swatches-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.dl-swatch-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 42px;
  padding: 0.5rem 1.15rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--dl-border, rgba(255, 255, 255, 0.12));
  color: var(--dl-text, #f5f5f7);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  user-select: none;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.dl-swatch-chip:hover:not(.is-disabled) {
  border-color: var(--dl-primary, #e11d74);
  background: rgba(225, 29, 116, 0.08);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(225, 29, 116, 0.2);
}

.dl-swatch-chip:focus-visible {
  outline: 2px solid var(--dl-primary, #e11d74);
  outline-offset: 2px;
}

.dl-swatch-chip.is-selected {
  background: linear-gradient(135deg, var(--dl-primary, #e11d74) 0%, #b8145c 100%);
  border-color: var(--dl-primary, #e11d74);
  color: #ffffff;
  font-weight: 600;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(225, 29, 116, 0.45);
}

.dl-swatch-chip.is-selected::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
  margin-left: 0.2rem;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
}

.dl-swatch-chip.is-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.05);
  color: var(--dl-text-muted, #9ca3af);
  text-decoration: line-through;
  pointer-events: none;
}

/* Indicador de stock dinámico para la variación elegida */
.dl-variation-stock-notice {
  font-size: 0.8rem;
  padding: 0.4rem 0.85rem;
  border-radius: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  animation: dlFadeIn 0.25s ease-out;
}

.dl-variation-stock-notice.is-in-stock {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: #86efac;
}

.dl-variation-stock-notice.is-low-stock {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #fde047;
}

.dl-variation-stock-notice.is-out-of-stock {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

/* Shake de validación si el cliente intenta comprar sin elegir presentación */
@keyframes dlSwatchShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.dl-swatch-shake {
  animation: dlSwatchShake 0.5s ease-in-out;
  border-color: var(--dl-primary, #e11d74) !important;
}

/* Transición suave para el precio al cambiar de variación */
.dl-price-update-pulse {
  animation: dlPricePulse 0.3s ease-out;
}

@keyframes dlPricePulse {
  0% { transform: scale(0.97); opacity: 0.7; }
  50% { transform: scale(1.03); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
