.wc-product-inner .wc-product-media,
.single-product .wc-layout-columns > .media-product-media {
    position: relative;
}

.wc-product-inner .wc-product-media > button.gg-club-favorite,
.single-product .media-product-media > button.gg-club-favorite {
    position: absolute;
    inset: 8px 8px auto auto;
    z-index: 7;
    display: grid;
    place-items: center;
    box-sizing: border-box;
    width: 40px;
    height: 40px;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 1px solid #ddd;
    border-radius: 50%;
    background: #fff;
    color: #292529;
    line-height: 1;
    cursor: pointer;
}

.gg-club-favorite svg {
    display: block;
    pointer-events: none;
}

button.gg-club-favorite[aria-pressed="true"] svg {
    color: #881337;
    fill: currentColor;
}

button.gg-club-favorite:focus-visible {
    outline: 2px solid #881337;
    outline-offset: 2px;
}

.single-product .media-product-media > button.gg-club-favorite {
    width: 44px;
    height: 44px;
}

/* The gallery's own magnifier occupies the same corner by default. */
.single-product .media-product-media > .gg-club-favorite ~ .woocommerce-product-gallery .woocommerce-product-gallery__trigger {
    top: 60px;
}

@media (max-width: 800px) {
    /* The photo starts 10px inside the media column. Leave 14px around the heart. */
    .single-product .media-product-media > button.gg-club-favorite {
        top: 24px;
        right: 24px;
        box-shadow: 0 2px 5px rgb(0 0 0 / 12%);
    }

    .single-product .media-product-media > .gg-club-favorite ~ .woocommerce-product-gallery .woocommerce-product-gallery__trigger {
        top: 70px;
    }
}

/* The phone gallery opens the full-size photo directly on tap. */
@media (max-width: 560px) {
    .single-product .media-product-media > .gg-club-favorite ~ .woocommerce-product-gallery .woocommerce-product-gallery__trigger {
        display: none;
    }
}
