/* =====================================================
   COMPONENTE: BOTONES - SISTEMA UNIFICADO
   ===================================================== */

/* =====================================================
   BASE BUTTON
   ===================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0.9rem 2rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: var(--transition-base);
  line-height: 1.2;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

/* =====================================================
   VARIANTES DE COLOR
   ===================================================== */

/* Primary Button */
.btn-primary,
.btn--primary {
  background: var(--accent);
  color: var(--primary);
  box-shadow: var(--shadow-accent);
}

.btn-primary:hover,
.btn--primary:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-accent-lg);
}

/* Secondary Button */
.btn-secondary,
.btn--secondary {
  background: var(--primary);
  color: var(--white);
  box-shadow: var(--shadow-md);
}

.btn-secondary:hover,
.btn--secondary:hover {
  background: var(--secondary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

/* Ghost Button */
.btn-ghost,
.btn--ghost {
  background: transparent;
  color: var(--white);
  border: 2px solid var(--white);
}

.btn-ghost:hover,
.btn--ghost:hover {
  background: var(--white);
  color: var(--primary);
}

/* Outline Button */
.btn-outline,
.btn--outline {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover,
.btn--outline:hover {
  background: var(--primary);
  color: var(--white);
}

/* Accent Outline */
.btn-outline-accent {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
}

.btn-outline-accent:hover {
  background: var(--accent);
  color: var(--primary);
}

/* =====================================================
   VARIANTES DE TAMAÑO
   ===================================================== */
.btn-xs,
.btn--xs {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.btn-sm,
.btn--sm {
  padding: 0.7rem 1.5rem;
  font-size: 0.9rem;
}

.btn-lg,
.btn--lg {
  padding: 1.2rem 2.5rem;
  font-size: 1.1rem;
}

.btn-xl,
.btn--xl {
  padding: 1.4rem 3rem;
  font-size: 1.2rem;
}

/* =====================================================
   ESTADOS ESPECIALES
   ===================================================== */

/* Disabled */
.btn:disabled,
.btn.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* Loading */
.btn.loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.btn.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid currentColor;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spinner 0.6s linear infinite;
}

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

/* =====================================================
   BUTTON BLOCK (FULL WIDTH)
   ===================================================== */
.btn-block {
  width: 100%;
  display: flex;
}

/* =====================================================
   BUTTON GROUPS
   ===================================================== */
.btn-group {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-group-vertical {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* =====================================================
   ICON BUTTONS
   ===================================================== */
.btn-icon {
  padding: 0.75rem;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-circle);
}

.btn-icon i,
.btn-icon svg {
  margin: 0;
}

/* =====================================================
   EFECTOS ESPECIALES
   ===================================================== */

/* Shimmer effect */
.btn-shimmer::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 ease;
}

.btn-shimmer:hover::before {
  left: 100%;
}

/* Ripple effect base (necesita JS para el punto de clic) */
.btn-ripple {
  overflow: hidden;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
  .btn {
    padding: 0.8rem 1.5rem;
    font-size: 0.95rem;
  }
  
  .btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
  }
  
  .btn-block-mobile {
    width: 100%;
    display: flex;
  }
}

@media (max-width: 480px) {
  .btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
  }
}

/* =====================================================
   FOCUS STATES (ACCESIBILIDAD)
   ===================================================== */
.btn:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

.btn-primary:focus-visible {
  outline-color: var(--accent);
}

.btn-secondary:focus-visible {
  outline-color: var(--primary);
}