/* ========================================
   MODAL DE CONTACTO DIRECTO - PREMIUM
   WhatsApp | Email | Telegram
   Diseño elegante y responsivo
   ======================================== */

/* Ocultar/Mostrar */
.contact-modal-hidden {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Ocultar modales de curso por defecto (reutiliza la misma lógica) */
.course-modal-hidden {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Mostrar modales de curso */
.course-modal-visible {
  display: block !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* ===== GARANTIZAR CLICKABILIDAD TOTAL ===== */
.course-option-btn,
.contact-option-btn {
  pointer-events: auto !important;
  cursor: pointer !important;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.course-option-btn:disabled,
.contact-option-btn:disabled {
  pointer-events: none !important;
  opacity: 0.5;
}

/* Backdrop oscuro */
.contact-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 998;
  animation: fadeIn 0.3s ease;
  backdrop-filter: blur(2px);
}

/* Contenedor del modal */
.contact-modal-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 999;
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translate(-50%, -40%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

/* Caja principal */
.contact-modal-box {
  background: linear-gradient(180deg, #1a3a47 0%, #172f3e 100%);
  border: 2px solid rgba(227, 208, 67, 0.25);
  border-radius: 18px;
  padding: 32px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.85),
              0 0 50px rgba(227, 208, 67, 0.15);
  position: relative;
  margin: 16px;
}

/* Botón cerrar */
.contact-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 32px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-weight: 300;
  padding: 0;
  line-height: 1;
}

.contact-modal-close:hover {
  background: rgba(227, 208, 67, 0.2);
  color: var(--accent);
  transform: rotate(90deg) scale(1.1);
}

.contact-modal-close:active {
  transform: rotate(90deg) scale(0.95);
}

/* Header del modal */
.contact-modal-header {
  text-align: center;
  margin-bottom: 28px;
}

.contact-modal-header h2 {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 10px 0;
  color: #e3d043;
  letter-spacing: 0.5px;
}

.contact-modal-header p {
  color: #ffffff;
  font-size: 16px;
  margin: 0;
  line-height: 1.5;
  font-weight: 400;
}

/* Opciones de contacto (grid) */
.contact-options,
.course-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 28px;
}

@media (min-width: 480px) {
  .contact-options,
  .course-options {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
}

@media (min-width: 768px) {
  .contact-options,
  .course-options {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}

/* Botón de opción */
.contact-option-btn {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border: 2px solid rgba(227, 208, 67, 0.15);
  border-radius: 14px;
  padding: 20px 16px;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: 'Poppins', sans-serif;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

/* Pseudo-elemento para efecto hover */
.contact-option-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(227, 208, 67, 0.1);
  transition: left 0.3s ease;
  z-index: 0;
}

.contact-option-btn > * {
  position: relative;
  z-index: 1;
}

.contact-option-btn:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(227, 208, 67, 0.2),
              inset 0 0 20px rgba(227, 208, 67, 0.05);
  transform: translateY(-4px);
}

.contact-option-btn:hover::before {
  left: 0;
}

.contact-option-btn.active {
  background: linear-gradient(180deg, rgba(227, 208, 67, 0.15), rgba(227, 208, 67, 0.08));
  border-color: var(--accent);
  box-shadow: 0 12px 32px rgba(227, 208, 67, 0.25),
              inset 0 0 20px rgba(227, 208, 67, 0.1);
}

/* Ícono */
.contact-icon {
  font-size: 36px;
  line-height: 1;
  display: block;
  animation: bounce 0.6s ease-in-out;
}

.contact-option-btn:hover .contact-icon {
  animation: bounce 0.6s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

/* Título de opción */
.contact-option-btn h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  color: #e3d043;
  letter-spacing: 0.3px;
  font-family: 'Cinzel', Georgia, serif;
}

/* Descripción */
.contact-option-btn p {
  font-size: 12px;
  color: #ffffff;
  margin: 0;
  line-height: 1.3;
  font-weight: 400;
}

/* Footer */
.contact-modal-footer {
  background: rgba(227, 208, 67, 0.08);
  border: 1px solid rgba(227, 208, 67, 0.15);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  backdrop-filter: blur(10px);
}

.contact-modal-footer p {
  margin: 6px 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  line-height: 1.4;
}

.contact-modal-footer p:first-child {
  color: var(--accent);
  font-weight: 600;
  margin-top: 0;
}

/* ===== MOBILE FIRST ===== */
@media (max-width: 479px) {
  .contact-modal-box {
    padding: 24px 20px;
    margin: 12px;
  }

  .contact-modal-header h2 {
    font-size: 26px;
  }

  .contact-modal-header p {
    font-size: 14px;
  }

  .contact-option-btn {
    padding: 18px 12px;
    gap: 6px;
  }

  .contact-icon {
    font-size: 32px;
  }

  .contact-option-btn h3 {
    font-size: 15px;
  }

  .contact-option-btn p {
    font-size: 11px;
  }

  .contact-options {
    gap: 10px;
    margin-bottom: 20px;
  }

  .contact-modal-footer {
    padding: 14px;
  }
}

/* ===== ACCESIBILIDAD ===== */
@media (prefers-reduced-motion: reduce) {
  .contact-modal-backdrop,
  .contact-modal-container,
  .contact-option-btn,
  .contact-modal-close {
    animation: none !important;
    transition: none !important;
  }
}

/* Focus visible para navegación por teclado */
.contact-option-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.contact-modal-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ===== SCROLLBAR MEJORADO ===== */
.contact-modal-container::-webkit-scrollbar {
  width: 8px;
}

.contact-modal-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
}

.contact-modal-container::-webkit-scrollbar-thumb {
  background: rgba(227, 208, 67, 0.3);
  border-radius: 10px;
  transition: background 0.3s ease;
}

.contact-modal-container::-webkit-scrollbar-thumb:hover {
  background: rgba(227, 208, 67, 0.5);
}
/* ===== SECCIÓN DE FORMULARIO ===== */
.contact-form-section {
  background: rgba(227, 208, 67, 0.05);
  border: 1px solid rgba(227, 208, 67, 0.15);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Campo de servicio */
.contact-service-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-service-field label {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  font-family: 'Cinzel', Georgia, serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.required {
  color: var(--accent);
  font-weight: 700;
}

.contact-service-select {
  padding: 12px 14px;
  border: 1px solid rgba(227, 208, 67, 0.25);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  color: #ffffff;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.contact-service-select:hover {
  border-color: rgba(227, 208, 67, 0.4);
  background: rgba(255, 255, 255, 0.06);
}

.contact-service-select:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(227, 208, 67, 0.2);
}

/* Estilos de opciones del select */
.contact-service-select option {
  background: #172f3e;
  color: #ffffff;
  padding: 10px;
}

.contact-service-select option:hover {
  background: var(--accent);
  color: #172f3e;
}

/* Campo de detalles */
.contact-details-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-details-field label {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  font-family: 'Cinzel', Georgia, serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.contact-details-textarea {
  padding: 12px 14px;
  border: 1px solid rgba(227, 208, 67, 0.25);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  color: #ffffff;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  resize: vertical;
  min-height: 80px;
  max-height: 150px;
  transition: all 0.3s ease;
}

.contact-details-textarea::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.contact-details-textarea:hover {
  border-color: rgba(227, 208, 67, 0.4);
  background: rgba(255, 255, 255, 0.06);
}

.contact-details-textarea:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(227, 208, 67, 0.2);
}

/* Contador de caracteres */
.char-count {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  text-align: right;
}

.contact-details-textarea.near-limit ~ .char-count {
  color: rgba(255, 165, 0, 0.8);
}

.contact-details-textarea.at-limit ~ .char-count {
  color: rgba(255, 100, 100, 0.8);
}

/* Mensaje de validación */
.contact-validation-msg {
  padding: 12px;
  border-radius: 8px;
  font-size: 13px;
  text-align: center;
  min-height: 0;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}

.contact-validation-msg.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: rgba(255, 100, 100, 1);
  opacity: 1;
  min-height: auto;
  pointer-events: auto;
}

.contact-validation-msg.success {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: rgba(100, 255, 150, 1);
  opacity: 1;
  min-height: auto;
  pointer-events: auto;
}

/* Animación de shake para errores */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

.contact-service-select.shake {
  animation: shake 0.6s ease-in-out;
}

/* ===== MOBILE OPTIMIZADO ===== */
@media (max-width: 479px) {
  .contact-form-section {
    padding: 14px;
    gap: 12px;
    margin-bottom: 18px;
  }

  .contact-service-select,
  .contact-details-textarea {
    font-size: 16px; /* Previene zoom en iOS */
  }

  .contact-details-textarea {
    min-height: 70px;
  }
}