/*
 * Modern B2B Marketplace Stylesheet
 * Professional, Clean, Responsive Design
 * Compatible with PHP 8 Migration
 */

/* ==================== CSS VARIABLES ==================== */
:root {
    /* Primary Colors - Can be overridden by PHP variables */
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    
    /* Secondary Colors */
    --secondary-color: #059669;
    --secondary-dark: #047857;
    --secondary-light: #10b981;
    
    /* Neutral Colors */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Semantic Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    /* Typography */
    --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-heading: 'Inter', -apple-system, system-ui, sans-serif;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== RESET & BASE STYLES ==================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--gray-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
    color: var(--gray-900);
    margin-bottom: var(--spacing-md);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: var(--spacing-md);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==================== CONTAINER & LAYOUT ==================== */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.container-fluid {
    width: 100%;
    padding: 0 var(--spacing-lg);
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 calc(var(--spacing-md) * -0.5);
}

.col {
    flex: 1;
    padding: 0 calc(var(--spacing-md) * 0.5);
}

/* Grid System */
.col-12 { width: 100%; }
.col-11 { width: 91.666%; }
.col-10 { width: 83.333%; }
.col-9 { width: 75%; }
.col-8 { width: 66.666%; }
.col-7 { width: 58.333%; }
.col-6 { width: 50%; }
.col-5 { width: 41.666%; }
.col-4 { width: 33.333%; }
.col-3 { width: 25%; }
.col-2 { width: 16.666%; }
.col-1 { width: 8.333%; }

/* ==================== HEADER & NAVIGATION ==================== */
.site-header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    background: var(--gray-100);
    padding: var(--spacing-sm) 0;
    font-size: 0.875rem;
}

.header-top .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-main {
    padding: var(--spacing-lg) 0;
}

.header-main .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-xl);
}

.site-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.site-logo img {
    max-height: 60px;
}

.search-bar-container {
    flex: 1;
    max-width: 600px;
}

.search-bar {
    display: flex;
    gap: var(--spacing-sm);
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color var(--transition-base);
}

.search-bar:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-bar input[type="text"] {
    flex: 1;
    border: none;
    padding: var(--spacing-md);
    font-size: 1rem;
    outline: none;
}

.search-bar select {
    border: none;
    border-left: 1px solid var(--gray-200);
    padding: var(--spacing-md);
    font-size: 0.875rem;
    outline: none;
    background: white;
    cursor: pointer;
}

.search-bar button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: var(--spacing-md) var(--spacing-xl);
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--transition-base);
}

.search-bar button:hover {
    background: var(--primary-dark);
}

/* Main Navigation */
.main-nav {
    background: white;
    border-bottom: 1px solid var(--gray-200);
}

.nav-container {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 0;
}

.nav-item {
    position: relative;
    list-style: none;
}

.nav-link {
    display: block;
    padding: var(--spacing-md) var(--spacing-lg);
    color: var(--gray-700);
    font-weight: 500;
    transition: all var(--transition-base);
    border-bottom: 3px solid transparent;
}

.nav-link:hover {
    color: var(--primary-color);
    background: var(--gray-50);
}

.nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: var(--gray-50);
}

/* ==================== COMPACT HEADER (ALIBABA-STYLE) ==================== */

/* Compact Top Bar */
.header-top-compact {
    background: var(--gray-100);
    border-bottom: 1px solid var(--gray-200);
    padding: 0.375rem 0;
}

.header-top-compact a {
    text-decoration: none;
    transition: color var(--transition-fast);
}

.header-top-compact a:hover {
    color: var(--primary-color) !important;
}

/* Compact Main Header */
.header-main-compact {
    background: white;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-200);
}

.header-content-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.site-logo-compact {
    flex-shrink: 0;
}

.site-logo-compact img {
    max-height: 45px;
    width: auto;
    display: block;
}

/* Compact Search Bar */
.search-bar-compact {
    flex: 1;
    max-width: 650px;
}

.search-form-compact {
    width: 100%;
}

.search-input-group {
    display: flex;
    border: 2px solid var(--primary-color);
    border-radius: 4px;
    overflow: hidden;
    background: white;
}

.search-input-group input[type="text"] {
    flex: 1;
    border: none;
    padding: 0.625rem 1rem;
    font-size: 0.9375rem;
    outline: none;
    min-width: 0;
}

.search-input-group input[type="text"]::placeholder {
    color: var(--gray-400);
}

.search-input-group select {
    border: none;
    border-left: 1px solid var(--gray-200);
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    outline: none;
    background: white;
    cursor: pointer;
    color: var(--gray-700);
}

.search-btn-compact {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.625rem 2rem;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: background-color var(--transition-base);
    white-space: nowrap;
}

.search-btn-compact:hover {
    background: var(--primary-dark);
}

/* Header Actions */
.header-actions-compact {
    flex-shrink: 0;
    display: flex;
    gap: 1rem;
}

.action-link-compact {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
    color: var(--gray-700);
    transition: color var(--transition-fast);
    padding: 0.25rem 0.5rem;
}

.action-link-compact:hover {
    color: var(--primary-color);
}

.action-icon {
    font-size: 1.5rem;
}

.action-text {
    font-size: 0.75rem;
    white-space: nowrap;
}

/* Banner Row */
.banner-row {
    background: var(--gray-50);
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-200);
}

/* Compact Navigation */
.main-nav-compact {
    background: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.nav-container-compact {
    display: flex;
    gap: 0;
    padding: 0;
    margin: 0;
    list-style: none;
    flex-wrap: wrap;
}

.nav-container-compact li {
    margin: 0;
}

.nav-link-compact {
    display: block;
    padding: 0.875rem 1.25rem;
    color: var(--gray-700);
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
    border-bottom: 2px solid transparent;
    font-size: 0.9375rem;
}

.nav-link-compact:hover {
    color: var(--primary-color);
    background: var(--gray-50);
}

.nav-link-compact.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.nav-link-compact.nav-highlight {
    background: var(--secondary-color);
    color: white;
    font-weight: 600;
}

.nav-link-compact.nav-highlight:hover {
    background: var(--secondary-dark);
    color: white;
}

/* Responsive for Compact Header */
@media (max-width: 1024px) {
    .header-content-row {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .search-bar-compact {
        order: 3;
        flex: 1 1 100%;
        max-width: 100%;
    }
    
    .action-text {
        display: none;
    }
}

@media (max-width: 768px) {
    .header-top-compact {
        font-size: 0.75rem;
    }
    
    .header-main-compact {
        padding: 0.5rem 0;
    }
    
    .site-logo-compact img {
        max-height: 35px;
    }
    
    .search-input-group input[type="text"] {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .search-input-group select {
        font-size: 0.8125rem;
        padding: 0.5rem;
    }
    
    .search-btn-compact {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .nav-container-compact {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-link-compact {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        white-space: nowrap;
    }
}

/* ==================== CARDS ==================== */
.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.card-header {
    padding: var(--spacing-lg);
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    font-weight: 600;
    font-size: 1.125rem;
}

.card-body {
    padding: var(--spacing-lg);
}

.card-footer {
    padding: var(--spacing-lg);
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-sm);
}

.card-text {
    color: var(--gray-600);
    margin-bottom: var(--spacing-md);
}

.card-img-top {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: white;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.btn-secondary:hover {
    background: var(--secondary-dark);
    border-color: var(--secondary-dark);
    color: white;
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-sm {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.875rem;
}

.btn-lg {
    padding: var(--spacing-lg) var(--spacing-xl);
    font-size: 1.125rem;
}

/* ==================== FORMS ==================== */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
    color: var(--gray-700);
}

.form-control {
    width: 100%;
    padding: var(--spacing-md);
    font-size: 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-select {
    width: 100%;
    padding: var(--spacing-md);
    font-size: 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    background: white;
    cursor: pointer;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* ==================== BADGES & TAGS ==================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-primary {
    background: var(--primary-color);
    color: white;
}

.badge-success {
    background: var(--success);
    color: white;
}

.badge-warning {
    background: var(--warning);
    color: white;
}

.badge-danger {
    background: var(--danger);
    color: white;
}

/* ==================== STATS & METRICS ==================== */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin: var(--spacing-xl) 0;
}

.stat-card {
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: transform var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
}

.stat-label {
    color: var(--gray-600);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ==================== CATEGORY GRID ==================== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin: var(--spacing-xl) 0;
}

.category-card {
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.category-icon {
    font-size: 2rem;
    margin-bottom: var(--spacing-md);
    color: var(--primary-color);
}

.category-name {
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--gray-800);
}

.category-count {
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* ==================== OFFER/PRODUCT CARDS ==================== */
.offer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-lg);
}

.offer-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.offer-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.offer-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--gray-100);
}

.offer-content {
    padding: var(--spacing-lg);
}

.offer-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--gray-900);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.offer-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
}

.offer-meta {
    display: flex;
    gap: var(--spacing-md);
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--gray-200);
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.sidebar-section {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--gray-200);
}

.sidebar-section:last-child {
    border-bottom: none;
}

.sidebar-title {
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--gray-900);
}

.sidebar-list {
    list-style: none;
}

.sidebar-list-item {
    padding: var(--spacing-sm) 0;
}

.sidebar-list-item a {
    display: flex;
    justify-content: space-between;
    color: var(--gray-700);
    transition: color var(--transition-fast);
}

.sidebar-list-item a:hover {
    color: var(--primary-color);
}

/* ==================== FOOTER ==================== */
.site-footer {
    background: var(--gray-900);
    color: var(--gray-300);
    margin-top: var(--spacing-2xl);
    padding-top: var(--spacing-2xl);
}

.footer-main {
    padding-bottom: var(--spacing-xl);
}

.footer-section {
    margin-bottom: var(--spacing-lg);
}

.footer-title {
    color: white;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: var(--spacing-sm);
}

.footer-links a {
    color: var(--gray-300);
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid var(--gray-700);
    padding: var(--spacing-lg) 0;
    text-align: center;
    font-size: 0.875rem;
}

/* ==================== UTILITIES ==================== */
.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.mt-4 { margin-top: var(--spacing-xl); }

.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }
.mb-4 { margin-bottom: var(--spacing-xl); }

.p-1 { padding: var(--spacing-sm); }
.p-2 { padding: var(--spacing-md); }
.p-3 { padding: var(--spacing-lg); }
.p-4 { padding: var(--spacing-xl); }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--primary-color); }
.text-gray { color: var(--gray-600); }
.text-muted { color: var(--gray-500); }

.bg-white { background: white; }
.bg-gray { background: var(--gray-100); }
.bg-primary { background: var(--primary-color); }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-1 { gap: var(--spacing-sm); }
.gap-2 { gap: var(--spacing-md); }
.gap-3 { gap: var(--spacing-lg); }

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 1024px) {
    .container {
        max-width: 100%;
    }
    
    .header-main .container {
        flex-wrap: wrap;
    }
    
    .search-bar-container {
        order: 3;
        width: 100%;
        max-width: 100%;
        margin-top: var(--spacing-md);
    }
}

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    
    .nav-container {
        flex-direction: column;
        gap: 0;
    }
    
    .nav-link {
        border-bottom: 1px solid var(--gray-200);
        border-left: 3px solid transparent;
    }
    
    .nav-link.active {
        border-bottom-color: var(--gray-200);
        border-left-color: var(--primary-color);
    }
    
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .offer-grid {
        grid-template-columns: 1fr;
    }
    
    [class^="col-"] {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .stat-value {
        font-size: 2rem;
    }
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn var(--transition-slow) ease-out;
}

/* ==================== LEGACY COMPATIBILITY ==================== */
/* Keep some old class names for backward compatibility */
.maintablestyle {
    background: white;
    border-radius: var(--radius-lg);
}

.innertablestyle {
    background: white;
}

.onepxtable {
    border: 1px solid var(--gray-200);
}

.normal {
    font-family: var(--font-primary);
    color: var(--gray-700);
}

.smalltext {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.activetab, .inactivetab {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.activetab {
    background: white;
    color: var(--primary-color);
    font-weight: 600;
    border-bottom: 3px solid var(--primary-color);
}

.inactivetab {
    background: var(--gray-100);
    color: var(--gray-600);
}

.inactivetab a {
    color: var(--gray-700);
}

.sidetitle {
    background: var(--primary-color);
    color: white;
    padding: var(--spacing-md);
    font-weight: 600;
}

/* ==================== HOMEPAGE COMPONENTS ==================== */

/* Statistics Cards */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    border: 1px solid var(--gray-200);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1rem;
    color: var(--gray-600);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.category-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    text-decoration: none;
    border: 2px solid var(--gray-100);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.category-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.category-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.category-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
}

.category-count {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* Offer Grid - 5 columns for featured offers */
.offer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.offer-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    border: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
}

.offer-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.offer-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--gray-100);
    display: block;
}

.offer-content {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.offer-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.offer-title a {
    color: var(--gray-900);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.offer-title a:hover {
    color: var(--primary-color);
}

.offer-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: auto;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.offer-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-primary {
    background: var(--primary-light);
    color: white;
}

.badge-secondary {
    background: var(--secondary-light);
    color: white;
}

.badge-warning {
    background: var(--warning);
    color: white;
}

/* Card Text */
.card-text {
    font-size: 0.875rem;
    color: var(--gray-600);
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* ==================== RESPONSIVE ADJUSTMENTS ==================== */
@media (max-width: 1024px) {
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .offer-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .offer-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .stat-value {
        font-size: 2rem;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
}

@media (max-width: 480px) {
    .offer-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== ALIBABA-STYLE HOMEPAGE ==================== */

/* Main Homepage Container */
.alibaba-homepage {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Hero Section with Sidebar */
.hero-section {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: visible;
}

/* Categories Sidebar */
.categories-sidebar {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: visible;
}

.sidebar-title {
    background: var(--primary-color);
    color: white;
    padding: 0.875rem 1rem;
    font-weight: 600;
    font-size: 1rem;
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow: hidden;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.category-list li {
    border-bottom: 1px solid var(--gray-100);
}

.category-item {
    position: relative;
}

.category-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--gray-700);
    transition: all var(--transition-fast);
}

.category-link:hover {
    background: var(--gray-50);
    color: var(--primary-color);
    padding-left: 1.25rem;
}

.cat-name {
    font-size: 0.9375rem;
}

.cat-arrow {
    color: var(--gray-400);
    font-size: 1.125rem;
    transition: transform var(--transition-fast);
}

.category-item.has-subcategories .cat-arrow {
    color: var(--primary-color);
    font-weight: bold;
}

.category-item.has-subcategories:hover .cat-arrow {
    transform: rotate(-90deg);
}

/* Subcategory Hover Menu */
.subcategory-menu {
    display: none !important;
    position: absolute !important;
    left: 100% !important;
    top: 0 !important;
    width: 550px !important;
    background: white !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3) !important;
    border: 3px solid red !important;
    border-radius: var(--radius-md);
    padding: 1.25rem !important;
    z-index: 9999 !important;
    margin-left: 5px !important;
}

.category-item:hover .subcategory-menu,
.category-item.has-subcategories:hover .subcategory-menu {
    display: block !important;
}

.subcategory-header {
    font-size: 1.125rem;
    color: var(--gray-900);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-color);
}

.subcategory-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.subcategory-link {
    padding: 0.625rem 0.875rem;
    color: var(--gray-700);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    transition: all var(--transition-fast);
    display: block;
}

.subcategory-link:hover {
    background: var(--primary-color);
    color: white;
    padding-left: 1.125rem;
}

.view-all-subcat {
    display: block;
    text-align: center;
    padding: 0.75rem;
    background: var(--gray-50);
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.view-all-subcat:hover {
    background: var(--primary-color);
    color: white;
}

.view-all-categories {
    display: block;
    text-align: center;
    padding: 0.875rem;
    background: var(--gray-50);
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    border-top: 2px solid var(--gray-200);
    font-size: 0.9375rem;
}

.view-all-categories:hover {
    background: var(--primary-color);
    color: white;
}

/* Hero Banner */
.hero-banner {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-md);
    padding: 3rem 2rem;
    color: white;
    box-shadow: var(--shadow-md);
}

.hero-content h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: white;
}

.hero-subtitle {
    font-size: 1.125rem;
    opacity: 0.95;
    margin-bottom: 2rem;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.hero-stat {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
}

.hero-stat strong {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.hero-stat span {
    font-size: 0.875rem;
    opacity: 0.9;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-hero {
    padding: 0.875rem 2rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-base);
    display: inline-block;
    font-size: 1rem;
}

.btn-hero-primary {
    background: white;
    color: var(--primary-color);
}

.btn-hero-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-hero-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-hero-secondary:hover {
    background: white;
    color: var(--primary-color);
}

/* Quick Access Cards */
.quick-access-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.quick-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 1.5rem 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    transition: all var(--transition-base);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.quick-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.quick-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.quick-content h3 {
    font-size: 1rem;
    margin-bottom: 0.375rem;
    color: var(--gray-900);
}

.quick-content p {
    font-size: 0.8125rem;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.quick-link {
    font-size: 0.875rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.quick-link:hover {
    text-decoration: underline;
}

/* Featured Sections */
.featured-section {
    margin-bottom: 2.5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--gray-200);
}

.section-header h2 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--gray-900);
}

.view-all-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9375rem;
}

.view-all-link:hover {
    text-decoration: underline;
}

/* Compact Product Grid */
.offers-grid-compact {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.product-card-compact {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition-fast);
}

.product-card-compact:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.product-image-link {
    display: block;
    position: relative;
    overflow: hidden;
}

.product-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: var(--gray-100);
    display: block;
    transition: transform var(--transition-base);
}

.product-card-compact:hover .product-image {
    transform: scale(1.05);
}

.gold-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: white;
    padding: 0.25rem 0.625rem;
    border-radius: 1rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.025em;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.product-info {
    padding: 0.875rem;
}

.product-title {
    font-size: 0.9375rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.product-title a {
    color: var(--gray-900);
    text-decoration: none;
}

.product-title a:hover {
    color: var(--primary-color);
}

.product-description {
    font-size: 0.8125rem;
    color: var(--gray-600);
    line-height: 1.5;
    margin-bottom: 0.625rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-meta {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.product-date, .product-company {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* Wide Product Cards (for product catalogs) */
.products-grid-compact {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.product-card-wide {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition-fast);
}

.product-card-wide:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.product-card-wide .product-image {
    height: 220px;
}

.product-card-wide .product-info {
    padding: 1rem;
}

.product-card-wide .product-title {
    font-size: 1rem;
    margin-bottom: 0.625rem;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 3rem 2rem;
    border-radius: var(--radius-md);
    text-align: center;
    margin-top: 3rem;
}

.cta-section h2 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    color: white;
}

.cta-section p {
    font-size: 1.125rem;
    opacity: 0.95;
    margin-bottom: 2rem;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-cta {
    padding: 0.875rem 2rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-base);
    display: inline-block;
    font-size: 1rem;
}

.btn-cta-primary {
    background: white;
    color: var(--primary-color);
}

.btn-cta-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.btn-cta-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-cta-secondary:hover {
    background: var(--secondary-dark);
    transform: translateY(-3px);
}

.btn-cta-outline {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-cta-outline:hover {
    background: white;
    color: var(--primary-color);
}

/* Responsive Alibaba Layout */
@media (max-width: 1024px) {
    .hero-section {
        grid-template-columns: 220px 1fr;
        gap: 1rem;
    }
    
    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quick-access-section {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .offers-grid-compact {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
    
    .products-grid-compact {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

@media (max-width: 768px) {
    .alibaba-homepage {
        padding: 1rem;
    }
    
    .hero-section {
        grid-template-columns: 1fr;
    }
    
    .categories-sidebar {
        display: none;
    }
    
    .hero-banner {
        padding: 2rem 1.5rem;
    }
    
    .hero-content h1 {
        font-size: 1.5rem;
    }
    
    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .quick-access-section {
        grid-template-columns: 1fr;
    }
    
    .quick-card {
        flex-direction: column;
        text-align: center;
    }
    
    .offers-grid-compact {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .products-grid-compact {
        grid-template-columns: 1fr;
    }
    
    .cta-section {
        padding: 2rem 1.5rem;
    }
    
    .cta-section h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero-stats {
        grid-template-columns: 1fr;
    }
    
    .offers-grid-compact {
        grid-template-columns: 1fr;
    }
    
    .hero-actions {
        flex-direction: column;
    }
    
    .btn-hero, .btn-cta {
        width: 100%;
        text-align: center;
    }
}
