.catalog {
    display: grid;
    gap: 20px;
    grid-auto-rows: 280px;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    align-items: center;
    justify-items: center;
}

.catalog > a {
    position: relative;
    height: 280px;
    width: 350px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #fff;
    transition: 0.5s;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.catalog > a:hover {
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transform: scale(1.02, 1.03);
}

/* Estilizando la imagen dentro del enlace */
.catalog > a > img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Overlay que aparece al pasar el mouse */
.overlay {
    position: absolute;
    top: -100%; /* Comienza fuera de la imagen */
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(187, 10, 10, 0.8); /* Rojo con transparencia */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    opacity: 0;
    transition: top 0.5s ease-in-out, opacity 0.3s ease-in-out;
}

/* Imagen dentro del overlay */
.overlay img {
    width: 100px;
    height: 100px;
    margin-bottom: 10px;
}

/* Texto dentro del overlay */
.overlay h3 {
    color: white;
    padding: 10px;
    margin: 0;
    font-weight: 600;
}
.overlay p {
    color: white;
    font-size: 16px;
    padding: 10px;
    margin: 0;
}

/* Efecto cuando el usuario pasa el mouse */
.catalog > a:hover .overlay {
    top: 0; /* Baja hasta cubrir la imagen */
    opacity: 1;
}
