:root {
    --primary: #8b5cf6;
    --primary-dim: rgba(139, 92, 246, 0.15);
    --primary-glow: rgba(139, 92, 246, 0.3);
    --bg: #0a0a0a;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.07);
    --text: #e5e5e5;
    --text-dim: #888;
    --text-bright: #fff;
    --border: rgba(255, 255, 255, 0.08);
    --success: #22c55e;
    --error: #ef4444;
    --radius: 12px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* === LIGHT THEME === */
[data-theme="light"] {
    --bg: #f5f5f7;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f0f2;
    --text: #374151;
    --text-dim: #6b7280;
    --text-bright: #111827;
    --border: rgba(0, 0, 0, 0.1);
    --primary-dim: rgba(139, 92, 246, 0.1);
    --primary-glow: rgba(139, 92, 246, 0.15);
}
[data-theme="light"] .nav { background: rgba(255, 255, 255, 0.92); }
[data-theme="light"] .product-image { background: rgba(0, 0, 0, 0.03); }
[data-theme="light"] .product-placeholder.large { background: rgba(0, 0, 0, 0.03); }
[data-theme="light"] .input,
[data-theme="light"] .card-element { background: rgba(0, 0, 0, 0.03); }
[data-theme="light"] .input::placeholder { color: #9ca3af; }
[data-theme="light"] .dashboard-table tr:hover td { background: rgba(0, 0, 0, 0.02); }
[data-theme="light"] .product-card:hover { box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1); border-color: rgba(139, 92, 246, 0.2); }
[data-theme="light"] #payment-message.error { background: rgba(239, 68, 68, 0.06); }
@media (max-width: 768px) {
    [data-theme="light"] .nav-links { background: rgba(255, 255, 255, 0.95); }
}
.theme-toggle-float {
    position: fixed; bottom: 1.25rem; right: 1.25rem; width: 40px; height: 40px;
    border-radius: 50%; background: var(--bg-card); border: 1px solid var(--border);
    color: var(--text-dim); cursor: pointer; display: flex; align-items: center;
    justify-content: center; z-index: 1000; transition: all 0.2s;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.theme-toggle-float:hover { color: var(--text-bright); transform: scale(1.1); }
@media print { .theme-toggle-float { display: none !important; } }

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* === NAV === */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-logo {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-bright);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.nav-logo-img { height: 32px; width: auto; }
.nav-links { display: flex; gap: 0.25rem; }
.nav-link {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
}
.nav-link:hover, .nav-link.active {
    color: var(--text-bright);
    background: var(--bg-card);
}
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; }
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    margin: 5px 0;
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

/* === PROMO BANNER === */
.promo-banner {
    background: linear-gradient(90deg, #f59e0b, #ef4444, #f59e0b);
    background-size: 200% auto;
    animation: bannerShine 4s linear infinite;
    color: #fff;
    text-align: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}
.promo-banner strong {
    background: rgba(255,255,255,0.25);
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    letter-spacing: 0.05em;
}
.promo-banner-icon { font-size: 1.1rem; }
@keyframes bannerShine {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* === HERO === */
.hero {
    padding: 8rem 1.5rem 4rem;
    text-align: center;
    background: radial-gradient(ellipse at 50% 0%, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
}
.hero-content { max-width: 700px; margin: 0 auto; }
.hero-title {
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    font-weight: 800;
    color: var(--text-bright);
    line-height: 1.1;
    margin-bottom: 0.75rem;
}
.hero-tagline {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 1rem;
}
.hero-desc {
    font-size: 1rem;
    color: var(--text-dim);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.7;
}

/* === SECTIONS === */
.section { padding: 4rem 1.5rem; }
.container { max-width: 1200px; margin: 0 auto; }
.container-narrow { max-width: 800px; margin: 0 auto; }
.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 2.5rem;
    text-align: center;
    position: relative;
}
.section-title::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: var(--primary);
    margin: 0.75rem auto 0;
    border-radius: 2px;
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    border: none;
    font-family: var(--font);
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 15px var(--primary-glow);
}
.btn-primary:hover { box-shadow: 0 6px 25px var(--primary-glow); }
.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--text-dim); background: var(--bg-card); }
.btn-large { padding: 1rem 2.5rem; font-size: 1rem; }
.btn-full { width: 100%; justify-content: center; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.8rem; }

/* === CATEGORY TABS === */
.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 2.5rem;
}
.category-tab {
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-dim);
    text-decoration: none;
    border: 1px solid var(--border);
    transition: all 0.2s;
}
.category-tab:hover {
    color: var(--text-bright);
    border-color: var(--text-dim);
}
.category-tab.active {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}

/* === PRODUCT CARDS === */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}
.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.product-card:hover {
    transform: translateY(-6px);
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}
.product-image {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    position: relative;
    background: rgba(255, 255, 255, 0.02);
}
.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}
.product-card:hover .product-image img { transform: scale(1.05); }
.product-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
}
.product-placeholder.large {
    aspect-ratio: 16 / 10;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius);
}
.product-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--error);
    color: #fff;
}
.featured-badge {
    background: var(--primary);
    left: auto;
    right: 0.75rem;
}
.product-info { padding: 1.25rem; }
.product-category {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
    margin-bottom: 0.375rem;
}
.product-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-bright);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}
.product-pricing {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.product-price {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-bright);
}
.product-price.free {
    color: var(--success);
}
.product-compare-price {
    font-size: 0.9rem;
    color: var(--text-dim);
    text-decoration: line-through;
}

/* === PRODUCT DETAIL === */
.product-detail-section { padding-top: 6rem; }
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    font-size: 0.85rem;
    flex-wrap: wrap;
}
.breadcrumb a {
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.2s;
}
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb-sep { color: var(--text-dim); opacity: 0.5; }
.breadcrumb span:last-child { color: var(--text); }

.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}
.product-detail-image {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}
.product-detail-image img {
    width: 100%;
    height: auto;
    display: block;
}
.product-detail-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-bright);
    line-height: 1.2;
    margin-bottom: 1.25rem;
}
.product-detail-pricing {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.price-current {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-bright);
}
.price-current.free { color: var(--success); }
.price-compare {
    font-size: 1.25rem;
    color: var(--text-dim);
    text-decoration: line-through;
}
.price-discount {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--success);
    background: rgba(34, 197, 94, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
}
.product-detail-desc {
    color: var(--text-dim);
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}
.product-meta {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
}
.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-dim);
}
.meta-item svg { color: var(--primary); flex-shrink: 0; }
.related-section { margin-top: 5rem; }

/* === CHECKOUT === */
.checkout-section { padding-top: 6rem; }
.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: start;
}
.checkout-summary,
.checkout-form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
}
.checkout-summary h2,
.checkout-form h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-bright);
    margin-bottom: 1.5rem;
}
.checkout-product {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}
.checkout-thumb {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}
.checkout-product-info h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-bright);
    margin-bottom: 0.25rem;
}
.checkout-totals { display: flex; flex-direction: column; gap: 0.75rem; }
.checkout-line {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    color: var(--text-dim);
}
.checkout-line.discount { color: var(--success); }
.checkout-line.total {
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-bright);
}

/* Coupon */
.coupon-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.25rem;
}
.coupon-form .input { flex: 1; }
.coupon-error {
    color: var(--error);
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

/* Form elements */
.form-group { margin-bottom: 1.25rem; }
.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 0.5rem;
}
.input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-bright);
    font-size: 0.95rem;
    font-family: var(--font);
    transition: border-color 0.2s;
    outline: none;
}
.input:focus { border-color: var(--primary); }
.input::placeholder { color: #555; }

.card-element {
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: border-color 0.2s;
}
.card-element:focus-within,
.card-element.StripeElement--focus { border-color: var(--primary); }

.form-error {
    color: var(--error);
    font-size: 0.8rem;
    margin-top: 0.5rem;
    min-height: 1.2em;
}

.stripe-not-configured {
    text-align: center;
    padding: 2rem 0;
}
.stripe-not-configured svg {
    color: var(--text-dim);
    margin-bottom: 1rem;
}
.stripe-not-configured p {
    color: var(--text);
    margin-bottom: 0.5rem;
}

.hidden { display: none !important; }
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

#payment-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
}
#payment-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* === DOWNLOAD === */
.download-section { padding-top: 8rem; }
.download-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}
.download-icon {
    margin-bottom: 1.5rem;
    color: var(--text-dim);
}
.download-icon.success { color: var(--success); }
.download-card h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 0.75rem;
}
.download-card p {
    color: var(--text-dim);
    margin-bottom: 0.5rem;
}
.download-card .expired h1 { color: var(--error); }
.download-form { margin: 2rem 0; }
.download-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}
.download-info-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}
.info-label { color: var(--text-dim); }
.info-value { color: var(--text-bright); font-weight: 500; }
.download-note {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--primary-dim);
    border-radius: 8px;
    font-size: 0.85rem;
}
.download-note p { color: var(--text); margin: 0; }

/* === DASHBOARD === */
.dashboard-section { padding-top: 6rem; }
.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 2rem;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.stat-card-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}
.stat-card-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-bright);
}
.dashboard-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.dashboard-card h2 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-bright);
    margin-bottom: 1.25rem;
}
.table-wrapper { overflow-x: auto; }
.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.dashboard-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    color: var(--text-dim);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.dashboard-table td {
    padding: 0.75rem 1rem;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.dashboard-table tr:last-child td { border-bottom: none; }
.dashboard-table tr:hover td { background: rgba(255, 255, 255, 0.02); }

/* === FOOTER === */
.footer {
    padding: 2rem 1.5rem;
    text-align: center;
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 0.85rem;
}
.footer a { color: var(--text-dim); text-decoration: none; transition: color 0.2s; }
.footer a:hover { color: var(--primary); }
.footer-contact { margin-top: 0.5rem; }

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-dim);
}
.empty-state svg { margin-bottom: 1rem; }
.empty-state p { margin-bottom: 1.5rem; }

/* === UTILITY === */
.text-dim { color: var(--text-dim); font-size: 0.9rem; }

/* === ANIMATIONS === */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: rgba(10, 10, 10, 0.95);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        flex-direction: column;
        padding: 1rem;
        border-bottom: 1px solid var(--border);
    }
    .nav-links.open { display: flex; }
    .nav-link { padding: 0.75rem 1rem; }

    .products-grid { grid-template-columns: 1fr; }

    .product-detail { grid-template-columns: 1fr; gap: 2rem; }
    .product-detail-title { font-size: 1.5rem; }
    .price-current { font-size: 1.5rem; }

    .checkout-layout { grid-template-columns: 1fr; }

    .stats-grid { grid-template-columns: 1fr 1fr; }

    .section { padding: 3rem 1.25rem; }
    .hero { padding: 7rem 1.25rem 3rem; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .category-tabs { gap: 0.375rem; }
    .category-tab { padding: 0.375rem 0.875rem; font-size: 0.8rem; }
}

/* === PRINT === */
@media print {
    * { background: #fff !important; color: #111 !important; box-shadow: none !important; }
    .nav, .footer, .btn { display: none !important; }
    .hero { padding: 2rem 0; }
    .section { padding: 1.5rem 0; }
    .product-card, .stat-card, .dashboard-card, .checkout-summary, .checkout-form {
        border: 1px solid #ddd !important;
        background: #fafafa !important;
    }
    .fade-in { opacity: 1 !important; transform: none !important; }
    a { text-decoration: none; }
}
