@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@100..900&display=swap');

/* Estilos básicos del body */
body {
  font-family: 'Futura', sans-serif;
  margin: 0;
  padding-top: 70px;
  display: flex;
  flex-direction: row;
  align-items: center;
  background-color: #f8f8f8;
  flex-wrap: wrap;
  justify-content: center;
}

/* Contenedor de tarjetas */
#contenedor-tarjetas {
  display: flex;
  grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
  justify-content: center;
  margin-top: 4%;
  flex-direction: row;
  flex-wrap: wrap;
}

/* Tarjeta */
.tarjeta {
  width: 15rem;
  height: 16rem;
  overflow: hidden;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  margin: 12px;
  align-content: center;
  flex-wrap: wrap;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Filtro */
.filtro {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 20px;
  z-index: 1;
  transition: background 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Imagen de la tarjeta */
.tarjeta img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 20px;
  z-index: 0;
}

/* Texto y botones dentro de la tarjeta */
.tarjeta h2,
.tarjeta p,
.botones {
  width: 80%;
  position: relative;
  z-index: 2;
  color: #fff;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  text-shadow: 0px 6px 13px black;
}

.active {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  z-index: 3;
  width: 70%;
  height: 70%;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Restaura la posición original cuando la tarjeta deja de estar activa */
.tarjeta:not(.active) {
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Títulos de las tarjetas */
.tarjeta h2 {
  margin-top: 20px;
  font-size: 1.8rem;
}

/* Descripciones de las tarjetas */
.tarjeta p {
  max-width: 70%;
  margin: 10px auto;
  font-size: 1.2rem;
}

/* Botones */
.botones {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
}

.boton-whatsapp,
.boton-ubicacion {
  display: none;
}

.tarjeta.active .botones {
  opacity: 1;
}

.tarjeta.active .boton-whatsapp,
.tarjeta.active .boton-ubicacion {
  display: inline-block;
  background-color: #25d366;
  color: #fff;
  padding: 13px 31px;
  border: none;
  border-radius: 10px;
  margin-bottom: 7px;
  cursor: pointer;
  transition: background-color 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
  position: absolute;
  bottom: 5px;
}

.tarjeta.active .boton-whatsapp {
  left: 12px;
}

.tarjeta.active .boton-ubicacion {
  right: 11px;
}

.boton-ubicacion {
  background-color: #34b7f1;
}

.boton-whatsapp:hover,
.boton-ubicacion:hover {
  background-color: #128C7E;
}

/* Superposición */
.overlay {
  backdrop-filter: blur(11px);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 3;
  display: none;
}

#logo-container {
    width: 50px;
    height: 50px;
    position: fixed;
    right: 10px;
    bottom: 10px;
    background-color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#logo {
    width: 40px;
    height: auto;
}

/* Media queries */
@media (max-width: 768px) {
  #contenedor-tarjetas {
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  }

  .tarjeta {
    width: 10rem;
    height: 10rem;
    border-radius: 12px;
    margin: 5px;
  }

  .tarjeta h2 {
    margin-top: 10px;
  }

  .tarjeta p {
    max-width: 78%;
    font-size: 1.1rem;
  }

  .botones {
    opacity: 0;
  }

  .tarjeta:hover .botones {
    opacity: 1;
  }
}

/* Nueva regla para ocultar tarjetas */
.tarjeta.hidden {
  display: none;
}

.active {
  position: fixed;
  left: auto;
  transform: scale(1.1);
  box-shadow: 0px 12px 20px rgba(0, 0, 0, 0.54);
  z-index: 3;
  width: 79%;
  max-width: 342px;
  height: 70%;
  max-height: 600px;
  top: 13%;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
