.modal {
    position: fixed;
    inset: 0;
    display: none;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    z-index: 9999;
    padding: 24px;
    overflow-y: auto;                 /* Scroll del modal completo */
    -webkit-overflow-scrolling: touch; /* Scroll suave en móvil */
    align-items: flex-start;          /* Permite que el contenido no se corte */
    justify-content: center;
  }
  
  .modal-content {
    position: relative;
    background: var(--surface-color, #fff);
    width: 100%;
    max-width: 1100px;
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
    padding: 24px;
    display: block;                    /* No flex, para que el contenido crezca */
  }

  
  /* ===========================
     BRILLO INTERNO PREMIUM
  =========================== */
  .modal-content::before,
  .modal-content::after {
    content: "";
    position: absolute;
    left: 0;
    width: 100%;
    height: 60px;
    pointer-events: none;
    border-radius: 20px;
  }
  
  .modal-content::before {
    top: 0;
    background: linear-gradient(to bottom, rgba(255,255,255,0.15), transparent);
  }
  
  .modal-content::after {
    bottom: 0;
    background: linear-gradient(to top, rgba(255,255,255,0.15), transparent);
  }
  
  /* Efecto sutil de “glow” interno en los bordes laterales */
  .modal-content::after,
  .modal-content::before {
    box-shadow: inset 0 0 20px rgba(255,255,255,0.05);
  }
  
  /* ===========================
     ANULA FONDO HEREDADO
  =========================== */
  .modal-content .section {
    background: none;
    padding: 0;
  }
  
  /* ===========================
     ANIMACIONES DE ENTRADA Y SALIDA
  =========================== */
  @keyframes modalEnter {
    from { opacity: 0; transform: translateY(30px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }
  
  .modal.is-closing .modal-content {
    animation: modalExit 0.3s ease forwards;
  }
  
  @keyframes modalExit {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(30px) scale(0.96); }
  }
  
  /* ===========================
     BOTÓN CERRAR
  =========================== */
  .modal .close-btn {
    position: sticky;
    top: 0;
    margin-left: auto;
    display: block;
    background: transparent;
    border: none;
    font-size: 32px;
    padding: 16px 24px 0 0;
    color: #64748b;
    cursor: pointer;
    z-index: 10;
    transition: all 0.25s ease;
  }
  
  .modal .close-btn:hover {
    color: var(--accent-color);
  }
  
  /* ===========================
     AJUSTES DEL CONTENIDO INTERNO
  =========================== */
  .modal .departments.section {
    padding-top: 0;
    padding-bottom: 40px;
  }
  
  .modal .section-title {
    text-align: center;
    margin-bottom: 32px;
  }
  
  .modal .section-title h2 {
    font-size: 28px;
  }
  
  .modal .section-title p {
    font-size: 16px;
    max-width: 600px;
    margin: 0 auto;
    color: #475569;
    line-height: 1.5;
  }
  
  /* ===========================
     BOTÓN ESTILO CTA
  =========================== */
  .modal .btn-cita {
    display: inline-block;
    margin-top: 16px;
    padding: 10px 24px;
    border-radius: 12px;
    background-color: var(--accent-color);
    color: var(--contrast-color);
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
  }
  
  .modal .btn-cita:hover {
    background-color: color-mix(in srgb, var(--accent-color), #000 10%);
    transform: translateY(-2px);
  }
  
  /* ===========================
     TABS (Bootstrap)
  =========================== */
  .modal .nav-tabs {
    border: none;
    gap: 6px;
  }
  
  .modal .nav-tabs .nav-link {
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    font-weight: 500;
    color: var(--default-color);
    background: transparent;
    transition: all 0.25s ease;
  }
  
  .modal .nav-tabs .nav-link:hover {
    background: color-mix(in srgb, var(--accent-color), transparent 90%);
  }
  
  .modal .nav-tabs .nav-link.active {
    background: var(--accent-color);
    color: var(--contrast-color);
  }
  
  /* ===========================
     CONTENIDO DE LAS TABS
  =========================== */
  .modal .tab-content h3 {
    font-size: 22px;
    margin-bottom: 14px;
  }
  
  .modal .tab-content p {
    font-size: 15px;
    line-height: 1.7;
    color: #475569;
  }
  
  .modal .tab-content img {
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
  }
  .tab-content {
    display: block;            /* importante para que el tab activo se muestre */
    overflow: visible;         /* dejamos que el modal overlay haga el scroll */
  }
  /* ===========================
     SCROLL INTERNO BONITO
  =========================== */
  .modal-content::-webkit-scrollbar {
    width: 8px;
  }
  
  .modal-content::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--accent-color), transparent 70%);
    border-radius: 10px;
  }
  
  .modal-content::-webkit-scrollbar-track {
    background: transparent;
  }
  
  /* ===========================
     EVITAR SCROLL DEL BODY
  =========================== */
  body.modal-open {
    overflow: hidden;
  }
  
  