/* Shared styles for the text pages (terms, privacy, payment result),
   using the same JPG brand tokens as the shop (index.html). */
:root {
    --black: #000000;
    --grey: #343434;
    --purple: #7577CA;
    --lime: #CFFF0F;
    --light: #DEDEDE;
    --muted: #8C8C8C;
    /* Manrope has no Georgian letters; the browser takes those from Noto Sans Georgian */
    --font: 'Manrope', 'Noto Sans Georgian', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --rail-w: 64px;
    --rail: var(--light);
    --gutter: clamp(16px, 4vw, 56px);
    --chamfer: 12px;
}

body[data-rail="lime"] { --rail: var(--lime); }

/* Each page carries both languages; assets/lang.js sets <html lang> */
html:not([lang="ka"]) [data-lang="ka"],
html[lang="ka"] [data-lang="en"] { display: none !important; }

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font);
    background: var(--black);
    color: var(--light);
    line-height: 1.7;
    padding-left: var(--rail-w);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img { display: block; max-width: 100%; }

:focus-visible {
    outline: 2px solid var(--lime);
    outline-offset: 3px;
}

::selection { background: var(--lime); color: var(--black); }

/* Side rail, as on the shop */
.rail {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--rail-w);
    z-index: 10;
    background: var(--rail);
    color: var(--black);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 28px 0 22px;
}

.rail-label {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 12px;
    line-height: 1.35;
    white-space: nowrap;
}

.rail-label strong { font-weight: 700; color: inherit; }
.rail-logo img { width: 46px; height: auto; }

/* Text pages */
.topbar {
    max-width: 760px;
    margin: 0 auto;
    padding: 28px var(--gutter) 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.topbar-logo img { width: 84px; height: auto; }

.topbar .back {
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    white-space: nowrap;
}

.topbar .back:hover { color: var(--light); }

.topbar-end {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* ქა / EN switch */
.lang-switch { display: flex; align-items: center; }

.lang-switch button {
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    padding: 4px 8px;
    color: var(--muted);
    background: none;
    border: 0;
    cursor: pointer;
}

.lang-switch button + button { border-left: 1px solid var(--grey); }
.lang-switch button:hover { color: var(--light); }
.lang-switch button[aria-pressed="true"] { color: var(--lime); }

.page {
    max-width: 760px;
    margin: 0 auto;
    padding: 72px var(--gutter) 120px;
}

h1 {
    font-size: clamp(38px, 5.4vw, 64px);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.04em;
    margin-bottom: 14px;
    overflow-wrap: break-word;
}

/* Georgian words run long and don't take tight tracking */
html[lang="ka"] h1 {
    font-size: clamp(26px, 4.4vw, 52px);
    letter-spacing: -0.01em;
    line-height: 1.15;
}

.updated {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 56px;
}

h2 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
    margin: 48px 0 14px;
    padding-top: 28px;
    border-top: 1px solid var(--grey);
}

h2:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

p,
li {
    font-size: 16px;
    margin-bottom: 14px;
}

ul { padding-left: 20px; margin-bottom: 14px; }
li::marker { color: var(--lime); }

strong { color: #fff; font-weight: 700; }

a { color: var(--light); text-underline-offset: 3px; }
a:hover { color: var(--lime); }

.highlight {
    margin: 16px 0 24px;
    padding: 16px 20px;
    border-left: 3px solid var(--purple);
    background: rgba(117, 119, 202, 0.12);
}

.highlight p:last-child { margin-bottom: 0; }

table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0 24px;
    font-size: 15px;
}

th,
td {
    text-align: left;
    vertical-align: top;
    padding: 12px 16px 12px 0;
    border-bottom: 1px solid var(--grey);
}

th {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
}

/* Payment result */
.done {
    max-width: 640px;
    min-height: 100vh;
    min-height: 100svh;
    margin: 0 auto;
    padding: 48px var(--gutter);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.done-mark {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin-bottom: 32px;
    border-radius: 50%;
    background: var(--lime);
    color: var(--black);
}

.done-mark svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.done p {
    max-width: 46ch;
    color: var(--muted);
    margin-bottom: 36px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 26px;
    font-size: 15px;
    font-weight: 700;
    color: var(--black);
    background: var(--lime);
    text-decoration: none;
    clip-path: polygon(var(--chamfer) 0, 100% 0, 100% 100%, 0 100%, 0 var(--chamfer));
    transition: background-color 0.2s ease;
}

.btn:hover { color: var(--black); background: var(--light); }

.btn:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 3px var(--black), inset 0 0 0 5px var(--light);
}

@media (max-width: 900px) {
    body { padding-left: 0; }

    .rail {
        inset: 0 0 auto 0;
        width: auto;
        height: 4px;
        padding: 0;
    }

    .rail > * { display: none; }
}

@media (max-width: 560px) {
    .page { padding-top: 48px; }

    /* Stack the privacy table into one block per row */
    table,
    tbody,
    tr,
    td { display: block; width: 100%; }

    tr:first-child { display: none; }

    tr {
        padding: 12px 0;
        border-bottom: 1px solid var(--grey);
    }

    td {
        padding: 2px 0;
        border: 0;
    }

    td:first-child { font-weight: 700; color: #fff; }
}
