@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;500;600;700&display=swap');

:root {
  --bg: #f2f3f7;
  --surface: #fcfdff;
  --ink: #292a2e;
  --muted: #757880;
  --muted-2: #45474d;
  --line: #ebedf2;
  --soft: #f7f8fc;
  --green: #3d9979;
  --green-soft: #f2fffa;
  --orange: #d98141;
  --danger: #e13d27;
  --accent: var(--green);
  --accent-2: var(--orange);
  --radius: 16px;
  --radius-sm: 8px;
  --shadow: 0 4px 16px rgba(41, 42, 46, 0.08), 0 0 1px rgba(41, 42, 46, 0.12);
  --font: Lato, system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; }
.container { width: min(1100px, calc(100% - 2rem)); margin: 0 auto; }
.main { padding: 8px 0 48px; }
.muted { color: var(--muted); }

/* Header — как у Пикабу */
.topbar {
  background: #eef0f4;
  color: var(--muted);
  font-size: 13px;
  padding: 8px 0;
  text-align: center;
}
.topbar a { color: var(--muted); text-decoration: underline; }
.header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg);
  padding: 16px 0;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.burger {
  width: 40px; height: 40px;
  border: 0; border-radius: 12px;
  background: var(--surface);
  display: grid; place-items: center;
  cursor: pointer; color: var(--ink);
}
.burger span,
.burger span::before,
.burger span::after {
  display: block; width: 16px; height: 2px;
  background: currentColor; border-radius: 2px; position: relative;
}
.burger span::before,
.burger span::after {
  content: ""; position: absolute; left: 0;
}
.burger span::before { top: -5px; }
.burger span::after { top: 5px; }

.logo {
  display: flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 18px;
}
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 36px; height: 36px; border-radius: 10px;
  display: block; flex-shrink: 0;
  object-fit: cover;
  box-shadow: 0 1px 2px rgba(28,25,23,.12);
}
.search {
  display: flex; align-items: center; gap: 0;
  flex: 1; min-width: 200px; max-width: 420px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.search input {
  flex: 1; border: 0; outline: 0; background: transparent;
  padding: 12px 16px; font: inherit; color: var(--ink);
}
.search button {
  border: 0; background: transparent; padding: 10px 14px;
  cursor: pointer; color: var(--muted);
}
.nav { display: flex; gap: 8px; margin-left: auto; align-items: center; }
.nav a {
  color: var(--ink); font-weight: 500; padding: 8px 12px; border-radius: 12px;
}
.nav a:hover { background: rgba(41,42,46,.05); text-decoration: none; }
.btn-login {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--green); color: #fcfdff !important;
  border-radius: var(--radius); padding: 12px 16px;
  font-weight: 500; text-decoration: none !important;
}
.btn-login:hover { filter: brightness(0.95); }

.breadcrumbs {
  padding: 4px 0 12px; font-size: 14px; color: var(--muted);
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs .sep { margin: 0 6px; opacity: .6; }

/* Hero / page titles */
.hero, .page-head { padding: 8px 0 4px; }
.hero h1, .page-head h1, h1 {
  font-size: 32px; font-weight: 700; line-height: 1.2;
  margin: 0 0 12px; letter-spacing: -0.02em; color: var(--ink);
}
.lead { font-size: 16px; color: var(--muted); max-width: 44rem; margin: 0 0 12px; }
.hero-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.hero-stats div {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 16px; min-width: 120px;
}
.hero-stats strong { display: block; font-size: 22px; font-weight: 700; }
.hero-stats span { color: var(--muted); font-size: 13px; }

section { margin-top: 28px; }
h2 {
  margin: 0 0 16px; font-size: 22px; font-weight: 700;
  letter-spacing: -0.01em;
}

/* Filter chips */
.filters {
  display: flex; gap: 8px; flex-wrap: nowrap; overflow-x: auto;
  padding: 4px 0 12px; scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.chip, .filters a, .filters button {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); color: var(--ink);
  border: 0; border-radius: var(--radius);
  padding: 8px 12px; font: inherit; font-size: 14px;
  text-decoration: none; cursor: pointer;
  box-shadow: none;
}
.chip:hover, .filters a:hover { text-decoration: none; background: #fff; }
.chip.is-active, .filters a.is-active, .filters button.is-active {
  background: var(--green-soft);
  box-shadow: inset 0 0 0 1px rgba(61,153,121,.35);
}
.chip .count, .filters .count {
  color: var(--muted); font-variant-numeric: tabular-nums;
}

/* Grids */
.cat-grid, .shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.cat-card, .shop-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px;
  text-decoration: none; color: inherit;
  transition: box-shadow .15s ease;
}
.cat-card:hover, .shop-card:hover {
  text-decoration: none;
  box-shadow: var(--shadow);
}
.cat-card img, .shop-card img {
  width: 100%; aspect-ratio: 4/3; object-fit: contain;
  background: var(--soft); border-radius: var(--radius-sm);
}
.cat-card-name, .shop-card-name { font-weight: 600; font-size: 15px; }
.badge {
  align-self: flex-start;
  background: var(--green-soft); color: var(--green);
  border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 700;
}
.deal { color: var(--orange); font-weight: 700; font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.list-shops { columns: 2; gap: 2rem; padding-left: 1.1rem; }
@media (max-width: 700px) { .list-shops { columns: 1; } }
.list-shops li { margin-bottom: 0.35rem; }

/* Shop layout */
.shop-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 40px;
  align-items: start;
}
@media (max-width: 960px) {
  .shop-layout { grid-template-columns: 1fr; gap: 24px; }
  .shop-side { order: -1; }
}
.side-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  position: sticky; top: 96px;
}
.side-logo {
  width: 100%; max-width: 180px; margin: 0 auto 12px;
  aspect-ratio: 4/3; object-fit: contain;
  background: var(--soft); border-radius: var(--radius-sm);
}
.side-card h2 { font-size: 18px; margin: 0 0 8px; }
.side-stats { list-style: none; padding: 0; margin: 12px 0; }
.side-stats li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--line);
  font-size: 14px; color: var(--muted);
}
.side-stats strong { color: var(--ink); font-weight: 600; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: var(--radius);
  padding: 12px 16px; font: inherit; font-size: 16px; font-weight: 500;
  cursor: pointer; text-decoration: none !important; white-space: nowrap;
}
.btn-primary { background: var(--green); color: #fcfdff !important; }
.btn-primary:hover { filter: brightness(0.96); }
.btn-special { background: var(--orange); color: #fcfdff !important; }
.btn-ghost {
  background: var(--surface); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}
.btn-block { display: flex; width: 100%; text-align: center; }
.btn-code {
  background: var(--surface);
  color: var(--green);
  box-shadow: inset 0 0 0 1px rgba(61,153,121,.45);
  font-weight: 700; letter-spacing: 0.04em;
}

/* Coupon cards — Пикабу */
.offers { display: flex; flex-direction: column; gap: 12px; }
.offer {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 32px;
  display: block;
}
.offer.is-expired { opacity: .55; }
.offer-grid {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 4px 20px;
  align-items: start;
}
@media (max-width: 640px) {
  .offer { padding: 20px; }
  .offer-grid { grid-template-columns: 64px minmax(0, 1fr); gap: 8px 12px; }
}
.discount {
  width: 80px; height: 80px;
  background: var(--soft);
  border-radius: var(--radius-sm);
  color: var(--green);
  font-weight: 700; font-size: 18px;
  display: grid; place-items: center;
  text-align: center; line-height: 1.1; padding: 6px;
}
@media (max-width: 640px) {
  .discount { width: 64px; height: 64px; font-size: 15px; }
}
.discount.code-mark, .discount.deal-mark { font-size: 14px; }
.offer-head { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.offer-title {
  margin: 0; font-size: 18px; font-weight: 600; line-height: 1.3; color: var(--ink);
}
.offer-title a { color: inherit; }
.offer-title a:hover { color: var(--green); }
.offer-status {
  display: flex; flex-wrap: wrap; gap: 12px;
  font-size: 14px; color: var(--muted);
}
.offer-status .ok { color: var(--green); font-weight: 500; }
.offer-desc {
  grid-column: 2;
  color: var(--muted-2); font-size: 16px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.offer-desc.is-open {
  display: block; -webkit-line-clamp: unset; overflow: visible;
}
.offer-actions {
  grid-column: 2;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-top: 10px;
}
.offer-used { width: 100%; font-size: 14px; color: var(--muted); margin-top: 2px; }
.code-mask {
  display: inline-flex; align-items: center; gap: 4px;
  height: 40px; padding: 0 16px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px rgba(61,153,121,.45);
  color: var(--green); text-decoration: none !important;
}
.code-mask .dot {
  width: 6px; height: 6px; border-radius: 50%; background: #1f2021;
}
.label {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600;
  background: #eaf7f2; color: var(--green);
  border-radius: 999px; padding: 2px 8px;
}
.label.recommend { background: #fff4e8; color: var(--orange); }
.label.deal { background: #eef2ff; color: #3b4cca; }

.local-search {
  display: flex; align-items: center;
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); margin: 8px 0 16px; overflow: hidden;
}
.local-search input {
  flex: 1; border: 0; outline: 0; background: transparent;
  padding: 14px 16px; font: inherit;
}

.howto { padding-left: 1.2rem; }
.howto li { margin-bottom: 12px; }
.seo-text { color: var(--muted-2); }
.seo-text img { border-radius: 12px; margin: 12px 0; }
.seo-block { margin-top: 32px; }

.search-lg {
  display: flex; max-width: 640px; margin: 16px 0 24px;
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.search-lg input {
  flex: 1; border: 0; outline: 0; padding: 14px 16px; font: inherit; background: transparent;
}
.search-lg button {
  border: 0; background: var(--green); color: #fff;
  padding: 12px 18px; font: inherit; font-weight: 500; cursor: pointer;
}

/* Footer */
.footer {
  margin-top: 40px;
  border-top: 1px solid var(--line);
  background: #1f2021;
  color: #d7d9de;
  padding: 32px 0;
}
.footer a { color: #8fd0b8; }
.footer-inner { display: grid; gap: 16px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }
.footer .muted { color: #9a9ea8; }

@media (max-width: 700px) {
  h1, .hero h1, .page-head h1 { font-size: 24px; }
  .nav .hide-mobile { display: none; }
}
