/*
 * ===============================================
 * VARIABLES Y ESTILOS BASE
 * ===============================================
 */

:root {
  /* Paleta de colores */
  --color-primary: #9e1428;
  --color-primary-dark: #7f1020;
  --color-highlight: #ffc857;
  --color-highlight-dark: #e6b04e;
  --color-dark-bg: #07162d;
  --color-dark-text: #07080a;
  --color-white: #f5f5f5;

  /* Transiciones y sombras */
  --transition-fast: all 0.3s ease;
  --shadow-base: 0 4px 14px 0 rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 7px 20px 0 rgba(0, 0, 0, 0.15);
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/*
 * ===============================================
 * COMPONENTES REUTILIZABLES (BOTONES)
 * ===============================================
 */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.875rem 2rem;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  box-shadow: var(--shadow-base);
  transition: var(--transition-fast);
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.btn-primary:hover {
  background-color: var(--color-primary-dark);
}

.btn-highlight {
  background-color: var(--color-highlight);
  color: var(--color-dark-text);
}

.btn-highlight:hover {
  background-color: var(--color-highlight-dark);
}

.btn-pulse {
  animation: pulse-btn 2s infinite ease-in-out;
}

/*
 * ===============================================
 * ELEMENTOS DE LA INTERFAZ (UI)
 * ===============================================
 */

/* Botón de "Volver Arriba" */
#back-to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 7rem;
  z-index: 999;
  display: flex; /* Cambiado de 'none' a 'flex' para controlar con opacidad */
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background-color: var(--color-dark-bg);
  color: var(--color-highlight);
  border-radius: 9999px;
  box-shadow: 0 4px 14px 0 rgba(0, 0, 0, 0.2);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px); /* Posición inicial para la animación de entrada */
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out, box-shadow 0.3s ease;
}

#back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 7px 20px 0 rgba(0, 0, 0, 0.25);
}

/* Notificación de Prueba Social */
#social-proof-toast {
  opacity: 0;
  transform: translateY(100%) translateX(-50%);
  transition: all 0.5s ease-in-out;
}

#social-proof-toast.show {
  opacity: 1;
  transform: translateY(0) translateX(-50%);
}

/*
 * ===============================================
 * MEDIA QUERIES (Ajustes para pantallas grandes)
 * ===============================================
 */

@media (min-width: 640px) { /* sm */
  #social-proof-toast {
    transform: translateY(100%) translateX(0);
  }

  #social-proof-toast.show {
    transform: translateY(0) translateX(0);
  }
}

@media (min-width: 768px) { /* md */
  #back-to-top {
    bottom: 1.5rem;
  }
}

/*
 * ===============================================
 * ANIMACIONES (Keyframes)
 * ===============================================
 */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes slideIn {
  from { transform: translateX(8%); opacity: 0.6; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes pulse-btn {
  0%, 100% {
    transform: scale(1);
    box-shadow: var(--shadow-base);
  }
  50% {
    transform: scale(1.02);
    box-shadow: var(--shadow-hover);
  }
}

@keyframes wave-hand {
  0%, 100% { transform: rotate(0deg); }
  15% { transform: rotate(14deg); }
  30% { transform: rotate(-8deg); }
  45% { transform: rotate(14deg); }
  60% { transform: rotate(-4deg); }
  75% { transform: rotate(10deg); }
}

/* Clases de utilidad para animaciones */
.animate-fade-in {
  animation: fadeIn 0.3s ease-out;
}

.animate-wave-hand {
  animation: wave-hand 2.5s infinite ease-in-out;
  transform-origin: 70% 70%;
}