/* =========================================================
   TCG — PRODUCT CARD
   Shared by the product listing and "You may also like".
   Markup: tcg_custom_product_card() in includes/product-card.php
========================================================= */

.tcg-card {
    display: block;
    color: #111111;
    font-family: "Lato", "Helvetica Neue", Arial, sans-serif;
    text-decoration: none;
}

.tcg-card:hover,
.tcg-card:focus {
    color: #111111;
    text-decoration: none;
}

.tcg-card__media {
    position: relative;
    display: block;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border-radius: 6px;
    background: #e9e6df;
}

.tcg-card .tcg-card__media img {
    position: absolute;
    inset: 0;
    display: block;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    mix-blend-mode: multiply;
    transition: opacity .35s ease, transform .7s cubic-bezier(.16, .8, .24, 1);
}

/* Cutouts and packshots on white: the whole product, blended onto the
   tile, whatever the shape of the file. A cutout with a lot of empty
   space around it is enlarged and centred (--tcg-zoom / --tcg-x / --tcg-y,
   set per image by tcg_custom_image_fit_style()). */

.tcg-card .tcg-card__media img.tcg-fit {
    object-fit: contain;
    transform: scale(var(--tcg-zoom, 1)) translate(var(--tcg-x, 0), var(--tcg-y, 0));
}

/* Photographs fill the tile in their own colours. */

.tcg-card .tcg-card__media img.tcg-photo {
    mix-blend-mode: normal;
}

/* The two images must never be visible together (the blended one would
   show through): on hover the first fades out as the second fades in. */

.tcg-card .tcg-card__media .tcg-card__hover {
    opacity: 0;
}

.tcg-card:hover .tcg-card__media .tcg-card__hover {
    opacity: 1;
}

.tcg-card:not(.tcg-card--single):hover .tcg-card__media img:not(.tcg-card__hover) {
    opacity: 0;
}

.tcg-card--single:hover .tcg-card__media img {
    transform: scale(1.035);
}

.tcg-card--single:hover .tcg-card__media img.tcg-fit {
    transform: scale(calc(var(--tcg-zoom, 1) * 1.035)) translate(var(--tcg-x, 0), var(--tcg-y, 0));
}

.tcg-card.is-soldout .tcg-card__media img:not(.tcg-card__hover) {
    opacity: .55;
}

.tcg-card.is-soldout:hover .tcg-card__media .tcg-card__hover {
    opacity: .55;
}

.tcg-card.is-soldout:not(.tcg-card--single):hover .tcg-card__media img:not(.tcg-card__hover) {
    opacity: 0;
}

/* product without a photo */
.tcg-card__empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(17, 17, 17, .28);
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: .3em;
    text-transform: uppercase;
}

/* a quiet label, not a badge */
.tcg-card__tag {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    color: #111111;
    font-size: 9.5px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.tcg-card__tag--sale {
    color: #7a1f2b;
}

.tcg-card .tcg-card__name {
    display: block;
    margin: 12px 2px 0;
    color: #111111;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.tcg-card .tcg-card__price {
    display: block;
    margin: 3px 2px 0;
    color: #6f6d66;
    font-size: 12.5px;
    font-weight: 400;
    line-height: 1.35;
    letter-spacing: .02em;
}

.tcg-card.is-soldout .tcg-card__name {
    color: #6f6d66;
}

.tcg-card__price del {
    margin-right: 6px;
    opacity: .6;
}

.tcg-card__price ins {
    color: #7a1f2b;
    text-decoration: none;
}

.tcg-card__price .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

/* touch screens: a tap must not leave the second image stuck on */
@media (hover: none) {

    .tcg-card:hover .tcg-card__media .tcg-card__hover,
    .tcg-card.is-soldout:hover .tcg-card__media .tcg-card__hover {
        opacity: 0;
    }

    .tcg-card:not(.tcg-card--single):hover .tcg-card__media img:not(.tcg-card__hover) {
        opacity: 1;
    }

    .tcg-card.is-soldout:not(.tcg-card--single):hover .tcg-card__media img:not(.tcg-card__hover) {
        opacity: .55;
    }

    .tcg-card--single:hover .tcg-card__media img {
        transform: none;
    }

    .tcg-card--single:hover .tcg-card__media img.tcg-fit {
        transform: scale(var(--tcg-zoom, 1)) translate(var(--tcg-x, 0), var(--tcg-y, 0));
    }
}
