* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
:root {
    --primary: #27ae60;
    --primary-dark: #219a52;
    --secondary: #f39c12;
    --bg: #f8f9fa;
    --bg-card: #ffffff;
    --text: #2c3e50;
    --text-light: #7f8c8d;
    --shadow: 0 4px 15px rgba(0,0,0,0.1);
    --radius: 16px;
    --transition: 0.3s ease;
}
[data-theme="dark"] {
    --primary: #2ecc71;
    --primary-dark: #27ae60;
    --secondary: #e67e22;
    --bg: #1a1a2e;
    --bg-card: #16213e;
    --text: #ecf0f1;
    --text-light: #bdc3c7;
    --shadow: 0 4px 15px rgba(0,0,0,0.5);
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background var(--transition), color var(--transition);
}
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }

.header {
    background: var(--bg-card);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.nav-brand h1 {
    font-size: 1.8rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.nav-subtitle {
    font-size: 0.9rem;
    color: var(--text-light);
}
.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text);
    cursor: pointer;
}
.nav-links {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}
.nav-links li a {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: background var(--transition);
}
.nav-links li a:hover {
    background: var(--primary);
    color: #fff;
}
.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.theme-btn, .dark-btn, .login-btn {
    background: none;
    border: 2px solid var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text);
    transition: all var(--transition);
}
.theme-btn:hover, .dark-btn:hover, .login-btn:hover {
    background: var(--primary);
    color: #fff;
}
.login-btn {
    background: var(--primary);
    color: #fff;
}

.hero {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 5rem 2rem;
    text-align: center;
    color: #fff;
}
.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}
.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
.btn-primary {
    display: inline-block;
    background: #fff;
    color: var(--primary);
    padding: 0.8rem 2rem;
    border-radius: 30px;
    font-weight: bold;
    transition: transform var(--transition);
}
.btn-primary:hover {
    transform: scale(1.05);
}

.filters {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}
.search-bar {
    flex: 1;
    min-width: 250px;
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border-radius: 30px;
    padding: 0.5rem 1rem;
    box-shadow: var(--shadow);
}
.search-bar i {
    color: var(--text-light);
    margin-right: 0.5rem;
}
.search-bar input {
    border: none;
    background: none;
    outline: none;
    width: 100%;
    font-size: 1rem;
    color: var(--text);
}
.filter-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.filter-group select {
    padding: 0.6rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--text-light);
    background: var(--bg-card);
    color: var(--text);
    cursor: pointer;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}
.product-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
}
.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}
.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
.card-body {
    padding: 1.5rem;
}
.card-body h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}
.desc {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}
.price {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 0.5rem;
}
.rating {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 1rem;
}
.rating .fa-star {
    color: #ddd;
}
.rating .fa-star.active {
    color: var(--secondary);
}
.rating span {
    font-size: 0.8rem;
    color: var(--text-light);
}
.add-cart {
    width: 100%;
    padding: 0.8rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background var(--transition);
}
.add-cart:hover {
    background: var(--primary-dark);
}

.stats-heatmap {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}
.stats-heatmap h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
}
.stat-card i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}
.stat-card span {
    font-size: 2rem;
    font-weight: bold;
    display: block;
}
.heatmap {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 2rem;
    min-height: 200px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    justify-content: center;
}
.heatmap-bar {
    width: 30px;
    background: linear-gradient(to top, var(--primary), var(--secondary));
    border-radius: 4px 4px 0 0;
    transition: height 0.5s;
}

.footer {
    background: var(--bg-card);
    padding: 3rem 2rem 1rem;
    margin-top: 3rem;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.05);
}
.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}
.footer-section h4 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}
.footer-section ul {
    list-style: none;
}
.footer-section ul li {
    margin-bottom: 0.5rem;
}
.social-share {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}
.social-share a {
    font-size: 1.5rem;
    color: var(--text-light);
    transition: color var(--transition);
}
.social-share a:hover {
    color: var(--primary);
}
.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #eee;
    margin-top: 2rem;
    color: var(--text-light);
}

/* Admin */
.admin-login {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}
.login-container {
    background: var(--bg-card);
    padding: 3rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 400px;
}
.login-container h2 {
    text-align: center;
    margin-bottom: 2rem;
}
.form-group {
    margin-bottom: 1.5rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}
.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg);
    color: var(--text);
}
.form-group textarea {
    resize: vertical;
}
.error {
    color: #e74c3c;
    text-align: center;
    margin-bottom: 1rem;
}
.back-link {
    text-align: center;
    margin-top: 1rem;
}
.admin-header {
    background: var(--bg-card);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
}
.admin-header h1 {
    font-size: 1.5rem;
}
.admin-actions a {
    margin-left: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
}
.admin-main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}
.admin-section {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}
.admin-section h2 {
    margin-bottom: 1.5rem;
}
.admin-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.admin-form .form-group:last-of-type {
    grid-column: 1 / -1;
}
.admin-form button {
    grid-column: 1 / -1;
}
.message {
    background: var(--primary);
    color: #fff;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}
.admin-table-wrapper {
    overflow-x: auto;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
}
.admin-table th, .admin-table td {
    padding: 0.8rem;
    border-bottom: 1px solid #eee;
    text-align: left;
}
.admin-table th {
    background: var(--primary);
    color: #fff;
}
.btn-danger {
    background: #e74c3c;
    color: #fff;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    .hamburger { display: block; }
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-card);
        padding: 1rem;
        box-shadow: var(--shadow);
    }
    .nav-links.active { display: flex; }
    .nav-actions { gap: 0.5rem; }
    .hero h2 { font-size: 1.8rem; }
    .filters { flex-direction: column; }
    .admin-form { grid-template-columns: 1fr; }
}