/* =========================================================
   SCRIPT MARKETPLACE — assets/css/main.css
   ========================================================= */

/* ── ROOT VARIABLES ─────────────────────────────────────── */
:root {
    --primary:       #6366f1;
    --primary-dark:  #4f46e5;
    --primary-soft:  #f0f0ff;
    --primary-grad:  linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --dark:          #0f172a;
    --dark2:         #1e1b4b;
    --surface:       #ffffff;
    --bg:            #f8fafc;
    --bg2:           #f1f5f9;
    --border:        #e2e8f0;
    --text:          #1e293b;
    --text2:         #475569;
    --muted:         #64748b;
    --green:         #10b981;
    --amber:         #f59e0b;
    --red:           #ef4444;
    --radius:        12px;
    --radius-lg:     16px;
    --shadow:        0 4px 20px rgba(0,0,0,0.06);
    --shadow-lg:     0 8px 32px rgba(0,0,0,0.10);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ── TOPBAR ─────────────────────────────────────────────── */
.topbar {
    background: var(--dark);
    padding: 7px 0;
}
.topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #94a3b8;
    gap: 12px;
    flex-wrap: wrap;
}

/* ── NAVBAR ─────────────────────────────────────────────── */
.main-nav {
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 999;
    transition: box-shadow 0.3s;
}
.main-nav.scrolled { box-shadow: 0 2px 20px rgba(0,0,0,0.08); }

.nav-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 20px;
    height: 60px;
    flex-wrap: nowrap;
}

.nav-logo {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: 20px;
    color: var(--dark);
    white-space: nowrap;
    text-decoration: none;
}
.logo-dot { color: var(--primary); }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links .nav-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--text2);
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.15s;
}
.nav-links .nav-link:hover, .nav-links .nav-link.active {
    color: var(--primary);
    background: var(--primary-soft);
}

.nav-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.search-form { display: flex; align-items: center; gap: 0; }
.search-input {
    border: 1.5px solid var(--border);
    border-radius: 8px 0 0 8px;
    padding: 7px 12px;
    font-size: 13px;
    outline: none;
    width: 180px;
    background: var(--bg);
    transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--primary); background: #fff; }
.search-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 0 8px 8px 0;
    padding: 7px 12px;
    cursor: pointer;
    font-size: 13px;
}

.nav-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: var(--text2);
    background: var(--bg);
    border: 1px solid var(--border);
    transition: all 0.15s;
    font-size: 14px;
}
.nav-icon-btn:hover { color: var(--primary); border-color: var(--primary); }

.nav-user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
}
.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-grad);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.btn-nav-outline {
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text2);
    white-space: nowrap;
    transition: all 0.15s;
}
.btn-nav-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-nav-primary {
    background: var(--primary-grad);
    border-radius: 8px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    transition: opacity 0.15s;
}
.btn-nav-primary:hover { opacity: 0.9; color: #fff; }

/* Mobile menu */
.mobile-menu-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 16px;
    color: var(--text);
    cursor: pointer;
}
.mobile-menu {
    display: none;
    border-top: 1px solid var(--border);
    padding: 12px 0;
    background: #fff;
}
.mobile-menu.show { display: block; }
.mobile-link {
    display: block;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text2);
    transition: all 0.15s;
}
.mobile-link:hover, .mobile-link.active { color: var(--primary); background: var(--primary-soft); }

/* ── HERO SECTION ────────────────────────────────────────── */
.hero {
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark2) 60%, #0f172a 100%);
    padding: 70px 0 60px;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -80px; right: -80px;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(99,102,241,0.2) 0%, transparent 70%);
    pointer-events: none;
}
.hero::after {
    content: '';
    position: absolute;
    bottom: -60px; left: -60px;
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(139,92,246,0.15) 0%, transparent 70%);
    pointer-events: none;
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(99,102,241,0.15);
    border: 1px solid rgba(99,102,241,0.3);
    color: #a5b4fc;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
    margin-bottom: 18px;
}
.hero h1 {
    font-family: 'Syne', sans-serif;
    font-size: clamp(28px, 4vw, 48px);
    font-weight: 800;
    color: #f8fafc;
    line-height: 1.15;
    margin-bottom: 14px;
    letter-spacing: -0.5px;
}
.hero h1 span { color: #818cf8; }
.hero p { color: #94a3b8; font-size: 16px; margin-bottom: 28px; max-width: 480px; }

.btn-hero-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-grad);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 13px 28px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 16px rgba(99,102,241,0.35);
    text-decoration: none;
}
.btn-hero-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(99,102,241,0.4); color: #fff; }

.btn-hero-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: #94a3b8;
    border: 1.5px solid rgba(148,163,184,0.35);
    border-radius: 10px;
    padding: 13px 28px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.btn-hero-outline:hover { border-color: #818cf8; color: #818cf8; }

/* STATS STRIP */
.stats-strip {
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}
.stat-box {
    padding: 16px;
    text-align: center;
    border-right: 1px solid var(--border);
}
.stat-box:last-child { border-right: none; }
.stat-num {
    font-family: 'Syne', sans-serif;
    font-size: 24px;
    font-weight: 800;
    color: var(--dark);
}
.stat-label { font-size: 12px; color: var(--muted); margin-top: 2px; font-weight: 500; }

/* ── SECTION COMMON ─────────────────────────────────────── */
.section { padding: 60px 0; }
.section-alt { background: var(--bg2); }
.section-sm { padding: 40px 0; }

.section-header { margin-bottom: 32px; }
.section-badge {
    display: inline-block;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.section-title {
    font-family: 'Syne', sans-serif;
    font-size: clamp(20px, 3vw, 28px);
    font-weight: 800;
    color: var(--dark);
    line-height: 1.2;
    margin-bottom: 8px;
}
.section-sub { font-size: 15px; color: var(--muted); }

.view-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    font-weight: 700;
    font-size: 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 8px 16px;
    transition: all 0.15s;
    white-space: nowrap;
}
.view-all:hover { border-color: var(--primary); color: var(--primary); }

/* ── CATEGORY CARDS ─────────────────────────────────────── */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.cat-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: block;
}
.cat-card:hover {
    border-color: var(--primary);
    background: var(--primary-soft);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.cat-icon { font-size: 28px; margin-bottom: 8px; line-height: 1; }
.cat-name { font-size: 12px; font-weight: 700; color: var(--dark); }
.cat-count { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* ── PRODUCT CARDS ───────────────────────────────────────── */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }

.product-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}
.product-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(99,102,241,0.12);
    color: inherit;
}

.product-thumb {
    width: 100%;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    font-size: 48px;
    overflow: hidden;
}
.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-grad-1 { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.thumb-grad-2 { background: linear-gradient(135deg, #059669, #34d399); }
.thumb-grad-3 { background: linear-gradient(135deg, #dc2626, #f87171); }
.thumb-grad-4 { background: linear-gradient(135deg, #d97706, #fbbf24); }
.thumb-grad-5 { background: linear-gradient(135deg, #0891b2, #38bdf8); }
.thumb-grad-6 { background: linear-gradient(135deg, #7c3aed, #c084fc); }

.badge-hot  { position: absolute; top: 8px; left: 8px; background: #ef4444; color: #fff; font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 10px; }
.badge-new  { position: absolute; top: 8px; left: 8px; background: #10b981; color: #fff; font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 10px; }
.badge-sale { position: absolute; top: 8px; right: 8px; background: #f59e0b; color: #fff; font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 10px; }
.badge-feat { position: absolute; top: 8px; left: 8px; background: #6366f1; color: #fff; font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 10px; }

.product-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.product-cat { font-size: 10px; color: var(--primary); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 5px; }
.product-name { font-size: 14px; font-weight: 700; color: var(--dark); line-height: 1.3; margin-bottom: 8px; flex: 1; }
.product-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.tag-pill { background: var(--bg2); color: var(--muted); font-size: 10px; padding: 2px 7px; border-radius: 8px; font-weight: 600; }

.product-meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); margin-bottom: 10px; }
.stars { color: #f59e0b; font-size: 11px; }

.product-footer { display: flex; align-items: center; justify-content: space-between; }
.price-wrap { display: flex; align-items: baseline; gap: 6px; }
.price-now { font-family: 'Syne', sans-serif; font-size: 18px; font-weight: 800; color: var(--dark); }
.price-old { font-size: 12px; color: var(--muted); text-decoration: line-through; }
.btn-buy {
    background: var(--primary-grad);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s;
    white-space: nowrap;
    text-decoration: none;
}
.btn-buy:hover { opacity: 0.9; color: #fff; }

/* ── FEATURED BANNER ─────────────────────────────────────── */
.featured-banner {
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark2) 100%);
    border-radius: var(--radius-lg);
    padding: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    border: 1px solid rgba(99,102,241,0.2);
    margin-bottom: 12px;
}
.featured-left h3 { font-family: 'Syne', sans-serif; font-size: 20px; font-weight: 800; color: #f8fafc; margin-bottom: 6px; }
.featured-left p  { font-size: 13px; color: #94a3b8; max-width: 300px; line-height: 1.6; }
.featured-tags    { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.featured-tag     { background: rgba(99,102,241,0.2); color: #a5b4fc; font-size: 11px; padding: 3px 10px; border-radius: 10px; font-weight: 600; }
.featured-right   { text-align: right; }
.featured-old     { font-size: 13px; color: #64748b; text-decoration: line-through; margin-bottom: 2px; }
.featured-price   { font-family: 'Syne', sans-serif; font-size: 30px; font-weight: 800; color: #818cf8; }
.featured-save    { color: #34d399; font-size: 12px; font-weight: 700; margin-bottom: 12px; }

/* ── WHY US / FEATURES ───────────────────────────────────── */
.features-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.feature-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 16px;
    transition: border-color 0.2s;
}
.feature-card:hover { border-color: var(--primary); }
.feature-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: var(--primary-soft);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 12px;
    font-size: 18px;
    color: var(--primary);
}
.feature-title { font-size: 14px; font-weight: 700; color: var(--dark); margin-bottom: 4px; }
.feature-desc  { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* ── FOOTER ─────────────────────────────────────────────── */
.site-footer {
    background: var(--dark);
    color: #94a3b8;
    padding: 56px 0 0;
}
.footer-logo {
    font-family: 'Syne', sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: #f8fafc;
    margin-bottom: 10px;
}
.footer-logo span { color: var(--primary); }
.footer-desc  { font-size: 13px; color: #64748b; line-height: 1.6; margin-bottom: 16px; }
.footer-social { display: flex; gap: 10px; }
.footer-social a {
    width: 34px; height: 34px;
    background: #1e293b;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #64748b;
    font-size: 15px;
    transition: all 0.15s;
}
.footer-social a:hover { background: var(--primary); color: #fff; }

.footer-heading { font-size: 12px; font-weight: 700; color: #f8fafc; text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 14px; }
.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { font-size: 13px; color: #64748b; transition: color 0.15s; }
.footer-links a:hover { color: #818cf8; }

.footer-contact-box {
    margin-top: 14px;
    font-size: 13px;
    color: #64748b;
}
.footer-contact-box a { color: #818cf8; }

.footer-bottom {
    border-top: 1px solid #1e293b;
    padding: 18px 0;
    margin-top: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
}
.footer-badges { display: flex; gap: 14px; flex-wrap: wrap; }
.footer-badges span { display: flex; align-items: center; gap: 4px; font-size: 12px; }

/* ── UTILITY CLASSES ─────────────────────────────────────── */
.text-primary-custom { color: var(--primary) !important; }
.bg-primary-soft     { background: var(--primary-soft) !important; }

.btn-primary-custom {
    background: var(--primary-grad);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 11px 24px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-primary-custom:hover { opacity: 0.9; transform: translateY(-1px); }

/* ── SEARCH PAGE / SHOP ──────────────────────────────────── */
.shop-header {
    background: linear-gradient(135deg, var(--dark), var(--dark2));
    padding: 36px 0 28px;
}
.filter-bar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    position: sticky;
    top: 60px;
    z-index: 99;
}
.filter-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.filter-select {
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 13px;
    color: var(--text2);
    background: var(--bg);
    outline: none;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}
.filter-select:focus { border-color: var(--primary); }
.filter-search {
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 13px;
    outline: none;
    flex: 1;
    min-width: 180px;
    background: var(--bg);
    font-family: 'Inter', sans-serif;
}
.filter-search:focus { border-color: var(--primary); background: #fff; }

.results-count { font-size: 13px; color: var(--muted); font-weight: 500; }

/* ── AUTH PAGES ──────────────────────────────────────────── */
.auth-wrapper {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    background: var(--bg2);
}
.auth-card {
    background: var(--surface);
    border-radius: 20px;
    border: 1px solid var(--border);
    padding: 36px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}
.auth-logo { text-align: center; margin-bottom: 24px; }
.auth-logo .logo { font-family: 'Syne', sans-serif; font-size: 24px; font-weight: 800; color: var(--dark); }
.auth-logo .logo span { color: var(--primary); }
.auth-title { font-size: 20px; font-weight: 800; color: var(--dark); margin-bottom: 4px; }
.auth-sub   { font-size: 13px; color: var(--muted); margin-bottom: 24px; }
.form-label { font-size: 12px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 5px; }
.form-input {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 14px;
    outline: none;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s;
    margin-bottom: 14px;
}
.form-input:focus { border-color: var(--primary); background: #fff; }
.btn-auth {
    width: 100%;
    padding: 13px;
    background: var(--primary-grad);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 6px;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(99,102,241,0.3);
}
.btn-auth:hover { opacity: 0.9; transform: translateY(-1px); }
.auth-divider { text-align: center; font-size: 13px; color: var(--muted); margin: 16px 0; }
.auth-footer  { text-align: center; font-size: 13px; color: var(--muted); margin-top: 20px; }
.auth-footer a { color: var(--primary); font-weight: 600; }
.alert-box { border-radius: 10px; padding: 12px 14px; font-size: 13px; margin-bottom: 14px; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .stats-strip { grid-template-columns: repeat(2, 1fr); }
    .hero { padding: 48px 0 40px; }
    .hero p { font-size: 14px; }
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .products-grid { grid-template-columns: repeat(2, 1fr); }
    .filter-inner { flex-direction: column; align-items: stretch; }
    .footer-bottom { flex-direction: column; text-align: center; }
}
@media (max-width: 480px) {
    .products-grid { grid-template-columns: 1fr; }
    .cat-grid { grid-template-columns: repeat(3, 1fr); }
    .stats-strip { grid-template-columns: repeat(2, 1fr); }
    .nav-inner { padding: 0 12px; gap: 10px; }
}
