.nwc-random-upsell {
    width: 100%;
    margin-top: 46px;
    padding-top: 34px;
    border-top: 1px solid #e1e8e3;
}

.nwc-random-upsell__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
}

.nwc-random-upsell__eyebrow {
    display: inline-flex;
    margin-bottom: 8px;
    padding: 5px 9px;
    border-radius: 999px;
    background: #edf6ef;
    color: #287447;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.nwc-random-upsell__header h2 {
    margin: 0;
    color: #202821;
    font-size: clamp(25px, 2.2vw, 34px);
    font-weight: 850;
    line-height: 1.08;
    letter-spacing: -.03em;
}

.nwc-random-upsell__header p {
    margin: 7px 0 0;
    color: #748078;
    font-size: 13px;
}

.nwc-random-upsell__header p strong {
    color: #536159;
    font-weight: 750;
}

.nwc-random-upsell__refresh {
    display: inline-flex;
    min-height: 42px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 14px;
    border: 1px solid #d8e2db;
    border-radius: 10px;
    background: #fff;
    color: #435149;
    font-size: 12px;
    font-weight: 750;
    transition:
        border-color 160ms ease,
        background-color 160ms ease,
        color 160ms ease;
}

.nwc-random-upsell__refresh:hover {
    border-color: #9bbda5;
    background: #f1f7f3;
    color: #1d5936;
}

.nwc-random-upsell__refresh svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nwc-random-upsell__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(14px, 1.5vw, 22px);
}

.nwc-random-upsell__card {
    display: flex;
    min-width: 0;
    overflow: hidden;
    flex-direction: column;
    border: 1px solid #e1e8e3;
    border-radius: 17px;
    background: #fff;
    box-shadow: 0 7px 22px rgba(24, 57, 38, .055);
    transition:
        transform 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease;
}

/* Senza JavaScript mostra solo i primi quattro */
.nwc-random-upsell__card:nth-child(n + 5) {
    display: none;
}

@media (hover: hover) {
    .nwc-random-upsell__card:hover {
        transform: translateY(-3px);
        border-color: #c9d8cd;
        box-shadow: 0 14px 32px rgba(24, 57, 38, .10);
    }
}

.nwc-random-upsell__image {
    display: block;
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background:
        linear-gradient(
            145deg,
            #f4f0e8,
            #faf9f6
        );
}

.nwc-random-upsell__image img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 0;
    object-fit: contain;
    transition: transform 240ms ease;
}

@media (hover: hover) {
    .nwc-random-upsell__card:hover
    .nwc-random-upsell__image img {
        transform: scale(1.025);
    }
}

.nwc-random-upsell__content {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 15px;
}

.nwc-random-upsell__name {
    display: -webkit-box;
    min-height: 43px;
    overflow: hidden;
    color: #273129;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.42;
    text-decoration: none;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.nwc-random-upsell__name:hover {
    color: #287447;
}

.nwc-random-upsell__price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 11px;
}

.nwc-random-upsell__price strong {
    color: #287447;
    font-size: 19px;
    font-weight: 850;
}

.nwc-random-upsell__old-price {
    color: #919b95;
    font-size: 12px;
    text-decoration: line-through;
}

.nwc-random-upsell__form {
    width: 100%;
    margin-top: auto;
    padding-top: 14px;
}

.nwc-random-upsell__button {
    display: inline-flex;
    width: 100%;
    min-height: 43px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: auto;
    padding: 9px 12px;
    border: 0;
    border-radius: 10px;
    background: #287447;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 7px 16px rgba(40, 116, 71, .17);
}

.nwc-random-upsell__button:hover {
    background: #1d5936;
    color: #fff;
}

.nwc-random-upsell__button.is-secondary {
    margin-top: 14px;
    border: 1px solid #d9e3dc;
    background: #f3f7f4;
    color: #315e43;
    box-shadow: none;
}

.nwc-random-upsell__button.is-secondary:hover {
    border-color: #abc5b3;
    background: #eaf3ed;
    color: #1d5936;
}

.nwc-random-upsell__button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (max-width: 1024px) {
    .nwc-random-upsell__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .nwc-random-upsell__card:nth-child(n + 4) {
        display: none;
    }
}

@media (max-width: 650px) {
    .nwc-random-upsell {
        margin-top: 32px;
        padding-top: 26px;
    }

    .nwc-random-upsell__header {
        align-items: flex-start;
        flex-direction: column;
        gap: 13px;
    }

    .nwc-random-upsell__refresh {
        min-height: 39px;
    }

    .nwc-random-upsell__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .nwc-random-upsell__card:nth-child(n + 3) {
        display: none;
    }

    .nwc-random-upsell__content {
        padding: 11px;
    }

    .nwc-random-upsell__name {
        min-height: 39px;
        font-size: 12px;
    }

    .nwc-random-upsell__price strong {
        font-size: 17px;
    }

    .nwc-random-upsell__button {
        min-height: 40px;
        padding-inline: 8px;
        font-size: 11px;
    }
}
