:root {
  --primary: #43a047;
  --primary-dark: #2e7d32;
  --text: #212121;
  --gray: #757575;
  --bg: #f5f5f5;
  --white: #ffffff;
  --border: #e0e0e0;
}

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

body {
  font-family: -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

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

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Шапка */
.header {
  background: var(--white);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header__top {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 0;
}
.logo {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}
.search { flex: 1; display: flex; max-width: 700px; }
.search input {
  flex: 1;
  padding: 10px 16px;
  border: 2px solid var(--border);
  border-right: none;
  border-radius: 6px 0 0 6px;
  font-size: 15px;
  outline: none;
}
.search input:focus { border-color: var(--primary); }
.search button {
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 0 24px;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  font-weight: 600;
}
.header__actions { display: flex; gap: 20px; align-items: center; }
.header__action {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 12px;
  color: var(--gray);
  position: relative;
}
.header__action b { font-size: 14px; color: var(--text); }
.cart-count {
  position: absolute;
  top: -6px;
  right: -10px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 10px;
}

/* Меню категорий */
.main-menu {
  background: var(--white);
  border-top: 1px solid var(--border);
}
.main-menu ul {
  display: flex;
  list-style: none;
  gap: 24px;
  padding: 10px 0;
  overflow-x: auto;
}
.main-menu a {
  font-weight: 500;
  white-space: nowrap;
  padding: 4px 0;
}
.main-menu a:hover { color: var(--primary); }

/* Баннер */
.hero {
  margin: 24px 0;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(120deg, #c8e6c9, #a5d6a7);
  padding: 60px 40px;
  position: relative;
}
.hero h1 { font-size: 36px; margin-bottom: 12px; color: #1b5e20; }
.hero p { font-size: 18px; color: #2e7d32; margin-bottom: 24px; }
.hero .btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  padding: 12px 32px;
  border-radius: 8px;
  font-weight: 600;
  transition: background .2s;
}
.hero .btn:hover { background: var(--primary-dark); }

/* Секции */
.section { margin: 40px 0; }
.section__title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 20px;
}

/* Плитка категорий */
.cats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}
.cat-tile {
  background: var(--white);
  border-radius: 10px;
  padding: 20px 12px;
  text-align: center;
  transition: transform .2s, box-shadow .2s;
}
.cat-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,.1);
}
.cat-tile__img {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  background: #e8f5e9;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}
.cat-tile__name { font-size: 14px; font-weight: 500; }

/* Сетка товаров */
.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.product-card {
  background: var(--white);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s;
  position: relative;
}
.product-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.1); }
.product-card__img {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.product-card__img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.product-card__title {
  font-size: 14px;
  font-weight: 500;
  min-height: 40px;
  margin-bottom: 8px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.product-card__price {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  margin-top: auto;
}
.product-card__old {
  font-size: 13px;
  color: var(--gray);
  text-decoration: line-through;
  margin-left: 6px;
}
.product-card__btn {
  margin-top: 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}
.product-card__btn:hover { background: var(--primary-dark); }
.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #e53935;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}
.badge--new { background: #43a047; }

/* Подвал */
.footer {
  background: #263238;
  color: #b0bec5;
  margin-top: 60px;
  padding: 40px 0 20px;
}
.footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  margin-bottom: 30px;
}
.footer h4 { color: #fff; margin-bottom: 14px; font-size: 15px; }
.footer a { display: block; padding: 4px 0; font-size: 14px; }
.footer a:hover { color: var(--primary); }
.footer__bottom {
  border-top: 1px solid #37474f;
  padding-top: 20px;
  text-align: center;
  font-size: 13px;
}

/* Адаптив */
@media (max-width: 768px) {
  .header__top { flex-wrap: wrap; }
  .search { order: 3; width: 100%; max-width: none; }
  .hero { padding: 32px 20px; }
  .hero h1 { font-size: 24px; }
  .products { grid-template-columns: repeat(2, 1fr); }
}