@import "~scss/variables";

.sw-cms-el-product-box {
    width: 100%;
    height: 100%;

    &.box-image {
        .sw-cms-el-product-box__media {
            height: 332px;

            .sw-cms-el-product-box__image-link img {
                height: 100%;
                object-fit: cover;
            }
        }
    }

    a {
        pointer-events: none;
    }

    .sw-cms-el-product-box__content {
        height: 100%;
        display: flex;
        flex-wrap: wrap;
        flex-grow: 1;
        align-content: start;
        justify-content: center;
        border: 1px solid #dadee5;
        border-radius: 4px;
        position: relative;
        background: $color-white;
        padding: 8px;
    }

    .sw-cms-el-product-box__badges {
        position: absolute;
        top: 30px;
        left: 0;
    }

    .sw-cms-el-product-box__badge-discount,
    .sw-cms-el-product-box__badge-topseller,
    .sw-cms-el-product-box__badge-new {
        padding: 4px 4px 4px 10px;
        margin-bottom: 10px;
        font-size: $font-size-xxs;
        font-weight: bold;
        background: $color-shopware-brand-500;
        color: $color-white;
        border-top-right-radius: 4px;
        border-bottom-right-radius: 4px;
    }

    .sw-cms-el-product-box__image-link {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .sw-cms-el-product-box__media {
        height: 200px;
        width: 100%;
        margin: 8px;

        a .sw-cms-el-product-box__image {
            display: block;
            max-width: 100%;
            max-height: 100%;

            &.is--cover {
                width: 100%;
                height: 100%;
                object-fit: cover;
            }

            &.is--contain {
                width: 100%;
                height: 100%;
                object-fit: contain;
            }
        }
    }

    .sw-cms-el-product-box__info,
    &__skeleton-info {
        margin: auto 8px;
        flex-shrink: 1;
        flex-grow: 1;
        flex-basis: 60%;
        display: flex;
        flex-direction: column;
    }

    .sw-cms-el-product-box__name {
        display: block;
        height: 40px;
        margin-bottom: 10px;
        font-size: $font-size-m;
        line-height: $line-height-sm;
        overflow: hidden;
        text-decoration: none;
        color: $color-darkgray-200;

        &:hover {
            color: $color-shopware-brand-500;
        }
    }

    .sw-cms-el-product-box__description {
        height: 72px;
        margin-top: 10px;
        font-size: $font-size-xs;
        line-height: $line-height-xs;
        overflow: hidden;
    }

    .sw-cms-el-product-box__price-info {
        margin-top: 10px;
    }

    .sw-cms-el-product-box__price-unit {
        height: 36px;
        font-size: $font-size-xs;
        line-height: $line-height-xs;
        overflow: hidden;
    }

    .sw-cms-el-product-box__price-unit-reference {
        height: 18px;
        font-size: $font-size-xs;
        line-height: $line-height-xs;
        overflow: hidden;
    }

    .sw-cms-el-product-box__price {
        height: 20px;
        margin-top: 10px;
        font-size: $font-size-m;
        font-weight: bold;
        line-height: $line-height-sm;
        overflow: hidden;
        color: $color-darkgray-200;
    }

    .sw-cms-el-product-box__actions {
        margin-top: 20px;
    }

    .sw-cms-el-product-box__buy-action {
        display: block;
        line-height: 40px;
        font-size: $font-size-xs;
        font-weight: bold;
        text-align: center;
        text-decoration: none;
        color: #fff;
        background: $gradient-action-button;
        border-radius: 4px;

        &:hover {
            background: darken($color-darkgray-200, 5%);
        }
    }

    div[class^="sw-cms-el-product-box__skeleton-"] {
        background: $color-gray-100;
        border-radius: 10px;
    }

    &__skeleton-name {
        width: 40%;
        height: 18px;
        margin: 20px 0 10px;
    }

    &__skeleton-description {
        max-width: 100%;
        height: 10px;
        margin-bottom: 8px;

        &:nth-child(3) {
            max-width: 90%;
        }
    }

    &__skeleton-price {
        width: 15%;
        height: 18px;
        margin-top: 20px;
    }
}
