:host {
    display: grid;
}

figure img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-right: -50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
}

.field-item {
    display: grid;
}

.image-area {
    display: grid;
    grid-area: image-area;
}

.fields-area {
    display: grid;
    align-items: center;
    grid-area: fields-area;
}

.price-area {
    display: grid;
    grid-area: price-area;
}

.action-area {
    display: flex;
    grid-area: action-area;
    height: 2.5rem;
    max-width: 12.5rem;
    justify-self: center;
    width: 100%;
}

.card-layout-grid {
    display: grid;
    padding: 0.5rem;
    border-style: solid;
    overflow: hidden;
    grid-template-rows: min-content min-content auto min-content;
    grid-template-areas:
        'image-area'
        'fields-area'
        'price-area'
        'action-area';
    flex-grow: 1;
}

.card-layout-grid figure {
    /* making the image container 1:1 aspect ratio */
    position: relative;
    padding-top: 100%;
    width: 100%;
}

.card-layout-grid .fields-area {
    justify-content: center;
}

.card-layout-grid .field-item {
    justify-content: center;
}

.card-layout-grid .price-area {
    justify-content: center;
    align-self: end;
}

.card-layout-list {
    display: grid;
    padding-right: 0.5rem;
    margin-right: 0.5rem;
    margin-left: 0.5rem;
    overflow: hidden;
    grid-template-columns: min-content 3fr 1fr;
    grid-template-areas:
        'image-area fields-area fields-area price-area'
        'image-area fields-area fields-area action-area';
    flex-grow: 1;
}

.card-layout-list figure {
    min-height: 6.25rem;
    max-height: 8.75rem;
    min-width: 8.75rem;
    align-self: center;

    /* making the image container 1:1 aspect ratio */
    position: relative;
    padding-left: 100%;
    height: 100%;
}

.card-layout-list .fields-area {
    padding-left: 1rem;
    padding-right: 1rem;
}

.card-layout-list .price-area {
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    line-height: 2rem;
}

.card-layout-list .action-area {
    width: 12.5rem;
    height: 2.5rem;
}

.listing-price {
    text-decoration: line-through;
    white-space: normal;
    word-break: break-all;
}

.selling-price {
    font-weight: var(--lwc-fontWeightRegular);
    white-space: normal;
    word-break: break-all;
}

@media only screen and (max-width: 47.9375em) {
    /* SLDS token: mqSmall */

    .card-layout-list {
        display: grid;
        padding: 0;
        margin: 0;
        overflow: hidden;
        grid-template-columns: min-content 3fr 1fr;
        grid-template-areas:
            'image-area fields-area fields-area'
            'image-area price-area price-area'
            'action-area action-area action-area';
        flex-grow: 1;
    }

    .card-layout-list figure {
        max-height: 6.25rem;
        min-width: 6.25rem;
    }

    .card-layout-list .action-area {
        justify-content: center;
        margin-top: 0.5rem;
        width: 100%;
    }

    .card-layout-list .fields-area {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .card-layout-list .price-area {
        display: block;
        margin-left: 0.5rem;
    }
}
