:root {
    --bg: #f3f4f6;
    --border: #e5e7eb;
    --text: #111827;
    --muted: #6b7280;
    --accent: #2563eb;
    --accent-soft: #eff6ff;
    --danger: #ef4444;
    --card: #ffffff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Общие элементы сайта оплаты */

header {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
}

.wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    gap: 16px;
}

@media (max-width: 600px) {
    .header-inner {
        padding-right: 24px;
    }
}

.logo {
    font-weight: 700;
    font-size: 18px;
}

.nav {
    display: flex;
    gap: 12px;
    font-size: 14px;
    flex-wrap: wrap;
}

.nav a {
    padding: 4px 8px;
    border-radius: 6px;
}

.nav a:hover {
    background: var(--accent-soft);
    text-decoration: none;
}

.main {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr);
    gap: 24px;
    padding: 24px 16px 40px;
}

@media (max-width: 900px) {
    .main {
        grid-template-columns: minmax(0, 1fr);
    }
}

.lead {
    font-size: 14px;
    color: var(--muted);
    margin-top: 4px;
    margin-bottom: 18px;
}

.products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.product {
    background: var(--card);
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-title {
    font-weight: 600;
    font-size: 14px;
}

.product-tag {
    font-size: 13px;
    color: var(--muted);
}

.product-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    gap: 8px;
}

.product-price {
    font-weight: 700;
    font-size: 15px;
}

.product-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.product-actions button {
    border-radius: 6px;
}

.qty {
    min-width: 26px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
}

button {
    cursor: pointer;
    border: 1px solid var(--border);
    background: #f9fafb;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
}

button:hover {
    background: #f3f4f6;
}

.btn-plus,
.btn-minus {
    width: 32px;
    padding: 4px 0;
}

.btn-small {
    padding: 2px 6px;
    font-size: 12px;
}

.btn-pay {
    width: 100%;
    border-radius: 10px;
    padding: 10px 14px;
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
    margin-top: 8px;
}

.btn-pay[disabled] {
    opacity: .6;
    cursor: not-allowed;
}

.btn-pay:not([disabled]):hover {
    background: #1d4ed8;
}

.sidebar {
    background: var(--card);
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 16px;
    align-self: flex-start;
}

.sidebar h2 {
    margin-top: 0;
    font-size: 16px;
}

.cart-items {
    border-radius: 8px;
    border: 1px dashed var(--border);
    padding: 10px;
    min-height: 60px;
    max-height: 260px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.cart-row {
    border-bottom: 1px solid #e5e7eb;
    padding: 6px 0;
    font-size: 13px;
}

.cart-row:last-child {
    border-bottom: 0;
}

.cart-row-title {
    font-weight: 500;
}

.cart-row-meta {
    color: var(--muted);
    margin: 2px 0 4px;
}

.cart-row-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.cart-qty {
    min-width: 20px;
    text-align: center;
    font-size: 13px;
}

.cart-total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    margin-top: 6px;
    margin-bottom: 10px;
}

.muted {
    color: var(--muted);
    font-size: 13px;
}

.small {
    font-size: 12px;
}

.consents {
    margin-top: 10px;
    font-size: 13px;
}

.consent-item {
    display: block;
    margin-top: 6px;
    line-height: 1.4;
}

.consent-item input {
    margin-right: 6px;
}

.required {
    color: var(--danger);
}

.consent-group {
    margin-top: 8px;
    border-radius: 8px;
    border: 1px solid var(--border);
    padding: 8px;
    background: #f3f4f6;
}

.consent-note {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--muted);
}

footer {
    border-top: 1px solid var(--border);
    background: #ffffff;
    padding: 16px 0 24px;
    font-size: 12px;
    color: var(--muted);
}

footer .foot-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

footer .foot-col {
    line-height: 1.5;
}

/* Страница pay.php */

body.page-pay {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 16px;
    line-height: 1.6;
    background: #ffffff;
}

.page-pay h1 {
    margin-top: 0;
}

.page-pay .muted {
    color: var(--muted);
}

.btn-back {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 14px;
    border-radius: 8px;
    background: var(--accent);
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.btn-back:hover {
    background: #1d4ed8;
    text-decoration: none;
}

/* Документальные страницы */

body.doc-page {
    background: #f9fafb;
}

.doc-wrap {
    max-width: 960px;
    margin: 40px auto;
    padding: 24px 18px 40px;
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid var(--border);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.03);
}

.doc-wrap h1 {
    margin-top: 0;
    margin-bottom: 18px;
    font-size: 20px;
}

.doc-wrap h2 {
    margin-top: 22px;
    margin-bottom: 8px;
    font-size: 16px;
}

.doc-wrap p {
    margin: 0 0 10px;
    font-size: 14px;
    line-height: 1.6;
}

.doc-wrap ul,
.doc-wrap ol {
    margin: 0 0 10px;
    padding-left: 20px;
    font-size: 14px;
    line-height: 1.6;
}
