/* ============================================================
   CMS PAGE
   Layout for editor-authored CMS pages (About, Terms, etc.).
   Solid navy backdrop + frosted glass card with typography for
   the rich-text content from the editor.
   ============================================================ */

/* Solid page background. cms-page.css is the only stylesheet on
 * this page, so targeting html/body here doesn't leak elsewhere. */
html,
body {
    background: #0F121B;
}

/* Disable the footer's 260px upward overlap on CMS pages — the card
 * content can be long and the overlap zone painted the footer's
 * city image alongside the card, making it look like the footer
 * was bleeding into the article. cms-page.css only loads on CMS
 * routes, so this override is scoped to those pages. */
.footer {
    margin-top: 0 !important;
    padding-top: 0 !important;
}
/* Body becomes the containing block for the absolutely-positioned
 * .cms-page__decor wrapper below, so the orbiters span the full
 * document height (and scroll WITH the page rather than staying
 * glued to the viewport). */
body {
    position: relative;
    min-height: 100vh;
}

/* pattern2.png — fixed lines texture at the top of the page,
 * radially masked so it fades out at the edges. Same treatment
 * as the home page's .faq::before and the checkout backdrop. */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 555px;
    background: var(--asset-pattern2) center / cover no-repeat;
    opacity: 0.35;
    mask-image: radial-gradient(ellipse 45% 45% at 50% 50%, black 0%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 45% 45% at 50% 50%, black 0%, transparent 75%);
    pointer-events: none;
    z-index: 0;
}

/* ──────────── PAGE CONTAINER ──────────── */
.cms-page {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    /* Push below the fixed navbar */
    padding: 140px clamp(20px, 5vw, 60px) 80px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    box-sizing: border-box;
}

/* ──────────── DECORATIVE NANO-3D ORBITERS ────────────
 * Icosahedron PNGs scattered across the WHOLE viewport (not just
 * the 960px content column) so the empty space on either side of
 * the card doesn't read as dead. The wrapper is position: fixed
 * to escape the .cms-page container's max-width, and items are
 * placed by viewport percentages and corner offsets.
 *
 * Hand-picked positions, sizes, and rotations — Tebex's sandboxed
 * Twig has no random(), so variation is baked in. Hidden on small
 * viewports so they don't crowd the content. */
.cms-page__decor {
    /* `absolute` (not `fixed`) so the orbiters scroll WITH the
     * page — they move up as the user scrolls, instead of staying
     * pinned to the viewport. The wrapper covers the full body
     * (body has position:relative + min-height:100vh). */
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    min-height: 100vh;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}
.cms-page__decor-item {
    position: absolute;
    width: 140px;
    height: 140px;
    object-fit: contain;
    opacity: 0.32;
    /* Stacked drop-shadows = a soft red bloom under each icon.
     * drop-shadow follows the PNG's alpha channel so the glow
     * hugs the icosahedron silhouette (unlike box-shadow which
     * uses the bounding box). */
    filter:
        drop-shadow(0 0 22px rgba(250, 64, 57, 0.55))
        drop-shadow(0 0 44px rgba(250, 64, 57, 0.32))
        drop-shadow(0 8px 26px rgba(0, 0, 0, 0.40));
    will-change: transform;
}

/* Spread across the full page — left edge, right edge, and a
 * few mid-area floaters. Larger sizes (90px–200px) so they read
 * clearly against the empty space on either side of the card. */
.cms-page__decor-item--1 {
    top: 8%;   left: 3vw;            width: 200px; height: 200px;
    animation: cmsOrbit1 24s ease-in-out infinite;
    opacity: 0.72;
}
.cms-page__decor-item--2 {
    top: 16%;  right: 4vw;           width: 130px; height: 130px;
    animation: cmsOrbit2 28s ease-in-out infinite;
    opacity: 0.72;
}
.cms-page__decor-item--3 {
    top: 38%;  left: 2vw;            width: 165px; height: 165px;
    animation: cmsOrbit3 22s ease-in-out infinite;
    opacity: 0.72;
}
.cms-page__decor-item--4 {
    top: 50%;  right: 2vw;           width: 180px; height: 180px;
    animation: cmsOrbit4 30s ease-in-out infinite;
    opacity: 0.72;
}
.cms-page__decor-item--5 {
    bottom: 18%; left: 6vw;          width: 115px; height: 115px;
    animation: cmsOrbit5 19s ease-in-out infinite;
    opacity: 0.72;
}
.cms-page__decor-item--6 {
    bottom: 12%; right: 7vw;         width: 150px; height: 150px;
    animation: cmsOrbit6 32s ease-in-out infinite;
    opacity: 0.72;
}
.cms-page__decor-item--7 {
    bottom: 38%; left: 18vw;         width: 95px;  height: 95px;
    animation: cmsOrbit7 20s ease-in-out infinite;
    opacity: 0.72;
}
.cms-page__decor-item--8 {
    top: 4%;   right: 22vw;          width: 100px; height: 100px;
    animation: cmsOrbit8 26s ease-in-out infinite;
    opacity: 0.72;
}

/* Each orbit pairs a unique starting rotation with a small
 * translate sway so they look like they're floating. */
@keyframes cmsOrbit1 {
    0%, 100% { transform: rotate(-18deg) translate(0, 0); }
    50%      { transform: rotate(8deg)   translate(6px, -10px); }
}
@keyframes cmsOrbit2 {
    0%, 100% { transform: rotate(42deg)  translate(0, 0); }
    50%      { transform: rotate(72deg)  translate(-8px, 12px); }
}
@keyframes cmsOrbit3 {
    0%, 100% { transform: rotate(115deg) translate(0, 0); }
    50%      { transform: rotate(95deg)  translate(10px, 6px); }
}
@keyframes cmsOrbit4 {
    0%, 100% { transform: rotate(-65deg) translate(0, 0); }
    50%      { transform: rotate(-40deg) translate(-12px, -8px); }
}
@keyframes cmsOrbit5 {
    0%, 100% { transform: rotate(160deg) translate(0, 0); }
    50%      { transform: rotate(190deg) translate(8px, -6px); }
}
@keyframes cmsOrbit6 {
    0%, 100% { transform: rotate(-110deg) translate(0, 0); }
    50%      { transform: rotate(-85deg)  translate(-6px, 10px); }
}
@keyframes cmsOrbit7 {
    0%, 100% { transform: rotate(28deg)  translate(0, 0); }
    50%      { transform: rotate(58deg)  translate(10px, -10px); }
}
@keyframes cmsOrbit8 {
    0%, 100% { transform: rotate(-145deg) translate(0, 0); }
    50%      { transform: rotate(-115deg) translate(-10px, 8px); }
}

/* Hide the cluster on narrow viewports — would crowd the body. */
@media (max-width: 720px) {
    .cms-page__decor { display: none; }
}

/* Respect users who have prefers-reduced-motion enabled. */
@media (prefers-reduced-motion: reduce) {
    .cms-page__decor-item { animation: none !important; }
}

/* ──────────── HEADER ──────────── */
.cms-page__header {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 24px;
    border-bottom: 2px dashed rgba(255, 255, 255, 0.12);
}
.cms-page__title {
    margin: 0;
    font-family: "GTA Art Deco", sans-serif;
    font-weight: 500;
    font-size: clamp(32px, 4vw, 48px);
    line-height: 1.05;
    color: #fff;
    letter-spacing: 0.005em;
}

/* ──────────── BODY (rich-text content from the editor) ──────────── */
/* The editor outputs raw HTML — h1-h6, p, ul/ol, blockquote, a, img,
 * code, pre, hr, table. Style each tag at this scope so the page
 * always looks intentional regardless of how the page was authored.
 *
 * Wrapped in a glass card mirroring .product-info__card so CMS
 * pages feel like part of the same product line. */
.cms-page__body {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    padding: clamp(24px, 3vw, 40px);
    background:
        radial-gradient(ellipse 100% 100% at 50% 50%,
            rgba(217, 217, 217, 0.10) 0%,
            rgba(115, 115, 115, 0) 100%),
        rgba(15, 18, 27, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(8px) saturate(140%);
    -webkit-backdrop-filter: blur(8px) saturate(140%);

    color: rgba(255, 255, 255, 0.85);
    font-family: "Barlow", "Inter", sans-serif;
    font-size: clamp(15px, 1.05vw, 17px);
    line-height: 1.7;
}

/* Typographic resets so editor markup looks consistent. */
.cms-page__body > :first-child { margin-top: 0; }
.cms-page__body > :last-child  { margin-bottom: 0; }

.cms-page__body h1,
.cms-page__body h2,
.cms-page__body h3,
.cms-page__body h4,
.cms-page__body h5,
.cms-page__body h6 {
    font-family: "GTA Art Deco", sans-serif;
    font-weight: 500;
    color: #fff;
    line-height: 1.2;
    margin: 1.6em 0 0.6em;
    letter-spacing: 0.005em;
}
.cms-page__body h1 { font-size: clamp(26px, 2.6vw, 34px); }
.cms-page__body h2 {
    font-size: clamp(22px, 2.2vw, 28px);
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.cms-page__body h3 { font-size: clamp(18px, 1.8vw, 22px); }
.cms-page__body h4 { font-size: 18px; }
.cms-page__body h5 { font-size: 16px; }
.cms-page__body h6 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.6);
}

.cms-page__body p {
    margin: 0 0 1em;
    color: rgba(255, 255, 255, 0.78);
}
.cms-page__body strong, .cms-page__body b { color: #fff; font-weight: 600; }
.cms-page__body em, .cms-page__body i     { color: rgba(255, 255, 255, 0.85); }

.cms-page__body a {
    color: #FA4039;
    text-decoration: none;
    border-bottom: 1px solid rgba(250, 64, 57, 0.4);
    transition: color 0.15s ease, border-color 0.15s ease;
}
.cms-page__body a:hover {
    color: #ff6b65;
    border-bottom-color: #ff6b65;
}

.cms-page__body ul,
.cms-page__body ol {
    margin: 0 0 1.2em;
    padding-left: 1.6em;
    color: rgba(255, 255, 255, 0.78);
}
.cms-page__body li {
    margin: 0.4em 0;
}
.cms-page__body ul li::marker { color: #FA4039; }
.cms-page__body ol li::marker { color: rgba(255, 255, 255, 0.5); }

.cms-page__body blockquote {
    margin: 1.4em 0;
    padding: 12px 18px;
    border-left: 3px solid #FA4039;
    background: rgba(250, 64, 57, 0.06);
    color: rgba(255, 255, 255, 0.85);
    border-radius: 0 6px 6px 0;
    font-style: italic;
}

.cms-page__body hr {
    margin: 2em 0;
    border: 0;
    border-top: 2px dashed rgba(255, 255, 255, 0.10);
}

.cms-page__body code {
    font-family: "JetBrains Mono", "Fira Code", monospace;
    font-size: 0.92em;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    color: #ffd9d6;
}
.cms-page__body pre {
    margin: 1em 0 1.4em;
    padding: 16px 18px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow-x: auto;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.55;
}
.cms-page__body pre code {
    padding: 0;
    background: transparent;
    color: inherit;
    font-size: inherit;
}

.cms-page__body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1em 0;
    display: block;
}

.cms-page__body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0 1.4em;
    font-size: 0.95em;
}
.cms-page__body th,
.cms-page__body td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
}
.cms-page__body th {
    color: #fff;
    font-family: "GTA Art Deco", sans-serif;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.03);
}

/* ──────────── RESPONSIVE ──────────── */
@media (max-width: 640px) {
    .cms-page { padding: 60px 16px 60px; gap: 20px; }
    .cms-page__header { padding-bottom: 18px; }
    .cms-page__body { padding: 20px; }
}
