/* Estilos para controlar la visibilidad del carrusel */
#carrusel-wrapper {
  display: none; /* Oculto por defecto */
  opacity: 0;
  transition: opacity 0.5s ease-in-out, height 0.5s ease-in-out;
  position: relative;
  z-index: 100;
  width: 100%;
  min-height: 600px; /* Altura mínima para desktop */
  height: auto; /* Altura automática para móviles */
  margin: 50px auto; /* Mayor margen para separarlo de otros elementos */
  overflow: hidden; /* Evitamos desbordamiento no deseado */
  clear: both; /* Evitamos que otros elementos floten a su lado */
  
  /* Ajustes para móviles */
  @media (max-width: 768px) {
    min-height: 100vh;
    height: auto;
    margin: 20px auto;
    padding: 1rem 0;
    overflow-y: auto; /* Permitir scroll vertical si es necesario */
  }
}

/* Cuando está activo, se muestra */
#carrusel-wrapper.active {
  display: block !important;
  opacity: 1 !important;
  
  /* Asegurar que el contenedor se expanda correctamente en móviles */
  @media (max-width: 768px) {
    display: flex !important;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-bottom: 2rem;
  }
}

/* Solo añadimos cursor pointer al botón */
#portafolio-btn {
  cursor: pointer;
  z-index: 200;
}

.hidden {
  display: none !important;
}

.tarjetas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
  padding: 0 1rem;
}

.tarjetas-grid a {
  text-decoration: none;
  display: block;
}

.card {
  position: relative;
  height: 320px;
  aspect-ratio: 2/3;
  border-radius: 1.5rem;
  overflow: hidden;
  background: rgba(20, 30, 40, 0.7);
  box-shadow: 0 0 24px 0 rgba(0,255,255,0.15), 0 0 0 2px rgba(0,255,255,0.2) inset;
  border: 1.5px solid rgba(0,255,255,0.3);
  transition: transform 0.3s cubic-bezier(.4,2,.6,1), box-shadow 0.3s, border 0.3s;
  backdrop-filter: blur(8px) saturate(1.2);
  will-change: transform, box-shadow;
  cursor: pointer;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}

.card .img {
  width: 100%;
  height: 100%;
  /* Si quieres overlay, puedes agregar aquí */
}

.card:hover {
  transform: scale(1.2) rotate(-2deg);
  box-shadow: 0 0 48px 8px #00fff7, 0 0 0 4px #00fff7 inset;
  border: 2.5px solid #00fff7;
  z-index: 2;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,255,255,0.08) 0%, rgba(0,0,0,0.12) 100%);
  pointer-events: none;
}

.card-desc {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  min-width: 70%;
  max-width: 90%;
  background: rgba(0, 20, 40, 0.85);
  color: #00fff7;
  border: 1.5px solid #00fff7;
  border-radius: 1rem;
  box-shadow: 0 0 24px 2px #00fff7, 0 0 0 2px #00fff7 inset;
  padding: 1rem 1.2rem;
  font-size: 1rem;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
  transition: opacity 0.25s, transform 0.25s;
  backdrop-filter: blur(6px) saturate(1.2);
}

.card:hover .card-desc {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1.08);
}
