.books {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding-top: 2rem;
    justify-content: center;

    @media (width >= 48rem) {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 2.5rem;
    }

    @media (width >= 60rem) {
        grid-template-columns: repeat(5, 1fr);
    }

    @media (width >= 100rem) {
        justify-content: flex-start;
    }

    li {
        position: relative;
        overflow: hidden;
        box-shadow: 0 0 1rem rgba(0,0,0,.4);

        .card-image {
            aspect-ratio: 95/140;
            height: 100%;
        }

        .card-text {
            overflow: hidden;
            height: 100%;
            position: absolute;
            top: 0;
            left: 0;
            opacity: 0;
            background-color: rgba(255, 255, 255);
            padding: 2rem 1rem;
            line-height: 1.1;
            aspect-ratio: 95/140;
            transition: opacity .3s;

            @media screen and (min-width: 576px) {
                background-color: rgba(255, 255, 255, 0.8);
            }

            &:hover {
                opacity: 1;
            }

            a {
                width: 100%;
                height: 100%;
                border: none;
                display: inline-block;
                /*pointer-events: none;*/
                /*position: relative;*/

                &:hover {
                    text-decoration: none;
                }

                &::after {
                    content: '';
                    position: absolute;
                    left: 0;
                    top: 0;
                    background-image: linear-gradient(
                            to bottom,
                            transparent 50%,
                            #fff 75%
                    );
                    width: 100%;
                    height: 100%;

                    @media screen and (min-width: 576px) {
                        background-image: linear-gradient(
                                to bottom,
                                transparent 30%,
                                #fff 80%
                        );
                    }
                }

                span, h3, p, i, em {
                    font-size: 14px;

                    @media screen and (min-width: 576px) {
                        font-size: var(--font-size-synopsis);
                    }
                }
            }
        }

        &.is-overlay-open {
            .card-text {
                opacity: 1;
            }
        }

        .card-title {
            text-transform: none;
            margin-bottom: 1rem;
            font-weight: normal;
        }

        .card-title,
        .number {
            color: var(--color-blue);
        }

        footer {
            position: absolute;
            bottom: 2rem;
            left: 50%;
            translate: -50% 0;
            z-index: 9;

           .add-to-cart {
               display: flex;
               flex-direction: row;
               align-items: center;
               gap: 10px;
           }

            &:not(&:has(.icon-bag)) {
                 bottom: 2rem;
            }

            .number {
                /*display: none;*/
                display: flex;
                flex-direction: column;
                align-items: center;
                gap: 2px;
                color: var(--color-blue);

                @media (width >= 576px) {
                    flex-direction: row;
                }
            }

            .price {
                display: block;
                margin-left: .5rem;
                white-space: nowrap;
            }

            .icon-bag {
                width: 2.25rem;
                height: 2.25rem;
            }
        }
    }
}

.htmx-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    translate: -50% 0;
}