/* Variables & Reset */
:root {
    --primary-color: #1B4332;
    --primary-light: #2D6A4F;
    --accent-color: #FFD166;
    --bg-color: #F8F9FA;
    --text-color: #212529;
    --white: #FFFFFF;
    --border: #DEE2E6;
    --danger: #E63946;
}
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', system-ui, sans-serif; }
body { background-color: var(--bg-color); color: var(--text-color); line-height: 1.6; }

/* Navbar */
.navbar { background-color: var(--primary-color); color: var(--white); padding: 1rem 5%; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 100; }
.nav-controls { display: flex; gap: 1rem; align-items: center; }
.btn-outline { background: transparent; border: 2px solid var(--accent-color); color: var(--accent-color); padding: 0.4rem 1rem; border-radius: 20px; cursor: pointer; font-weight: bold; }
.cart-icon { cursor: pointer; font-size: 1.5rem; position: relative; }
.badge { position: absolute; top: -5px; right: -10px; background: var(--danger); color: white; font-size: 0.8rem; padding: 2px 6px; border-radius: 50%; }

/* Hero Section */
.hero { background: linear-gradient(135deg, var(--primary-light), var(--primary-color)); color: white; text-align: center; padding: 3rem 1rem; }
.hero h1 { margin-bottom: 0.5rem; }
.search-bar { margin-top: 1.5rem; }
.search-bar input { padding: 0.8rem; width: 80%; max-width: 400px; border-radius: 25px; border: none; outline: none; }

/* Layout Grid */
.container { display: flex; gap: 2rem; padding: 2rem 5%; flex-wrap: wrap; }
.sidebar { flex: 1; min-width: 200px; background: white; padding: 1.5rem; border-radius: 12px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); height: fit-content; }
.sidebar ul { list-style: none; margin-top: 1rem; }
.sidebar li { padding: 0.8rem; cursor: pointer; border-radius: 8px; margin-bottom: 0.5rem; transition: 0.3s; }
.sidebar li:hover, .sidebar li.active { background-color: var(--primary-light); color: white; }

.product-section { flex: 3; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.5rem; margin-top: 1rem; }

/* Product Cards */
.card { background: white; border-radius: 12px; padding: 1rem; box-shadow: 0 2px 5px rgba(0,0,0,0.05); text-align: center; display: flex; flex-direction: column; justify-content: space-between; }
.card img { width: 100%; border-radius: 8px; height: 150px; object-fit: cover; margin-bottom: 1rem; }
.card h4 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.price { color: var(--primary-color); font-weight: bold; font-size: 1.2rem; }
.stock-status { font-size: 0.85rem; color: gray; margin-bottom: 1rem; }
.btn-primary { background: var(--accent-color); color: var(--primary-color); border: none; padding: 0.6rem 1rem; border-radius: 8px; font-weight: bold; cursor: pointer; transition: 0.2s; }
.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled { background: #ccc; cursor: not-allowed; }
.w-100 { width: 100%; }

/* Cart Sidebar */
.cart-sidebar { position: fixed; top: 0; right: -400px; width: 100%; max-width: 400px; height: 100vh; background: white; box-shadow: -4px 0 10px rgba(0,0,0,0.1); transition: right 0.3s ease; z-index: 1000; display: flex; flex-direction: column; }
.cart-sidebar.open { right: 0; }
.cart-header { padding: 1.5rem; background: var(--primary-color); color: white; display: flex; justify-content: space-between; align-items: center; }
.close-btn { background: none; border: none; color: white; font-size: 1.5rem; cursor: pointer; }
.cart-items { flex: 1; overflow-y: auto; padding: 1rem; }
.cart-item { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); padding-bottom: 1rem; margin-bottom: 1rem; }
.cart-item h5 { font-size: 0.9rem; }
.qty-controls { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.5rem; }
.qty-btn { width: 25px; height: 25px; border-radius: 5px; border: 1px solid var(--border); cursor: pointer; }
.remove-btn { color: var(--danger); background: none; border: none; cursor: pointer; font-size: 0.8rem; margin-top: 0.5rem; }
.cart-footer { padding: 1.5rem; border-top: 1px solid var(--border); }
.cart-total { display: flex; justify-content: space-between; margin-bottom: 1rem; font-size: 1.2rem; }

/* Modals */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; }
.modal-content { background: white; padding: 2rem; border-radius: 12px; width: 90%; max-width: 500px; position: relative; }
.modal-content .close-btn { color: var(--text-color); position: absolute; right: 1.5rem; top: 1.5rem; }
.form-group { margin-bottom: 1rem; text-align: left; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; }
.form-group input, .form-group textarea { width: 100%; padding: 0.8rem; border: 1px solid var(--border); border-radius: 8px; }
.success-msg { text-align: center; }
.success-msg h3 { color: var(--primary-color); margin-bottom: 1rem; }

footer { text-align: center; padding: 2rem; background: var(--primary-color); color: white; margin-top: 2rem; }