:root {
  --brand: #ff4d2e;          /* logo, accents */
  --btn: #d9361a;            /* white text on it passes WCAG AA (4.6:1) */
  --btn-hover: #bf2d13;
  --link: #c22d10;           /* also text on --brand-soft (5.2:1) */
  --brand-soft: #fff1ed;
  --text: #18181b;
  --muted: #6b7280;
  --border: #ececec;
  --surface: #f7f7f8;
  --bg: #fff;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 16px rgba(0, 0, 0, .05);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.65rem; line-height: 1.25; margin: 0 0 .6em; }
h2 { font-size: 1.25rem; line-height: 1.3; margin: 0 0 .8em; }
h3 { font-size: 1.05rem; margin: 0; }
img { max-width: 100%; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.main { padding-top: 20px; padding-bottom: 48px; min-height: 60vh; }
.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 16px 0; }
.section { margin-top: 36px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border: 0; border-radius: 10px;
  background: var(--btn); color: #fff; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--btn-hover); text-decoration: none; }
.btn-tail { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 500; letter-spacing: .5px; }
.btn--deal { background: var(--text); }
.btn--deal:hover { background: #000; }
.btn--ghost { background: var(--brand-soft); color: var(--link); }
.btn--ghost:hover { background: #ffe2da; }
:focus-visible { outline: 3px solid #ffb4a3; outline-offset: 2px; }

/* Header */
.header { border-bottom: 1px solid var(--border); background: var(--bg); }
.header-top { display: flex; align-items: center; gap: 12px; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 1.3rem; font-weight: 700; letter-spacing: -.3px; }
.logo:hover { text-decoration: none; }
.logo b { color: var(--brand); }
.search { display: flex; flex: 1 1 100%; order: 3; }
.search input {
  flex: 1; min-width: 0; height: 44px; padding: 0 14px; font: inherit;
  border: 1px solid var(--border); border-right: 0; border-radius: 10px 0 0 10px; background: var(--surface);
}
.search input:focus { outline: none; border-color: var(--brand); background: #fff; }
.search button { height: 44px; padding: 0 16px; border: 0; border-radius: 0 10px 10px 0; background: var(--btn); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.search--big { max-width: 560px; margin: 20px auto 0; }
.search--big input, .search--big button { height: 52px; }
.az-toggle { margin-left: auto; height: 40px; padding: 0 14px; border: 1px solid var(--border); border-radius: 10px; background: #fff; font: inherit; font-weight: 600; cursor: pointer; }

/* Alphabet index: full-screen panel on phones, two rows with hover popup on desktop */
.az { display: none; }
.az--open { display: block; position: fixed; inset: 0; z-index: 50; background: #fff; overflow-y: auto; padding: 56px 0 24px; }
.az-close { position: absolute; top: 8px; right: 12px; width: 44px; height: 44px; border: 0; background: none; font-size: 32px; cursor: pointer; }
.az-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.az-row a { display: flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; border-radius: 8px; background: var(--surface); color: var(--text); font-weight: 600; }
.az-row a:hover { background: var(--brand-soft); color: var(--link); text-decoration: none; }
.az-pop { columns: 4 180px; column-gap: 24px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.az-pop a { display: block; padding: 3px 0; color: var(--text); break-inside: avoid; }
.az-pop a:hover { color: var(--link); }
.az-pop .az-all { color: var(--link); font-weight: 600; }

@media (min-width: 900px) {
  h1 { font-size: 2rem; }
  .search { flex: 0 1 420px; order: 0; margin-left: auto; }
  .az-toggle, .az-close { display: none; }
  .az { display: block; }
  .az-inner { position: relative; padding-top: 0; padding-bottom: 10px; }
  .az-row { gap: 2px; margin-bottom: 2px; }
  .az-row a { min-width: 28px; height: 28px; padding: 0 4px; background: none; font-size: .9rem; font-weight: 500; color: var(--muted); }
  .az-pop { position: absolute; left: 16px; right: 16px; top: 100%; z-index: 40; max-height: 60vh; overflow-y: auto; }
}

/* Breadcrumbs */
.crumbs { font-size: .875rem; color: var(--muted); margin-bottom: 16px; }
.crumbs a { color: var(--muted); }

/* Home hero */
.hero { text-align: center; padding: 24px 0 8px; }
.hero p { color: var(--muted); max-width: 560px; margin: 0 auto; }

/* Store cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.card {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 12px; text-align: center;
  border: 1px solid var(--border); border-radius: var(--radius); background: #fff; color: var(--text);
  transition: box-shadow .15s, border-color .15s;
}
.card:hover { text-decoration: none; border-color: #ffd0c4; box-shadow: var(--shadow); }
.card-logo { width: 56px; height: 56px; object-fit: contain; border-radius: 12px; }
.card-name { font-weight: 600; line-height: 1.3; }
.card-count { font-size: .85rem; color: var(--muted); }
.logo-ph { display: flex; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand); font-size: 1.5rem; font-weight: 700; }

/* Chips (categories) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--surface); color: var(--text); font-weight: 500; }
.chip span { color: var(--muted); font-size: .85rem; }
.chip:hover { background: var(--brand-soft); text-decoration: none; }
.chips--big .chip { padding: 12px 18px; }

/* Store page */
.store-head { display: grid; grid-template-columns: 72px 1fr; gap: 16px; align-items: start; }
.store-logo { width: 72px; height: 72px; border-radius: 16px; object-fit: contain; border: 1px solid var(--border); }
.store-info h1 { margin-bottom: .3em; }
.lead { margin: 0; color: #3f3f46; }
.store-go { grid-column: 1 / -1; }
@media (min-width: 700px) {
  .store-head { grid-template-columns: 96px 1fr auto; }
  .store-logo { width: 96px; height: 96px; }
  .store-go { grid-column: auto; }
}
.ad-mark { margin: 6px 0 0; font-size: .75rem; color: var(--muted); }

/* Coupons */
.coupons { display: grid; gap: 12px; }
.coupon {
  display: grid; grid-template-columns: 88px 1fr; gap: 14px; padding: 16px;
  border: 1px solid var(--border); border-radius: var(--radius); background: #fff;
}
.coupon--exclusive { border-color: #ffc2b3; background: linear-gradient(0deg, #fff, #fff8f6); }
.coupon-badge {
  display: flex; align-items: center; justify-content: center; min-height: 72px; padding: 6px; border-radius: 10px;
  background: var(--brand-soft); color: var(--link); font-weight: 800; font-size: .9rem; text-align: center; line-height: 1.2;
  hyphens: auto; overflow-wrap: anywhere;
}
@media (min-width: 700px) { .coupon-badge { font-size: 1.05rem; } }
.coupon-store { font-size: .85rem; font-weight: 600; }
.coupon-desc { margin: 6px 0 0; color: #3f3f46; font-size: .93rem; }
.coupon-meta { margin: 6px 0 0; font-size: .85rem; color: var(--muted); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--btn); color: #fff; font-size: .75rem; font-weight: 700; }
.coupon-action { grid-column: 1 / -1; }
.coupon-action .btn { width: 100%; }
@media (min-width: 700px) {
  .coupon { grid-template-columns: 104px 1fr auto; align-items: center; }
  .coupon-action { grid-column: auto; }
  .coupon-action .btn { width: auto; min-width: 200px; }
}

/* Text, FAQ, expired */
.text { max-width: 780px; }
.text h2 { margin-top: 1.4em; }
.text li { margin: .3em 0; }
.faq details { border-bottom: 1px solid var(--border); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details div { margin-top: 8px; color: #3f3f46; }
.expired summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.expired ul { color: #3f3f46; }

/* Revealed code */
.reveal { width: min(440px, calc(100% - 32px)); padding: 28px 24px 24px; border: 0; border-radius: 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); text-align: center; }
.reveal::backdrop { background: rgba(24, 24, 27, .55); }
.reveal h2 { margin-bottom: .4em; }
.reveal-close { position: absolute; top: 6px; right: 10px; border: 0; background: none; font-size: 28px; cursor: pointer; color: var(--muted); }
.reveal-code { display: flex; gap: 8px; margin: 16px 0 10px; }
.reveal-code input {
  flex: 1; min-width: 0; height: 48px; padding: 0 12px; text-align: center;
  border: 2px dashed var(--brand); border-radius: 10px; background: var(--brand-soft);
  font: 700 1.25rem ui-monospace, Menlo, Consolas, monospace; letter-spacing: 1px;
}
.reveal-code .btn { flex: none; }

/* All stores A–Я */
.letter-jump { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 24px; }
.letter-jump a { min-width: 32px; padding: 4px 6px; text-align: center; border-radius: 6px; background: var(--surface); color: var(--text); font-weight: 600; }
.letter-section { margin-bottom: 24px; scroll-margin-top: 16px; }
.letter-section h2 { color: var(--brand); border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.letter-list { columns: 4 200px; column-gap: 24px; list-style: none; margin: 0; padding: 0; }
.letter-list li { padding: 3px 0; break-inside: avoid; }

/* Pager */
.pager { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 24px; }
.pager a, .pager span { min-width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--surface); color: var(--text); }
.pager span { background: var(--btn); color: #fff; font-weight: 700; }

/* Cookie notice */
.cookie {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60; max-width: 720px; margin: 0 auto;
  display: flex; align-items: center; gap: 16px; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); font-size: .875rem;
}
.cookie[hidden] { display: none; }
.cookie p { margin: 0; }

/* Footer */
.footer { border-top: 1px solid var(--border); background: var(--surface); padding: 24px 0; font-size: .875rem; color: var(--muted); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 12px; }
.footer-nav a { color: var(--text); }
.coupons .empty { margin: 0; padding: 8px 0; }
.reveal-go { width: 100%; margin-bottom: 8px; }
details.coupon-desc summary { cursor: pointer; color: var(--link); font-size: .9rem; }
details.coupon-desc p { margin: 6px 0 0; }
