/* ==========================================================================
   wa-popup.css - Formulario Emergente de WhatsApp (Botón Flotante con Popover)
   AgencyOS Invariante rules/whatsapp-popup-form-invariant.md
   ========================================================================== */

/* Contenedor Flotante Fijo en la esquina inferior derecha */
.wa-floating-wrapper {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

/* Botón disparador de WhatsApp */
.wa-float-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.75rem;
  height: 3.75rem;
  border-radius: 9999px;
  background-color: #25D366;
  color: #ffffff;
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 25px -5px rgba(37, 211, 102, 0.5), 0 8px 10px -6px rgba(37, 211, 102, 0.4);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease;
  position: relative;
  z-index: 10001;
  outline: none;
}

.wa-float-btn:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 14px 28px -5px rgba(37, 211, 102, 0.6);
}

.wa-float-btn svg {
  width: 2.25rem;
  height: 2.25rem;
  fill: currentColor;
}

/* Tooltip o badge cuando está cerrado (opcional) */
.wa-float-pulse {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 9999px;
  background-color: #25D366;
  opacity: 0.4;
  animation: wa-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  z-index: -1;
}

@keyframes wa-pulse {
  0% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.35); opacity: 0; }
  100% { transform: scale(1.35); opacity: 0; }
}

/* ==========================================================================
   POPUP FORMULARIO (Se abre ARRIBA del botón, NO como modal invasivo)
   ========================================================================== */
.wa-popover {
  position: absolute;
  bottom: 4.75rem; /* Justo arriba del botón flotante */
  right: 0;
  width: calc(100vw - 2rem);
  max-width: 380px;
  background: #ffffff;
  border-radius: 1.5rem;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  display: none;
  flex-direction: column;
  transform-origin: bottom right;
  animation: wa-popup-in 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  z-index: 10000;
}

.wa-popover.is-open {
  display: flex !important;
}

@keyframes wa-popup-in {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Cabecera del Popup con Logo de Emaús */
.wa-popover-header {
  background: linear-gradient(135deg, #009245 0%, #007034 100%);
  color: #ffffff;
  padding: 0.85rem 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.wa-popover-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.wa-popover-logo {
  width: 2rem;
  height: 2rem;
  background: #ffffff;
  padding: 0.15rem;
  border-radius: 9999px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  object-fit: contain;
  flex-shrink: 0;
}

.wa-popover-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
}

.wa-popover-sub {
  font-size: 0.75rem;
  opacity: 0.92;
  margin-top: 0.1rem;
  font-weight: 500;
  color: #e5e7eb;
}

.wa-status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background-color: #25D366;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.4);
}

.wa-close-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  transition: opacity 0.15s, background-color 0.15s;
}

.wa-close-btn:hover {
  opacity: 1;
  background-color: rgba(255, 255, 255, 0.2);
}

/* Cuerpo del Formulario */
.wa-popover-body {
  padding: 1.25rem;
  max-height: calc(85vh - 7rem);
  overflow-y: auto;
  background-color: #ffffff;
}

.wa-popover-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.wa-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-align: left;
}

.wa-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #374151;
}

.wa-input,
.wa-textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  font-size: 0.875rem;
  border: 1px solid #d1d5db;
  border-radius: 0.625rem;
  background-color: #f9fafb;
  color: #111827;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.wa-input:focus,
.wa-textarea:focus {
  background-color: #ffffff;
  border-color: #25D366;
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.15);
}

.wa-submit-btn {
  width: 100%;
  background: linear-gradient(135deg, #25D366 0%, #1ea952 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.9375rem;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 0.625rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  margin-top: 0.35rem;
}

.wa-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.45);
}

.wa-submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Enlace de respaldo directo wa.me */
.wa-direct-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: #4b5563;
  text-decoration: none;
  padding-top: 0.5rem;
  margin-top: 0.25rem;
  border-top: 1px dashed #e5e7eb;
  transition: color 0.15s;
}

.wa-direct-link:hover {
  color: #25D366;
  text-decoration: underline;
}

/* Mensaje de confirmación */
.wa-success-card {
  padding: 1.25rem 0.5rem;
  text-align: center;
}

.wa-success-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  background-color: #25D366;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 0.75rem auto;
}

/* ==========================================================================
   REDISEÑO ELEGANTE DE LA SECCIÓN ¿CÓMO NOS PUEDES DONAR?
   ========================================================================== */
.steps-section {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%) !important;
  color: #1e293b !important;
  position: relative;
  overflow: hidden;
}

.steps-section .steps-badge {
  color: #009245;
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.steps-section .steps-title {
  color: #0f172a;
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .steps-section .steps-title {
    font-size: 2.75rem;
  }
}

.steps-section .steps-divider {
  width: 4rem;
  height: 0.25rem;
  background-color: #ef4444;
  border-radius: 9999px;
  margin: 0 auto;
}

.steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  margin-top: 3.5rem;
}

@media (min-width: 768px) {
  .steps-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.step-card {
  background: #ffffff;
  border-radius: 1.25rem;
  padding: 2.25rem 1.75rem;
  text-align: center;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.step-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  border-color: #cbd5e1;
}

.step-number-badge {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  background-color: #f1f5f9;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-icon-wrapper {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  box-shadow: 0 8px 16px -2px rgba(239, 68, 68, 0.35);
  color: #ffffff;
  transition: transform 0.25s ease;
}

.step-card:hover .step-icon-wrapper {
  transform: scale(1.1);
}

.step-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.75rem;
}

.step-card-desc {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #64748b;
}

.step-phone-btn {
  margin-top: 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: #fee2e2;
  color: #b91c1c;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}

.step-phone-btn:hover {
  background-color: #fecaca;
  color: #991b1b;
}
