/* ================================================================
   Поле «Набор услуг с ценами» (price_list) — forms_price_list.php
   Цвета — переменными: сайт может переопределить их у .prl или выше.
   ================================================================ */
.prl {
    --prl-bg: #ffffff;
    --prl-card: #ffffff;
    --prl-border: #e6e3da;
    --prl-text: #16181d;
    --prl-muted: #6b6f78;
    --prl-accent: #16181d;
    --prl-accent-soft: #fff8dc;
    --prl-highlight: #ffc400;
    --prl-radius: 14px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    color: var(--prl-text);
    position: relative;
}

.prl-group {
    background: var(--prl-card);
    border: 1px solid var(--prl-border);
    border-radius: calc(var(--prl-radius) + 4px);
    padding: 20px 20px 14px;
    box-shadow: 0 1px 2px rgba(22, 24, 29, .04), 0 8px 24px rgba(22, 24, 29, .05);
}

.prl-group-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.prl-group-num {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--prl-highlight);
    color: var(--prl-accent);
    font-weight: 800;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.prl-group-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.25;
}
.prl-group-note {
    margin: -6px 0 12px 42px;
    color: var(--prl-muted);
    font-size: .92rem;
}

.prl-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ---------- позиция ---------- */
.prl-item {
    position: relative;
    display: grid;
    grid-template-columns: 24px 36px 1fr auto;
    align-items: center;
    column-gap: 12px;
    padding: 12px 14px;
    border: 1.5px solid var(--prl-border);
    border-radius: var(--prl-radius);
    background: var(--prl-bg);
    cursor: pointer;
    margin: 0;
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease, transform .15s ease;
    user-select: none;
}
.prl-item:hover {
    border-color: #cfc9b8;
    box-shadow: 0 4px 14px rgba(22, 24, 29, .07);
}
.prl-item.is-checked {
    border-color: var(--prl-accent);
    background: var(--prl-accent-soft);
}
.prl-item.is-locked {
    cursor: default;
    border-style: dashed;
}
.prl-item.is-locked:hover { box-shadow: none; }

/* настоящий чекбокс — невидим, но в фокусе и в отправке */
.prl-check {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}
.prl-box {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    border: 2px solid #c9c4b5;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color .15s ease, border-color .15s ease;
}
.prl-box::after {
    content: "";
    width: 11px;
    height: 6px;
    border-left: 2.5px solid transparent;
    border-bottom: 2.5px solid transparent;
    transform: rotate(-45deg) translate(1px, -1px);
}
.prl-item.is-checked .prl-box {
    background: var(--prl-accent);
    border-color: var(--prl-accent);
}
.prl-item.is-checked .prl-box::after {
    border-color: var(--prl-highlight);
}
.prl-item.is-locked .prl-box {
    background: #8a8d94;
    border-color: #8a8d94;
}
.prl-item.is-locked .prl-box::after { border-color: #fff; }
.prl-check:focus-visible + .prl-box {
    outline: 3px solid var(--prl-highlight);
    outline-offset: 2px;
}

.prl-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #f4f1e8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    line-height: 1;
}
.prl-icon::before { content: "📦"; }
.prl-item.is-checked .prl-icon { background: #fff; }

.prl-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.prl-name {
    font-weight: 600;
    line-height: 1.3;
}
.prl-desc {
    font-size: .88rem;
    color: var(--prl-muted);
    line-height: 1.35;
}
.prl-badge {
    align-self: flex-start;
    margin-top: 4px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: #5b5e66;
    background: #ecebe6;
    border-radius: 999px;
    padding: 2px 9px;
}
.prl-badge::before { content: "🔒 "; }

.prl-price {
    text-align: right;
    white-space: nowrap;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.15;
}
.prl-price b {
    font-size: 1.05rem;
    font-weight: 800;
}
.prl-price small {
    color: var(--prl-muted);
    font-size: .78rem;
}

/* ---------- позиция с количеством «[N]»: − N мес. + ---------- */
.prl-item--qty {
    grid-template-columns: 36px 1fr auto 96px;
    cursor: default;
}
.prl-unit-price {
    font-size: .85rem;
    color: var(--prl-muted);
}
.prl-stepper {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f4f1e8;
    border-radius: 12px;
    padding: 4px;
}
.prl-item--qty.is-checked .prl-stepper { background: #fff; }
.prl-step {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 9px;
    background: var(--prl-accent);
    color: var(--prl-highlight);
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: opacity .15s ease, transform .1s ease;
}
.prl-step:active { transform: scale(.94); }
.prl-step:disabled {
    opacity: .25;
    cursor: default;
}
.prl-step:focus-visible {
    outline: 3px solid var(--prl-highlight);
    outline-offset: 2px;
}
.prl-qty {
    display: inline-flex;
    align-items: baseline;
    line-height: 1.2;
    justify-content: center;
    gap: 3px;
    min-width: 64px;
}
.prl-qty-input {
    width: 34px;
    border: 0;
    background: transparent;
    color: var(--prl-text);
    font-weight: 800;
    font-size: 1.05rem;
    text-align: right;
    padding: 0;
    /* Общее правило сайта «input, select» даёт полям display:block и
       margin-bottom: 8px — число уезжало вверх из середины «− +». */
    display: inline-block;
    margin: 0;
    height: auto;
    line-height: 1.2;
    box-shadow: none;
    -moz-appearance: textfield;
    appearance: textfield;
}
.prl-qty-input::-webkit-outer-spin-button,
.prl-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.prl-qty-input:focus { outline: none; }
.prl-qty small {
    color: var(--prl-muted);
    font-size: .82rem;
}
.prl-item--qty:not(.is-checked) .prl-price b { color: var(--prl-muted); }

/* ---------- итог ---------- */
.prl-summary {
    position: sticky;
    bottom: 12px;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    border-radius: calc(var(--prl-radius) + 4px);
    background: var(--prl-accent);
    color: #fff;
    box-shadow: 0 12px 30px rgba(22, 24, 29, .25);
}
.prl-summary-caption {
    font-weight: 700;
    font-size: 1.02rem;
}
.prl-summary-count,
.prl-summary-periods {
    font-size: .85rem;
    color: rgba(255, 255, 255, .7);
}
.prl-summary-periods:empty { display: none; }
.prl-summary-total {
    text-align: right;
    white-space: nowrap;
}
.prl-summary-total span {
    display: block;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: rgba(255, 255, 255, .7);
}
.prl-summary-total b {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--prl-highlight);
    font-variant-numeric: tabular-nums;
}
.prl-summary.is-bump { animation: prl-bump .35s ease; }
@keyframes prl-bump {
    0% { transform: scale(1); }
    40% { transform: scale(1.015); }
    100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
    .prl-summary.is-bump { animation: none; }
    .prl-item { transition: none; }
}

/* подсказку «выберите хотя бы одну» браузер показывает на этом поле */
.prl-validity {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
    border: 0;
    padding: 0;
    pointer-events: none;
}

/* ---------- телефон ---------- */
@media (max-width: 576px) {
    .prl-group { padding: 16px 12px 10px; }
    .prl-item {
        grid-template-columns: 24px 1fr auto;
        column-gap: 10px;
        padding: 11px 12px;
    }
    .prl-icon { display: none; }
    /* название во всю ширину, под ним «− N +» и сумма */
    .prl-item--qty {
        grid-template-columns: 1fr auto;
        row-gap: 10px;
    }
    .prl-item--qty .prl-body { grid-column: 1 / -1; }
    .prl-item--qty .prl-stepper { justify-self: start; }
    .prl-price b { font-size: .98rem; }
    .prl-group-note { margin-left: 0; }
    .prl-summary { padding: 14px 16px; }
    .prl-summary-total b { font-size: 1.5rem; }
}

/* ---------- тёмная тема ---------- */
body.theme-dark .prl {
    --prl-bg: #1f2126;
    --prl-card: #191b1f;
    --prl-border: #34373e;
    --prl-text: #eceef2;
    --prl-muted: #9ca1ab;
    --prl-accent: #ffc400;
    --prl-accent-soft: rgba(255, 196, 0, .09);
    --prl-highlight: #ffc400;
}
body.theme-dark .prl-box { background: #25282e; border-color: #4a4e57; }
body.theme-dark .prl-item.is-checked .prl-box::after { border-color: #16181d; }
body.theme-dark .prl-icon,
body.theme-dark .prl-item.is-checked .prl-icon { background: #2a2d33; }
body.theme-dark .prl-badge { background: #2e3138; color: #c3c7cf; }
body.theme-dark .prl-group-num { color: #16181d; }
body.theme-dark .prl-summary { background: #0f1013; border: 1px solid #34373e; }
body.theme-dark .prl-stepper,
body.theme-dark .prl-item--qty.is-checked .prl-stepper { background: #2a2d33; }
body.theme-dark .prl-step { color: #16181d; }
