/* === Переменные === */
:root {
  --primary: #2d2d2d;
  --accent: #e85d4a;
  --accent-hover: #d14a38;
  --bg: #f8f8f8;
  --card-bg: #fff;
  --text: #111;
  --text-light: #555;
  --border: #eee;
  --radius: 12px;
  --shadow: 0 2px 16px rgba(0,0,0,0.07);
}

/* === Сброс и база === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* === Шапка === */
.header {
  position: sticky; top: 0; z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.header-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; gap: 24px;
  padding: 14px 20px;
}
.logo {
  font-size: 1.5rem; font-weight: 800; letter-spacing: 2px;
  color: var(--primary); text-decoration: none;
}
.nav { display: flex; gap: 20px; margin-left: auto; }
.nav-link {
  text-decoration: none; color: var(--text-light);
  font-weight: 500; transition: color .2s;
}
.nav-link:hover, .nav-link.active { color: var(--accent); }
.cart-btn {
  background: var(--primary); color: #fff; border: none;
  padding: 10px 18px; border-radius: 50px;
  font-size: .9rem; font-weight: 600;
  cursor: pointer; transition: background .2s;
  display: flex; align-items: center; gap: 6px;
}
.cart-btn:hover { background: #444; }
.cart-count {
  background: var(--accent); border-radius: 50%;
  width: 22px; height: 22px; display: inline-flex;
  align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700;
}

/* === Герой === */
.hero {
  background: linear-gradient(135deg, #2d2d2d 0%, #444 100%);
  color: #fff; text-align: center;
  padding: 100px 20px 80px;
}
.hero h1 { font-size: 2.6rem; font-weight: 800; margin-bottom: 12px; }
.hero p { font-size: 1.15rem; opacity: .8; margin-bottom: 32px; }
.hero-btn {
  display: inline-block; background: var(--accent); color: #fff;
  padding: 14px 36px; border-radius: 50px;
  font-size: 1rem; font-weight: 600; text-decoration: none;
  transition: background .2s, transform .15s;
}
.hero-btn:hover { background: var(--accent-hover); transform: translateY(-2px); }

/* === Секции === */
.section-title {
  text-align: center; font-size: 2rem; font-weight: 800;
  margin: 60px 0 30px; color: #111;
}

/* === Фильтры === */
.filters {
  display: flex; justify-content: center; gap: 10px;
  flex-wrap: wrap; margin-bottom: 36px;
}
.filter-btn {
  padding: 10px 22px; border: 2px solid #ccc;
  border-radius: 50px; background: #fff;
  font-size: .9rem; font-weight: 600; cursor: pointer;
  transition: all .2s; color: #333;
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active {
  background: var(--accent); color: #fff;
  border-color: var(--accent);
}

/* === Карточки товаров === */
.products {
  max-width: 1100px; margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px; padding: 0 20px 60px;
}
.product-card {
  background: var(--card-bg); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  transition: transform .2s, box-shadow .2s;
  display: flex; flex-direction: column;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}
.product-img {
  width: 100%; aspect-ratio: 3/4;
  object-fit: cover; background: #eaeaea;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem;
}
.product-info { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.product-category {
  font-size: .8rem; text-transform: uppercase;
  color: var(--accent); font-weight: 700; letter-spacing: 1px;
  margin-bottom: 4px;
}
.product-name { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; color: #111; }
.product-price { font-size: 1.25rem; font-weight: 800; margin-bottom: 14px; color: #111; }
.product-btn {
  margin-top: auto; width: 100%;
  padding: 12px; border: none; border-radius: 8px;
  background: var(--primary); color: #fff;
  font-size: .9rem; font-weight: 600; cursor: pointer;
  transition: background .2s;
}
.product-btn:hover { background: var(--accent); }

/* === О нас === */
.about {
  background: #fff; padding: 0 20px 60px;
}
.about-grid {
  max-width: 900px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}
.about-card {
  text-align: center; padding: 32px 20px;
  border-radius: var(--radius); background: var(--bg);
}
.about-icon { font-size: 2.4rem; margin-bottom: 12px; }
.about-card h3 { font-size: 1.1rem; margin-bottom: 8px; font-weight: 700; }
.about-card p { font-size: .95rem; color: #444; }

/* === Подвал === */
.footer {
  text-align: center; padding: 28px 20px;
  color: var(--text-light); font-size: .85rem;
  border-top: 1px solid var(--border);
}

/* === Модальное окно === */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.45);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff; border-radius: var(--radius);
  width: 100%; max-width: 480px; max-height: 85vh;
  display: flex; flex-direction: column;
  box-shadow: 0 12px 40px rgba(0,0,0,.2);
  animation: slideUp .25s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 1.2rem; }
.modal-close {
  background: none; border: none; font-size: 1.6rem;
  cursor: pointer; color: var(--text-light);
  transition: color .2s;
}
.modal-close:hover { color: var(--accent); }
.modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.empty-cart { text-align: center; color: var(--text-light); padding: 40px 0; }
.cart-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.cart-item-icon { font-size: 1.8rem; }
.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 600; font-size: .95rem; }
.cart-item-price { font-size: .85rem; color: var(--text-light); }
.cart-item-qty {
  display: flex; align-items: center; gap: 8px;
}
.qty-btn {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--border); background: #fff;
  font-size: 1rem; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  transition: all .15s;
}
.qty-btn:hover { border-color: var(--accent); color: var(--accent); }
.cart-item-remove {
  background: none; border: none; color: #c44;
  font-size: 1.2rem; cursor: pointer; padding: 4px;
}
.modal-footer {
  padding: 20px 24px; border-top: 1px solid var(--border);
}
.cart-total {
  font-size: 1.15rem; font-weight: 700;
  margin-bottom: 14px; text-align: right;
}
.checkout-btn {
  width: 100%; padding: 14px; border: none;
  border-radius: 8px; background: var(--accent);
  color: #fff; font-size: 1rem; font-weight: 600;
  cursor: pointer; transition: background .2s;
}
.checkout-btn:hover { background: var(--accent-hover); }

/* === Уведомление === */
.toast {
  position: fixed; bottom: 30px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--primary); color: #fff;
  padding: 14px 28px; border-radius: 50px;
  font-size: .9rem; font-weight: 500;
  box-shadow: 0 6px 20px rgba(0,0,0,.2);
  transition: transform .3s ease;
  z-index: 300; pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* === Адаптив === */
@media (max-width: 600px) {
  .hero h1 { font-size: 1.8rem; }
  .header-inner { gap: 12px; }
  .nav { gap: 12px; }
  .nav-link { font-size: .85rem; }
  .cart-btn { font-size: .8rem; padding: 8px 12px; }
  .products { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
}
