/* Product card grid. */

.hbe-popular-pumps-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;

    @media (min-width: 640px) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    @media (min-width: 768px) {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    @media (min-width: 1024px) {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .hbe-pump-card {
        display: flex;
        flex-direction: column;
        background: white;
        border-radius: 12px;
        border: 1px solid #e5e7eb;
        overflow: hidden;
        /* Named, not all: hover only moves the card and its shadow. */
        transition:
            transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
            box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
            border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        height: 100%;

        &:hover {
            transform: translateY(-2px);
            box-shadow:
                0 4px 12px rgba(99, 93, 167, 0.15),
                0 2px 4px rgba(99, 93, 167, 0.1),
                0 1px 2px rgba(99, 93, 167, 0.05);

            .hbe-pump-content .hbe-pump-actions .hbe-pump-quickview {
                opacity: 1;
                transform: translateY(0);
            }
        }

        &:not([data-has-gallery='true']):hover {
            .hbe-pump-image img {
                transform: scale(1.05);
            }
        }

        .hbe-pump-image {
            position: relative;
            overflow: hidden;
            aspect-ratio: 1;
            background: #f9fafb;

            img {
                width: 100%;
                height: 100%;
                object-fit: contain;
                padding: 1rem;
                transition:
                    transform 0.3s ease,
                    opacity 0.3s ease;
                /* Pure black at 10%, so the edge doesn't tint the photo. */
                outline: 1px solid oklch(0 0 0 / 0.1);
                outline-offset: -1px;
                position: absolute;
                top: 0;
                left: 0;

                &.primary-image {
                    opacity: 1;
                    z-index: 2;
                }

                &.hover-image {
                    opacity: 0;
                    z-index: 1;
                }
            }
        }

        &[data-has-gallery='true']:hover {
            .hbe-pump-image {
                .primary-image {
                    opacity: 0;
                }

                .hover-image {
                    opacity: 1;
                    transform: scale(1.05);
                }
            }
        }

        .hbe-pump-content {
            display: flex;
            flex-direction: column;
            flex: 1;
            padding: 1.5rem;
            gap: 1rem;
            text-align: center;

            .hbe-pump-title {
                font-size: 1.25rem;
                font-weight: 700;
                color: #1f2937;
                line-height: 1.3;
                margin: 0 0 0.5rem 0;
                min-height: 4.2rem;
                display: flex;
                align-items: flex-start;
                justify-content: center;
            }

            .hbe-pump-actions {
                display: flex;
                flex-direction: column;
                gap: 0.5rem;
                margin-top: auto;

                /* Divi's generated link color outranks class-only rules. */
                .hbe-pump-quickview {
                    font-size: 0.8rem;
                    color: #6b7280 !important;
                    text-decoration: none;
                    text-align: center;
                    opacity: 0;
                    transform: translateY(5px);
                    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
                    font-weight: 500;

                    &:hover {
                        color: #635ea7 !important;
                        text-decoration: underline;
                        text-underline-offset: 2px;
                    }
                }

                .hbe-pump-cta {
                    display: inline-flex;
                    align-items: center;
                    justify-content: center;
                    background: linear-gradient(
                        135deg,
                        #635ea7 0%,
                        #574fa5 100%
                    );
                    color: white !important;
                    font-weight: 600;
                    font-size: 0.8rem;
                    padding: 0.6rem 1rem;
                    border-radius: 50px;
                    text-decoration: none;
                    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
                    border: none;
                    box-shadow:
                        0 2px 8px rgba(99, 93, 167, 0.18),
                        0 1px 3px rgba(99, 93, 167, 0.08);
                    position: relative;
                    overflow: hidden;
                    letter-spacing: -0.01em;
                    line-height: 1.2;

                    &::before {
                        content: '';
                        position: absolute;
                        top: 0;
                        left: 0;
                        right: 0;
                        bottom: 0;
                        background: linear-gradient(
                            135deg,
                            #574fa5 0%,
                            #4c4399 100%
                        );
                        opacity: 0;
                        transition: opacity 0.3s ease;
                        z-index: -1;
                    }

                    &:hover {
                        transform: translateY(-1px);
                        box-shadow:
                            0 4px 16px rgba(99, 93, 167, 0.25),
                            0 2px 6px rgba(99, 93, 167, 0.12);
                        color: white !important;
                        text-decoration: none;

                        &::before {
                            opacity: 1;
                        }
                    }
                }
            }
        }
    }
}
