/*
 * MH Purchase Resources — customer profile.
 * The palette and spacing intentionally match MH Course Certificates.
 * All rules are scoped to this plugin to avoid theme/profile collisions.
 */
.mhpr-library,
.mhpr-notice {
    --mhpr-blue: #388cc7;
    --mhpr-navy: #203d56;
    --mhpr-yellow: #f9e741;
    --mhpr-olive: #504b30;
    --mhpr-border: #e3e8ed;
    --mhpr-muted: #66727d;
    --mhpr-soft-blue: #f5f9fc;
    --mhpr-shadow: 0 9px 30px rgba(32, 61, 86, 0.07);
    font-family: inherit;
}

.mhpr-library {
    direction: rtl;
    margin: 24px 0;
    color: #293640;
    text-align: right;
}

.mhpr-library *,
.mhpr-notice * {
    box-sizing: border-box;
}

.mhpr-library-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    padding: 20px 22px;
    overflow: hidden;
    border: 1px solid var(--mhpr-border);
    border-top: 4px solid var(--mhpr-yellow);
    border-radius: 18px;
    background: linear-gradient(135deg, #fff 0%, #f8fbfd 100%);
    box-shadow: var(--mhpr-shadow);
}

.mhpr-library-head h3 {
    margin: 0;
    color: var(--mhpr-navy);
    font-size: 21px;
    font-weight: 900;
    line-height: 1.75;
}

.mhpr-library-head p {
    margin: 4px 0 0;
    color: var(--mhpr-muted);
    font-size: 13px;
    line-height: 1.9;
}

.mhpr-library-count,
.mhpr-resource-count {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    border-radius: 999px;
    padding: 6px 11px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.5;
}

.mhpr-library-count {
    background: var(--mhpr-yellow);
    color: var(--mhpr-olive);
}

.mhpr-products {
    display: grid;
    gap: 16px;
}

.mhpr-product-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--mhpr-border);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--mhpr-shadow);
}

.mhpr-product-card::before {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    width: 4px;
    height: 100%;
    background: var(--mhpr-blue);
    content: "";
}

.mhpr-product-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 16px 18px;
    border-bottom: 1px solid #edf0f2;
    background: linear-gradient(90deg, rgba(56, 140, 199, 0.07), rgba(249, 231, 65, 0.09));
}

.mhpr-product-identity {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 13px;
}

.mhpr-product-image {
    display: flex;
    flex: 0 0 54px;
    width: 54px;
    height: 54px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid #d7e2e9;
    border-radius: 13px;
    background: #fff;
}

.mhpr-product-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mhpr-product-placeholder {
    color: var(--mhpr-blue);
    font-size: 23px;
    line-height: 1;
}

.mhpr-product-kind {
    display: inline-block;
    margin-bottom: 3px;
    color: var(--mhpr-blue);
    font-size: 11px;
    font-weight: 800;
}

.mhpr-product-head h4 {
    margin: 0;
    color: var(--mhpr-navy);
    font-size: 16px;
    font-weight: 900;
    line-height: 1.85;
    overflow-wrap: anywhere;
}

.mhpr-product-head h4 a {
    color: var(--mhpr-navy);
    text-decoration: none;
}

.mhpr-product-head h4 a:hover,
.mhpr-product-head h4 a:focus-visible {
    color: var(--mhpr-blue);
}

.mhpr-resource-count {
    border: 1px solid #d9e4eb;
    background: #fff;
    color: var(--mhpr-muted);
}

.mhpr-resource-list {
    display: grid;
    gap: 11px;
    padding: 15px 16px 17px;
}

.mhpr-resource-item {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
    padding: 13px;
    border: 1px solid #e5ebef;
    border-radius: 14px;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.mhpr-resource-item:hover {
    border-color: #cadde9;
    box-shadow: 0 7px 20px rgba(32, 61, 86, 0.06);
    transform: translateY(-1px);
}

.mhpr-resource-icon {
    display: flex;
    width: 52px;
    height: 52px;
    align-items: center;
    justify-content: center;
    border: 1px solid #cfe2ef;
    border-radius: 12px;
    background: #f3f9fd;
    color: var(--mhpr-blue);
    font-size: 11px;
    font-weight: 900;
    line-height: 1.3;
    text-align: center;
}

.mhpr-resource-icon-book,
.mhpr-resource-icon-booklet {
    border-color: #eadf8a;
    background: #fffbea;
    color: #6f6214;
}

.mhpr-resource-icon-image {
    border-color: #ddd1ed;
    background: #f8f4fc;
    color: #7045a1;
}

.mhpr-resource-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.mhpr-resource-title-row strong {
    color: var(--mhpr-navy);
    font-size: 14px;
    font-weight: 900;
    line-height: 1.8;
}

.mhpr-resource-title-row span,
.mhpr-resource-meta span {
    border-radius: 999px;
    font-size: 10.5px;
    line-height: 1.5;
}

.mhpr-resource-title-row span {
    padding: 3px 8px;
    background: var(--mhpr-soft-blue);
    color: #607485;
}

.mhpr-resource-info {
    min-width: 0;
}

.mhpr-resource-info p {
    margin: 4px 0 0;
    color: var(--mhpr-muted);
    font-size: 12.5px;
    line-height: 1.9;
    overflow-wrap: anywhere;
}

.mhpr-resource-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.mhpr-resource-meta span {
    padding: 3px 7px;
    border: 1px solid #e2e9ee;
    background: #fbfcfd;
    color: #687985;
}

.mhpr-download-button {
    display: inline-flex;
    min-width: 98px;
    min-height: 41px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 15px;
    border: 0;
    border-radius: 10px;
    background: var(--mhpr-blue);
    box-shadow: 0 7px 16px rgba(56, 140, 199, 0.18);
    color: #fff !important;
    font-size: 12.5px;
    font-weight: 800;
    line-height: 1.5;
    text-decoration: none !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.mhpr-download-button:hover,
.mhpr-download-button:focus-visible {
    background: #277bb5;
    box-shadow: 0 9px 20px rgba(56, 140, 199, 0.24);
    color: #fff !important;
    transform: translateY(-1px);
}

.mhpr-download-button:focus-visible,
.mhpr-product-head h4 a:focus-visible {
    outline: 3px solid rgba(56, 140, 199, 0.22);
    outline-offset: 3px;
}

.mhpr-notice {
    direction: rtl;
    display: flex;
    min-height: 92px;
    align-items: center;
    gap: 13px;
    margin: 24px 0;
    padding: 18px;
    border: 1px solid var(--mhpr-border);
    border-top: 4px solid var(--mhpr-yellow);
    border-radius: 18px;
    background: linear-gradient(135deg, #fff, #f8fbfd);
    box-shadow: var(--mhpr-shadow);
    color: var(--mhpr-muted);
    text-align: right;
}

.mhpr-notice > span {
    display: flex;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--mhpr-yellow);
    color: var(--mhpr-olive);
    font-weight: 900;
}

.mhpr-notice strong {
    display: block;
    color: var(--mhpr-navy);
    font-size: 14px;
    line-height: 1.9;
}

.mhpr-notice p {
    margin: 3px 0 0;
    font-size: 12px;
    line-height: 1.9;
}

@media (max-width: 720px) {
    .mhpr-library-head,
    .mhpr-product-head {
        align-items: flex-start;
    }

    .mhpr-library-head {
        display: block;
        padding: 17px;
    }

    .mhpr-library-count {
        margin-top: 10px;
    }

    .mhpr-product-card,
    .mhpr-library-head,
    .mhpr-notice {
        border-radius: 14px;
    }

    .mhpr-product-head {
        padding: 14px 15px;
    }

    .mhpr-resource-list {
        padding: 12px;
    }

    .mhpr-resource-item {
        grid-template-columns: 44px minmax(0, 1fr);
        padding: 11px;
    }

    .mhpr-resource-icon {
        width: 44px;
        height: 44px;
    }

    .mhpr-download-button {
        grid-column: 1 / -1;
        width: 100%;
    }

    .mhpr-product-image {
        flex-basis: 46px;
        width: 46px;
        height: 46px;
    }

    .mhpr-resource-count {
        font-size: 10.5px;
    }
}

@media (max-width: 460px) {
    .mhpr-product-head {
        flex-direction: column;
    }

    .mhpr-resource-count {
        align-self: flex-start;
    }

    .mhpr-notice {
        align-items: flex-start;
        padding: 15px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mhpr-resource-item,
    .mhpr-download-button {
        transition: none;
    }
}
