:root {
    --bg-main: #f5f5f5;
    --bg-card: #ffffff;
    --text-main: #212121;
    --text-muted: #757575;
    --accent-gold: #ffc107; /* Tokopedia-ish green or Gold. Let's use Gold & Green */
    --accent-primary: #03ac0e; /* Tokopedia Green */
    --accent-hover: #02870b;
    --danger: #ff5252;
    --border-color: #e0e0e0;
    --shadow-sm: 0 1px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.5;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 5%;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    gap: 2rem;
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.logo .stars {
    color: var(--accent-gold);
    font-size: 0.7rem;
    letter-spacing: 1px;
}

.logo h1 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: -0.5px;
}

/* Search Bar (Fake) */
.search-container {
    flex-grow: 1;
    display: flex;
    max-width: 600px;
}
.search-container input {
    width: 100%;
    padding: 0.6rem 1rem;
    border: 1px solid var(--border-color);
    border-right: none;
    border-radius: 8px 0 0 8px;
    outline: none;
    font-size: 0.95rem;
}
.search-container input:focus {
    border-color: var(--accent-primary);
}
.search-container button {
    padding: 0.6rem 1.2rem;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    background: var(--bg-main);
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.auth-btn {
    background: transparent;
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    padding: 0.4rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

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

.cart-icon {
    position: relative;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.cart-icon:hover {
    transform: scale(1.1);
}

#cart-count {
    position: absolute;
    top: -5px;
    right: -10px;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
}

/* Categories Nav */
.category-nav {
    background: var(--bg-card);
    padding: 1rem 5%;
    display: flex;
    justify-content: center;
    gap: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.nav-btn:hover {
    color: var(--accent-primary);
}

.nav-btn.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

/* Banner Section */
.banner {
    margin: 1.5rem 5%;
    background: linear-gradient(90deg, var(--accent-primary) 0%, #17c622 100%);
    border-radius: 12px;
    padding: 2rem;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
}
.banner h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}
.banner p {
    font-size: 1rem;
    opacity: 0.9;
}
.banner-img {
    font-size: 4rem;
    opacity: 0.8;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.2rem;
    padding: 1rem 5% 4rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Product Card */
.product-card {
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}

.product-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent-primary);
}

.product-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-bottom: 1px solid var(--border-color);
}

.product-info {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 0.95rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.product-seller {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.product-seller::before {
    content: "🏪";
}

.add-to-cart {
    margin-top: auto;
    width: 100%;
    padding: 0.6rem;
    border: 1px solid var(--accent-primary);
    border-radius: 4px;
    background: transparent;
    color: var(--accent-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-to-cart:hover {
    background: var(--accent-primary);
    color: white;
}

/* Cart Overlay */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: flex-end;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.cart-overlay.show {
    opacity: 1;
    visibility: visible;
}

.cart-modal {
    width: 100%;
    max-width: 400px;
    height: 100%;
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.cart-overlay.show .cart-modal {
    transform: translateX(0);
}

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

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.8rem;
    cursor: pointer;
}

.cart-items {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.item-info h4 {
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
    font-weight: 600;
}

.item-info p {
    font-size: 0.9rem;
    color: var(--accent-primary);
    font-weight: bold;
}

.remove-btn {
    background: var(--bg-main);
    color: var(--danger);
    border: 1px solid var(--danger);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
}

.cart-summary {
    padding: 1.2rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
    box-shadow: 0 -4px 10px rgba(0,0,0,0.05);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.summary-row.admin-fee {
    color: var(--accent-gold);
}

.summary-row.total {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px dashed var(--border-color);
}

.checkout-btn {
    width: 100%;
    padding: 0.8rem;
    margin-top: 1rem;
    border: none;
    border-radius: 6px;
    background: var(--accent-primary);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
}
.checkout-btn:hover {
    background: var(--accent-hover);
}

/* Authentication Forms */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}
.auth-card {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-md);
    text-align: center;
}
.auth-card h2 {
    color: var(--accent-primary);
    margin-bottom: 1.5rem;
}
.input-group {
    margin-bottom: 1rem;
    text-align: left;
}
.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}
.input-group input, .input-group select {
    width: 100%;
    padding: 0.8rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    color: var(--text-main);
    outline: none;
}
.input-group input:focus, .input-group select:focus {
    border-color: var(--accent-primary);
}
.btn-submit {
    width: 100%;
    padding: 0.8rem;
    margin-top: 1rem;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
}

/* Admin Dashboard Table */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}
.admin-table th, .admin-table td {
    padding: 0.8rem;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    font-size: 0.9rem;
}
.admin-table th {
    background: var(--bg-main);
    font-weight: 600;
    color: var(--text-muted);
}
.badge {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    background: var(--accent-gold);
    color: #fff;
    font-weight: 600;
}

@media (max-width: 768px) {
    .search-container {
        display: none;
    }
}
