:root {
    --bg-base: #0a0a0f;
    --bg-surface: rgba(20, 20, 30, 0.6);
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.15);
    --primary: #06b6d4;
    --primary-light: #22d3ee;
    --primary-glow: rgba(6, 182, 212, 0.35);
    --secondary: #8b5cf6;
    --accent: #f472b6;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --font-fam: 'Outfit', sans-serif;
    --glass-blur: blur(20px);
    --transition-fast: 0.15s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --bg-base: #f1f5f9;
    --bg-surface: rgba(255, 255, 255, 0.7);
    --border-subtle: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.15);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --primary-glow: rgba(6, 182, 212, 0.15);
    --glass-blur: blur(15px);
}

[data-theme="light"] .glow-bg {
    opacity: 0.2;
}

[data-theme="light"] .glass {
    background: var(--bg-surface);
    border-color: var(--border-subtle);
}

[data-theme="light"] .input-field {
    background: rgba(255, 255, 255, 0.8);
    color: #0f172a;
    border-color: #cbd5e1;
}

[data-theme="light"] .modal-content {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.98));
}

[data-theme="light"] .btn-secondary {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-main);
}

[data-theme="light"] .footer-bottom {
    border-top-color: rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-fam);
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    overflow-y: scroll; /* Force scrollbar to prevent layout shift */
    position: relative;
    min-height: 100vh;
}

.glow-bg {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.5;
    animation: drift 25s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

.glow-bg.top-left {
    top: -25vh;
    left: -15vw;
    width: 55vw;
    height: 55vh;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
}

.glow-bg.bottom-right {
    bottom: -25vh;
    right: -15vw;
    width: 60vw;
    height: 60vh;
    background: radial-gradient(circle, var(--secondary) 0%, transparent 60%);
    animation-delay: -8s;
}

@keyframes drift {
    0% {
        transform: scale(1) translate(0, 0);
    }
    100% {
        transform: scale(1.15) translate(40px, 25px);
    }
}

.glass {
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-subtle);
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 40%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.accent-text {
    color: var(--primary-light);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 99px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
    font-size: 0.95rem;
    user-select: none;
    -webkit-user-select: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-primary:hover {
    box-shadow: 0 8px 30px var(--primary-glow);
    transform: translateY(-2px);
    filter: brightness(1.15);
}

.btn-secondary {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.btn-small {
    padding: 0.4rem 1.2rem;
    font-size: 0.85rem;
}

.btn-full {
    width: 100%;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    border-bottom: 1px solid var(--border-subtle);
    border-left: none;
    border-right: none;
    border-top: none;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.logo-icon {
    font-size: 1.2rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-fast);
}

.nav-link:hover {
    color: var(--primary-light);
}

.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
}

.theme-toggle {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-size: 1.1rem;
    padding: 0;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-hover);
    transform: rotate(15deg);
}

[data-theme="light"] .theme-toggle:hover {
    background: rgba(0, 0, 0, 0.03);
}

.theme-toggle .sun-icon {
    display: none;
}

[data-theme="light"] .theme-toggle .moon-icon {
    display: none;
}

[data-theme="light"] .theme-toggle .sun-icon {
    display: block;
}

.store-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.section-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.category-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    padding: 0.5rem 1.25rem;
    border-radius: 99px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
    user-select: none;
    -webkit-user-select: none;
}

.filter-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.04);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    min-height: 400px; /* Prevent page height jumping during loading */
}

.product-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top left, rgba(6, 182, 212, 0.08), transparent 50%);
    pointer-events: none;
}

.product-card:hover {
    transform: translateY(-6px);
    border-color: var(--primary);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4), 0 0 30px var(--primary-glow);
}

.product-card-img-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    background: rgba(6, 182, 212, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    padding: 0.5rem;
}

.product-card img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-category {
    font-size: 0.75rem;
    color: var(--primary-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.product-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.product-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.08);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 4rem auto;
    grid-column: 1 / -1;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

.footer {
    padding: 3rem 2rem 1.5rem;
    margin-top: 4rem;
    border-bottom: none;
    border-left: none;
    border-right: none;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-brand h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.footer-brand p {
    color: var(--text-muted);
    max-width: 300px;
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    flex-direction: column;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.footer-links a:hover {
    color: var(--primary-light);
}

.footer-bottom {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-subtle);
    max-width: 1200px;
    margin: 0 auto;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: linear-gradient(145deg, rgba(20, 20, 35, 0.95), rgba(15, 15, 25, 0.98));
    border: 1px solid var(--border-subtle);
    width: 100%;
    max-width: 450px;
    border-radius: 24px;
    padding: 2rem;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    z-index: 10;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
    transform: rotate(90deg);
}

.modal-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.modal-product-img {
    height: 80px;
    margin-bottom: 1rem;
    pointer-events: none;
}

.modal-header h3 {
    font-size: 1.4rem;
}

.modal-body p {
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.modal-price {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
}

.purchase-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.purchase-form label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.input-field {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-subtle);
    padding: 0.8rem 1rem;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    margin-bottom: 1rem;
    outline: none;
    transition: all 0.2s;
}

.input-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.input-field::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-actions {
        flex-direction: column;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
}

.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 9999;
}

.toast {
    min-width: 250px;
    padding: 1rem 1.5rem;
    background: rgba(20, 20, 35, 0.95);
    border-left: 4px solid var(--primary);
    border-radius: 12px;
    color: white;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
}

.toast-error {
    border-left-color: #ef4444;
}

.toast-success {
    border-left-color: #10b981;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.status-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-completed {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-pending {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.copy-btn {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
    margin-left: 0.5rem;
}

.copy-btn:hover {
    opacity: 1;
}
