/* ============================================
   VapeMarket - Main Styles
   Dark Mode Design System
   ============================================ */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #09090b;
    color: #fafafa;
    line-height: 1.5;
    overflow-x: hidden;
}

/* Color System */
:root {
    /* Neutral Colors (Dark Mode Base) */
    --bg-page: #09090b;
    --bg-surface: #18181b;
    --bg-surface-hover: #27272a;
    --border-color: #3f3f46;
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    
    /* Brand Colors (Electric Indigo) */
    --primary-500: #6366f1;
    --primary-400: #818cf8;
    --primary-900: #312e81;
    
    /* Semantic Colors */
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    
    /* Spacing System (4pt Grid) */
    --space-xs: 8px;
    --space-sm: 16px;
    --space-md: 24px;
    --space-lg: 32px;
    --space-xl: 64px;
    --space-xxl: 96px;
    
    /* Typography Scale */
    --text-xs: 12px;
    --text-sm: 14px;
    --text-base: 16px;
    --text-lg: 18px;
    --text-xl: 20px;
    --text-2xl: 32px;
    --text-3xl: 48px;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 16px;
    
    /* Shadows */
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
}

/* Container System */
.container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.2;
}

h1 {
    font-size: var(--text-3xl);
    font-weight: 700;
    letter-spacing: -0.02em;
}

h2 {
    font-size: var(--text-2xl);
    font-weight: 600;
}

h3 {
    font-size: var(--text-xl);
    font-weight: 600;
}

p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 48px;
    gap: var(--space-xs);
}

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

.btn-primary:hover {
    background: var(--primary-400);
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

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

.btn-ghost:hover {
    background: var(--bg-surface);
    border-color: var(--primary-500);
}

.btn-seller {
    background: transparent;
    color: var(--primary-500);
    border: 1px solid var(--primary-500);
    padding: 8px 16px;
    font-size: var(--text-xs);
}

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

.btn-cart {
    width: 100%;
    margin-top: var(--space-sm);
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    position: relative;
}

.icon-btn:hover {
    color: var(--text-primary);
    background: var(--bg-surface);
}

/* Age Gate Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-xxl);
    max-width: 500px;
    width: 90%;
    text-align: center;
}

.modal-content h2 {
    margin-bottom: var(--space-md);
    font-size: var(--text-2xl);
}

.modal-content p {
    margin-bottom: var(--space-lg);
    font-size: var(--text-base);
}

.modal-actions {
    display: flex;
    gap: var(--space-sm);
}

.modal-actions .btn {
    flex: 1;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    background: var(--bg-page);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    gap: var(--space-lg);
}

.logo h1 {
    color: var(--primary-500);
    font-size: var(--text-xl);
    font-weight: 700;
}

.nav {
    display: flex;
    gap: var(--space-lg);
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

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

.search {
    display: flex;
    flex: 1;
    max-width: 400px;
    position: relative;
}

.search-input {
    flex: 1;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 48px 12px var(--space-sm);
    color: var(--text-primary);
    font-size: var(--text-base);
}

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

.search-btn {
    position: absolute;
    right: var(--space-xs);
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: var(--space-xs);
}

.user-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--primary-500);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* Mobile Navigation */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    z-index: 100;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: var(--space-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: var(--text-xs);
    transition: color 0.2s ease;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
    color: var(--primary-500);
}

/* Hero Section */
.hero {
    padding: var(--space-xxl) 0;
    background: var(--bg-page);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
    align-items: center;
    position: relative;
}

.hero-title {
    font-size: clamp(32px, 5vw, var(--text-3xl));
    margin-bottom: var(--space-md);
    line-height: 1.1;
}

.hero-subtitle {
    font-size: var(--text-lg);
    margin-bottom: var(--space-lg);
    color: var(--text-secondary);
}

.quick-search {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}

.quick-search-input {
    flex: 1;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px var(--space-sm);
    color: var(--text-primary);
    font-size: var(--text-base);
}

.quick-search-input::placeholder {
    color: var(--text-secondary);
}

.hero-stats {
    display: flex;
    gap: var(--space-lg);
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--primary-500);
}

.stat-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.hero-product-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
    max-width: 320px;
    margin-left: auto;
}

.hero-product-card {
    aspect-ratio: 1;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
}

.hero-product-card img {
    max-width: 80%;
    max-height: 80%;
    border-radius: var(--radius-sm);
}

/* Section Styles */
.section-title {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

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

.section-link:hover {
    color: var(--primary-400);
}

/* Categories */
.categories {
    padding: var(--space-xl) 0;
    background: var(--bg-page);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
}

.category-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-500);
    box-shadow: var(--shadow-glow);
}

.category-icon {
    font-size: 32px;
    margin-bottom: var(--space-sm);
}

.category-card h3 {
    margin-bottom: var(--space-xs);
    font-size: var(--text-base);
}

.category-card p {
    font-size: var(--text-sm);
}

/* Products */
.featured {
    padding: var(--space-xl) 0;
    background: var(--bg-page);
}

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

.product-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.25s ease-out;
}

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

.product-image {
    position: relative;
    aspect-ratio: 1;
    background: var(--bg-surface-hover);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
}

.product-badge {
    position: absolute;
    top: var(--space-sm);
    left: var(--space-sm);
    background: var(--primary-500);
    color: white;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 500;
}

.product-badge.new {
    background: var(--success);
}

.product-badge.sale {
    background: var(--error);
}

.product-info {
    padding: var(--space-md);
}

.product-title {
    font-size: var(--text-base);
    margin-bottom: var(--space-xs);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-seller {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.product-price {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.price-old {
    color: var(--text-secondary);
    text-decoration: line-through;
    margin-right: var(--space-xs);
    font-size: var(--text-sm);
}

/* Benefits */
.benefits {
    padding: var(--space-xl) 0;
    background: var(--bg-page);
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-lg);
}

.benefit-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    text-align: center;
}

.benefit-icon {
    font-size: 48px;
    margin-bottom: var(--space-md);
}

.benefit-card h3 {
    margin-bottom: var(--space-sm);
    font-size: var(--text-lg);
}

.benefit-card p {
    font-size: var(--text-sm);
    line-height: 1.6;
}

/* Footer */
.footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    padding: var(--space-xl) 0 var(--space-lg);
    margin-top: var(--space-xl);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.footer-section h3 {
    color: var(--primary-500);
    margin-bottom: var(--space-md);
    font-size: var(--text-lg);
}

.footer-section h4 {
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    font-size: var(--text-base);
}

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

.footer-section li {
    margin-bottom: var(--space-xs);
}

.footer-section a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: var(--text-sm);
    transition: color 0.2s ease;
}

.footer-section a:hover {
    color: var(--primary-500);
}

.social-links {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-surface-hover);
    border-radius: var(--radius-sm);
    font-size: 18px;
    transition: all 0.2s ease;
}

.social-link:hover {
    background: var(--primary-500);
    transform: translateY(-2px);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-color);
}

.footer-bottom p {
    color: var(--text-secondary);
    font-size: var(--text-sm);
}