/* ============================================
   MarketPlace - Design System
   Dark Mode with Electric Purple/Cyan
   ============================================ */

/* ---- CSS Variables ---- */
:root {
    --bg-primary: #faf9ff;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f5f3ff;
    --bg-card: #ffffff;
    --bg-hover: #f5f3ff;
    --bg-input: #ffffff;

    --accent-primary: #a16ae8;
    --accent-primary-hover: #8b5cf6;
    --accent-primary-light: rgba(161, 106, 232, 0.1);
    --accent-secondary: #7c3ed0;
    --accent-secondary-hover: #6d28d9;
    --accent-secondary-light: rgba(124, 62, 208, 0.1);
    --accent-pink: #c084fc;
    --accent-pink-light: rgba(192, 132, 252, 0.1);
    --accent-orange: #9333ea;
    --accent-orange-light: rgba(147, 51, 234, 0.1);
    --accent-gradient: linear-gradient(135deg, #a16ae8, #7c3ed0);
    --accent-gradient-hover: linear-gradient(135deg, #8b5cf6, #6d28d9);
    --accent-gradient-2: linear-gradient(135deg, #a16ae8, #c084fc);
    --accent-gradient-3: linear-gradient(135deg, #7c3ed0, #a16ae8);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-accent: #a16ae8;

    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --info: #a16ae8;
    --info-bg: rgba(161, 106, 232, 0.1);

    --border: #e9e5ff;
    --border-light: #f5f3ff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 20px rgba(161, 106, 232, 0.15);
    --shadow-glow-pink: 0 0 20px rgba(192, 132, 252, 0.15);
    --shadow-glow-cyan: 0 0 20px rgba(124, 62, 208, 0.15);

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

    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --container-width: 1280px;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    width: 100%;
}
html { overflow-x: hidden; width: 100%; }

a { color: var(--accent-secondary); text-decoration: none; transition: var(--transition-fast); }
a:hover { color: var(--text-accent); }

img { max-width: 100%; height: auto; }

/* ---- Container ---- */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ---- Top Bar ---- */
.top-bar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 6px 0;
    font-size: 0.8rem;
}
.top-bar .container { display: flex; justify-content: space-between; align-items: center; }
.top-bar-left { color: var(--text-secondary); }
.top-bar-left i { color: var(--accent-secondary); margin-right: 6px; }
.top-bar-right { display: flex; gap: 16px; }
.top-bar-right a { color: var(--text-secondary); font-weight: 500; }
.top-bar-right a:hover { color: var(--text-primary); }

/* ---- Main Header ---- */
.main-header {
    background: var(--bg-secondary);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.92);
}
.main-header .container { display: flex; align-items: center; justify-content: space-between; gap: 32px; }

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    color: var(--text-primary);
    white-space: nowrap;
}
.logo i {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.6rem;
}
.logo strong { color: var(--accent-secondary); -webkit-text-fill-color: var(--accent-secondary); }

/* Search Bar */
.search-bar {
    flex: 1;
    max-width: 700px;
    position: relative;
    display: flex;
}
.search-bar input {
    flex: 1;
    padding: 10px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-right: none;
    border-radius: var(--radius) 0 0 var(--radius);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-family);
    outline: none;
    transition: var(--transition);
}
.search-bar input:focus { 
    border-color: var(--accent-primary); 
    box-shadow: 0 0 0 4px var(--accent-primary-light), 0 8px 16px -4px rgba(161, 106, 232, 0.15);
}
.search-bar input::placeholder { color: var(--text-muted); }
.search-bar button {
    padding: 0 18px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 0 var(--radius) var(--radius) 0;
    color: white;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
}
.search-bar button:hover { opacity: 0.9; transform: scale(1.02); }

/* Search Suggestions */
.search-suggestions {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    max-height: 350px;
    overflow-y: auto;
}
.search-suggestions.active { display: block; }
.search-suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: var(--transition-fast);
}
.search-suggestion-item:hover { background: var(--bg-hover); }
.search-suggestion-item img { width: 40px; height: 40px; object-fit: cover; border-radius: var(--radius-sm); }
.search-suggestion-item .suggestion-text { flex: 1; }
.search-suggestion-item .suggestion-price { color: var(--accent-secondary); font-weight: 600; }

/* Header Nav */
.header-nav { display: flex; align-items: center; gap: 12px; }
.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 0.9rem;
    transition: var(--transition);
    position: relative;
    text-decoration: none;
}
.nav-btn:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border); }
.nav-avatar { width: 28px; height: 28px; border-radius: var(--radius-full); object-fit: cover; }
.nav-username { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-badge {
    position: absolute;
    top: 2px; right: 2px;
    background: var(--accent-gradient);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    width: 18px; height: 18px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}

/* Dropdown Menu */
.nav-dropdown { position: relative; }
.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 240px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    overflow: hidden;
    animation: fadeDown 0.2s ease;
}
.dropdown-menu.active { display: block; }
.dropdown-header { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.dropdown-header strong { display: block; color: var(--text-primary); }
.dropdown-header small { color: var(--text-muted); font-size: 0.8rem; }
.dropdown-menu a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; color: var(--text-secondary);
    transition: var(--transition-fast);
}
.dropdown-menu a:hover { background: var(--bg-hover); color: var(--text-primary); }
.dropdown-menu a i { width: 18px; text-align: center; font-size: 0.9rem; }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }
.text-danger { color: var(--danger) !important; }

/* Categories Nav */
.categories-nav {
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
}
.categories-nav::-webkit-scrollbar { display: none; }
.categories-nav .container { display: flex; gap: 4px; padding: 6px 20px; }
.cat-link {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
    transition: var(--transition);
}
.cat-link:hover { background: var(--accent-primary-light); color: var(--accent-primary); }
.cat-link i { font-size: 0.8rem; }

/* ---- Mobile Search Button ---- */
.mobile-search-btn { display: none; }

/* ---- Mobile Menu ---- */
.mobile-menu-btn { display: none; }
.mobile-menu {
    display: none;
    position: fixed;
    top: 0; right: -300px;
    width: 300px; height: 100vh;
    background: var(--bg-secondary);
    z-index: 1000;
    transition: right 0.3s ease;
    flex-direction: column;
}
.mobile-menu.active { right: 0; display: flex; }
.mobile-menu-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
    font-weight: 600; font-size: 1.1rem;
}
.mobile-menu-header button { background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 1.2rem; }
.mobile-menu-body { padding: 16px; overflow-y: auto; flex: 1; }
.mobile-menu-body a {
    display: flex; align-items: center; gap: 12px;
    padding: 12px; color: var(--text-secondary);
    border-radius: var(--radius); transition: var(--transition);
}
.mobile-menu-body a:hover { background: var(--bg-hover); color: var(--text-primary); }
.mobile-menu-body a i { width: 20px; text-align: center; }
.mobile-user-info {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 12px; margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.mobile-user-info img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.mobile-user-info strong { display: block; }
.mobile-user-info small { color: var(--text-muted); }
.mobile-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 999;
}
.mobile-overlay.active { display: block; }

/* ---- Toast Notifications ---- */
.toast-container {
    position: fixed; top: 80px; right: 20px;
    z-index: 9999;
    display: flex; flex-direction: column; gap: 8px;
}
.toast {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    min-width: 300px;
}
.toast i { font-size: 1.2rem; }
.toast span { flex: 1; }
.toast-close { background: none; border: none; color: var(--text-muted); cursor: pointer; }
.toast-success { border-left: 4px solid var(--success); }
.toast-success i { color: var(--success); }
.toast-danger { border-left: 4px solid var(--danger); }
.toast-danger i { color: var(--danger); }
.toast-warning { border-left: 4px solid var(--warning); }
.toast-warning i { color: var(--warning); }
.toast-info { border-left: 4px solid var(--info); }
.toast-info i { color: var(--info); }

/* ---- Main Content ---- */
.main-content { min-height: 60vh; padding-bottom: 40px; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 24px;
    border: none; border-radius: var(--radius);
    font-family: var(--font-family);
    font-size: 0.9rem; font-weight: 600;
    cursor: pointer; transition: var(--transition);
    text-decoration: none; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent-gradient); color: white; box-shadow: 0 4px 16px rgba(124,58,237,0.3); }
.btn-primary:hover { box-shadow: 0 6px 24px rgba(124,58,237,0.4); color: white; }
.btn-secondary { background: var(--bg-tertiary); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--accent-primary); color: white; }
.btn-outline { background: transparent; color: var(--accent-primary); border: 1px solid var(--accent-primary); }
.btn-outline:hover { background: var(--accent-primary-light); color: var(--accent-primary); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-ghost { background: none; border: none; color: var(--text-secondary); padding: 8px; }
.btn-ghost:hover { color: var(--text-primary); }
.btn-lg { padding: 14px 32px; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-full { width: 100%; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: var(--radius-full); }

/* ---- 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: rgba(124,58,237,0.3); box-shadow: var(--shadow-glow); transform: translateY(-2px); }
.card-body { padding: 16px; }
.card-header { padding: 16px; border-bottom: 1px solid var(--border); }
.card-footer { padding: 16px; border-top: 1px solid var(--border); }

/* ---- Product Card ---- */
.product-card { position: relative; }
.product-card-image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--bg-tertiary);
}
.product-card-image img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.product-card:hover .product-card-image img { transform: scale(1.08); }
.product-card-badges {
    position: absolute; top: 10px; left: 10px;
    display: flex; flex-direction: column; gap: 4px;
}
.product-badge {
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-digital { background: var(--accent-secondary-light); color: var(--accent-secondary); }
.badge-new { background: var(--success-bg); color: var(--success); }
.badge-sale { background: var(--danger-bg); color: var(--danger); }
.badge-featured { background: var(--accent-primary-light); color: var(--accent-primary); }
.product-card-wishlist {
    position: absolute; top: 10px; right: 10px;
    width: 34px; height: 34px;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    border: none; border-radius: 50%;
    color: white; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
    font-size: 0.85rem;
}
.product-card-wishlist:hover { background: var(--danger); transform: scale(1.1); }
.product-card-wishlist.active { background: var(--danger); }
.product-card-info { padding: 14px; }
.product-card-title {
    font-size: 0.9rem; font-weight: 500;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-clamp: 3;
    overflow: hidden; margin-bottom: 6px;
    line-height: 1.3;
}
.product-card-title a { color: inherit; }
.product-card-title a:hover { color: var(--accent-secondary); }
.product-card-price { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.product-card-price .current-price { font-size: 1.2rem; font-weight: 700; color: var(--text-primary); }
.product-card-price .original-price {
    font-size: 0.85rem; color: var(--text-muted);
    text-decoration: line-through;
}
.product-card-price .discount {
    font-size: 0.75rem; font-weight: 700;
    color: var(--success);
}
.product-card-meta { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--text-muted); }
.product-card-shipping { color: var(--success); font-weight: 500; }
.product-card-shipping i { margin-right: 3px; }

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

/* ---- Hero Section ---- */
.hero {
    padding: 60px 0 50px;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-tertiary) 40%, rgba(139,92,246,0.06) 70%, var(--bg-primary) 100%);
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%; right: -20%;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(139,92,246,0.15) 0%, rgba(236,72,153,0.05) 40%, transparent 70%);
    border-radius: 50%;
}
.hero::after {
    content: '';
    position: absolute;
    bottom: -30%; left: -10%;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(34,211,238,0.12) 0%, rgba(249,115,22,0.04) 50%, transparent 70%);
    border-radius: 50%;
}
.hero .container { position: relative; z-index: 1; }
.hero-content { max-width: 600px; }
.hero h1 { font-size: 2.8rem; font-weight: 800; line-height: 1.15; margin-bottom: 16px; }
.hero h1 span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero p { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 28px; line-height: 1.7; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---- Categories Grid ---- */
.section { padding: 50px 0; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.section-header h2 { font-size: 1.5rem; font-weight: 700; }
.section-header a { color: var(--accent-secondary); font-weight: 500; }

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}
.category-card {
    display: flex; flex-direction: column; align-items: center;
    gap: 10px; padding: 24px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: var(--transition);
    text-decoration: none;
}
.category-card:hover {
    border-color: var(--accent-primary);
    background: var(--accent-primary-light);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}
.category-card i {
    font-size: 2rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.category-card span { color: var(--text-secondary); font-size: 0.85rem; font-weight: 500; }
.category-card:hover span { color: var(--text-primary); }

/* ---- Forms ---- */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block; margin-bottom: 6px;
    font-size: 0.85rem; font-weight: 600;
    color: var(--text-secondary);
}
.form-control {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}
.form-control:focus { border-color: var(--accent-primary); box-shadow: 0 0 0 3px var(--accent-primary-light); }
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { min-height: 120px; resize: vertical; }
select.form-control { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.form-text { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
.form-error { color: var(--danger); font-size: 0.8rem; margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Checkbox & Radio */
.form-check {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 0; cursor: pointer;
}
.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    appearance: none; width: 18px; height: 18px;
    border: 2px solid var(--border);
    border-radius: 4px;
    background: var(--bg-input);
    cursor: pointer; transition: var(--transition);
    position: relative;
}
.form-check input[type="radio"] { border-radius: 50%; }
.form-check input:checked {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}
.form-check input:checked::after {
    content: '✓'; position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: white; font-size: 0.7rem; font-weight: 700;
}
.form-check label { font-size: 0.9rem; color: var(--text-secondary); cursor: pointer; }

/* ---- Auth Page ---- */
.auth-page {
    display: flex; align-items: center; justify-content: center;
    min-height: 60vh; padding: 40px 20px;
}
.auth-card {
    width: 100%; max-width: 440px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}
.auth-card h1 {
    font-size: 1.6rem; font-weight: 700;
    text-align: center; margin-bottom: 8px;
}
.auth-card .subtitle {
    text-align: center; color: var(--text-secondary);
    margin-bottom: 28px; font-size: 0.9rem;
}
.auth-divider {
    display: flex; align-items: center; gap: 12px;
    margin: 20px 0; color: var(--text-muted); font-size: 0.8rem;
}
.auth-divider::before, .auth-divider::after {
    content: ''; flex: 1; height: 1px;
    background: var(--border);
}
.auth-footer { text-align: center; margin-top: 20px; font-size: 0.9rem; color: var(--text-secondary); }
.auth-footer a { color: var(--accent-secondary); font-weight: 600; }

/* ---- Badges ---- */
.badge {
    display: inline-flex; align-items: center;
    padding: 4px 10px; border-radius: var(--radius-full);
    font-size: 0.75rem; font-weight: 600;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-primary { background: var(--accent-primary-light); color: var(--accent-primary); }
.badge-secondary { background: var(--accent-secondary-light); color: var(--accent-secondary); }

/* ---- Product Detail ---- */
.product-detail { padding: 30px 0; }
.product-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.product-gallery { position: relative; }
.gallery-main {
    aspect-ratio: 1; border-radius: var(--radius-lg);
    overflow: hidden; background: var(--bg-tertiary);
    border: 1px solid var(--border);
}
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-thumbnails { display: flex; gap: 8px; margin-top: 12px; }
.gallery-thumb {
    width: 72px; height: 72px;
    border-radius: var(--radius);
    overflow: hidden; cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
    background: var(--bg-tertiary);
}
.gallery-thumb:hover, .gallery-thumb.active { border-color: var(--accent-primary); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }

.product-info h1 { font-size: 1.6rem; font-weight: 700; margin-bottom: 8px; line-height: 1.3; }
.product-info .product-condition { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 12px; }
.product-info .product-review-summary {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 16px;
}
.product-info .price-section {
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
}
.price-section .price-main { font-size: 2.2rem; font-weight: 800; }
.price-section .price-original {
    font-size: 1rem; color: var(--text-muted);
    text-decoration: line-through; margin-left: 12px;
}
.price-section .price-discount {
    display: inline-block; margin-left: 10px;
    color: var(--success); font-weight: 700; font-size: 1rem;
}
.price-section .installments {
    margin-top: 8px; color: var(--text-secondary); font-size: 0.9rem;
}
.price-section .installments strong { color: var(--success); }

.product-shipping {
    display: flex; align-items: center; gap: 10px;
    padding: 14px; background: var(--success-bg);
    border-radius: var(--radius); margin-bottom: 16px;
    color: var(--success); font-weight: 500;
}

.product-actions { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }

.quantity-selector {
    display: flex; align-items: center; gap: 6px;
    margin-bottom: 16px;
}
.quantity-selector label { color: var(--text-secondary); font-size: 0.9rem; margin-right: 8px; }
.quantity-selector button {
    width: 34px; height: 34px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
    font-size: 1rem;
}
.quantity-selector button:hover { border-color: var(--accent-primary); }
.quantity-selector input {
    width: 50px; text-align: center;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    padding: 6px;
    font-family: var(--font-family);
    font-size: 0.95rem;
}

.seller-card {
    display: flex; align-items: center; gap: 12px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    margin-top: 16px;
}
.seller-card img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.seller-card .seller-name { font-weight: 600; }
.seller-card .seller-meta { font-size: 0.8rem; color: var(--text-muted); }

/* Product Detail tabs */
.product-tabs { margin-top: 40px; }
.tabs-nav { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tab-btn {
    padding: 12px 24px;
    background: none; border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-family: var(--font-family);
    font-size: 0.95rem; font-weight: 600;
    cursor: pointer; transition: var(--transition);
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--accent-primary); border-bottom-color: var(--accent-primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }
.tab-content .description-text { color: var(--text-secondary); line-height: 1.8; }

/* ---- Star Rating ---- */
.star-rating { display: inline-flex; gap: 2px; color: var(--warning); }
.star-rating .far { color: var(--text-muted); }

/* Reviews */
.review-card {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}
.review-header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.review-header img { width: 36px; height: 36px; border-radius: 50%; }
.review-header .reviewer-name { font-weight: 600; }
.review-header .review-date { font-size: 0.8rem; color: var(--text-muted); }
.review-body { color: var(--text-secondary); line-height: 1.6; }

/* ---- Cart Page ---- */
.cart-page .container { display: grid; grid-template-columns: 1fr 360px; gap: 30px; padding-top: 30px; }
.cart-items { display: flex; flex-direction: column; gap: 16px; }
.cart-item {
    display: flex; gap: 16px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.cart-item-image {
    width: 120px; height: 120px;
    border-radius: var(--radius);
    overflow: hidden; background: var(--bg-tertiary);
    flex-shrink: 0;
}
.cart-item-image img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info { flex: 1; display: flex; flex-direction: column; }
.cart-item-info h3 { font-size: 1rem; font-weight: 500; margin-bottom: 4px; overflow-wrap: break-word; word-break: break-word; }

.cart-item-info h3 a { color: var(--text-primary); }
.cart-item-info .item-seller { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 8px; }
.cart-item-info .item-type { font-size: 0.75rem; }
.cart-item-actions {
    display: flex; align-items: center; gap: 12px;
    margin-top: auto;
}
.cart-item-price { text-align: right; min-width: 100px; }
.cart-item-price .price-current { font-size: 1.2rem; font-weight: 700; }
.cart-item-price .price-old { font-size: 0.8rem; color: var(--text-muted); text-decoration: line-through; }

/* Cart Summary */
.cart-summary {
    position: sticky; top: 80px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    height: fit-content;
}
.cart-summary h2 { font-size: 1.2rem; margin-bottom: 20px; }
.summary-row { display: flex; justify-content: space-between; padding: 10px 0; font-size: 0.95rem; }
.summary-row.total {
    border-top: 2px solid var(--border);
    margin-top: 8px; padding-top: 16px;
    font-size: 1.2rem; font-weight: 700;
}
.summary-row .free { color: var(--success); font-weight: 600; }

/* ---- Checkout ---- */
.checkout-page .container { display: grid; grid-template-columns: 1fr 380px; gap: 30px; padding-top: 30px; }
.checkout-step {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
}
.checkout-step h2 {
    display: flex; align-items: center; gap: 12px;
    font-size: 1.2rem; margin-bottom: 20px;
}
.step-number {
    width: 32px; height: 32px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.9rem; font-weight: 700; color: white;
}

/* Payment Methods */
.payment-methods { display: flex; flex-direction: column; gap: 10px; }
.payment-method {
    display: flex; align-items: center; gap: 14px;
    padding: 16px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer; transition: var(--transition);
}
.payment-method:hover { border-color: var(--accent-primary); }
.payment-method.selected { border-color: var(--accent-primary); background: var(--accent-primary-light); }
.payment-method i { font-size: 1.5rem; width: 30px; text-align: center; }
.payment-method .method-name { font-weight: 600; }
.payment-method .method-desc { font-size: 0.8rem; color: var(--text-muted); }

/* ---- Dashboard ---- */
.dashboard { padding: 30px 0; }
.dashboard-header { margin-bottom: 30px; }
.dashboard-header h1 { font-size: 1.8rem; font-weight: 700; }
.dashboard-header p { color: var(--text-secondary); }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}
.stat-card {
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: var(--transition);
}
.stat-card:hover { border-color: rgba(124,58,237,0.3); }
.stat-card .stat-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; margin-bottom: 12px;
}
.stat-card .stat-value { font-size: 1.8rem; font-weight: 800; margin-bottom: 2px; }
.stat-card .stat-label { font-size: 0.85rem; color: var(--text-secondary); }
.stat-icon.purple { background: var(--accent-primary-light); color: var(--accent-primary); }
.stat-icon.cyan { background: var(--accent-secondary-light); color: var(--accent-secondary); }
.stat-icon.green { background: var(--success-bg); color: var(--success); }
.stat-icon.yellow { background: var(--warning-bg); color: var(--warning); }

/* ---- Tables ---- */
.table-wrapper { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
th {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
td { font-size: 0.9rem; color: var(--text-secondary); }
tr:hover td { background: var(--bg-hover); }

/* ---- Order Confirmation ---- */
.confirmation-page { text-align: center; padding: 60px 20px; }
.confirmation-icon {
    width: 80px; height: 80px;
    background: var(--success-bg);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 24px;
    font-size: 2.5rem; color: var(--success);
    animation: scaleIn 0.5s ease;
}
.confirmation-page h1 { font-size: 2rem; margin-bottom: 10px; }
.confirmation-page .order-number { color: var(--accent-secondary); font-size: 1.2rem; font-weight: 600; }

/* ---- Filters Sidebar ---- */
.products-layout { display: grid; grid-template-columns: 260px 1fr; gap: 24px; padding: 30px 0; }
.filters-sidebar {
    position: sticky; top: 80px;
    height: fit-content;
}
.filter-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
}
.filter-section h3 {
    font-size: 0.9rem; font-weight: 600;
    margin-bottom: 14px;
    display: flex; align-items: center; gap: 8px;
}
.filter-section h3 i { color: var(--accent-primary); }

.price-range { display: flex; gap: 10px; align-items: center; }
.price-range input {
    width: 100%; padding: 8px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.85rem;
}
.price-range span { color: var(--text-muted); }

.products-header {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 20px;
}
.products-header .results-count { color: var(--text-muted); font-size: 0.9rem; }

.sort-select {
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font-family);
    cursor: pointer;
}

/* ---- Sell Page ---- */
.sell-page { padding: 30px 0; }
.sell-page .container { max-width: 800px; }
.sell-form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 36px;
}
.sell-form h1 {
    font-size: 1.5rem; margin-bottom: 8px;
}
.sell-form .subtitle { color: var(--text-secondary); margin-bottom: 28px; }

.image-upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}
.image-upload-area:hover { border-color: var(--accent-primary); background: var(--accent-primary-light); }
.image-upload-area i { font-size: 2.5rem; color: var(--text-muted); margin-bottom: 12px; }
.image-upload-area p { color: var(--text-secondary); }
.image-upload-area .note { font-size: 0.8rem; color: var(--text-muted); margin-top: 6px; }
.image-previews { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.image-preview {
    width: 80px; height: 80px;
    border-radius: var(--radius);
    overflow: hidden; position: relative;
    border: 1px solid var(--border);
}
.image-preview img { width: 100%; height: 100%; object-fit: cover; }
.image-preview .remove-image {
    position: absolute; top: 2px; right: 2px;
    width: 20px; height: 20px;
    background: var(--danger);
    border: none; border-radius: 50%;
    color: white; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.6rem;
}

/* Type Toggle */
.type-toggle { display: flex; gap: 12px; margin-bottom: 20px; }
.type-option {
    flex: 1; padding: 20px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    text-align: center; cursor: pointer;
    transition: var(--transition);
}
.type-option:hover { border-color: var(--accent-primary); }
.type-option.selected { border-color: var(--accent-primary); background: var(--accent-primary-light); }
.type-option i { font-size: 2rem; margin-bottom: 8px; display: block; }
.type-option .type-name { font-weight: 600; }
.type-option .type-desc { font-size: 0.8rem; color: var(--text-muted); }

/* ---- Profile Page ---- */
.profile-page { padding: 30px 0; }
.profile-grid { display: grid; grid-template-columns: 300px 1fr; gap: 30px; }
.profile-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 30px;
    text-align: center;
    height: fit-content;
}
.profile-avatar {
    width: 100px; height: 100px;
    border-radius: 50%; object-fit: cover;
    margin: 0 auto 16px;
    border: 3px solid var(--accent-primary);
}
.profile-sidebar h2 { font-size: 1.2rem; margin-bottom: 4px; }
.profile-sidebar .username { color: var(--text-muted); margin-bottom: 12px; }
.profile-sidebar .member-since { font-size: 0.8rem; color: var(--text-muted); }

.profile-form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 30px;
}

/* ---- Wishlist ---- */
.wishlist-page { padding: 30px 0; }

/* ---- Order Tracking ---- */
.order-timeline { padding: 20px 0; }
.timeline-step {
    display: flex; gap: 16px;
    padding-bottom: 24px;
    position: relative;
}
.timeline-step::before {
    content: '';
    position: absolute;
    left: 15px; top: 32px;
    width: 2px; height: calc(100% - 32px);
    background: var(--border);
}
.timeline-step:last-child::before { display: none; }
.timeline-dot {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; color: var(--text-muted);
    flex-shrink: 0;
}
.timeline-step.completed .timeline-dot { background: var(--success); border-color: var(--success); color: white; }
.timeline-step.active .timeline-dot { background: var(--accent-primary); border-color: var(--accent-primary); color: white; }
.timeline-info h4 { font-size: 0.95rem; }
.timeline-info .timeline-date { font-size: 0.8rem; color: var(--text-muted); }

/* ---- Pagination ---- */
.pagination { display: flex; justify-content: center; gap: 6px; padding: 30px 0; }
.pagination a, .pagination span {
    display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px;
    border-radius: var(--radius);
    font-size: 0.9rem; font-weight: 500;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: var(--transition);
}
.pagination a:hover { border-color: var(--accent-primary); color: var(--accent-primary); }
.pagination .active { background: var(--accent-gradient); border-color: transparent; color: white; }

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}
.empty-state i { font-size: 4rem; color: var(--text-muted); margin-bottom: 16px; }
.empty-state h2 { font-size: 1.5rem; margin-bottom: 8px; }
.empty-state p { color: var(--text-secondary); margin-bottom: 24px; }

/* ---- 404 Page ---- */
.page-404 { text-align: center; padding: 80px 20px; }
.page-404 h1 {
    font-size: 6rem; font-weight: 900;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.page-404 p { color: var(--text-secondary); font-size: 1.2rem; margin-bottom: 24px; }

/* ---- Footer ---- */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 50px 0 20px;
    margin-top: 60px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}
.footer-logo {
    display: flex; align-items: center; gap: 10px;
    font-size: 1.3rem; margin-bottom: 14px; color: var(--text-primary);
}
.footer-logo i {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.footer-logo strong { color: var(--accent-secondary); -webkit-text-fill-color: var(--accent-secondary); }
.site-footer p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; }
.footer-social { display: flex; gap: 10px; margin-top: 16px; }
.footer-social a {
    width: 36px; height: 36px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
}
.footer-social a:hover { background: var(--accent-primary); color: white; border-color: var(--accent-primary); }
.footer-col h4 { font-size: 0.9rem; font-weight: 600; margin-bottom: 14px; color: var(--text-primary); }
.footer-col a { display: block; color: var(--text-secondary); padding: 5px 0; font-size: 0.85rem; }
.footer-col a:hover { color: var(--accent-secondary); }
.footer-security { font-size: 0.85rem; line-height: 2; }
.footer-security i { color: var(--accent-secondary); margin-right: 4px; }
.footer-bottom {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: 0.8rem; color: var(--text-muted);
}
.footer-payment-icons { display: flex; gap: 12px; font-size: 1.5rem; color: var(--text-muted); }

/* ---- Animations ---- */
@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideIn {
    from { opacity: 0; transform: translateX(60px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: 200px 0; }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-hover) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius);
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .product-detail-grid { grid-template-columns: 1fr; }
    .products-layout { grid-template-columns: 1fr; }
    .filters-sidebar { position: static; }
    .checkout-page .container { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .profile-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .top-bar { display: none; }
    .logo-text { display: none; }
    .logo { margin-right: 0; }
    .mobile-menu-btn { display: flex; }
    .container { padding: 0 12px; }
    .main-content { padding: 0 0 40px; }
    .cart-page .container { grid-template-columns: 1fr; gap: 16px; padding-top: 16px; }


    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .footer-bottom { flex-direction: column; gap: 10px; }
    .categories-grid { grid-template-columns: repeat(3, 1fr); }
    .form-row { grid-template-columns: 1fr; }
    .auth-card { padding: 28px 24px; }
    .sell-form { padding: 24px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    
    /* Better Header for Mobile */
    .main-header { padding: 8px 0; }
    .main-header .container { 
        gap: 16px; 
        flex-wrap: wrap; 
        justify-content: space-between;
    }
    .logo { order: 1; }
    .header-nav { order: 2; gap: 8px; }
    .header-search-container {
        order: 3;
        width: 100%;
        display: block !important;
        position: static !important;
        padding: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
    }
    .search-bar { width: 100%; max-width: none; }
    .search-bar input { padding: 6px 10px; font-size: 0.8rem; }
    .search-bar button { padding: 0 10px; }
    
    .header-nav { order: 2; gap: 8px; }
    .nav-btn { padding: 6px 6px; font-size: 1.1rem; }
    .nav-btn .fa-chevron-down { display: none; }
    .nav-username, .nav-btn span:not(.cart-badge) { display: none; }
    .nav-avatar { width: 22px; height: 22px; }


    
    .categories-nav .container { gap: 8px; padding: 2px 10px; overflow-x: auto; flex-wrap: nowrap; }
    .cat-link { padding: 4px 6px; font-size: 0.7rem; white-space: nowrap; }
    .cat-link i { font-size: 0.65rem; }
    
    /* Product Card Mobile Adjustments */
    .product-card-title { font-size: 0.75rem; -webkit-line-clamp: 2; line-clamp: 2; height: 2.1rem; overflow: hidden; }
    .product-card-price .current-price { font-size: 0.95rem; }
    
    /* Tables on Mobile */
    .table-wrapper { margin: 0 -16px; width: calc(100% + 32px); }
    th, td { padding: 8px 6px; font-size: 0.7rem; }

    /* Cart Refinements Mobile */
    .cart-item { padding: 12px; gap: 12px; }
    .cart-item-image { width: 80px; height: 80px; }
    .cart-item-info h3 { font-size: 0.95rem; }
    .cart-item-actions { margin-top: 12px; flex-wrap: wrap; gap: 8px; }

    .cart-item-price { text-align: left; min-width: 0; margin-top: 4px; }
    .btn-sm { padding: 6px 10px; }
    .cart-summary { position: static; margin-top: 10px; padding: 20px; }

}

@media (max-width: 480px) {
    .main-header .container { gap: 4px; }
    .logo i { font-size: 1.2rem; }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
    .categories-grid { grid-template-columns: repeat(3, 1fr); }
    .hero { padding: 25px 0 15px; }
    .hero h1 { font-size: 1.3rem; }
    .hero-actions .btn { padding: 10px 16px; font-size: 0.85rem; }
    .section-header h2 { font-size: 1rem; }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--bg-hover); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-primary); }

/* ---- Selection ---- */
::selection { background: var(--accent-primary); color: white; }

/* ============================================
   Admin Panel Styles
   ============================================ */

@media (max-width: 900px) {
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar { 
        position: static; 
        height: auto; 
        border-right: none; 
        border-bottom: 1px solid var(--border);
        padding: 10px 0;
    }
    .admin-sidebar-header { display: none; }
    .admin-nav { 
        display: flex; 
        overflow-x: auto; 
        padding: 0 10px; 
        gap: 8px;
        scrollbar-width: none;
    }
    .admin-nav::-webkit-scrollbar { display: none; }
    .admin-nav-item { 
        white-space: nowrap; 
        margin-bottom: 0;
        padding: 8px 14px;
        background: var(--bg-tertiary);
    }
    .admin-nav-label, .admin-nav-divider { display: none; }
    .admin-content { padding: 20px 15px; }
    .admin-stats { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
    .admin-stats { grid-template-columns: 1fr; }
    .admin-page-header { flex-direction: column; align-items: flex-start; gap: 15px; }
    .admin-charts { grid-template-columns: 1fr; }
}

/* Admin Content */
.admin-content {
    padding: 30px;
    max-width: 1200px;
}
.admin-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}
.admin-page-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}
.admin-page-header h1 i {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.admin-page-header p {
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Admin Stats */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}
.admin-stat-card {
    padding: 22px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}
.admin-stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
}
.admin-stat-card:nth-child(1)::before { background: var(--accent-gradient); }
.admin-stat-card:nth-child(2)::before { background: linear-gradient(90deg, #f59e0b, #8b5cf6); }
.admin-stat-card:nth-child(3)::before { background: linear-gradient(90deg, #ec4899, #f97316); }
.admin-stat-card:nth-child(4)::before { background: linear-gradient(90deg, #34d399, #f59e0b); }
.admin-stat-card:nth-child(5)::before { background: linear-gradient(90deg, #fbbf24, #f97316); }
.admin-stat-card:nth-child(6)::before { background: linear-gradient(90deg, #f87171, #ec4899); }
.admin-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
}
.admin-stat-card .stat-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius-lg);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 14px;
}
.admin-stat-card .stat-value {
    font-size: 2rem; font-weight: 800;
    margin-bottom: 2px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.admin-stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.admin-stat-card .stat-change {
    position: absolute;
    top: 16px; right: 16px;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}
.stat-change.up { background: var(--success-bg); color: var(--success); }
.stat-change.down { background: var(--danger-bg); color: var(--danger); }

/* Admin Table */
.admin-table-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
}
.admin-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}
.admin-table-header h3 { font-size: 1.05rem; }
.admin-table-header .table-actions {
    display: flex; gap: 8px;
}
.admin-table-filter {
    display: flex; gap: 8px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    flex-wrap: wrap;
}

/* Claim badges */
.claim-type { text-transform: capitalize; }
.claim-open { background: var(--warning-bg); color: var(--warning); }
.claim-in_review { background: var(--info-bg); color: var(--info); }
.claim-resolved { background: var(--success-bg); color: var(--success); }
.claim-rejected { background: var(--danger-bg); color: var(--danger); }

/* Shipping guide card */
.guide-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 12px;
    transition: var(--transition);
}
.guide-card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}
.guide-card .guide-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px;
}
.guide-card .guide-order {
    font-weight: 700;
    font-size: 1rem;
}
.guide-card .guide-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    font-size: 0.85rem;
}
.guide-card .guide-details .detail-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-bottom: 2px;
}

/* Admin Charts area */
.admin-charts {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}
.admin-chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}
.admin-chart-card h3 {
    margin-bottom: 16px;
    font-size: 1rem;
}

/* Mini bar chart */
.mini-chart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 120px;
    padding-top: 10px;
}
.mini-chart .chart-bar {
    flex: 1;
    border-radius: 4px 4px 0 0;
    transition: var(--transition);
    position: relative;
    cursor: pointer;
    min-height: 8px;
}
.mini-chart .chart-bar:hover {
    opacity: 0.8;
    transform: scaleY(1.05);
    transform-origin: bottom;
}
.mini-chart .chart-bar .bar-label {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Color bars for chart */
.bar-purple { background: linear-gradient(to top, #8b5cf6, #c4b5fd); }
.bar-pink { background: linear-gradient(to top, #ec4899, #f9a8d4); }
.bar-cyan { background: linear-gradient(to top, #22d3ee, #a5f3fc); }
.bar-orange { background: linear-gradient(to top, #f97316, #fdba74); }
.bar-green { background: linear-gradient(to top, #34d399, #a7f3d0); }

/* Activity list */
.activity-list { display: flex; flex-direction: column; gap: 12px; }
.activity-item {
    display: flex; gap: 12px;
    padding: 10px;
    border-radius: var(--radius);
    transition: var(--transition);
}
.activity-item:hover { background: var(--bg-hover); }
.activity-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}
.activity-icon.purple { background: var(--accent-primary-light); color: var(--accent-primary); }
.activity-icon.pink { background: var(--accent-pink-light); color: var(--accent-pink); }
.activity-icon.cyan { background: var(--accent-secondary-light); color: var(--accent-secondary); }
.activity-icon.green { background: var(--success-bg); color: var(--success); }
.activity-icon.orange { background: var(--accent-orange-light); color: var(--accent-orange); }
.activity-text { font-size: 0.85rem; }
.activity-text strong { color: var(--text-primary); }
.activity-time { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* Admin modal */
.admin-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.admin-modal-overlay.active { display: flex; }
.admin-modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 32px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: scaleIn 0.2s ease;
}
.admin-modal h2 { margin-bottom: 20px; font-size: 1.3rem; }

/* Responsive admin */
@media (max-width: 1024px) {
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar {
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 16px 0;
    }
    .admin-nav { display: flex; flex-wrap: wrap; gap: 4px; }
    .admin-stats { grid-template-columns: repeat(2, 1fr); }
    .admin-charts { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .admin-stats { grid-template-columns: 1fr; }
    .admin-content { padding: 20px; }
    .guide-card .guide-details { grid-template-columns: 1fr; }
}
/* Dispute Chat System */
.claim-container {
    max-width: 900px;
    margin: 40px auto;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
}

.claim-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.claim-chat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    height: 700px;
}

.chat-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: var(--bg-primary);
}

.message-bubble {
    max-width: 80%;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.message-bubble.me {
    align-self: flex-end;
}

.message-content {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.message-bubble.me .message-content {
    background: var(--accent-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-bubble:not(.me) .message-content {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.message-bubble.admin .message-content {
    background: var(--bg-tertiary);
    border: 1px solid var(--accent-secondary);
    color: var(--text-primary);
}

.message-info {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.message-bubble.me .message-info {
    text-align: right;
}

.chat-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
}

.chat-input-wrapper {
    display: flex;
    gap: 12px;
}

.chat-input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 12px 20px;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

.chat-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-light);
}

@media (max-width: 768px) {
    .claim-container { grid-template-columns: 1fr; }
    .claim-sidebar { order: 2; }
    .claim-chat-card { height: 600px; }
}

/* ---- Notifications ---- */
.notification-item {
    display: flex;
    gap: 16px;
    padding: 20px;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
    position: relative;
    background: var(--bg-card);
}
.notification-item:hover {
    background: var(--bg-tertiary);
    transform: translateX(4px);
}
.notification-item.unread {
    background: var(--accent-primary-light);
    border-left: 4px solid var(--accent-primary);
}
.notification-item.unread::after {
    content: '';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
}
.notification-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.2rem;
    color: var(--accent-primary);
    box-shadow: var(--shadow);
}

/* Out of Stock Styling */
.product-card.out-of-stock {
    opacity: 0.85;
}
.product-card.out-of-stock .product-card-image img {
    filter: grayscale(0.6);
}
.product-card.out-of-stock .product-card-title a {
    color: var(--text-muted);
}

/* Input Groups */
.input-group {
    display: flex;
    align-items: stretch;
}
.input-group-prepend {
    display: flex;
}
.input-group-text {
    display: flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-secondary);
    text-align: center;
    white-space: nowrap;
    background-color: #e9ecef;
    border: 1px solid var(--border);
    border-radius: 4px 0 0 4px;
}
.input-group .form-control {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    flex: 1 1 auto;
    width: 1%;
}

/* Reputation Bar */
.reputation-container {
    margin: 15px 0;
}
.reputation-bar {
    display: flex;
    gap: 4px;
    height: 8px;
    margin-bottom: 8px;
}
.reputation-segment {
    flex: 1;
    background-color: #eee;
    border-radius: 2px;
    transition: all 0.3s ease;
}
.reputation-segment.active {
    transform: scaleY(1.5);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.segment-1.active { background-color: #ef4444; } /* Red */
.segment-2.active { background-color: #f97316; } /* Orange */
.segment-3.active { background-color: #f59e0b; } /* Yellow */
.segment-4.active { background-color: #84cc16; } /* Light Green */
.segment-5.active { background-color: #22c55e; } /* Green */

.reputation-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}
.reputation-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 8px 12px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
