/* ==============================
   TEAM MODAL
============================== */

.team-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;

  display: none;
  align-items: center;
  justify-content: center;

  padding: 26px;
}

.team-modal.active {
  display: flex;
}

.team-modal-overlay {
  position: absolute;
  inset: 0;

  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
}

.team-modal-panel {
  position: relative;
  z-index: 2;

  width: min(100%, 1180px);
  max-height: 90vh;
  overflow-y: auto;

  background:
    linear-gradient(rgba(0, 0, 0, 0.92), rgba(12, 0, 4, 0.96)),
    url("../assets/images/backgrounds/bg-estudio.jpg") center/cover no-repeat;

  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 24px;

  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.72);

animation: teamModalIn 0.22s ease;
}

@keyframes teamModalIn {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(18px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.team-modal-close {
  position: absolute;
  top: 32px;
  right: 32px;
  z-index: 10;

  width: 40px;
  height: 40px;

  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  color: #ffffff;

  font-size: 28px;
  line-height: 1;
  cursor: pointer;

  display: grid;
  place-items: center;
}

.team-section-modal {
  background: transparent;
}

.team-section-modal .section-inner {
  padding-top: 24px;
  padding-bottom: 76px;
}

.team-modal-panel .team-grid {
  margin-top: 36px;
}

/* Evita scroll del fondo cuando el modal está abierto */
body.modal-open {
  overflow: hidden;
}

@media (max-width: 720px) {
  .team-modal {
    padding: 12px;
    align-items: flex-start;
    overflow-y: auto;
  }

  .team-modal-panel {
    width: 100%;
    max-height: none;
    border-radius: 18px;
  }

  .team-modal-close {
    top: 28px;
    right: 22px;
    width: 38px;
    height: 38px;
    font-size: 26px;
  }

  .team-section-modal .section-inner {
    padding: 24px 18px 54px;
  }

  .team-modal-panel .team-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

@media (max-width: 420px) {
  .team-modal-panel .team-grid {
    grid-template-columns: 1fr;
  }
}