/*
 * Product recommendation cards (DESIGN.md "Components contract"): "Podobne produkty" on the
 * product page and the cart's cross-sells, both rendered by woocommerce/medi-related-products.php.
 * Loaded on is_product() and is_cart(), after flatsome-bridge.css; values come from tokens.css.
 * Split out of bridge/product.css on 2026-11-28 so the cart can use the same cards.
 */

.medi-related-products {
    margin-top: 28px;
}

.medi-related-products__grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.medi-related-card {
    background: var(--mt-surface);
    min-width: 0;
    overflow: hidden;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.medi-related-card:hover {
    border-color: var(--mt-line-strong);
    box-shadow: var(--mt-shadow-raised);
    transform: translateY(-1px);
}

.medi-related-card__image {
    align-items: center;
    background: var(--mt-bg);
    border-bottom: 1px solid var(--mt-line);
    display: flex;
    justify-content: center;
    min-height: 172px;
    padding: 16px;
}

.medi-related-card__image img {
    height: 140px;
    object-fit: contain;
    width: auto;
}

.medi-related-card__content {
    gap: 10px;
    min-width: 0;
    padding: 14px 14px 10px;
}

.medi-related-card__name {
    color: var(--mt-green-text);
    font-size: var(--mt-text-14);
    font-weight: 700;
    overflow-wrap: anywhere;
}

.medi-related-card__name:hover {
    color: var(--mt-green-deep);
}

.medi-related-card__meta {
    color: var(--mt-muted);
    display: grid;
    font-size: var(--mt-text-12);
    gap: 4px;
    line-height: 1.35;
}

.medi-related-card__meta a,
.medi-related-card__meta strong {
    color: var(--mt-green-text);
    font-weight: 700;
}

/* the brand link: a 24px target, not a 15px line */
.medi-related-card__meta a {
    display: inline-block;
    padding: 4px 0;
    margin: -4px 0;
}

.medi-related-card__specs {
    grid-template-columns: 1fr;
}

.medi-related-card__specs dt {
    line-height: 1.1;
}

.medi-related-card__specs dd {
    line-height: 1.18;
    -webkit-box-orient: vertical;
}

.medi-related-card__footer {
    border-top: 1px solid var(--mt-line);
    min-width: 0;
    padding: 12px 14px 14px;
}

.medi-related-card__price {
    color: var(--mt-ink);
    font-weight: 700;
    line-height: 1.2;
}

.medi-related-card__price .price {
    display: block;
}

.medi-related-card__price del,
.medi-related-card__price ins {
    display: block;
}

.medi-related-card__stock {
    font-size: var(--mt-text-13);
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
    min-height: 16px;
}

.medi-related-card__button {
    margin: 0;
}

@media only screen and (max-width: 64em) {
.medi-related-products__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media only screen and (max-width: 48em) {
.medi-related-products {
        margin-top: 22px;
    }

.medi-related-products__title {
        padding: 0 15px;
    }

.medi-related-products__grid {
        gap: 12px;
        grid-template-columns: 1fr;
        padding: 0 15px;
    }

    /* phones: [image | text] with the price row under both. The bridge's desktop column
       flex (flatsome-bridge.css "Related products") has to be overruled at its specificity,
       or the image fills the card and clips the rest (critique 2026-11-28, P0). */
    html body .medi-related-card {
        display: grid;
        grid-template-columns: 104px minmax(0, 1fr);
    }

.medi-related-card__image {
        align-self: stretch;
        border-bottom: 0;
        border-right: 1px solid var(--mt-line);
        min-height: 0;
        padding: 10px;
    }

.medi-related-card__image img {
        height: 86px;
    }

.medi-related-card__content {
        gap: 8px;
        padding: 12px 12px 8px;
    }

.medi-related-card__name {
        font-size: var(--mt-text-13);
    }

.medi-related-card__meta {
        font-size: var(--mt-text-min);
    }

.medi-related-card__specs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

.medi-related-card__footer {
        grid-column: 1 / -1;
        padding: 10px 12px 12px;
    }

    /* one row per card: no reserved price line when there is no price */
    html body .medi-related-card__footer {
        grid-template-rows: none;
    }

    html body .medi-related-card__price {
        min-height: 0;
    }

    html body .medi-related-card__price.is-empty {
        display: none;
    }

.medi-related-card__price {
        font-size: var(--mt-text-15);
    }
}
