*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue: #2b3ef5;
  --blue-dark: #1a2bcc;
  --blue-light: #3d52ff;
  --dark: #0f1117;
  --dark2: #181c2a;
  --text: #1a1d2e;
  --muted: #6b7280;
  --white: #ffffff;
  --border: #e5e7eb;
  --green: #16a34a;
  --green-bg: #f0fdf4;
}

body {
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  background: #f8f9fc;
  overflow-x: hidden;
}

/* NAV */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: 58px;
  background: var(--dark2);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--white);
  letter-spacing: -0.02em;
  text-decoration: none;
}

.logo-icon {
  width: 28px;
  height: 28px;
  background: var(--blue);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 400;
  padding: 6px 14px;
  border-radius: 6px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 5px;
}

.nav-links a:hover { color: #fff; background: rgba(255,255,255,0.08); }
.nav-links a.active { color: #fff; }

.nav-cart {
  background: var(--blue);
  color: white;
  border: none;
  padding: 8px 18px;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  transition: background 0.2s;
}

.nav-cart:hover { background: var(--blue-light); }

.cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #ef4444;
  color: white;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* PAGE */
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

.page h1 {
  font-family: 'Syne', sans-serif;
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  color: var(--text);
}

/* SEARCH */
.search-bar {
  position: relative;
  margin-bottom: 18px;
}

.search-bar input {
  width: 100%;
  max-width: 340px;
  padding: 9px 14px 9px 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  color: var(--text);
  background: white;
  outline: none;
  transition: border 0.2s;
}

.search-bar input:focus { border-color: var(--blue); }
.search-bar input::placeholder { color: var(--muted); }

.search-bar .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 14px;
}

/* CATEGORIES */
.categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.cat-btn {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: white;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text);
}

.cat-btn:hover { border-color: var(--blue); color: var(--blue); }

.cat-btn.active {
  background: var(--dark);
  border-color: var(--dark);
  color: white;
  font-weight: 500;
}

/* RESULTS */
.results-count {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 400;
  margin-bottom: 20px;
}

/* GRID */
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* PRODUCT CARD */
.product-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all 0.25s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.1);
  transform: translateY(-3px);
  border-color: #c7d2fe;
}

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

.product-body {
  padding: 12px 14px 6px;
  flex: 1;
}

.product-name {
  font-family: 'Syne', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.3;
}

.product-desc {
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.4;
  margin-bottom: 10px;
}

.product-footer {
  padding: 0 14px 14px;
}

.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.price {
  font-family: 'Syne', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--blue);
}

.badge-stock {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 20px;
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid #bbf7d0;
}

.btn-cart {
  width: 100%;
  background: var(--dark);
  color: white;
  border: none;
  padding: 9px 0;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-cart:hover { background: var(--blue); }

/* FOOTER */
footer {
  background: var(--dark);
  padding: 48px 40px 28px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 48px;
  max-width: 1100px;
  margin: 0 auto 40px;
}

.footer-brand h3 {
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: white;
  margin-bottom: 8px;
}

.footer-brand p {
  font-size: 0.82rem;
  line-height: 1.6;
  color: rgba(255,255,255,0.4);
}

.footer-col h4 {
  font-family: 'Syne', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: white;
  margin-bottom: 14px;
}

.footer-col p, .footer-col a {
  font-size: 0.82rem;
  line-height: 1.9;
  color: rgba(255,255,255,0.45);
  display: block;
  text-decoration: none;
}

.footer-col a:hover { color: rgba(255,255,255,0.7); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 20px;
  text-align: center;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.25);
  max-width: 1100px;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .products-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  nav { padding: 0 20px; }
}

@media (max-width: 500px) {
  .products-grid { grid-template-columns: 1fr; }
}
