:root {
    --mr-bg: #ffffff;
    --mr-text: #1d2327;
    --mr-muted: #667085;
    --mr-border: #e4e7ec;
    --mr-accent: #2271b1;
    --mr-card-bg: #f8f9fb;
}

.mr-container {
    width: 100%;
    max-width: 1200rem;
    margin: 0 auto;
    padding: 24rem 20rem 60rem;
}

.mr-archive__header,
.mr-single__header {
    display: flex;
    flex-direction: column;
    gap: 8rem;
    margin-bottom: 24rem;
}

.mr-archive__title,
.mr-single__title {
    font-size: 28rem;
    line-height: 1.2;
    margin: 0;
    color: var(--mr-text);
}

.mr-archive__description {
    margin: 0;
    color: var(--mr-muted);
    font-size: 15rem;
    max-width: 70%;
}

.mr-archive__filters {
    margin-bottom: 20rem;
}

.mr-archive__filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12rem;
}

.mr-archive__input,
.mr-archive__select {
    border: 1rem solid var(--mr-border);
    border-radius: 8rem;
    padding: 10rem 12rem;
    font-size: 14rem;
    min-height: 42rem;
    flex: 1 1 240rem;
    background: #ffffff;
    color: var(--mr-text);
}

.mr-archive__button {
    border: none;
    border-radius: 8rem;
    padding: 10rem 18rem;
    font-size: 14rem;
    background: var(--mr-accent);
    color: #ffffff;
    cursor: pointer;
}

.mr-archive__results--loading {
    opacity: 0.6;
    pointer-events: none;
}

.mr-archive__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16rem;
}

.mr-card {
    background: var(--mr-card-bg);
    border: 1rem solid var(--mr-border);
    border-radius: 12rem;
    flex: 1 1 calc(33.333% - 16rem);
    min-width: 240rem;
}

.mr-card__link {
    display: flex;
    flex-direction: column;
    gap: 12rem;
    padding: 18rem;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.mr-card__title {
    font-size: 18rem;
    line-height: 1.4;
    margin: 0;
    color: var(--mr-text);
}

.mr-card__meta {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8rem;
}

.mr-card__meta-row {
    display: flex;
    justify-content: space-between;
    gap: 8rem;
    font-size: 13rem;
    color: var(--mr-muted);
}

.mr-card__meta-label {
    font-weight: 600;
    color: var(--mr-text);
}

.mr-pagination {
    margin-top: 24rem;
}

.mr-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    gap: 6rem;
    margin-right: 6rem;
    padding: 6rem 10rem;
    border-radius: 6rem;
    border: 1rem solid var(--mr-border);
    color: var(--mr-text);
    text-decoration: none;
    font-size: 13rem;
}

.mr-pagination .page-numbers.current {
    background: var(--mr-accent);
    color: #ffffff;
    border-color: var(--mr-accent);
}

.mr-empty {
    font-size: 15rem;
    color: var(--mr-muted);
}

.mr-single__back {
    margin-bottom: 12rem;
}

.mr-link {
    color: var(--mr-accent);
    text-decoration: none;
    font-size: 14rem;
}

.mr-badge {
    display: inline-flex;
    align-items: center;
    padding: 4rem 10rem;
    border-radius: 999rem;
    background: rgba(34, 113, 177, 0.12);
    color: var(--mr-accent);
    font-size: 12rem;
    width: fit-content;
}

.mr-single__section {
    background: var(--mr-bg);
    border: 1rem solid var(--mr-border);
    border-radius: 12rem;
    padding: 18rem;
    margin-bottom: 16rem;
}

.mr-single__section-title {
    font-size: 18rem;
    margin: 0 0 12rem;
}

.mr-single__meta {
    display: flex;
    flex-direction: column;
    gap: 10rem;
    margin: 0;
}

.mr-single__meta-row {
    display: flex;
    justify-content: space-between;
    gap: 8rem;
    font-size: 14rem;
}

.mr-single__meta-label {
    font-weight: 600;
    color: var(--mr-text);
}

.mr-single__meta-value {
    color: var(--mr-muted);
    text-align: right;
}

.mr-single__producer-name {
    margin: 0 0 6rem;
    font-size: 15rem;
    font-weight: 600;
}

.mr-single__producer-address {
    margin: 0;
    color: var(--mr-muted);
}

.mr-table {
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.mr-table__row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120rem, 1fr));
    gap: 8rem;
    padding: 8rem 10rem;
    border-radius: 6rem;
    background: var(--mr-card-bg);
}

.mr-table__row--head {
    background: #eef2f7;
    font-weight: 600;
    color: var(--mr-text);
}

.mr-table__cell {
    font-size: 13rem;
    color: var(--mr-muted);
    word-break: break-word;
}

.mr-table__cell--head {
    color: var(--mr-text);
}

@media (max-width: 960rem) {
    .mr-card {
        flex: 1 1 calc(50% - 16rem);
    }

    .mr-archive__description {
        max-width: 100%;
    }
}

@media (max-width: 640rem) {
    .mr-container {
        padding: 20rem 16rem 40rem;
    }

    .mr-card {
        flex: 1 1 100%;
    }

    .mr-single__meta-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .mr-single__meta-value {
        text-align: left;
    }
}


/* ===== Кнопка "Получить КП" + popup ===== */
.mr-single__title-row {
    display: flex;
    align-items: center;
    gap: 12rem;
    flex-wrap: wrap;
}

.mr-btn {
    border: none;
    border-radius: 8rem;
    padding: 10rem 16rem;
    font-size: 14rem;
    cursor: pointer;
    background: var(--mr-border);
    color: var(--mr-text);
}

.mr-btn--primary {
    background: var(--mr-accent);
    color: #fff;
}

.mr-btn--kp {
    background: #e53935;
    color: #fff;
}


/* ===== Popup "Получить КП" ===== */
body.mr-kp-popup-lock {
    overflow: hidden;
}

.mr-kp-popup {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: grid;
    place-items: start center;
    padding: 10vh 16rem 24rem;
}

.mr-kp-popup__overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.62);
    opacity: 0;
    transition: opacity .22s ease;
}

.mr-kp-popup__content {
    position: relative;
    width: min(520rem, calc(100% - 0rem));
    background: #fff;
    border-radius: 18rem;
    padding: 22rem 22rem 18rem;
    box-shadow: 0 30rem 90rem rgba(0, 0, 0, 0.28);
    opacity: 0;
    transform: translateY(18rem) scale(.985);
    transition: opacity .22s ease, transform .22s ease;
    border: 1rem solid rgba(226, 232, 240, 0.9);
}

.mr-kp-popup--open .mr-kp-popup__overlay {
    opacity: 1;
}

.mr-kp-popup--open .mr-kp-popup__content {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.mr-kp-popup__close {
    position: absolute;
    top: 10rem;
    right: 10rem;
    width: 36rem;
    height: 36rem;
    border-radius: 10rem;
    border: 1rem solid rgba(226, 232, 240, 1);
    background: #fff;
    font-size: 20rem;
    line-height: 1;
    cursor: pointer;
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease, transform .15s ease;
}

.mr-kp-popup__close:hover {
    background: #f8fafc;
    transform: translateY(-1rem);
}

.mr-kp-popup__title {
    margin: 0 40rem 14rem 0;
    font-size: 18rem;
    font-weight: 700;
    color: #0f172a;
}

.mr-kp-form {
    display: grid;
    gap: 12rem;
}

.mr-kp-form label {
    display: grid;
    gap: 6rem;
    font-size: 12rem;
    color: var(--mr-muted);
}

.mr-kp-form input {
    border: 1rem solid var(--mr-border);
    border-radius: 12rem;
    padding: 12rem 12rem;
    font-size: 14rem;
    background: #fff;
    color: #0f172a;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.mr-kp-form input:focus {
    border-color: rgba(34, 113, 177, 0.55);
    box-shadow: 0 0 0 4rem rgba(34, 113, 177, 0.14);
}

.mr-btn-submit {
    margin-top: 4rem;
    width: 100%;
    border: none;
    border-radius: 12rem;
    padding: 12rem 14rem;
    background: var(--mr-accent);
    color: #fff;
    font-size: 14rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform .15s ease, filter .15s ease;
}

.mr-btn-submit:hover {
    filter: brightness(0.98);
    transform: translateY(-1rem);
}

.mr-btn-submit:disabled {
    opacity: .7;
    cursor: not-allowed;
    transform: none;
}

.mr-btn-submit.is-loading {
    position: relative;
}

.mr-btn-submit.is-loading::after {
    content: '';
    position: absolute;
    right: 14rem;
    top: 50%;
    width: 14rem;
    height: 14rem;
    margin-top: -7rem;
    border-radius: 50%;
    border: 2rem solid rgba(255, 255, 255, .55);
    border-top-color: #fff;
    animation: mrSpin .7s linear infinite;
}

@keyframes mrSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.mr-kp-form__policy {
    font-size: 12rem;
    color: #94a3b8;
    line-height: 1.4;
}

.mr-kp-form__msg {
    margin-top: 6rem;
    padding: 10rem 12rem;
    border-radius: 12rem;
    font-size: 13rem;
    line-height: 1.35;
    border: 1rem solid rgba(226, 232, 240, 1);
    background: #f8fafc;
    color: #0f172a;
}

.mr-kp-form__msg.is-success {
    border-color: rgba(16, 185, 129, .35);
    background: rgba(16, 185, 129, .08);
}

.mr-kp-form__msg.is-error {
    border-color: rgba(239, 68, 68, .35);
    background: rgba(239, 68, 68, .08);
}


.mr-kp-popup-lock {
    overflow: hidden;
}
