.woocommerce div.product .product-family {
    grid-column: 1 / -1;
    padding-top: 36px;
    border-top: 1px solid #cfc5b8;
}

.woocommerce div.product .product-family > h2 {
    margin: 0 0 28px;
    font-family: "Lora", Georgia, serif;
    font-size: clamp(26px, 3vw, 36px);
    font-weight: 400;
}

.product-family__products {
    display: grid;
    grid-template-columns: repeat(calc(var(--family-count) + 1), minmax(0, 1fr));
    gap: 52px;
    max-width: calc((var(--family-count) + 1) * 300px + var(--family-count) * 52px);
    margin: 0;
    padding: 0;
    list-style: none;
}

.product-family__product,
.product-family__total {
    position: relative;
    min-width: 0;
    text-align: center;
}

.product-family__plus {
    position: absolute;
    top: 0;
    margin-top: 50%;
    left: -39px;
    transform: translateY(-50%);
    color: #805a40;
    font-size: 32px;
    line-height: 1;
}

.product-family__link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.product-family__link:focus-visible {
    outline: 2px solid #805a40;
    outline-offset: 5px;
}

.product-family__media {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
    margin-bottom: 16px;
    background: #efede6;
}

.product-family__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-family__badge {
    position: absolute;
    top: 9px;
    right: 0;
    padding: 5px 9px;
    color: #f7f4eb;
    background: #24221e;
    font-size: 12px;
    line-height: 1.3;
}

.woocommerce div.product .product-family h3 {
    margin: 0 0 8px;
    font-family: "Lora", Georgia, serif;
    font-size: 21px;
    font-weight: 400;
    line-height: 1.4;
}

.woocommerce div.product .product-family .price {
    display: block;
    margin: 0;
    font-size: 18px;
    line-height: 1.5;
}

.product-family .price del { opacity: 0.65; }
.product-family .price ins { background: none; }

.product-family__view {
    display: inline-block;
    margin-top: 12px;
    font-size: 14px;
    text-underline-offset: 4px;
}

.product-family__link:hover .product-family__view { text-decoration: underline; }

.product-family__result {
    display: flex;
    min-height: 100%;
    padding: 28px 18px;
    border: 1px solid #cfc5b8;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
}

.product-family__total-label {
    font-size: 16px;
    line-height: 1.5;
}

.product-family__total-price {
    font-size: clamp(25px, 2.8vw, 36px);
    font-weight: 400;
    line-height: 1.3;
}

@media (max-width: 640px) {
    .product-family__products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 44px 26px;
    }

    .product-family__plus { left: -22px; font-size: 26px; }
    .product-family__product:nth-child(2n + 3) .product-family__plus {
        top: -35px;
        left: calc(50% - 8px);
        margin-top: 0;
        transform: none;
    }

    .product-family__product:nth-last-child(2):nth-child(odd) {
        grid-column: 1 / -1;
        width: calc(50% - 13px);
        justify-self: center;
    }

    .product-family__total {
        display: block;
        grid-column: 1 / -1;
        justify-self: stretch;
        text-align: center;
    }

    .product-family__equals { display: none; }

    .product-family__result {
        aspect-ratio: auto;
        align-items: center;
        gap: 6px;
    }

    .woocommerce div.product .product-family h3 { font-size: 17px; }
    .woocommerce div.product .product-family .price { font-size: 16px; }
    .product-family__badge { padding: 4px 6px; font-size: 11px; }
}

.product-family__form { margin: 0; }
.product-family__availability { display: block; margin-top: 8px; font-size: 14px; color: #8d3727; }
.product-family__availability:empty { display: none; }
.product-family__count { font-size: 14px; color: #71695f; }
.woocommerce .product-family .product-family__buy {
    display: block; width: 100%; min-height: 48px; margin-top: 12px; padding: 12px 16px;
    border: 1px solid #2d2018; border-radius: 0; background: #2d2018; color: #f7f4eb;
    font: inherit; font-size: 16px; font-weight: 400; line-height: 1.4; cursor: pointer;
}
.woocommerce .product-family .product-family__buy:hover { background: #533f30; color: #fff; }
.product-family__buy:focus-visible { outline: 2px solid #805a40; outline-offset: 4px; }
.woocommerce .product-family .product-family__buy:disabled { opacity: .5; cursor: default; }
@media (min-width: 641px) and (max-width: 980px) {
    .product-family__products { gap: 32px; }
    .product-family__plus { left: -25px; }
    .product-family__result { padding: 20px 12px; }
}
