:root {
    --brand: #2563eb;
    --brand-dark: #1e40af;
    --accent: #f59e0b;
    --text: #1f2937;
    --text-muted: #6b7280;
    --background: #f9fafb;
    --card-bg: #ffffff;
    --border: #e5e7eb;
    --danger: #dc2626;
    --success: #16a34a;
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    --radius: 12px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    color: var(--text);
    background: var(--background);
    line-height: 1.5;
    font-size: 16px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    border: none;
    outline: none;
    background: none;
}

/* Header Styles */
.header {
    background: var(--brand-dark);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.shop-badge {
    font-size: 0.875rem;
    background: var(--accent);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.seller-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--accent);
    color: white;
    border-radius: var(--radius);
    font-weight: 500;
}

.seller-btn:hover {
    background: #d97706;
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Search Styles */
.search-global {
    padding: 1rem 0;
    background: var(--card-bg);
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: white;
}

.search-input-wrapper input {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    color: var(--text);
}

.search-input-wrapper button {
    padding: 0.75rem 1rem;
    background: var(--brand);
    color: white;
    cursor: pointer;
}

.search-input-wrapper button:hover {
    background: var(--brand-dark);
}

.search-info {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Hero Banner */
.banner-hero-section {
    margin: 1rem 0;
}

.banner-hero {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.banner-hero img {
    width: 100%;
    height: auto;
    display: block;
}

.banner-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    color: white;
}

.banner-overlay h2 {
    font-size: 1.5rem;
    margin: 0 0 0.5rem;
}

.banner-overlay p {
    font-size: 1rem;
    margin: 0;
}

/* Categories Section */
.categories-section {
    margin: 2rem 0;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
}

.cat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.cat-card:hover {
    transform: translateY(-4px);
}

.cat-card img,
.cat-card .cat-emoji,
.cat-card .cat-initial {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.cat-card .cat-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
}

.cat-name {
    font-size: 0.875rem;
    text-align: center;
    color: var(--text);
}

.cat-active-indicator {
    font-size: 0.75rem;
    color: var(--success);
    margin-top: 0.25rem;
}

/* Sellers Section */
.sellers-section {
    margin: 2rem 0;
}

.seller-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.seller-card {
    padding: 1rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
}

.seller-card:hover {
    transform: translateY(-4px);
}

.seller-name {
    font-size: 1rem;
    font-weight: 500;
}

.seller-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Products Section */
.products-section {
    margin: 2rem 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.product-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-4px);
}

.product-link {
    display: block;
}

.product-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.discount-badge,
.out-of-stock {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    color: white;
}

.discount-badge {
    background: var(--accent);
}

.out-of-stock {
    background: var(--danger);
}

.product-info {
    padding: 1rem;
}

.product-name {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
}

.price-current {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--brand);
}

.price-old {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

.product-stock {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.empty-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.tip {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 1rem;
}

/* Pagination */
.pagination {
    margin: 2rem 0;
    text-align: center;
}

.pagination-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.page-link {
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    background: var(--card-bg);
    color: var(--text);
    font-size: 0.875rem;
    transition: var(--transition);
}

.page-link:hover {
    background: var(--brand);
    color: white;
}

.page-link.active {
    background: var(--brand);
    color: white;
    font-weight: 600;
}

.page-ellipsis {
    padding: 0.5rem;
    color: var(--text-muted);
}

.pagination-info {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-left: 1rem;
}

/* Footer */
.footer {
    background: var(--brand-dark);
    color: white;
    padding: 2rem 0;
    margin-top: 2rem;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: space-between;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-tag {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: 1rem;
}

.footer-links a {
    font-size: 0.875rem;
    color: white;
}

.footer-links a:hover {
    color: var(--accent);
}

/* Debug Panel */
.debug-panel {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    max-width: 400px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem;
    font-size: 0.875rem;
}

.debug-panel summary {
    cursor: pointer;
    font-weight: 600;
}

.debug-grid {
    display: grid;
    gap: 0.5rem;
    margin: 1rem 0;
}

.debug-content pre {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    max-height: 300px;
    overflow: auto;
    font-size: 0.75rem;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .header-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--brand-dark);
        flex-direction: column;
        padding: 1rem;
    }

    .header-nav.active {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }

    .search-input-wrapper input {
        font-size: 0.875rem;
    }

    .banner-overlay h2 {
        font-size: 1.25rem;
    }

    .cat-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .seller-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .section-title {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 8px;
    }

    .product-name {
        font-size: 0.875rem;
    }

    .price-current {
        font-size: 1rem;
    }
}

.banner-overlay h2 {
    font-size: 1.5rem; /* Adjust as needed */
}
.banner-overlay p {
    font-size: 1rem; /* Adjust as needed */
}

@media (min-width: 768px) {
    .banner-hero {
        max-width: 500px; /* Smaller width */
        margin: 0 auto;
    }
    .banner-hero img {
        width: 100%;
        height: auto;
    }
}