:root {
  --bg: #f5f7f2;
  --surface: #ffffff;
  --surface-soft: #f5f9f4;
  --primary: #0d7a5d;
  --primary-dark: #0a5b46;
  --text: #15241d;
  --muted: #5d6f67;
  --line: #dfe8e0;
  --danger: #b93d34;
  --shadow: 0 18px 38px rgba(15, 31, 25, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header,
.section,
.site-footer,
.hero,
.benefits,
.contact-section {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-weight: 700;
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: var(--shadow);
}

.brand span:nth-child(2) {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  letter-spacing: 0.06em;
}

.brand small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  color: var(--muted);
  font-weight: 700;
}

.main-nav a {
  position: relative;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.main-nav a:hover::after,
.main-nav a:focus-visible::after {
  transform: scaleX(1);
}

.primary-button,
.secondary-button,
.admin-button,
.whatsapp-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.85rem 1.4rem;
  font-weight: 700;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-button,
.admin-button,
.whatsapp-button {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 12px 24px rgba(13, 122, 93, 0.2);
}

.secondary-button {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
}

.primary-button:hover,
.secondary-button:hover,
.admin-button:hover,
.whatsapp-button:hover,
.primary-button:focus-visible,
.secondary-button:focus-visible,
.admin-button:focus-visible,
.whatsapp-button:focus-visible {
  transform: translateY(-1px);
}

.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 28px;
  padding: 48px 0 18px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--primary);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.hero h1,
.admin-heading h1,
.section-heading h2,
.contact-section h2,
.admin-panel h2 {
  margin: 0;
  color: var(--text);
  line-height: 1.08;
}

.hero h1 {
  font-size: clamp(2.6rem, 5vw, 5rem);
}

.hero h1 span {
  color: var(--primary);
}

.hero-content p,
.section-heading p,
.contact-section p,
.admin-heading p,
.admin-panel p,
.site-footer p,
.demo-warning {
  color: var(--muted);
}

.hero-content p {
  max-width: 540px;
  margin: 18px 0 24px;
  font-size: 1.1rem;
}

.hero-art {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 420px;
  background: linear-gradient(180deg, #eef4ee, #fcfdfb);
  border: 1px solid var(--line);
  border-radius: 32px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.gear {
  position: absolute;
  display: grid;
  place-items: center;
  font-size: clamp(6rem, 12vw, 9rem);
  color: rgba(13, 122, 93, 0.2);
  animation: spin 16s linear infinite;
}

.gear-one {
  top: 52px;
  left: 54px;
}

.gear-two {
  right: 56px;
  bottom: 52px;
  animation-direction: reverse;
}

.hero-badge {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(13, 122, 93, 0.1);
  box-shadow: 0 24px 52px rgba(13, 122, 93, 0.08);
  text-align: center;
}

.hero-badge strong {
  font-size: 2rem;
  letter-spacing: 0.12em;
}

.hero-badge span {
  margin-top: 8px;
  color: var(--muted);
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.benefits {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: 20px 0 12px;
}

.benefits div {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  font-weight: 700;
  color: var(--primary);
}

.benefits span {
  color: var(--text);
}

.section {
  padding: 52px 0 0;
}

.section-heading,
.admin-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.section-heading h2,
.contact-section h2,
.admin-page h1,
.admin-panel h2 {
  font-size: clamp(2rem, 3vw, 2.7rem);
}

.search-box {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: min(100%, 380px);
  padding: 0.92rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
}

.search-box input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  outline: none;
}

.search-box input::placeholder {
  color: #7c8a84;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.product-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 10px 24px rgba(16, 29, 24, 0.03);
}

.product-card .product-tag {
  display: inline-flex;
  align-self: flex-start;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(13, 122, 93, 0.08);
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.product-card h3 {
  margin: 0;
  font-size: 1.2rem;
}

.product-card .price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: auto;
}

.product-price {
  font-size: 1.6rem;
  font-weight: 800;
}

.product-stock {
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: #edf8f5;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
}

.product-card.low-stock .product-stock {
  background: #fff4eb;
  color: #af5a12;
}

.product-card.out-stock .product-stock {
  background: #fdeceb;
  color: var(--danger);
}

.empty-message {
  margin-top: 18px;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
  text-align: center;
}

.contact-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 44px 0 60px;
  margin-top: 26px;
  border-top: 1px solid var(--line);
}

.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 36px 0 50px;
  text-align: center;
  background: #e7efe9;
  border-top: 1px solid var(--line);
}

.footer-brand {
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--primary);
}

#admin-view[hidden] {
  display: none;
}

.admin-page {
  padding-top: 42px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 26px 0 24px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 12px 20px rgba(18, 35, 28, 0.04);
}

.stat-card span {
  color: var(--muted);
}

.stat-card strong {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.admin-panel {
  padding: 22px 20px;
  margin-top: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 12px 20px rgba(16, 29, 24, 0.03);
}

.product-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.product-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 700;
  color: var(--muted);
}

.product-form input,
.product-form select {
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcfb;
  color: var(--text);
}

.product-form input:focus,
.product-form select:focus {
  outline: 2px solid rgba(13, 122, 93, 0.12);
  border-color: rgba(13, 122, 93, 0.35);
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}

.table-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.table-heading span {
  color: var(--muted);
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.table-status {
  display: inline-flex;
  align-items: center;
  padding: 0.36rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.status-in-stock {
  background: #edf8f5;
  color: var(--primary);
}

.status-low-stock {
  background: #fff4eb;
  color: #af5a12;
}

.status-out-stock {
  background: #fdeceb;
  color: var(--danger);
}

.action-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-button {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text);
  border-radius: 10px;
  padding: 0.55rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.action-button.delete {
  border-color: rgba(185, 61, 52, 0.2);
  background: #fff1f0;
  color: var(--danger);
}

.demo-warning {
  margin: 26px 0 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: #fff7e7;
  border: 1px solid rgba(244, 166, 42, 0.25);
  color: #7c5b1d;
}

@media (max-width: 860px) {
  .site-header,
  .section-heading,
  .admin-heading,
  .contact-section {
    flex-direction: column;
    align-items: flex-start;
  }

  .main-nav {
    flex-wrap: wrap;
    gap: 18px;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .benefits,
  .product-form,
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .brand {
    align-items: flex-start;
  }

  .site-header,
  .hero,
  .section,
  .contact-section,
  .site-footer {
    width: min(100% - 20px, 1120px);
  }

  .primary-button,
  .secondary-button,
  .admin-button,
  .whatsapp-button {
    width: 100%;
  }

  .search-box {
    width: 100%;
  }
}

    <meta name="description"
          content="Find motorcycle spare parts at Nuru Spares in Migori.">

    <title>Nuru Spares | Motorcycle Parts</title>
    <link rel="stylesheet" href="style.css">
    <script src="script.js" defer></script>
</head>

<body>

    <header class="site-header">
        <a href="#home" class="brand">
            <span class="brand-icon">N</span>
            <span>NURU <strong>SPARES</strong>
                <small>Motorcycle Parts</small>
            </span>
        </a>

        <nav class="main-nav">
            <a href="#home">Home</a>
            <a href="#products">Products</a>
            <a href="#contact">Contact</a>
        </nav>

        <button id="admin-toggle" class="admin-button" type="button">
            Manage Shop
        </button>
    </header>

    <main id="customer-view">

        <section class="hero" id="home">
            <div class="hero-content">
                <span class="eyebrow">YOUR LOCAL MOTORCYCLE PARTNER</span>

                <h1>Keep Your Bike<br>
                    <span>Moving.</span>
                </h1>

                <p>
                    Find the motorcycle spare parts and engine oils
                    you need at Nuru Spares, Migori.
                </p>

                <a href="#products" class="primary-button">
                    Explore Products →
                </a>
            </div>

            <div class="hero-art" aria-hidden="true">
                <span class="gear gear-one">⚙</span>
                <span class="gear gear-two">⚙</span>
                <div class="hero-badge">
                    <strong>QUALITY</strong>
                    <span>Parts & Oils</span>
                </div>
            </div>
        </section>

        <section class="benefits">
            <div>✓ <span>Useful parts for your bike</span></div>
            <div>✓ <span>Clear prices in KSh</span></div>
            <div>✓ <span>Easy WhatsApp enquiries</span></div>
        </section>

        <section class="catalogue section" id="products">
            <div class="section-heading">
                <div>
                    <span class="eyebrow">OUR CATALOGUE</span>
                    <h2>Find Your Parts</h2>
                    <p>Browse our available product listings.</p>
                </div>

                <label class="search-box">
                    <span aria-hidden="true">⌕</span>
                    <input id="product-search"
                           type="search"
                           placeholder="Search spare parts..."
                           aria-label="Search products">
                </label>
            </div>

            <div id="product-grid" class="product-grid"></div>

            <p id="empty-message" class="empty-message" hidden>
                No matching products found.
            </p>
        </section>

        <section class="contact-section" id="contact">
            <div>
                <span class="eyebrow">NEED HELP?</span>
                <h2>Looking for a specific part?</h2>
                <p>Contact Nuru Spares to ask about a product or its availability.</p>
            </div>

            <a id="main-whatsapp"
               class="whatsapp-button"
               href="#contact">
                Contact on WhatsApp ↗
            </a>
        </section>

    </main>

    <main id="admin-view" hidden>
        <section class="admin-page section">
            <div class="admin-heading">
                <div>
                    <span class="eyebrow">SHOP CONTROL</span>
                    <h1>Management Dashboard</h1>
                    <p>Manage your product catalogue and stock.</p>
                </div>

                <button id="store-toggle" class="secondary-button" type="button">
                    ← Customer Website
                </button>
            </div>

            <div class="stats-grid">
                <article class="stat-card">
                    <span>Total Products</span>
                    <strong id="stat-products">0</strong>
                </article>

                <article class="stat-card">
                    <span>Units in Stock</span>
                    <strong id="stat-stock">0</strong>
                </article>

                <article class="stat-card">
                    <span>Low Stock Items</span>
                    <strong id="stat-low">0</strong>
                </article>
            </div>

            <section class="admin-panel">
                <h2 id="form-heading">Add a Product</h2>

                <form id="product-form" class="product-form">
                    <input id="edit-id" type="hidden">

                    <label>
                        Product Name
                        <input id="product-name"
                               type="text"
                               placeholder="e.g. Piston"
                               required>
                    </label>

                    <label>
                        Price (KSh)
                        <input id="product-price"
                               type="number"
                               min="0"
                               step="1"
                               placeholder="450"
                               required>
                    </label>

                    <label>
                        Stock Quantity
                        <input id="product-stock"
                               type="number"
                               min="0"
                               step="1"
                               placeholder="10"
                               required>
                    </label>

                    <label>
                        Category
                        <select id="product-category">
                            <option value="Engine Parts">Engine Parts</option>
                            <option value="Oils & Lubricants">Oils & Lubricants</option>
                            <option value="Transmission">Transmission</option>
                            <option value="Other">Other</option>
                        </select>
                    </label>

                    <div class="form-actions">
                        <button class="primary-button" type="submit">
                            Save Product
                        </button>

                        <button id="cancel-edit"
                                class="secondary-button"
                                type="button"
                                hidden>
                            Cancel Edit
                        </button>
                    </div>
                </form>
            </section>

            <section class="admin-panel">
                <div class="table-heading">
                    <h2>Product Inventory</h2>
                    <span>Demo data stored in this browser</span>
                </div>

                <div class="table-scroll">
                    <table>
                        <thead>
                            <tr>
                                <th>Product</th>
                                <th>Price</th>
                                <th>Stock</th>
                                <th>Status</th>
                                <th>Actions</th>
                            </tr>
                        </thead>
                        <tbody id="inventory-body"></tbody>
                    </table>
                </div>
            </section>

            <p class="demo-warning">
                Demo only: this dashboard has no login or cloud database.
                Do not use it for sensitive or production business data yet.
            </p>
        </section>
    </main>

    <footer class="site-footer">
        <a href="#home" class="footer-brand">NURU SPARES</a>
        <p>Motorcycle spare parts · Migori, Kenya</p>
        <p>© 2026 Nuru Spares</p>
    </footer>

</body>
</html>
/* CATEGORY FILTERS */
.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0 24px;
}

.category-btn {
    padding: 10px 16px;
    border: 1px solid #d1d5db;
    border-radius: 24px;
    background: #ffffff;
    color: #1f2937;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.category-btn:hover {
    border-color: #0f766e;
    color: #0f766e;
}

.category-btn.active {
    background: #0f766e;
    border-color: #0f766e;
    color: #ffffff;
}

.category-btn:focus-visible {
    outline: 3px solid #99f6e4;
    outline-offset: 3px;
}