/* ============================================
   MARKETHUB - MAIN STYLESHEET
   Hybrid B2C & P2P Marketplace
   ============================================ */

/* ============================================
   MARKETHUB - GLOBAL VARIABLE CONTROLS
   ============================================ */
/* ============================================
   THEME SYSTEM - "Studio White" (Corporate) is the default (:root).
   5 alternate themes are opt-in overrides via a body class, set by the
   theme switcher in header.php. Every existing variable NAME is kept
   unchanged so the ~20+ files that already reference var(--dark-color),
   var(--text-main), var(--gray-color) etc. pick up each theme automatically.
   ============================================ */
:root {
    /* Brand Accent Colors */
    --primary-color: #0f172a;
    --primary-dark: #000000;
    --primary-light: rgba(15, 23, 42, 0.05);
    --primary-gradient: linear-gradient(135deg, #0f172a, #3b82f6);
    --secondary-color: #6366f1;
    --secondary-dark: #4f46e5;
    --secondary-light: rgba(99, 102, 241, 0.06);

    /* Semantic Feedback Colors */
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #06b6d4;

    /* Layout Interface Neutrals */
    --dark-color: #0f172a;          /* Deep Charcoal for main headings (theme's text-primary) */
    --text-main: #475569;           /* Default content prose color (theme's text-secondary) */
    --gray-color: #64748b;          /* Subtitles, icons, and placeholder states - darkened from #94a3b8 so muted text/placeholders stay readable on white/light-gray surfaces */
    --gray-light: #cbd5e1;          /* Muted borders and weak text links */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-inverse: #ffffff;

    /* Surfaces, Containers and Background Elements */
    --bg-body: #f8fafc;             /* Deliberately the theme's --bg-secondary (not its pure-white --bg-body) so white cards stay visibly separated from the page backdrop */
    --bg-card: #ffffff;             /* Foreground blocks, items, panels, sidebars */
    --bg-sidebar: #f8fafc;          /* Alternating left-hand panel wrappers */
    --light-color: #f8fafc;         /* Standard subtle content rows highlight */
    --bg-secondary: #f8fafc;
    --bg-input: #f1f5f9;

    /* Grid Layout Separators */
    --border-color: #cbd5e1;        /* Standard line division borders - darkened from #e2e8f0 so card/input/chip edges are actually visible on white and off-white surfaces */
    --border-light: #e2e8f0;        /* Faint borders inside cards/tables - darkened from #f1f5f9 for the same reason */
    --border-focus: #0f172a;

    /* Shadow Depth Definitions */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.04);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.04);

    --transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);

    /* Spacing + radius scale (additive - existing components aren't required to adopt these) */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    --spacing-3xl: 80px;
    --spacing-4xl: 120px;
    --border-radius-sm: 8px;
    --border-radius-md: 14px;
    --border-radius-lg: 20px;
    --border-radius-xl: 32px;
}

/* --- Theme: Warm Alabaster (Default reference theme) --- */
body.theme-warm {
    --primary-color: #4361ee;
    --primary-dark: #3a56d4;
    --primary-light: rgba(67, 97, 238, 0.06);
    --primary-gradient: linear-gradient(135deg, #4361ee, #7209b7);
    --secondary-color: #7209b7;
    --secondary-dark: #560bad;
    --secondary-light: rgba(114, 9, 183, 0.06);
    --success-color: #2ec4b6;
    --warning-color: #ffb703;
    --danger-color: #f72585;
    --info-color: #00b4d8;
    --dark-color: #1d2125;
    --text-main: #495057;
    --gray-color: #6b7280;
    --gray-light: #6b7280;
    --text-primary: #1d2125;
    --text-secondary: #495057;
    --text-muted: #6b7280;
    --text-inverse: #ffffff;
    --bg-body: #f1f0ec;
    --bg-card: #ffffff;
    --bg-sidebar: #f0eeea;
    --light-color: #f1f0ec;
    --bg-secondary: #f1f0ec;
    --bg-input: #fafaf9;
    --border-color: rgba(33, 37, 41, 0.18);
    --border-light: rgba(33, 37, 41, 0.09);
    --border-focus: rgba(67, 97, 238, 0.35);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 10px 24px rgba(33, 37, 41, 0.03);
    --shadow-lg: 0 20px 48px rgba(33, 37, 41, 0.06);
    --shadow-xl: 0 30px 70px rgba(33, 37, 41, 0.08);
    --shadow-glow: 0 0 40px rgba(67, 97, 238, 0.05);
}

/* --- Theme: Obsidian Midnight (Dark) --- */
body.theme-dark {
    --primary-color: #5466f9;
    --primary-dark: #4353d8;
    --primary-light: rgba(84, 102, 249, 0.15);
    --primary-gradient: linear-gradient(135deg, #5466f9, #9d4edd);
    --secondary-color: #9d4edd;
    --secondary-dark: #7b2cbf;
    --secondary-light: rgba(157, 78, 221, 0.15);
    --success-color: #00f5d4;
    --warning-color: #fee440;
    --danger-color: #f72585;
    --info-color: #00b4d8;
    --dark-color: #f8fafc;
    --text-main: #cbd5e1;
    --gray-color: #64748b;
    --gray-light: #64748b;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --text-inverse: #0b0f19;
    --bg-body: #121826;
    --bg-card: #1a2236;
    --bg-sidebar: #121826;
    --light-color: #121826;
    --bg-secondary: #121826;
    --bg-input: #0f1422;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.04);
    --border-focus: rgba(84, 102, 249, 0.5);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 10px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 30px 70px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(84, 102, 249, 0.15);
}

/* --- Theme: Nordic Slate (Cool Minimal) --- */
body.theme-nordic {
    --primary-color: #0284c7;
    --primary-dark: #0369a1;
    --primary-light: rgba(2, 132, 199, 0.06);
    --primary-gradient: linear-gradient(135deg, #0284c7, #4f46e5);
    --secondary-color: #4f46e5;
    --secondary-dark: #3730a3;
    --secondary-light: rgba(79, 70, 229, 0.06);
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #db2777;
    --info-color: #0ea5e9;
    --dark-color: #0f172a;
    --text-main: #334155;
    --gray-color: #475569;
    --gray-light: #475569;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #475569;
    --text-inverse: #ffffff;
    --bg-body: #e2e8f0;
    --bg-card: #ffffff;
    --bg-sidebar: #e2e8f0;
    --light-color: #e2e8f0;
    --bg-secondary: #e2e8f0;
    --bg-input: #f8fafc;
    --border-color: rgba(148, 163, 184, 0.4);
    --border-light: rgba(148, 163, 184, 0.2);
    --border-focus: rgba(2, 132, 199, 0.4);
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.02);
    --shadow-md: 0 10px 24px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 20px 48px rgba(15, 23, 42, 0.06);
    --shadow-xl: 0 30px 70px rgba(15, 23, 42, 0.08);
    --shadow-glow: 0 0 40px rgba(2, 132, 199, 0.05);
}

/* --- Theme: Emerald Forest (Deep Green) --- */
body.theme-emerald {
    --primary-color: #10b981;
    --primary-dark: #059669;
    --primary-light: rgba(16, 185, 129, 0.1);
    --primary-gradient: linear-gradient(135deg, #10b981, #0284c7);
    --secondary-color: #3b82f6;
    --secondary-dark: #2563eb;
    --secondary-light: rgba(59, 130, 246, 0.1);
    --success-color: #34d399;
    --warning-color: #fbbf24;
    --danger-color: #f87171;
    --info-color: #60a5fa;
    --dark-color: #f2f9f6;
    --text-main: #a7f3d0;
    --gray-color: #4b5563;
    --gray-light: #4b5563;
    --text-primary: #f2f9f6;
    --text-secondary: #a7f3d0;
    --text-muted: #4b5563;
    --text-inverse: #060d0a;
    --bg-body: #0a1712;
    --bg-card: #11241d;
    --bg-sidebar: #0a1712;
    --light-color: #0a1712;
    --bg-secondary: #0a1712;
    --bg-input: #0c1c16;
    --border-color: rgba(52, 211, 153, 0.08);
    --border-light: rgba(52, 211, 153, 0.04);
    --border-focus: rgba(16, 185, 129, 0.5);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 30px 70px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 40px rgba(16, 185, 129, 0.1);
}

/* --- Theme: Velvet Obsidian (Rich Purple) --- */
body.theme-velvet {
    --primary-color: #ec4899;
    --primary-dark: #db2777;
    --primary-light: rgba(236, 72, 153, 0.12);
    --primary-gradient: linear-gradient(135deg, #ec4899, #8b5cf6);
    --secondary-color: #8b5cf6;
    --secondary-dark: #7c3aed;
    --secondary-light: rgba(139, 92, 246, 0.12);
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    --dark-color: #fafafa;
    --text-main: #ddd6fe;
    --gray-color: #6b7280;
    --gray-light: #6b7280;
    --text-primary: #fafafa;
    --text-secondary: #ddd6fe;
    --text-muted: #6b7280;
    --text-inverse: #0f0e13;
    --bg-body: #16141c;
    --bg-card: #1f1b29;
    --bg-sidebar: #16141c;
    --light-color: #16141c;
    --bg-secondary: #16141c;
    --bg-input: #14121a;
    --border-color: rgba(139, 92, 246, 0.12);
    --border-light: rgba(139, 92, 246, 0.06);
    --border-focus: rgba(236, 72, 153, 0.5);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 30px 70px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.15);
}

/* Apply global theme colors to basic elements */
body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-main);
    background-color: var(--bg-body);
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   HEADER - COMPLETE FIXED VERSION
   ============================================ */

.header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: var(--transition);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Logo */
.logo a {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-decoration: none;
    white-space: nowrap;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo a span {
    -webkit-text-fill-color: var(--text-primary);
}

.logo a i {
    -webkit-text-fill-color: var(--primary-color);
}

/* Search Container */
.search-container {
    flex: 1;
    max-width: 400px;
    position: relative;
}

.search-form {
    display: flex;
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    transition: var(--transition);
}

.search-form:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.search-form input {
    flex: 1;
    padding: 0.6rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
}

.search-form input::placeholder {
    color: var(--text-muted);
}

.search-form button {
    padding: 0.6rem 1.2rem;
    background: transparent;
    color: var(--text-muted);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.search-form button:hover {
    color: var(--primary-color);
}

/* Store Type Selector */
.store-type-selector {
    display: flex;
    gap: 0.5rem;
    background: var(--light-color);
    padding: 0.25rem;
    border-radius: 30px;
}

.store-type-btn {
    padding: 0.4rem 1rem;
    border: none;
    background: transparent;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
}

.store-type-btn.active {
    background: var(--primary-color);
    color: white;
}

.store-type-btn:hover:not(.active) {
    background: #e0e0e0;
}

/* Navigation Links Container */
.nav-links {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: var(--transition);
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
    transform: scaleX(0);
    transition: var(--transition);
    border-radius: 1px;
}

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

.nav-link:hover::after {
    transform: scaleX(1);
}

.nav-link-sell {
    color: var(--secondary-color) !important;
    font-weight: 600;
}

.nav-link-sell::after {
    background: var(--secondary-color);
}

.nav-link-sell:hover {
    color: var(--secondary-color) !important;
    opacity: 0.8;
}

/* Cart Link */
.cart-link {
    position: relative;
}

.cart-badge {
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: 600;
    position: absolute;
    top: -8px;
    right: -12px;
    min-width: 18px;
    text-align: center;
}

/* Chat Link */
.chat-link {
    position: relative;
}

.chat-badge {
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: 600;
    position: absolute;
    top: -8px;
    right: -12px;
    min-width: 18px;
    text-align: center;
}

/* Theme Picker */
.theme-menu {
    position: relative;
}

.theme-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.theme-menu-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--primary-light);
}

.theme-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    padding: 0.5rem 0;
    z-index: 1001;
    display: none;
}

.theme-menu.show .theme-dropdown {
    display: block;
}

.theme-dropdown-title {
    padding: 0.4rem 1rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--gray-color);
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.55rem 1rem;
    border: none;
    background: transparent;
    text-align: left;
    color: var(--text-main);
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.theme-option:hover {
    background: var(--light-color);
    color: var(--primary-color);
}

.theme-option.active {
    font-weight: 600;
}

.theme-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.theme-check {
    margin-left: auto;
    color: var(--primary-color);
    font-size: 0.75rem;
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    transition: var(--transition);
}

.user-menu-btn:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    padding: 0.5rem 0;
    z-index: 1001;
    display: none;
}

.user-menu.show .user-dropdown {
    display: block;
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    text-decoration: none;
    color: var(--text-secondary);
    transition: var(--transition);
    font-size: 0.85rem;
}

.user-dropdown a:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

.user-dropdown a.logout-link {
    color: var(--danger-color);
}

.user-dropdown a.logout-link:hover {
    background: rgba(247, 37, 133, 0.08);
}

.user-dropdown hr {
    margin: 0.5rem 0;
    border: none;
    border-top: 1px solid var(--border-light);
}

/* Auth Buttons */
.auth-links {
    display: flex;
    gap: 0.75rem;
}

.btn-login, .btn-register {
    padding: 0.5rem 1rem;
    border-radius: 30px;
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.85rem;
}

.btn-login {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-login:hover {
    background: var(--primary-color);
    color: white;
}

.btn-register {
    background: var(--primary-color);
    color: white;
}

.btn-register:hover {
    background: var(--primary-dark);
}

/* Mobile Menu Toggle */
/* Mobile Sidebar Additional Styles */
.mobile-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.75rem 0;
}

.mobile-store-types {
    padding: 0.5rem 0;
}

.mobile-store-types strong {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    color: #888;
}

.mobile-store-types a {
    display: block;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

.mobile-store-types a:hover {
    background: var(--light-color);
    padding-left: 1rem;
}
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #555;
    padding: 0.5rem;
}

/* Mobile Sidebar */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100%;
    background: white;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    transition: left 0.3s ease;
    overflow-y: auto;
}

.mobile-sidebar.open {
    left: 0;
}

.mobile-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--primary-color);
    color: white;
}

.mobile-sidebar-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.close-sidebar {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
}

.mobile-sidebar-content {
    padding: 1rem;
}

.mobile-sidebar-content a {
    display: block;
    padding: 0.75rem;
    text-decoration: none;
    color: #555;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.mobile-sidebar-content a:hover {
    background: var(--light-color);
    color: var(--primary-color);
    padding-left: 1.25rem;
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   DESKTOP STYLES (Default - 992px and above)
   ============================================ */

@media (min-width: 992px) {
    .navbar {
        flex-wrap: nowrap;
    }
    
    .nav-links {
        display: flex !important;
    }
    
    .mobile-menu-toggle {
        display: none;
    }
}

/* ============================================
   TABLET STYLES (768px - 991px)
   ============================================ */

@media (max-width: 991px) and (min-width: 769px) {
    .navbar {
        flex-wrap: wrap;
    }
    
    .search-container {
        order: 3;
        width: 100%;
        max-width: 100%;
        margin-top: 0.5rem;
    }
    
    .store-type-selector {
        order: 2;
    }
    
    .nav-links {
        display: flex !important;
    }
    
    .mobile-menu-toggle {
        display: none;
    }
}

/* ============================================
   MOBILE STYLES (768px and below)
   ============================================ */

@media (max-width: 768px) {
    .navbar {
        flex-wrap: nowrap;
        justify-content: space-between;
    }
    
    /* Hide desktop navigation */
    .nav-links {
        display: none !important;
    }
    
    /* Show mobile menu button */
    .mobile-menu-toggle {
        display: block;
    }
    
    /* Adjust search for mobile */
    .search-container {
        max-width: 200px;
    }
    
    .search-form input {
        font-size: 0.8rem;
        padding: 0.5rem 0.8rem;
    }
    
    .search-form button {
        padding: 0.5rem 1rem;
    }
    
    /* Hide store type selector on mobile (optional) */
    .store-type-selector {
        display: none;
    }
    
    /* Logo size adjustment */
    .logo a {
        font-size: 1.2rem;
    }
    
    /* Auth buttons on mobile */
    .auth-links {
        display: none;
    }
}

/* ============================================
   SMALL MOBILE (480px and below)
   ============================================ */

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .search-container {
        max-width: 150px;
    }
    
    .search-form input {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .search-form button {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }
    
    .logo a {
        font-size: 1rem;
    }
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
    text-align: center;
    padding: var(--spacing-3xl) 2rem;
    margin-bottom: var(--spacing-2xl);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--primary-light) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--secondary-light) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 1;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem;
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    .hero {
        padding: 2rem 1rem;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 1rem;
    }
}

/* ============================================
   PRODUCTS SECTION
   ============================================ */

.products-section {
    margin: 3rem 0;
}

/* Products Header Toolbar Container layout */
.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card, #ffffff);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color, #dee2e6);
    box-shadow: var(--shadow-sm, 0 2px 4px rgba(0,0,0,0.05));
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.products-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--dark-color);
    margin: 0;
}

.products-toolbar-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

/* Segmented Button Filter Switcher Styles */
.seller-type-filter-group {
    display: inline-flex;
    background-color: var(--light-color, #f8f9fa);
    padding: 4px;
    border-radius: 6px;
    border: 1px solid var(--border-color, #dee2e6);
}

.toolbar-filter-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-color, #6c757d);
    text-decoration: none;
    border-radius: 4px;
    transition: var(--transition, all 0.3s ease);
    border: none;
    cursor: pointer;
}

.toolbar-filter-btn:hover {
    color: var(--primary-color);
}

.toolbar-filter-btn.active {
    background-color: var(--primary-color);
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(67, 97, 238, 0.2);
}

/* Sort Area Options styling overrides */
.sort-options-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-options-wrapper label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
}

.toolbar-sort-select {
    padding: 6px 12px;
    border: 1px solid var(--border-color, #dee2e6);
    border-radius: 4px;
    font-size: 0.85rem;
    background-color: var(--bg-card, #ffffff);
    color: var(--text-main, #333333);
    cursor: pointer;
    outline: none;
    transition: var(--transition, all 0.3s ease);
}

.toolbar-sort-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
}

/* Responsiveness adjustments */
@media (max-width: 768px) {
    .products-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .products-toolbar-controls {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    .seller-type-filter-group {
        display: flex;
        width: 100%;
    }
    .toolbar-filter-btn {
        flex: 1;
        justify-content: center;
    }
    .sort-options-wrapper {
        justify-content: space-between;
        width: 100%;
    }
    .toolbar-sort-select {
        flex: 1;
        max-width: 70%;
    }
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-options select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 0.9rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
}

/* ============================================
   PRODUCT CARD
   ============================================ */

.product-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md), var(--shadow-glow);
    border-color: var(--primary-light);
}

.product-card a {
    text-decoration: none;
    color: inherit;
}

.product-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--bg-secondary);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-info {
    padding: 1rem;
}

.vendor-name {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 0.5rem;
}

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

.product-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.product-description {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.5rem;
}

.quick-add {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
}

.quick-add:hover {
    background: var(--primary-dark);
}

/* ============================================
   PAGINATION
   ============================================ */

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.page-link {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    text-decoration: none;
    color: #555;
    transition: var(--transition);
}

.page-link:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-link.current {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ============================================
   PRODUCT DETAIL PAGE
   ============================================ */

.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin: 3rem 0;
}

@media (max-width: 768px) {
    .product-detail {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.product-gallery {
    background: white;
    border-radius: 10px;
    padding: 1rem;
}

.main-image {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    border-radius: 10px;
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.thumbnail-gallery {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.thumbnail-gallery img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
}

.thumbnail-gallery img:hover {
    border-color: var(--primary-color);
}

.product-info {
    background: white;
    border-radius: 10px;
    padding: 2rem;
}

.seller-info {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.seller-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.seller-corporate {
    background: var(--primary-color);
    color: white;
}

.seller-peer {
    background: var(--secondary-color);
    color: white;
}

.seller-name {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.seller-location {
    font-size: 0.8rem;
    color: #666;
}

.product-info h1 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

/* ============================================
   CART PAGE
   ============================================ */

.cart-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    margin: 2rem 0;
}

@media (max-width: 768px) {
    .cart-container,
    .checkout-container {
        grid-template-columns: 1fr;
    }
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-item {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.cart-item-image {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 8px;
    background: var(--bg-body);
    flex-shrink: 0;
}

.cart-item-details {
    flex: 1;
}

.cart-item-details h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.05rem;
}

.item-variant {
    font-size: 0.85rem;
    color: var(--gray-color);
    margin-bottom: 0.25rem;
}

.cart-item-seller {
    margin-bottom: 0.5rem;
}

.seller-type-tag {
    display: inline-block;
    padding: 0.2rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.seller-type-tag.corporate {
    background: var(--primary-light);
    color: var(--primary-color);
}

.seller-type-tag.p2p {
    background: #f3e8ff;
    color: var(--secondary-color);
}

.cart-item-price {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.cart-item-subtotal {
    font-weight: 600;
    color: var(--dark-color);
}

.remove-btn {
    background: none;
    border: none;
    color: var(--gray-color);
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.remove-btn:hover {
    background: var(--danger-color);
    color: white;
}

@media (max-width: 576px) {
    .cart-item {
        flex-direction: column;
        text-align: center;
    }
    .cart-item-image {
        width: 100%;
        height: 160px;
        margin: 0 auto;
    }
    .cart-item-controls {
        justify-content: center;
    }
}

.cart-summary {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    position: sticky;
    top: 100px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
}

.summary-row.total {
    font-size: 1.2rem;
    font-weight: bold;
    border-bottom: none;
}

.free-shipping-notice {
    background: #d4edda;
    color: #155724;
    padding: 0.5rem;
    border-radius: 5px;
    margin: 1rem 0;
    text-align: center;
    font-size: 0.85rem;
}

.btn-checkout {
    width: 100%;
    margin: 1rem 0;
}

.empty-cart {
    text-align: center;
    padding: 4rem;
}

/* ============================================
   CHECKOUT PAGE
   ============================================ */

.checkout-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    margin: 2rem 0;
}

.checkout-form {
    background: white;
    border-radius: 10px;
    padding: 2rem;
}

.form-section {
    margin-bottom: 2rem;
}

.form-section h3 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
}

.payment-methods {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.payment-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.payment-option:hover {
    border-color: var(--primary-color);
}

.payment-option input[type="radio"] {
    margin: 0;
}

.escrow-notice {
    background: #d4edda;
    border: 1px solid #28a745;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
}

.escrow-notice h3 {
    border: none;
    padding: 0;
    margin-bottom: 0.5rem;
}

.escrow-notice ul {
    margin: 0.5rem 0 0 1.25rem;
}

.escrow-notice li {
    margin-bottom: 0.25rem;
}

.order-items {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    position: sticky;
    top: 100px;
    height: fit-content;
}

.order-item {
    display: flex;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}

.order-item .item-seller {
    font-size: 0.8rem;
    color: var(--gray-color);
    margin: 0.15rem 0;
}

.order-summary {
    margin-top: 1rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
}

.summary-item.total {
    font-weight: bold;
    font-size: 1.1rem;
    border-top: 2px solid #eee;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
}

.btn-place-order {
    width: 100%;
    margin-top: 1rem;
}

/* ============================================
   LOGIN / REGISTER FORMS
   ============================================ */

.auth-container {
    max-width: 500px;
    margin: 3rem auto;
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.auth-container h1 {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-form .form-group {
    margin-bottom: 1.5rem;
}

.auth-form .btn {
    width: 100%;
}

.auth-links {
    text-align: center;
    margin-top: 1.5rem;
}

/* ============================================
   BUTTONS & BADGES
   ============================================ */

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: #ddd;
    color: #333;
}

.btn-secondary:hover {
    background: #ccc;
}

.btn-large {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
}

.in-stock {
    color: var(--success-color);
}

.low-stock {
    color: var(--warning-color);
}

.out-of-stock {
    color: var(--danger-color);
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-light);
    color: var(--text-secondary);
    margin-top: 4rem;
    padding: var(--spacing-2xl) 2rem 0;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-light);
}

.footer-section h3,
.footer-section h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.footer-section h3 {
    font-size: 1.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-section h3 span {
    -webkit-text-fill-color: var(--text-primary);
}

.footer-section p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

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

.footer-section a:hover {
    color: var(--primary-color);
    padding-left: 0.25rem;
}

.footer-bottom {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.5rem 0;
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0;
}

.footer-payment-methods {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

@media (max-width: 992px) {
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .footer-content {
        grid-template-columns: 1fr;
    }
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* ============================================
   NOTIFICATIONS
   ============================================ */

.notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    max-width: 420px;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-lg);
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--info-color);
    z-index: 10000;
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg);
    font-size: 0.95rem;
}

.notification-success {
    border-left-color: var(--success-color);
}

.notification-error {
    border-left-color: var(--danger-color);
}

.notification-info {
    border-left-color: var(--info-color);
}

@keyframes slideIn {
    from {
        transform: translateY(80px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================
   AUTOCOMPLETE
   ============================================ */

.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
}

.search-form {
    position: relative;
}

.autocomplete-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #eee;
    transition: var(--transition);
}

.autocomplete-item:hover {
    background: var(--light-color);
}

.autocomplete-image {
    width: 50px;
    height: 50px;
    margin-right: 1rem;
}

.autocomplete-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
}

.autocomplete-info {
    flex: 1;
}

.autocomplete-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.autocomplete-price {
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 500;
}

/* ============================================
   LOADING SPINNER
   ============================================ */

.loading-spinner {
    text-align: center;
    padding: 2rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* ============================================
   WISHLIST BUTTON
   ============================================ */

.wishlist-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #ccc;
    transition: var(--transition);
}

.wishlist-btn.active {
    color: var(--danger-color);
}

.wishlist-btn:hover {
    color: var(--danger-color);
}

/* ============================================
   FORM ERROR STYLES
   ============================================ */

input.error,
textarea.error,
select.error {
    border-color: var(--danger-color) !important;
    background-color: #fff8f8 !important;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* ============================================
   HERO SEARCH + TRUST BADGES (homepage hero)
   ============================================ */

.hero-search {
    max-width: 600px;
    margin: 0 auto 1.5rem;
    display: flex;
    gap: 0.3rem;
    background: var(--bg-card);
    padding: 0.3rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    position: relative;
    z-index: 1;
}

.hero-search input {
    flex: 1;
    padding: 0.8rem 1.2rem;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
}

.hero-search input::placeholder {
    color: var(--text-muted);
}

.hero-search button {
    padding: 0.8rem 2rem;
    background: var(--primary-gradient);
    border: none;
    border-radius: var(--border-radius-md);
    font-weight: 600;
    color: var(--text-inverse);
    cursor: pointer;
    transition: var(--transition);
}

.hero-search button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.hero-badges {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.hero-badges span {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 0.4rem 1.2rem;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
}

@media (max-width: 768px) {
    .hero-badges { gap: 0.5rem; }
    .hero-badges span { font-size: 0.75rem; }
}

/* ============================================
   CATEGORY CHIPS BAR (replaces the old tree sidebar
   on index.php/search.php - see category_sidebar.php)
   ============================================ */

.categories-bar {
    background: var(--bg-card);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.categories-scroll {
    display: flex;
    gap: 0.75rem;
}

.category-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.1rem;
    background: var(--light-color);
    border-radius: 20px;
    white-space: nowrap;
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.88rem;
    transition: var(--transition);
    text-decoration: none;
}

.category-chip:hover {
    background: var(--primary-light);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.category-chip.active {
    background: var(--primary-gradient);
    color: white;
}

/* ============================================
   PRODUCT BADGE OVERLAY (corporate vs peer-to-peer)
   ============================================ */

.product-card {
    position: relative;
}

.product-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    z-index: 2;
    box-shadow: var(--shadow-sm);
}

.product-badge.corporate {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

.product-badge.p2p {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-dark));
}

.wishlist-toggle {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.wishlist-toggle:hover,
.wishlist-toggle.active {
    color: var(--danger-color);
    border-color: var(--danger-color);
    background: rgba(247, 37, 133, 0.08);
}

.service-tag {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: var(--warning-color);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #1a1a1a; /* fixed, not a theme token - warning-color is bright yellow/amber in every theme, so this always needs dark text */
    z-index: 2;
}

.product-card .seller-name {
    font-size: 0.8rem;
    color: var(--gray-color);
}

.product-card .seller-type-tag {
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 0.4rem;
}

.product-card .seller-type-tag.corporate {
    background: var(--primary-light);
    color: var(--primary-color);
}

.product-card .seller-type-tag.p2p {
    background: var(--secondary-light);
    color: var(--secondary-color);
}

/* ============================================
   P2P SELLER SPOTLIGHT (homepage)
   ============================================ */

.p2p-spotlight {
    margin: 3rem 0;
}

.spotlight-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.spotlight-header h2 {
    font-size: 1.5rem;
    color: var(--dark-color);
}

.spotlight-header .view-all {
    color: var(--primary-color);
    font-weight: 500;
    text-decoration: none;
}

.p2p-sellers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1.5rem;
}

.seller-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--border-radius-lg);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--border-light);
}

.seller-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.seller-avatar {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.seller-card h4 {
    font-size: 1.05rem;
    margin-bottom: 0.4rem;
    color: var(--dark-color);
}

.seller-stats {
    color: var(--gray-color);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.seller-listings-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.listing-tag {
    background: var(--bg-body);
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    font-size: 0.72rem;
    color: var(--gray-color);
}

.visit-store {
    display: inline-block;
    padding: 0.4rem 1.5rem;
    background: var(--primary-light);
    color: var(--primary-color);
    border-radius: 20px;
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
    font-size: 0.85rem;
}

.visit-store:hover {
    background: var(--primary-color);
    color: white;
}

/* ============================================
   BENEFITS / TRUST SECTION (homepage)
   ============================================ */

.benefits-section {
    background: var(--bg-card);
    padding: var(--spacing-3xl) 1.5rem;
    margin: 3rem 0 0;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-light);
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.benefit-item {
    text-align: center;
}

.benefit-icon {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.benefit-item h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: var(--dark-color);
}

.benefit-item p {
    color: var(--gray-color);
    font-size: 0.85rem;
}

/* ============================================
   QUANTITY STEPPER (cart + product detail)
   ============================================ */

.quantity-stepper {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    width: fit-content;
}

.quantity-stepper button {
    width: 34px;
    height: 34px;
    border: none;
    background: var(--light-color);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-main);
}

.quantity-stepper button:hover {
    background: var(--primary-color);
    color: white;
}

.quantity-stepper input {
    width: 46px;
    text-align: center;
    border: none;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    padding: 0.4rem 0;
    font-size: 0.95rem;
}

.quantity-stepper input:focus {
    outline: none;
}

/* ============================================
   PRICE + STOCK ROW (product cards, grids)
   ============================================ */

.product-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.product-price .stock {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--success-color);
}

.product-price .stock.out {
    color: var(--danger-color);
}

.product-price .stock.service {
    color: var(--warning-color);
}

/* ============================================
   UNIFIED MIXED-CATALOG CARD (templates/product_card.php)
   ============================================ */

.product-details {
    padding: 1.25rem;
}

.product-details h3 {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    color: var(--dark-color);
}

.product-seller {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--gray-color);
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

.seller-type {
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.seller-type.corporate {
    background: var(--primary-light);
    color: var(--primary-color);
}

.seller-type.individual {
    background: #f3e8ff;
    color: var(--secondary-color);
}

.product-meta {
    font-size: 0.8rem;
    color: var(--gray-color);
    margin-bottom: 0.5rem;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    color: var(--gray-color);
    margin-bottom: 0.5rem;
}

.product-rating .stars {
    color: var(--warning-color);
    letter-spacing: 1px;
}

.product-rating .rating-value {
    font-weight: 600;
    color: var(--dark-color);
}

.add-to-cart {
    width: 100%;
    padding: 0.7rem;
    border: none;
    border-radius: 0;
    background: var(--primary-gradient);
    color: var(--text-inverse);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.add-to-cart:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.add-to-cart.p2p-btn {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-dark));
}