/* ===== KleinesWunder — базовые стили ===== */

:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f7f4ee;
  --color-text: #232323;
  --color-text-muted: #7a7a7a;
  --color-border: #e5e0d5;
  --color-accent: #232323;
  --color-price: #232323;
  --color-price-sale: #c8202e;
  --color-star: #f4b400;

  --font-heading: 'Baskervville', 'Times New Roman', serif;
  --font-body: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --wrap: 1360px;
  --wrap-narrow: 1200px;

  --header-h: 72px;

  --radius-sm: 4px;
  --radius-md: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; background: none; border: 0; color: inherit; cursor: pointer; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: var(--wrap-narrow); margin: 0 auto; padding: 0 24px; }

/* ===== Шапка ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.96);
  border-bottom: 1px solid var(--color-border);
  height: var(--header-h);
  backdrop-filter: blur(6px);
}
.site-header.on-hero {
  background: transparent;
  border-bottom-color: transparent;
  color: #ffffff;
}
.site-header__inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex; align-items: center; justify-content: space-between;
}
.site-logo {
  font-family: var(--font-heading);
  font-size: 26px;
  letter-spacing: 0.02em;
  line-height: 1;
  display: inline-flex; flex-direction: column;
}
.site-logo__tag {
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-top: 4px;
}
.site-header.on-hero .site-logo__tag { color: rgba(255,255,255,0.85); }
.site-cart {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%;
  transition: background-color .15s ease;
}
.site-cart:hover { background: rgba(0,0,0,0.05); }
.site-header.on-hero .site-cart:hover { background: rgba(255,255,255,0.15); }
.site-cart svg { width: 22px; height: 22px; }
.site-cart__count {
  position: absolute; top: 4px; right: 4px;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: #c8202e; color: #fff; font-size: 11px; font-weight: 600;
  border-radius: 999px; display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.site-cart__count:empty { display: none; }

/* ===== Футер ===== */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 28px 24px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 13px;
  background: var(--color-bg);
}

/* ===== Кнопки ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 28px;
  font-family: var(--font-body);
  font-size: 14px; font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  transition: opacity .15s ease, transform .05s ease;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: #1a1a1a; color: #fff; }
.btn-primary:hover { background: #000; }
.btn-primary:disabled { background: #b7b7b7; cursor: not-allowed; opacity: 0.7; }
.btn-outline { border-color: #1a1a1a; color: #1a1a1a; background: transparent; }
.btn-outline:hover { background: #1a1a1a; color: #fff; }
.btn-light { background: #fff; color: #1a1a1a; border-color: #fff; }
.btn-light:hover { background: #f2f2f2; }
.btn-block { width: 100%; }

/* ===== Рейтинг звёзд ===== */
.stars {
  display: inline-flex; align-items: center; gap: 2px; color: var(--color-star);
  font-size: 13px; line-height: 1;
}
.stars__count { color: var(--color-text-muted); font-size: 12px; margin-left: 6px; }

/* ===== Цена ===== */
.price {
  font-weight: 500;
  font-size: 15px;
  color: var(--color-price);
}
.price__old {
  text-decoration: line-through;
  color: var(--color-text-muted);
  margin-right: 8px;
  font-weight: 400;
}
.price__new { color: var(--color-price-sale); font-weight: 600; }

/* ===== Беджи на карточках ===== */
.badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #232323;
  color: #fff;
  border-radius: var(--radius-sm);
}
.badge--sale  { background: #c8202e; }
.badge--new   { background: #4a7d5a; }

/* ===== Утилиты ===== */
.hidden { display: none !important; }

/* ===== Отзывчивость ===== */
@media (max-width: 640px) {
  .site-header__inner { padding: 0 16px; }
  .wrap, .wrap-narrow { padding: 0 16px; }
  .btn { padding: 12px 22px; font-size: 13px; }
  .site-logo { font-size: 22px; }
  .site-logo__tag { font-size: 9px; }
}
