/* ===== Backdrop Funciones ===== */
#funcionesBackdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  z-index: 1000;
}

#funcionesBackdrop.open {
  display: block;
}

/* ===== Modal Funciones ===== */
.funciones-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  width: min(950px, 95%);
  max-height: 90vh;
  overflow-y: auto; /* scroll si contenido largo */
  background: #000;
  border-radius: 16px;
  padding: 40px;
  z-index: 1001;
  color: #fff;
  text-align: center;

  border: 1px solid var(--neon);
  box-shadow: 0 0 10px rgba(0, 255, 128, 0.4);

  /* Estado inicial (oculto) */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.4s ease;

  /* Scroll oculto en PC */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE 10+ */
}

.funciones-panel::-webkit-scrollbar {
  width: 0; /* Chrome, Edge, Safari */
}

.funciones-panel.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  animation: modalEnter 0.5s ease forwards;
}

/* ===== Animación de entrada ===== */
@keyframes modalEnter {
  0% {
    opacity: 0;
    transform: translate(-50%, -40%) scale(0.8);
  }
  60% {
    opacity: 1;
    transform: translate(-50%, -52%) scale(1.05);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* ===== Botón cerrar ===== */
.funciones-panel .sheet-close {
  position: absolute;
  top: 15px;
  right: 18px;
  background: transparent;
  border: none;
  color: var(--neon);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

/* ===== Cuerpo ===== */
.funciones-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
}

/* ===== Grid de funciones ===== */
.funciones-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  width: 100%;
}

/* ===== Tarjetas (look neón) ===== */
.funcion-card {
  background: transparent;
  border: 1px solid #00ff80;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: transform 0.2s ease;
  box-shadow: 0 0 12px rgba(0, 255, 128, 0.2);
}

.funcion-card:hover {
  transform: scale(1.05);
}

.funcion-card h3 {
  color: var(--neon);
  margin-bottom: 10px;
  font-size: 20px;
}

.funcion-card p {
  color: #aaa;
  font-size: 14px;
}

/* ===== Responsive móviles ===== */
@media (max-width: 600px) {
  .funciones-panel {
    width: 90%;
    padding: 20px;
    max-height: 85vh;
    scrollbar-width: thin; /* scroll visible en móviles */
  }

  .funciones-panel::-webkit-scrollbar {
    width: 6px;
  }

  .funciones-panel::-webkit-scrollbar-thumb {
    background-color: rgba(0,255,128,0.4);
    border-radius: 3px;
  }

  .funciones-panel::-webkit-scrollbar-track {
    background: transparent;
  }

  .funcion-card h3 {
    font-size: 18px;
  }

  .funcion-card p {
    font-size: 12px;
  }
}
