/* ============================================
   CPMItem — Main Stylesheet
   Dark Racing / Gaming Aesthetic
   ============================================ */

:root {
    --bg-deep:    #080a0f;
    --bg-card:    #0d1117;
    --bg-raised:  #131920;
    --bg-hover:   #1a2230;
    --border:     rgba(255,255,255,0.07);
    --border-acc: rgba(255,170,0,0.3);

    --accent:     #ffaa00;
    --accent-dim: #cc8800;
    --accent-glow:#ffaa0040;
    --accent2:    #00d4ff;
    --accent2-glow:#00d4ff25;
    --danger:     #ff4444;
    --success:    #00cc77;
    --warning:    #ffaa00;

    --text-primary:   #e8eaf0;
    --text-secondary: #8a97aa;
    --text-muted:     #4a5568;

    --font-display: 'Rajdhani', sans-serif;
    --font-body:    'Inter', sans-serif;

    --radius-sm: 6px;
    --radius:    10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --shadow:     0 4px 24px rgba(0,0,0,0.4);
    --shadow-acc: 0 0 30px rgba(255,170,0,0.15);
    --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
}

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

html { scroll-behavior: smooth; }

body {
    background: var(--bg-deep);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── Background Grid ── */
.bg-grid {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background-image:
        linear-gradient(rgba(255,170,0,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,170,0,0.025) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 80% 80% at 50% 0%, black 40%, transparent 100%);
}

/* ── Navbar ── */
.navbar {
    position: sticky; top: 0; z-index: 100;
    background: rgba(8,10,15,0.92);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}
.nav-inner {
    max-width: 1280px; margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex; align-items: center; gap: 32px;
}
.nav-logo {
    display: flex; align-items: center; gap: 8px;
    text-decoration: none; flex-shrink: 0;
}
.logo-icon { font-size: 22px; }
.logo-text {
    font-family: var(--font-display);
    font-size: 22px; font-weight: 700;
    color: var(--text-primary); letter-spacing: 1px;
}
.logo-accent { color: var(--accent); }

.nav-links {
    display: flex; align-items: center; gap: 4px;
    list-style: none; margin-left: auto;
}
.nav-links a {
    display: block; padding: 6px 14px;
    color: var(--text-secondary); text-decoration: none;
    font-size: 14px; font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.nav-links a:hover, .nav-links a.active {
    color: var(--text-primary);
    background: var(--bg-raised);
}
.nav-links a.active { color: var(--accent); }
.nav-admin { color: var(--accent) !important; }

.nav-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.nav-user {
    font-size: 13px; color: var(--text-secondary);
    background: var(--bg-raised); padding: 5px 12px;
    border-radius: var(--radius-sm); border: 1px solid var(--border);
}
.nav-toggle { display: none; }

.nav-mobile {
    display: none; flex-direction: column;
    padding: 12px 24px 20px; gap: 4px;
    border-top: 1px solid var(--border);
}
.nav-mobile a {
    display: block; padding: 10px 14px;
    color: var(--text-secondary); text-decoration: none;
    border-radius: var(--radius-sm); font-weight: 500;
    transition: var(--transition);
}
.nav-mobile a:hover { background: var(--bg-raised); color: var(--text-primary); }

/* ── Buttons ── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 22px; border-radius: var(--radius);
    font-family: var(--font-display); font-size: 15px; font-weight: 600;
    letter-spacing: 0.5px; cursor: pointer;
    text-decoration: none; border: none;
    transition: var(--transition); white-space: nowrap;
}
.btn-sm { padding: 7px 16px; font-size: 13px; }
.btn-lg { padding: 14px 32px; font-size: 17px; }
.btn-full { width: 100%; }

.btn-primary {
    background: var(--accent); color: #0a0800;
}
.btn-primary:hover { background: #ffbb22; box-shadow: 0 0 20px var(--accent-glow); transform: translateY(-1px); }

.btn-ghost {
    background: transparent; color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-raised); color: var(--text-primary); border-color: rgba(255,255,255,0.15); }

.btn-danger {
    background: var(--danger); color: #fff;
}
.btn-danger:hover { background: #ff6666; }

.btn-outline {
    background: transparent; color: var(--accent);
    border: 1px solid var(--border-acc);
}
.btn-outline:hover { background: var(--accent-glow); }

/* ── Main content ── */
.main-content {
    position: relative; z-index: 1;
    min-height: calc(100vh - 64px - 200px);
}

/* ── Container ── */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 720px; margin: 0 auto; padding: 0 24px; }

/* ── Section ── */
.section { padding: 60px 0; }

/* ── Hero ── */
.hero {
    padding: 80px 0 60px;
    text-align: center; position: relative;
}
.hero::before {
    content: '';
    position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 600px; height: 300px;
    background: radial-gradient(ellipse, rgba(255,170,0,0.08) 0%, transparent 70%);
    pointer-events: none;
}
.hero-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(255,170,0,0.08); border: 1px solid var(--border-acc);
    color: var(--accent); padding: 5px 16px; border-radius: 999px;
    font-size: 13px; font-weight: 600; letter-spacing: 1px;
    text-transform: uppercase; margin-bottom: 20px;
}
.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(36px, 6vw, 72px);
    font-weight: 700; line-height: 1.1;
    letter-spacing: -1px;
    margin-bottom: 18px;
}
.hero h1 span { color: var(--accent); }
.hero p {
    font-size: 18px; color: var(--text-secondary);
    max-width: 520px; margin: 0 auto 32px;
}
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.hero-stats {
    display: flex; justify-content: center; gap: 48px;
    margin-top: 60px; padding-top: 40px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}
.stat-item { text-align: center; }
.stat-num {
    font-family: var(--font-display);
    font-size: 36px; font-weight: 700;
    color: var(--accent); display: block;
}
.stat-label { font-size: 13px; color: var(--text-secondary); }

/* ── Cards ── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
}
.card:hover {
    border-color: var(--border-acc);
    box-shadow: var(--shadow-acc);
    transform: translateY(-3px);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    display: flex; flex-direction: column;
    text-decoration: none; color: inherit;
    position: relative;
}
.product-card:hover {
    border-color: var(--border-acc);
    box-shadow: var(--shadow-acc);
    transform: translateY(-4px);
}

.product-img {
    aspect-ratio: 16/9; overflow: hidden;
    background: var(--bg-raised);
    display: flex; align-items: center; justify-content: center;
    font-size: 64px;
}
.product-img img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.4s ease;
}
.product-card:hover .product-img img { transform: scale(1.05); }

.product-body { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.product-cat {
    font-size: 11px; color: var(--accent); font-weight: 600;
    text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px;
}
.product-name {
    font-family: var(--font-display);
    font-size: 19px; font-weight: 600;
    color: var(--text-primary); margin-bottom: 8px; line-height: 1.3;
}
.product-desc {
    font-size: 13px; color: var(--text-secondary);
    flex: 1; margin-bottom: 16px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding-top: 14px; border-top: 1px solid var(--border);
}
.product-price {
    font-family: var(--font-display);
    font-size: 22px; font-weight: 700; color: var(--accent);
}
.product-badge {
    position: absolute; top: 12px; right: 12px;
    background: var(--accent); color: #0a0800;
    font-size: 11px; font-weight: 700;
    padding: 3px 10px; border-radius: 999px;
    letter-spacing: 0.5px;
}
.badge-hot { background: #ff4444; color: #fff; }
.badge-new { background: var(--accent2); color: #000; }
.badge-sale { background: var(--success); color: #000; }

/* ── Section title ── */
.section-header { margin-bottom: 36px; }
.section-title {
    font-family: var(--font-display);
    font-size: clamp(24px, 3vw, 36px);
    font-weight: 700; color: var(--text-primary);
    margin-bottom: 8px;
}
.section-title span { color: var(--accent); }
.section-sub { color: var(--text-secondary); font-size: 15px; }

/* ── Category filter ── */
.cat-filter {
    display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 32px;
}
.cat-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 18px; border-radius: 999px;
    background: var(--bg-raised); border: 1px solid var(--border);
    color: var(--text-secondary); font-size: 13px; font-weight: 500;
    cursor: pointer; text-decoration: none;
    transition: var(--transition);
}
.cat-btn:hover, .cat-btn.active {
    background: var(--accent-glow); border-color: var(--border-acc);
    color: var(--accent);
}

/* ── Auth forms ── */
.auth-page {
    min-height: calc(100vh - 64px);
    display: flex; align-items: center; justify-content: center;
    padding: 40px 24px;
}
.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 40px; width: 100%; max-width: 420px;
    box-shadow: var(--shadow);
}
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-title {
    font-family: var(--font-display);
    font-size: 28px; font-weight: 700;
    text-align: center; margin-bottom: 6px;
}
.auth-sub { color: var(--text-secondary); text-align: center; font-size: 14px; margin-bottom: 28px; }

/* ── Forms ── */
.form-group { margin-bottom: 18px; }
.form-label {
    display: block; font-size: 13px; font-weight: 500;
    color: var(--text-secondary); margin-bottom: 7px;
}
.form-control {
    width: 100%; padding: 11px 14px;
    background: var(--bg-deep); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text-primary);
    font-family: var(--font-body); font-size: 14px;
    transition: var(--transition); outline: none;
}
.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; }

.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── Alerts ── */
.alert {
    padding: 12px 16px; border-radius: var(--radius);
    font-size: 14px; margin-bottom: 18px;
    display: flex; align-items: flex-start; gap: 10px;
}
.alert-error { background: rgba(255,68,68,0.1); border: 1px solid rgba(255,68,68,0.3); color: #ff8888; }
.alert-success { background: rgba(0,204,119,0.1); border: 1px solid rgba(0,204,119,0.3); color: #44dd99; }
.alert-info { background: rgba(0,212,255,0.08); border: 1px solid rgba(0,212,255,0.25); color: var(--accent2); }
.alert-warning { background: rgba(255,170,0,0.08); border: 1px solid var(--border-acc); color: var(--accent); }

/* ── Breadcrumb ── */
.breadcrumb {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; color: var(--text-muted); margin-bottom: 28px; flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-secondary); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { color: var(--text-muted); }

/* ── Product Detail ── */
.product-detail {
    display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px;
    align-items: start;
}
.product-detail-img {
    aspect-ratio: 4/3; background: var(--bg-raised);
    border-radius: var(--radius-xl); overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    font-size: 96px; border: 1px solid var(--border);
}
.product-detail-img img { width: 100%; height: 100%; object-fit: cover; }
.product-detail-info {}
.product-detail-cat {
    font-size: 12px; color: var(--accent); font-weight: 600;
    text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 10px;
}
.product-detail-name {
    font-family: var(--font-display);
    font-size: clamp(28px, 4vw, 42px); font-weight: 700;
    line-height: 1.15; margin-bottom: 16px;
}
.product-detail-price {
    font-family: var(--font-display);
    font-size: 44px; font-weight: 700; color: var(--accent);
    margin-bottom: 20px;
}
.product-detail-desc {
    color: var(--text-secondary); line-height: 1.7;
    margin-bottom: 28px; font-size: 15px;
}
.product-trust {
    display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px;
}
.trust-item {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; color: var(--text-secondary);
    background: var(--bg-raised); padding: 6px 12px;
    border-radius: 999px; border: 1px solid var(--border);
}

/* ── Checkout Modal ── */
.modal-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(0,0,0,0.8); backdrop-filter: blur(4px);
    display: none; align-items: center; justify-content: center;
    padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-xl); width: 100%; max-width: 540px;
    max-height: 90vh; overflow-y: auto;
    box-shadow: 0 20px 80px rgba(0,0,0,0.6);
    animation: modalIn 0.25s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(20px) scale(0.97); } to { opacity: 1; transform: none; } }
.modal-header {
    padding: 24px 28px 0;
    display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-family: var(--font-display); font-size: 22px; font-weight: 700; }
.modal-close {
    background: var(--bg-raised); border: 1px solid var(--border);
    color: var(--text-secondary); width: 32px; height: 32px;
    border-radius: 50%; cursor: pointer; font-size: 18px;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.modal-body { padding: 24px 28px 28px; }

/* Step wizard */
.steps {
    display: flex; align-items: center; gap: 0;
    margin-bottom: 28px;
}
.step {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    gap: 6px; position: relative;
}
.step::after {
    content: '';
    position: absolute; top: 16px; left: 50%; width: 100%;
    height: 2px; background: var(--border); z-index: 0;
}
.step:last-child::after { display: none; }
.step-num {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--bg-raised); border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; z-index: 1;
    font-family: var(--font-display);
}
.step.active .step-num { background: var(--accent); border-color: var(--accent); color: #0a0800; }
.step.done .step-num { background: var(--success); border-color: var(--success); color: #000; }
.step-label { font-size: 11px; color: var(--text-muted); text-align: center; }
.step.active .step-label { color: var(--accent); }

.step-content { display: none; }
.step-content.active { display: block; }

/* ── Orders table ── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    text-align: left; padding: 12px 16px;
    font-size: 12px; font-weight: 600;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px;
    border-bottom: 1px solid var(--border);
}
.data-table td {
    padding: 14px 16px; border-bottom: 1px solid var(--border);
    font-size: 14px; vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,0.02); }

.table-wrap {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); overflow: hidden;
}

/* Status badges */
.status {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px; border-radius: 999px;
    font-size: 12px; font-weight: 600;
}
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.status-pending { background: rgba(255,170,0,0.12); color: var(--accent); }
.status-pending::before { background: var(--accent); }
.status-paid { background: rgba(0,212,255,0.1); color: var(--accent2); }
.status-paid::before { background: var(--accent2); }
.status-processing { background: rgba(139,92,246,0.12); color: #a78bfa; }
.status-processing::before { background: #a78bfa; }
.status-completed { background: rgba(0,204,119,0.1); color: var(--success); }
.status-completed::before { background: var(--success); }
.status-cancelled { background: rgba(255,68,68,0.1); color: var(--danger); }
.status-cancelled::before { background: var(--danger); }

/* ── Page header ── */
.page-header {
    padding: 48px 0 36px;
    border-bottom: 1px solid var(--border); margin-bottom: 48px;
}
.page-header h1 {
    font-family: var(--font-display);
    font-size: clamp(28px, 4vw, 44px); font-weight: 700;
}
.page-header p { color: var(--text-secondary); margin-top: 8px; }

/* ── Legal pages ── */
.legal-content {
    max-width: 760px; margin: 0 auto;
}
.legal-content h2 {
    font-family: var(--font-display); font-size: 26px; font-weight: 700;
    margin: 36px 0 12px; color: var(--accent);
}
.legal-content h3 {
    font-size: 17px; font-weight: 600; margin: 24px 0 10px;
    color: var(--text-primary);
}
.legal-content p { color: var(--text-secondary); margin-bottom: 14px; line-height: 1.75; }
.legal-content ul { color: var(--text-secondary); padding-left: 20px; margin-bottom: 14px; }
.legal-content li { margin-bottom: 6px; }

/* ── Empty state ── */
.empty-state {
    text-align: center; padding: 80px 24px; color: var(--text-secondary);
}
.empty-state .empty-icon { font-size: 56px; margin-bottom: 16px; }
.empty-state h3 { font-family: var(--font-display); font-size: 22px; color: var(--text-primary); margin-bottom: 8px; }

/* ── Checkbox ── */
.checkbox-group { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.checkbox-group input[type=checkbox] { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--accent); margin-top: 2px; }
.checkbox-group span { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.checkbox-group a { color: var(--accent); }

/* ── Footer ── */
.footer {
    background: var(--bg-card); border-top: 1px solid var(--border);
    margin-top: 80px;
}
.footer-inner {
    max-width: 1280px; margin: 0 auto; padding: 48px 24px 32px;
    display: grid; grid-template-columns: 1fr 2fr; gap: 60px;
}
.footer-brand p { color: var(--text-secondary); font-size: 14px; margin: 14px 0 20px; line-height: 1.6; }
.footer-social { display: flex; gap: 8px; flex-wrap: wrap; }
.social-btn {
    padding: 6px 14px; background: var(--bg-raised);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text-secondary); font-size: 13px; text-decoration: none;
    transition: var(--transition);
}
.social-btn:hover { border-color: var(--border-acc); color: var(--accent); }

.footer-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.footer-col h4 {
    font-family: var(--font-display); font-size: 14px; font-weight: 700;
    color: var(--text-primary); letter-spacing: 1px; text-transform: uppercase;
    margin-bottom: 14px;
}
.footer-col a {
    display: block; color: var(--text-secondary); text-decoration: none;
    font-size: 14px; margin-bottom: 8px; transition: var(--transition);
}
.footer-col a:hover { color: var(--accent); }

.footer-bottom {
    border-top: 1px solid var(--border); padding: 20px 24px;
    text-align: center; font-size: 12px; color: var(--text-muted);
    max-width: 1280px; margin: 0 auto;
}

/* ── Divider ── */
.divider { border: none; border-top: 1px solid var(--border); margin: 28px 0; }

/* ── Pagination ── */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 40px; }
.page-btn {
    width: 36px; height: 36px; border-radius: var(--radius-sm);
    background: var(--bg-raised); border: 1px solid var(--border);
    color: var(--text-secondary); font-size: 14px;
    display: flex; align-items: center; justify-content: center;
    text-decoration: none; transition: var(--transition);
}
.page-btn:hover, .page-btn.active {
    background: var(--accent-glow); border-color: var(--border-acc); color: var(--accent);
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .nav-links { display: none; }
    .nav-actions { display: none; }
    .nav-toggle {
        display: flex; flex-direction: column; gap: 5px;
        background: none; border: none; cursor: pointer; padding: 4px; margin-left: auto;
    }
    .nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text-primary); border-radius: 2px; }
    .nav-mobile.show { display: flex; }

    .product-detail { grid-template-columns: 1fr; }
    .footer-inner { grid-template-columns: 1fr; gap: 32px; }
    .footer-links { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .hero-stats { gap: 24px; }
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
    .footer-links { grid-template-columns: 1fr 1fr; }
    .auth-card { padding: 28px 20px; }
    .modal { border-radius: var(--radius-lg); }
    .modal-body, .modal-header { padding-left: 20px; padding-right: 20px; }
}
