/* Länk mellan produktnamn och pris i befintliga WooCommerce-kort. */
body:is(.home, .tax-product_cat, .tax-product_tag, .post-type-archive-product) ul.products li.product > a.woocommerce-LoopProduct-link {
    flex: 0 0 auto !important;
}

body:is(.home, .tax-product_cat, .tax-product_tag, .post-type-archive-product) ul.products li.product > .jpm-card-link {
    display: block;
    align-self: center;
    width: fit-content;
    max-width: 100%;
    margin: 2px 7px 12px;
    color: #ba2830;
    font-size: 12px;
    line-height: 1.45;
    font-weight: 600;
    text-align: center;
    text-decoration: underline;
    text-underline-offset: 3px;
}

body:is(.home, .tax-product_cat, .tax-product_tag, .post-type-archive-product) ul.products li.product > .jpm-card-link:hover,
body:is(.home, .tax-product_cat, .tax-product_tag, .post-type-archive-product) ul.products li.product > .jpm-card-link:focus {
    color: #9d1e27;
}

/* Matchningssidan */
.jpm-page {
    color: #253630;
    max-width: 1200px;
    margin: 0 auto 40px;
}

.jpm-intro {
    margin: 0 0 28px;
    color: #596760;
    font-size: 16px;
    line-height: 1.7;
}

.jpm-intro p {
    max-width: 780px;
    margin: 0 0 12px;
}

.jpm-eyebrow {
    display: block;
    margin-bottom: 12px;
    color: #69746f;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.7px;
}

.jpm-results {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.jpm-result-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 12px 12px 16px;
    background: #fff;
    border: 1px solid #eeeae5;
    border-radius: 12px;
    box-shadow: 0 3px 15px rgba(20, 40, 30, .035);
}

.jpm-result-card--source {
    border-color: #d6b9b5;
    background: #fffaf9;
}

.jpm-result-badge {
    display: inline-block;
    align-self: flex-start;
    margin: 0 0 10px;
    padding: 5px 9px;
    background: #f1ece7;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #173c35;
}

.jpm-result-card--source .jpm-result-badge {
    background: #f9e3df;
    color: #9d1e27;
}

.jpm-result-image {
    display: block;
    aspect-ratio: 1/1;
    overflow: hidden;
    background: #f7f7f5;
    border-radius: 8px;
}

.jpm-result-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.jpm-result-card h3 {
    margin: 15px 2px 10px;
    color: #173c35;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
}

.jpm-result-price {
    margin: auto 2px 13px;
    padding-top: 4px;
    font-size: 18px;
    font-weight: 700;
    color: #253630;
}

.jpm-result-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 8px;
    background: #ba2830;
    color: #fff !important;
    border-radius: 8px;
    text-align: center;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 600;
}

.jpm-result-button:hover,
.jpm-result-button:focus {
    background: #9d1e27;
    color: #fff !important;
}

.jpm-empty {
    margin: 20px 0;
    padding: 18px 20px;
    background: #faf7f3;
    border-radius: 8px;
    line-height: 1.7;
}

.jpm-disclaimer {
    margin: 23px 0 15px;
    color: #69746f;
    font-size: 13px;
    line-height: 1.7;
}

.jpm-back {
    display: inline-block;
    color: #ba2830 !important;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
}

.jpm-back:hover {
    text-decoration: underline;
}

@media (max-width: 1000px) {
    .jpm-results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
    .jpm-results { gap: 10px; }
    .jpm-result-card { padding: 8px 8px 12px; }
    .jpm-result-card h3 { font-size: 13px; }
    .jpm-result-price { font-size: 16px; }
    .jpm-result-button { font-size: 12px; line-height: 1.35; }
    .jpm-intro { font-size: 14px; }
    body:is(.home, .tax-product_cat, .tax-product_tag, .post-type-archive-product) ul.products li.product > .jpm-card-link {
        font-size: 11px;
    }
}
