.enlace-programa-profesion {
  color: inherit;
  text-decoration: none;
}

.enlace-programa-profesion:hover {
  color: #c81542;
}

.acciones-programa-profesion {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.acciones-programa-profesion .btnprogramprofesion {
  flex: 1 1 190px;
}

.ver-programa-profesion {
  display: inline-block;
  padding: 10px 14px;
  color: #0d638f;
  font-weight: 700;
  text-align: center;
  text-decoration: underline;
}

.intro-formacion-profesion h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.intro-formacion-profesion p {
  margin: 0 0 18px;
  font-size: 15px !important;
  line-height: 1.45;
}

.profesion-meta {
  margin: 5px 0 18px;
  padding: 0;
  color: #666;
  font-size: 14px !important;
}

/* Popup comercial de profesiones: imagen completa y CTA debajo. */
.popup-formacion-profesion {
  display: block;
  padding: 0;
  overflow: hidden;
  border: 1px solid #e8e8e8;
  border-radius: 18px;
  background: #fff;
}

.popup-formacion-profesion .modal__content {
  width: 100%;
}

.popup-formacion-profesion .modal__content > h3 {
  margin: 0;
  padding: 18px 54px 8px;
  color: #777;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
}

.popup-programa-cabecera {
  padding: 8px 26px 18px;
  text-align: center;
}

.popup-programa-cabecera span {
  display: inline-block;
  margin-bottom: 7px;
  color: #c81542;
  font-size: 12px;
  font-weight: 700;
}

.popup-programa-cabecera h4 {
  margin: 0;
  padding: 0;
  color: #191919;
  font-size: 22px;
  font-weight: 750;
  line-height: 1.25;
  text-align: center;
}

.popup-formacion-profesion picture,
.popup-formacion-profesion picture img {
  display: block;
  width: 100%;
}

.popup-formacion-profesion picture img {
  height: auto;
  max-height: 430px;
  object-fit: contain;
  background: #f5f5f3;
}

.popup-programa-accion {
  padding: 20px 24px 22px;
  text-align: center;
}

.popup-formacion-profesion .programaspopup.inputlabel {
  float: none;
  display: block;
  width: 100% !important;
  margin: 0;
  padding: 13px 18px;
  border-color: #e9104f;
  border-radius: 10px;
  background: #e9104f;
  box-shadow: 0 8px 20px rgba(233, 16, 79, .18);
  font-size: 16px;
  font-weight: 700;
}

.popup-formacion-profesion .programaspopup.inputlabel:hover {
  border-color: #c80d42;
  background: #c80d42;
}

.popup-programa-accion small {
  display: block;
  margin-top: 10px;
  color: #777;
  font-size: 12px;
  line-height: 1.3;
}

.popup-formacion-profesion #close,
.popup-formacion-profesion + #close {
  top: 10px;
  right: 10px;
  margin: 0;
  border: 1px solid #e3e3e3;
  background: #f7f7f7;
}

@media (max-width: 991px) {
  .acciones-programa-profesion {
    display: block;
  }

  .ver-programa-profesion {
    display: block;
  }

  .acciones-programa-profesion .btnprogramprofesion {
    width: 100%;
  }
}

@media (max-width: 500px) {
  .popup-formacion-profesion {
    border-radius: 16px;
  }

  .popup-formacion-profesion .modal__content > h3 {
    padding: 18px 48px 6px;
    font-size: 11px;
  }

  .popup-programa-cabecera {
    padding: 7px 18px 16px;
  }

  .popup-programa-cabecera h4 {
    font-size: 19px;
  }

  .popup-formacion-profesion picture img {
    max-height: 44vh;
  }

  .popup-programa-accion {
    padding: 17px 18px 18px;
  }
}

/* Formulario de solicitud: cierre visible y desplazamiento seguro en móvil. */
#modal.modal-formulario-activo {
  overflow: hidden;
}

#modal.modal-formulario-activo #modal-content {
  position: relative;
  max-height: calc(100vh - 30px);
  max-height: calc(100dvh - 30px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.cerrar-formulario-profesion {
  position: sticky;
  top: 10px;
  z-index: 30;
  display: block;
  width: 44px;
  height: 44px;
  margin: 10px 10px -54px auto;
  padding: 0;
  border: 1px solid #ddd;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .18);
  color: #222;
  cursor: pointer;
  font: 400 34px/40px Arial, sans-serif;
  text-align: center;
}

.cerrar-formulario-profesion:hover,
.cerrar-formulario-profesion:focus {
  border-color: #c81542;
  color: #c81542;
  outline: 2px solid rgba(200, 21, 66, .18);
}

@media (max-width: 500px) {
  #modal.modal-formulario-activo #modal-content {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
    margin: 10px auto;
  }

  .cerrar-formulario-profesion {
    top: 8px;
    margin: 8px 8px -52px auto;
  }
}

/* Autocompletado movil: resultados con scroll propio, sin ocultar la busqueda. */
@media (max-width: 768px) {
    #ajaxbuscador.resultadosbuscador {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        width: 100%;
        max-height: 52vh;
        max-height: 52dvh;
        margin-top: 8px;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }
    #autocomplete-list {
        position: static !important;
        width: 100% !important;
        max-height: none !important;
        transform: none !important;
    }
    #txtbuscar.inputbuscador {color: #222 !important;-webkit-text-fill-color: #222;}
}
