/*
 * Terms & Conditions / Privacy Policy — matches the reference design
 * ("Metronic Theme/Twelve New desgin/Others"), which is a dark, editorial
 * look distinct from the storefront's light/dark toggle — so colors here
 * are the design's own literal palette, not the site's --tw-* tokens.
 * Content stays the CMS-editable HTML from setting('terms_*'/'privacy_policy_*');
 * the sidebar table of contents (legal-page.js) is progressive enhancement
 * built from whatever <h2> section titles the admin wrote — pages without
 * headings just render as a single column.
 */

.tw-legal-page {
    --tw-legal-bg: #060608;
    --tw-legal-ink: #edecf2;
    --tw-legal-muted: #8e8c99;
    --tw-legal-body: #b9b7c0;
    --tw-legal-brand: #ff3d68;
    --tw-legal-brand-2: #ff7a3d;
    --tw-legal-line: rgba(255, 255, 255, 0.08);
    --tw-legal-surface: rgba(255, 255, 255, 0.03);
    --tw-legal-chip: rgba(255, 255, 255, 0.05);
    --tw-legal-brand-soft: rgba(255, 61, 104, 0.08);
    --tw-legal-brand-line: rgba(255, 61, 104, 0.25);

    width: 100vw;
    margin-inline-start: calc(50% - 50vw);
    margin-inline-end: calc(50% - 50vw);
    background: var(--tw-legal-bg);
    color: var(--tw-legal-ink);
    font-family: var(--tw-font);
}

.tw-legal-page__inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: calc(var(--tw-header-h, 70px) + 28px) 20px 72px;
}

.tw-legal-page__hero {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 22px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--tw-legal-line);
}

.tw-legal-page__title {
    margin: 0;
    font-size: 32px;
    font-weight: 800;
    color: var(--tw-legal-ink);
}

.tw-legal-page__tagline {
    margin: 0;
    font-size: 12.5px;
    font-weight: 300;
    color: var(--tw-legal-muted);
}

.tw-legal-page__layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    align-items: start;
    max-width: 760px;
    margin: 0 auto;
}

.tw-legal-page__layout.has-toc {
    max-width: none;
    grid-template-columns: 240px 1fr;
}

@media (max-width: 900px) {
    .tw-legal-page__layout.has-toc {
        grid-template-columns: 1fr;
    }

    .tw-legal-page__toc {
        display: none;
    }
}

.tw-legal-page__toc {
    position: sticky;
    top: calc(var(--tw-header-h, 70px) + 20px);
    max-height: calc(100vh - var(--tw-header-h, 70px) - 40px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--tw-legal-surface);
    border: 1px solid var(--tw-legal-line);
    border-radius: 18px;
    padding: 12px;
}

.tw-legal-page__toc-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--tw-legal-muted);
    padding: 6px 10px;
}

.tw-legal-page__toc a {
    display: block;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--tw-legal-muted);
    text-decoration: none;
    transition: background .15s, color .15s;
}

.tw-legal-page__toc a:hover {
    background: var(--tw-legal-chip);
    color: var(--tw-legal-ink);
}

.tw-legal-page__toc a.is-active {
    background: var(--tw-legal-brand-soft);
    color: var(--tw-legal-brand);
}

.tw-legal-page__body {
    color: var(--tw-legal-body);
    font-size: 13.5px;
    font-weight: 300;
    line-height: 2.1;
}

.tw-legal-page__body br + br {
    display: block;
    content: "";
    margin-top: 0.6em;
}

.tw-legal-page__body p {
    margin: 0 0 14px;
}

.tw-legal-page__body h1,
.tw-legal-page__body h2,
.tw-legal-page__body h3,
.tw-legal-page__body h4 {
    margin-top: 28px;
    margin-bottom: 8px;
    font-weight: 800;
    color: var(--tw-legal-ink);
    scroll-margin-top: calc(var(--tw-header-h, 70px) + 20px);
}

.tw-legal-page__body > h1:first-child,
.tw-legal-page__body > h2:first-child,
.tw-legal-page__body > h3:first-child,
.tw-legal-page__body > h4:first-child {
    margin-top: 0;
}

.tw-legal-page__body h1 {
    font-size: 26px;
}

.tw-legal-page__body h2 {
    font-size: 19px;
}

.tw-legal-page__body h3,
.tw-legal-page__body h4 {
    font-size: 16px;
}

.tw-legal-page__body strong,
.tw-legal-page__body b {
    color: var(--tw-legal-ink);
    font-weight: 700;
}

.tw-legal-page__body ul,
.tw-legal-page__body ol {
    margin: 0 0 14px;
    padding-inline-start: 20px;
}

.tw-legal-page__body li {
    margin-bottom: 8px;
}

.tw-legal-page__body a {
    color: var(--tw-legal-brand);
    text-decoration: none;
}

.tw-legal-page__body a:hover {
    color: var(--tw-legal-brand-2);
    text-decoration: underline;
}

.tw-legal-page__body img {
    max-width: 100%;
    border-radius: 12px;
    margin: 12px 0;
}

.tw-legal-page__contact {
    margin-top: 36px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 18px 20px;
    border-radius: 18px;
    background: var(--tw-legal-brand-soft);
    border: 1px solid var(--tw-legal-brand-line);
}

.tw-legal-page__contact b {
    font-size: 13.5px;
    color: var(--tw-legal-ink);
}

.tw-legal-page__contact span {
    font-size: 12.5px;
    font-weight: 300;
    color: var(--tw-legal-body);
}

.tw-legal-page__contact a {
    color: var(--tw-legal-brand);
    font-weight: 700;
}

@media (max-width: 640px) {
    .tw-legal-page__title {
        font-size: 24px;
    }
}
