/* ════════════════════════════════════════════════════════════
   product.css — Shared stylesheet for all CMG product pages
   (tier detail pages + trial detail pages)
   ════════════════════════════════════════════════════════════ */

/* ── RESET & BASE ──────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box
}

:root {
    --black: #0e0e0e;
    --dark: #161616;
    --dark2: #1e1e1e;
    --green: #00e676;
    --orange: #ff9100;
    --blue: #2979ff;
    --white: #f5f5f5;
    --gray: #888;
    --radius: 5px;
    --transition: .35s cubic-bezier(.4, 0, .2, 1)
}

html {
    scroll-behavior: smooth;
    font-size: 16px
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--black);
    background-image:
        radial-gradient(ellipse 80% 60% at 15% 25%, rgba(0, 230, 118, .12) 0%, transparent 55%),
        radial-gradient(ellipse 70% 55% at 85% 75%, rgba(41, 121, 255, .10) 0%, transparent 50%),
        radial-gradient(ellipse 60% 45% at 50% 50%, rgba(255, 145, 0, .07) 0%, transparent 45%);
    color: var(--white);
    line-height: 1.6;
    overflow-x: hidden
}

a {
    color: var(--green);
    text-decoration: none
}

/* ── BACK LINK ─────────────────────────────────── */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: 1rem 2rem;
    font-size: .9rem;
    color: var(--gray);
    transition: var(--transition)
}

.back-link:hover {
    color: var(--white)
}

/* ── PRODUCT HERO ──────────────────────────────── */
.product-hero {
    max-width: 900px;
    margin: 0 auto;
    padding: 4rem 2rem 2rem
}

.tier-badge {
    display: inline-block;
    padding: .3rem 1rem;
    border-radius: 50px;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    background: rgba(0, 230, 118, .1);
    color: var(--green)
}

.tier-badge.trial {
    background: rgba(255, 255, 255, .08);
    color: var(--white)
}

.product-hero h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: .5rem
}

.product-hero .subtitle {
    font-size: 1.1rem;
    color: var(--gray);
    margin-bottom: 2rem;
    max-width: 650px
}

/* ── PRICING ───────────────────────────────────── */
.price-tag {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: .3rem
}

.price-tag span {
    font-size: .9rem;
    font-weight: 400;
    color: var(--gray)
}

.price-tag.free {
    color: var(--green)
}

/* ── CONTENT SECTIONS ──────────────────────────── */
.section {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem
}

.section h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    padding-bottom: .6rem;
    border-bottom: 1px solid rgba(255, 255, 255, .06)
}

.section p,
.section li {
    color: var(--gray);
    line-height: 1.8
}

.section ul {
    list-style: none;
    padding: 0
}

.section ul li {
    padding: .5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, .04)
}

.section ul li::before {
    content: '\2713';
    color: var(--green);
    margin-right: .7rem;
    font-weight: 700
}

/* ── SPEC GRID ─────────────────────────────────── */
.spec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem
}

.spec-item {
    background: var(--dark2);
    border: 1px solid rgba(255, 255, 255, .05);
    border-radius: var(--radius);
    padding: 1.5rem
}

.spec-item .label {
    font-size: .75rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: .4rem
}

.spec-item .value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.3rem;
    font-weight: 700
}

/* ── TABLES ────────────────────────────────────── */
table,
.tiers-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem
}

th,
td,
.tiers-table th,
.tiers-table td {
    text-align: left;
    padding: .7rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, .05);
    font-size: .9rem
}

th,
.tiers-table th {
    color: var(--green);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: 1px
}

td,
.tiers-table td {
    color: var(--gray)
}

.tiers-table td a {
    color: var(--green);
    font-weight: 600
}

/* ── CTA BOX ───────────────────────────────────── */
.cta-box {
    max-width: 900px;
    margin: 3rem auto;
    padding: 2.5rem;
    text-align: center;
    background: var(--dark2);
    border: 1px solid rgba(255, 255, 255, .05);
    border-radius: var(--radius)
}

.cta-box h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    margin-bottom: .8rem
}

.cta-box p {
    color: var(--gray);
    margin-bottom: 1.5rem
}

.btn-cta {
    display: inline-block;
    padding: .9rem 2.5rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    background: var(--green);
    color: var(--black);
    transition: var(--transition);
    text-decoration: none
}

.btn-cta:hover {
    background: #00c853;
    box-shadow: 0 6px 24px rgba(0, 230, 118, .3)
}

/* ── FOOTER ────────────────────────────────────── */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--gray);
    font-size: .8rem;
    border-top: 1px solid rgba(255, 255, 255, .05);
    margin-top: 3rem
}

/* ── 3D CANVAS BACKGROUND ──────────────────────── */
#product3d {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: .7
}

/* ── CSS 3D FLOATING SHAPES ────────────────────── */
.css3d-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    perspective: 1200px
}

.css3d-shape {
    position: absolute;
    border: 1.5px solid;
    border-radius: 4px;
    opacity: 0.18;
    animation-timing-function: linear;
    animation-iteration-count: infinite
}

.shape-1 {
    width: 100px;
    height: 100px;
    border-color: var(--green);
    top: 10%;
    left: 6%;
    animation: float3d1 72s infinite, spin3d 100s linear infinite
}

.shape-2 {
    width: 70px;
    height: 70px;
    border-color: var(--orange);
    top: 60%;
    right: 8%;
    border-radius: 50%;
    animation: float3d2 88s infinite, spin3d2 120s linear infinite
}

.shape-3 {
    width: 50px;
    height: 50px;
    border-color: var(--blue);
    top: 28%;
    right: 18%;
    animation: float3d3 60s infinite, spin3d 80s linear infinite reverse
}

.shape-4 {
    width: 120px;
    height: 120px;
    border-color: var(--green);
    bottom: 12%;
    left: 12%;
    border-radius: 50%;
    animation: float3d2 80s infinite reverse, spin3d2 140s linear infinite
}

.shape-5 {
    width: 35px;
    height: 35px;
    border-color: var(--orange);
    top: 18%;
    left: 48%;
    animation: float3d1 48s infinite reverse, spin3d 60s linear infinite
}

.shape-6 {
    width: 85px;
    height: 85px;
    border-color: var(--blue);
    bottom: 25%;
    right: 4%;
    border-radius: 2px;
    animation: float3d3 100s infinite, spin3d2 72s linear infinite reverse
}

@keyframes float3d1 {

    0%,
    100% {
        transform: translate3d(0, 0, 0) rotateX(0deg)
    }

    25% {
        transform: translate3d(40px, -60px, 100px) rotateX(90deg)
    }

    50% {
        transform: translate3d(-30px, -120px, 50px) rotateX(180deg)
    }

    75% {
        transform: translate3d(20px, -60px, 150px) rotateX(270deg)
    }
}

@keyframes float3d2 {

    0%,
    100% {
        transform: translate3d(0, 0, 0) rotateY(0deg)
    }

    25% {
        transform: translate3d(-50px, 40px, 80px) rotateY(90deg)
    }

    50% {
        transform: translate3d(30px, 80px, -40px) rotateY(180deg)
    }

    75% {
        transform: translate3d(-20px, 40px, 120px) rotateY(270deg)
    }
}

@keyframes float3d3 {

    0%,
    100% {
        transform: translate3d(0, 0, 0) rotate3d(1, 1, 0, 0deg)
    }

    33% {
        transform: translate3d(60px, -40px, 60px) rotate3d(1, 1, 0, 120deg)
    }

    66% {
        transform: translate3d(-40px, -80px, -30px) rotate3d(1, 1, 0, 240deg)
    }
}

@keyframes spin3d {
    from {
        transform: rotateX(0deg) rotateY(0deg)
    }

    to {
        transform: rotateX(360deg) rotateY(360deg)
    }
}

@keyframes spin3d2 {
    from {
        transform: rotateY(0deg) rotateZ(0deg)
    }

    to {
        transform: rotateY(360deg) rotateZ(360deg)
    }
}

/* ── BACK TO TOP ───────────────────────────────── */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 999;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .1);
    color: rgba(255, 255, 255, .4);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity .3s ease, visibility .3s ease, transform .3s ease, background .2s ease, color .2s ease;
    backdrop-filter: blur(8px)
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0)
}

.back-to-top:hover {
    background: rgba(255, 255, 255, .12);
    color: rgba(255, 255, 255, .7)
}

/* ── SCREENSHOT GALLERY ────────────────────────── */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem
}

.gallery-thumb {
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, .06);
    transition: transform .2s, box-shadow .2s
}

.gallery-thumb:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .4)
}

.gallery-thumb img {
    width: 100%;
    height: auto;
    display: block
}

.gallery-thumb .caption {
    padding: .5rem .75rem;
    font-size: .75rem;
    color: var(--gray);
    background: var(--dark2);
    text-align: center
}

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, .92);
    align-items: center;
    justify-content: center;
    padding: 2rem
}

.lightbox.open {
    display: flex
}

.lightbox img {
    max-width: 95vw;
    max-height: 90vh;
    border-radius: var(--radius);
    box-shadow: 0 0 60px rgba(0, 0, 0, .6)
}

.lightbox-close {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    z-index: 10000
}

/* ── TRIAL PAGE: THEMED FLOATING ICONS ─────────── */
.themed-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden
}

.themed-icon {
    position: absolute;
    font-size: 2.5rem;
    opacity: 0.14;
    animation: floatIcon linear infinite;
    filter: grayscale(0.5)
}

@keyframes floatIcon {
    0% {
        transform: translateY(110vh) rotate(0deg)
    }

    100% {
        transform: translateY(-10vh) rotate(360deg)
    }
}

/* ── TABLET (max-width: 768px) ─────────────────── */
@media (max-width: 768px) {
    .product-hero {
        padding: 3rem 1.5rem 1.5rem
    }

    .product-hero>img {
        width: 64px !important;
        height: 64px !important
    }

    .price-tag {
        font-size: 2rem
    }

    .section {
        padding: 1.5rem
    }

    .spec-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem
    }

    .gallery-grid {
        grid-template-columns: 1fr 1fr;
        gap: .75rem
    }

    .cta-box {
        padding: 2rem;
        margin: 2rem auto
    }

    .themed-bg {
        opacity: .5
    }

    #product3d {
        opacity: .35
    }

    .css3d-bg {
        opacity: .5
    }
}

/* ── MOBILE (max-width: 480px) ─────────────────── */
@media (max-width: 480px) {
    .back-link {
        padding: .75rem 1rem
    }

    .product-hero {
        padding: 2rem 1rem 1rem
    }

    .product-hero>img {
        width: 48px !important;
        height: 48px !important
    }

    .product-hero .subtitle {
        font-size: .95rem
    }

    .price-tag {
        font-size: 1.8rem
    }

    .section {
        padding: 1rem
    }

    .section h2 {
        font-size: 1.2rem
    }

    .spec-grid {
        grid-template-columns: 1fr
    }

    .spec-item {
        padding: 1rem
    }

    .spec-item .value {
        font-size: 1.1rem
    }

    .gallery-grid {
        grid-template-columns: 1fr
    }

    .cta-box {
        padding: 1.5rem;
        margin: 1.5rem 1rem
    }

    .cta-box h2 {
        font-size: 1.2rem
    }

    .btn-cta {
        padding: .75rem 1.5rem;
        font-size: .9rem;
        width: 100%;
        text-align: center
    }

    table,
    .tiers-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch
    }

    footer {
        padding: 1.5rem 1rem
    }

    .back-to-top {
        bottom: 1rem;
        right: 1rem
    }

    .themed-bg {
        display: none
    }

    #product3d {
        display: none
    }
}