  /* Fondo oscuro con desenfoque */
  .popup-fondo {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(20, 24, 40, .6);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
    overflow-y: auto;
  }
  .popup-fondo.abierto {
    opacity: 1;
    visibility: visible;
  }
 
  /* Caja principal (Enfoque Desktop-First adaptado) */
  .popup {
    position: relative;
    display: flex;
    width: 100%;
    max-width: 780px;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
    transform: translateY(24px) scale(.97);
    transition: transform .3s ease;
  }
  .popup-fondo.abierto .popup {
    transform: none;
  }
 
  /* Lado izquierdo: contenedor que aloja el círculo */
  .popup-imagen {
    flex: 1 1 45%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px; /* Margen interno para que no toque los bordes rectangulares */
  }
  
  /* Imagen circular perfecta en escritorio */
  .popup-imagen img {
    width: 250px;       /* Ancho fijo para mantener la proporción */
    height: 250px;      /* Alto idéntico al ancho */
    border-radius: 50%; /* Genera el círculo perfecto */
    object-fit: cover;  /* Evita que las facciones se estiren o aplasten */
    display: block;
  }
 
  /* Lado derecho: texto y botón */
  .popup-contenido {
    flex: 1 1 55%;
    padding: 40px 32px 32px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
  }
  .popup-contenido h2 {
    margin: 0;
    font-size: 2.4rem;
    line-height: 1.1;
  }
  .popup-contenido p {
    margin: 0;
    color: #5b6275;
    line-height: 1.5;
  }
  .popup-boton {
    align-self: center;
    margin-top: 8px;
    padding: 12px 28px;
    border-radius: 8px;
    background: #1a1f36;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: .03em;
  }
  .popup-boton:hover { background: #2c3354; }
 
  /* Botón de cerrar (X) minimalista y elegante */
  .popup-cerrar {
    position: absolute;
    top: 16px;
    right: 18px;
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    font-size: 1.8rem;
    line-height: 1;
    color: #1a1f36;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.2s ease;
  }
  .popup-cerrar:hover { opacity: 1; }
  .popup-cerrar:focus-visible,
  .popup-boton:focus-visible { outline: 3px solid #2b6cff; outline-offset: 2px; }
 
  /* Móvil: Ajuste fluido sin distorsiones */
  @media (max-width: 640px) {
    .popup { 
      flex-direction: column; 
      max-width: 420px; 
      max-height: calc(100vh - 40px); /* Protege pantallas muy pequeñas */
      overflow-y: auto; 
    }
    .popup-imagen {
      padding: 24px 0 12px;
    }
    /* Mantiene la circularidad intacta en teléfonos reduciendo la escala proporcionalmente */
    .popup-imagen img { 
      width: 165px; 
      height: 165px; 
    }
    .popup-contenido { padding: 20px 20px 24px; }
    .popup-contenido h2 { font-size: 1.9rem; }
    .popup-boton { align-self: stretch; } /* Botón fácil de presionar en móviles */
    
    /* En móvil la X queda sobre fondo negro debido al script */
    .popup-cerrar { color: #ffffff; }
  }
 
  @media (prefers-reduced-motion: reduce) {
    .popup-fondo, .popup { transition: none; }
  }
