/*
 * WRYEDGE DIRECT
 * Similar Products
 * v0.1.0-alpha1
 */


.wd-similar-products {
    padding:
        54px
        0
        72px;

    border-top:
        1px solid
        var(--wd-border);

    background:
        #fff;
}


.wd-similar-products[hidden] {
    display:
        none !important;
}


.wd-similar-products__header {
    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;

    margin-bottom:
        24px;
}


.wd-similar-products__header h2 {
    margin:
        0;

    font-size:
        26px;

    font-weight:
        700;

    line-height:
        1.2;

    letter-spacing:
        -0.02em;
}


.wd-similar-products__grid {
    display:
        grid;

    grid-template-columns:
        repeat(
            4,
            minmax(0, 1fr)
        );

    gap:
        16px;
}


/* =========================================================
   PRODUCT CARD
   Same StoreFront visual language as Main Shop.
   ========================================================= */

.wd-similar-products
.wd-product-card {
    display:
        flex;

    flex-direction:
        column;

    min-width:
        0;

    overflow:
        hidden;

    border:
        1px solid
        #dfe3e7;

    border-radius:
        10px;

    background:
        #fff;

    transition:
        border-color 150ms ease,
        box-shadow 150ms ease,
        transform 150ms ease;
}


.wd-similar-products
.wd-product-card:hover {
    border-color:
        #cfd2d6;

    box-shadow:
        0 8px 24px
        rgba(0, 0, 0, .05);

    transform:
        translateY(-1px);
}


.wd-similar-products
.wd-product-card__media {
    position:
        relative;

    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    aspect-ratio:
        1 / 1;

    padding:
        16px;

    overflow:
        hidden;

    border-bottom:
        1px solid
        #f0f1f2;

    background:
        #fff;
}


.wd-similar-products
.wd-product-card__media img {
    display:
        block;

    width:
        100%;

    height:
        100%;

    object-fit:
        contain;
}


.wd-similar-products
.wd-product-card__image-fallback {
    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    width:
        100%;

    height:
        100%;

    color:
        #d8dde2;

    font-size:
        48px;

    font-weight:
        800;
}


.wd-similar-products
.wd-product-card__sale-badge {
    position:
        absolute;

    top:
        12px;

    left:
        12px;

    z-index:
        2;

    display:
        inline-flex;

    align-items:
        center;

    justify-content:
        center;

    min-height:
        23px;

    padding:
        3px
        7px;

    border:
        1px solid
        #4a4f55;

    border-radius:
        5px;

    background:
        #4a4f55;

    color:
        #fff;

    font-size:
        10px;

    font-weight:
        700;

    line-height:
        1;
}


.wd-similar-products
.wd-product-card__body {
    display:
        flex;

    flex:
        1;

    flex-direction:
        column;

    min-width:
        0;

    padding:
        17px
        17px
        16px;
}


.wd-similar-products
.wd-product-card__brand {
    margin-bottom:
        6px;

    color:
        #7b848d;

    font-size:
        11px;

    font-weight:
        600;

    text-transform:
        uppercase;
}


.wd-similar-products
.wd-product-card__title {
    display:
        -webkit-box;

    min-height:
        42px;

    margin:
        0;

    overflow:
        hidden;

    -webkit-box-orient:
        vertical;

    -webkit-line-clamp:
        2;

    line-clamp:
        2;

    font-size:
        14px;

    line-height:
        1.45;
}


.wd-similar-products
.wd-product-card__title a {
    color:
        var(--wd-text);

    text-decoration:
        none;
}


.wd-similar-products
.wd-product-card__title a:hover {
    color:
        var(--wd-accent);
}


.wd-similar-products
.wd-product-card__sku {
    margin-top:
        7px;

    color:
        var(--wd-text-faint);

    font-size:
        10px;
}


.wd-similar-products
.wd-product-card__commerce {
    display:
        flex;

    flex-direction:
        column;

    gap:
        7px;

    margin-top:
        auto;

    padding-top:
        18px;
}


.wd-similar-products
.wd-product-card__price {
    display:
        flex;

    align-items:
        baseline;

    flex-wrap:
        wrap;

    gap:
        7px;
}


.wd-similar-products
.wd-product-card__price strong {
    color:
        #18212b;

    font-size:
        17px;

    font-weight:
        700;
}


.wd-similar-products
.wd-product-card__price del {
    color:
        #9b9fa5;

    font-size:
        11px;

    font-weight:
        500;
}


.wd-similar-products
.wd-product-card__stock {
    width:
        fit-content;

    font-size:
        11px;

    font-weight:
        500;
}


.wd-similar-products
.wd-product-card__stock.is-in-stock {
    color:
        #087a45;
}


.wd-similar-products
.wd-product-card__stock.is-out-of-stock {
    color:
        #9b6a6a;
}


.wd-similar-products
.wd-product-card__delivery {
    width:
        fit-content;

    color:
        #747980;

    font-size:
        11px;

    font-weight:
        500;

    line-height:
        1.35;
}


.wd-similar-products
.wd-product-card__delivery.is-ready {
    color:
        #555b62;
}


.wd-similar-products
.wd-product-card__delivery.is-unavailable {
    color:
        #9b6a6a;
}


.wd-similar-products
.wd-product-card__cta {
    display:
        flex;

    align-items:
        center;

    justify-content:
        center;

    min-height:
        40px;

    margin-top:
        14px;

    padding:
        8px
        12px;

    border:
        1px solid
        #d8dde2;

    border-radius:
        7px;

    color:
        var(--wd-text);

    font-size:
        12px;

    font-weight:
        600;

    text-decoration:
        none;

    transition:
        background 150ms ease,
        border-color 150ms ease,
        color 150ms ease;
}


.wd-similar-products
.wd-product-card__cta:hover {
    border-color:
        var(--wd-accent);

    background:
        var(--wd-accent);

    color:
        #fff;
}


/* TABLET */

@media (max-width: 980px) {

    .wd-similar-products__grid {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );
    }

}


/* MOBILE */

@media (max-width: 600px) {

    .wd-similar-products {
        padding:
            40px
            0
            54px;
    }


    .wd-similar-products__header h2 {
        font-size:
            23px;
    }


    /*
     * Horizontal product browsing is better than
     * one very long single-column recommendation list.
     */

    .wd-similar-products__grid {
        display:
            flex;

        gap:
            12px;

        overflow-x:
            auto;

        scroll-snap-type:
            x mandatory;

        padding-bottom:
            8px;
    }


    .wd-similar-products
    .wd-product-card {
        flex:
            0
            0
            min(
                78vw,
                270px
            );

        scroll-snap-align:
            start;
    }

}


/* =========================================================
   WRYEDGE DIRECT
   Similar Products v0.1.1-alpha1
   Header / View All Polish
   ========================================================= */

.wd-similar-products__header {
    display:
        flex;

    align-items:
        baseline;

    justify-content:
        space-between;

    gap:
        24px;
}


.wd-similar-products__view-all {
    display:
        inline-flex;

    align-items:
        center;

    gap:
        6px;

    margin-left:
        auto;

    color:
        #59636e;

    font-size:
        13px;

    font-weight:
        600;

    line-height:
        1.3;

    text-decoration:
        none;

    white-space:
        nowrap;

    transition:
        color 150ms ease;
}


.wd-similar-products__view-all:hover {
    color:
        var(--wd-accent);
}


.wd-similar-products__view-all[hidden] {
    display:
        none !important;
}


@media (max-width: 600px) {

    .wd-similar-products__header {
        gap:
            14px;
    }


    .wd-similar-products__view-all {
        font-size:
            12px;
    }

}



/* =========================================================
   Similar Products
   Canonical StoreFront Sale Badge
   ========================================================= */

.wd-similar-products
.wd-product-card__sale-badge {
    min-height: 28px;

    padding:
        5px
        10px;

    border: 0;

    border-radius: 6px;

    background:
        rgba(183, 28, 46, .68);

    color: #fff;

    font-size: 12px;
    font-weight: 700;

    line-height: 1;

    letter-spacing: .01em;

    box-shadow:
        0 2px 6px
        rgba(0, 0, 0, .06);
}


/* =========================================================
   SIMILAR PRODUCTS
   v0.1.3-alpha1
   PRODUCT BADGE STACK
   ========================================================= */

.wd-similar-products
.wd-product-card__badges {
    position: absolute;

    top: 12px;
    left: 12px;

    z-index: 4;

    display: flex;
    flex-direction: column;
    align-items: flex-start;

    gap: 6px;

    pointer-events: none;
}


.wd-similar-products
.wd-product-card__badges
.wd-product-card__sale-badge {
    position: static;

    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
}


.wd-similar-products
.wd-product-card__badge {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-height: 28px;

    padding:
        5px
        10px;

    border-radius: 6px;

    font-size: 11px;
    font-weight: 800;

    line-height: 1;

    letter-spacing: .035em;

    box-shadow:
        0 2px 6px
        rgba(0, 0, 0, .06);
}


.wd-similar-products
.wd-product-card__badge--new {
    background:
        rgba(23, 25, 28, .88);

    color:
        #ffffff;
}


.wd-similar-products
.wd-product-card__badge--featured {
    background:
        rgba(205, 171, 83, .88);

    color:
        #17191c;
}
