:root {
    --primary: #f97316;
    --primary-hover: #ea580c;
    --secondary: #0A2540;
    --background: #f8fafc;
    --surface: #ffffff;
    --text: #334155;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 8px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--background);
    color: var(--text);
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Navbar */
.navbar {
    background: var(--surface);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--secondary);
}

.search-bar {
    flex: 1;
    max-width: 500px;
    display: flex;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 99px;
    overflow: hidden;
}

.search-bar input {
    flex: 1;
    border: none;
    padding: 0.5rem 1rem;
    background: transparent;
    outline: none;
}

.search-bar button {
    background: transparent;
    border: none;
    padding: 0 1rem;
    color: var(--text-muted);
    cursor: pointer;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cart-btn {
    position: relative;
    font-size: 1.25rem;
    color: var(--secondary);
    cursor: pointer;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-btn {
    background: var(--secondary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Hero */
.hero {
    background: linear-gradient(135deg, var(--secondary), #1e3a8a);
    color: white;
    padding: 3rem 1rem;
    border-radius: var(--radius);
    margin: 2rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Categories */
.categories {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    scrollbar-width: none;
}
.categories::-webkit-scrollbar { display: none; }

.cat-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 99px;
    cursor: pointer;
    white-space: nowrap;
    font-weight: 500;
    color: var(--text);
    transition: all 0.2s;
}

.cat-btn.active, .cat-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Products */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    padding-bottom: 4rem;
}

.product-card {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s;
}

.product-card:hover {
    transform: translateY(-4px);
}

.product-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #f1f5f9;
}

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

.product-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.product-cat {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

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

.product-stock {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.btn-add-cart {
    margin-top: auto;
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
}

.btn-add-cart:hover {
    background: var(--primary-hover);
}
.btn-add-cart:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}

/* 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.show {
    display: flex;
}

.modal-content {
    background: var(--surface);
    width: 90%;
    max-width: 500px;
    border-radius: var(--radius);
    padding: 1.5rem;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}

.close-btn {
    position: absolute;
    top: 15px; right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

/* Cart Items */
.cart-items {
    margin-top: 1.5rem;
    max-height: 300px;
    overflow-y: auto;
}

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

.cart-item-info {
    flex: 1;
}

.cart-item-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.cart-item-price {
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 600;
}

.cart-qty-ctrl {
    display: flex;
    align-items: center;
    gap: 10px;
}
.cart-qty-ctrl button {
    width: 25px; height: 25px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: var(--background);
    cursor: pointer;
}

.cart-summary {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid var(--border);
}
.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
}
.btn-primary { background: var(--primary); color: white; }
.btn-block { width: 100%; }

/* Forms */
.form-group {
    margin-bottom: 1rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}
.form-group input, .form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
}

@media (max-width: 768px) {
    .nav-container { flex-wrap: wrap; }
    .search-bar { order: 3; max-width: 100%; }
}
