﻿@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;600;700;800&family=Fraunces:opsz,wght@9..144,700&display=swap');

:root {
  color-scheme: light;
  --bg: #f3f6fb;
  --bg-grad-a: #eef5ff;
  --bg-grad-b: #fef7f0;
  --surface: #ffffff;
  --surface-soft: #f8fbff;
  --surface-strong: #eef4ff;
  --text: #1d2433;
  --muted: #6a7384;
  --border: #d9e2ef;
  --shadow: 0 14px 34px rgba(35, 49, 72, 0.08);
  --primary: #ff6600;
  --primary-strong: #eb5700;
  --link: #2f6ce2;
  --chip: #edf3ff;
  --ok: #1c8f50;
  --hero-grad: linear-gradient(135deg, #eef5ff 0%, #ffffff 45%, #fff2e7 100%);
  --top-bg: #eef2f8;
  --top-strip-bg: #dde4ef;
  --top-text: #1f2a3a;
  --top-subtext: #5d6b80;
  --top-icon: #5e7fbe;
  --top-divider: rgba(29, 39, 58, 0.12);
  --top-btn-bg: #6f8df3;
  --top-btn-text: #ffffff;
  --top-input-bg: #ffffff;
  --top-input-text: #1f2a3a;
  --top-input-placeholder: #8290a3;
  --top-tile-text: #2a3444;
  --top-icon-box-bg: rgba(255, 255, 255, 0.72);
  --top-icon-box-border: rgba(95, 131, 197, 0.35);
  --brand-slogan: #4d628c;
}

body[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f141d;
  --bg-grad-a: #182230;
  --bg-grad-b: #2a1c15;
  --surface: #182231;
  --surface-soft: #101a27;
  --surface-strong: #253246;
  --text: #ebf1ff;
  --muted: #98a6bd;
  --border: #33445d;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.35);
  --primary: #ff7d2f;
  --primary-strong: #ff964b;
  --link: #78a7ff;
  --chip: #213043;
  --ok: #53cd84;
  --hero-grad: linear-gradient(140deg, #1a2535 0%, #182231 56%, #332116 100%);
  --top-bg: #4b4e56;
  --top-strip-bg: #34363b;
  --top-text: #ebedf2;
  --top-subtext: #9fb8f8;
  --top-icon: #8fb3fb;
  --top-divider: rgba(255, 255, 255, 0.08);
  --top-btn-bg: #6f8df3;
  --top-btn-text: #ffffff;
  --top-input-bg: #4a4b50;
  --top-input-text: #e6e8ed;
  --top-input-placeholder: #898c94;
  --top-tile-text: #d6d9df;
  --top-icon-box-bg: rgba(67, 71, 79, 0.72);
  --top-icon-box-border: rgba(145, 173, 229, 0.34);
  --brand-slogan: #ff7a1a;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: 'Rubik', 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
}

a {
  color: var(--link);
  text-decoration: none;
}

.bg-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(40vw 32vw at -8% -10%, var(--bg-grad-a) 0%, transparent 68%),
    radial-gradient(36vw 30vw at 108% 0%, var(--bg-grad-b) 0%, transparent 72%);
}

.container {
  width: min(1360px, calc(100% - 34px));
  margin: 0 auto;
}

.top-showcase {
  background: var(--top-bg);
  color: var(--top-text);
  border-bottom: 1px solid var(--top-divider);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

body[data-theme="dark"] .top-showcase {
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.03);
}

.top-nav-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  padding: 12px 0 0;
}

.top-left-tools,
.top-right-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-right-tools {
  justify-self: end;
}

.city-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--top-subtext);
}

.city-select-wrap::after {
  content: '▾';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--top-btn-text);
  font-size: 12px;
  pointer-events: none;
}

.city-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border: 0;
  border-radius: 6px;
  background: var(--top-btn-bg);
  color: var(--top-btn-text);
  font-size: 16px;
  font-weight: 600;
  padding: 10px 36px 10px 12px;
  cursor: pointer;
  min-width: 220px;
}

.city-select:focus {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 1px;
}

.loc-pin {
  font-size: 20px;
  line-height: 1;
}

.brand-center {
  justify-self: center;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.top-showcase .brand-center img {
  width: 176px;
  max-width: 26vw;
  display: block;
}

.brand-slogan {
  margin: 0;
  color: var(--brand-slogan);
  font-size: 1.17rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: none;
  text-align: center;
  line-height: 1.3;
}

.top-icon-btn {
  border: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: transparent;
  color: var(--top-icon);
}

.control-group-compact {
  border: 0;
  background: transparent;
  padding: 0;
  gap: 2px;
}

.control-group-compact button {
  color: var(--top-icon);
  background: transparent;
  border-radius: 6px;
  padding: 4px 8px;
}

.control-group-compact button.active {
  background: rgba(111, 141, 243, 0.2);
  color: #e8eeff;
}

.top-search-zone {
  text-align: center;
  padding: 74px 0 86px;
}

.top-tagline {
  margin: 0 auto 18px;
  max-width: 900px;
  font-size: clamp(20px, 2.1vw, 36px);
  line-height: 1.2;
  font-weight: 700;
  color: var(--top-text);
}

.search-wrap-hero {
  width: min(720px, 100%);
  margin: 0 auto;
}

.top-showcase .search-wrap-hero input {
  border: 0;
  border-radius: 6px;
  background: var(--top-input-bg);
  color: var(--top-input-text);
  box-shadow: none;
  padding: 16px 16px 16px 52px;
}

.top-showcase .search-wrap-hero input::placeholder {
  color: var(--top-input-placeholder);
}

.top-showcase .search-wrap-hero button {
  left: 10px;
  right: auto;
  top: 8px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: transparent;
  color: var(--top-input-placeholder);
  font-size: 28px;
}

.top-categories-strip {
  background: var(--top-strip-bg);
  border-top: 1px solid var(--top-divider);
  padding: 24px 0;
}

body[data-theme="dark"] .top-right-tools .top-icon-btn {
  background: #3a3d44;
  border: 1px solid #3a3d44;
  color: var(--top-icon);
}

body[data-theme="dark"] .top-right-tools .control-group-compact {
  background: #3a3d44;
  border: 1px solid #3a3d44;
  border-radius: 12px;
  padding: 3px;
}

.header-wrap {
  position: sticky;
  top: 0;
  z-index: 70;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  border-bottom: 1px solid var(--border);
}

.header-main {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 12px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--text);
}

.brand img {
  width: 206px;
  max-width: 42vw;
  display: block;
}

.search-wrap {
  position: relative;
}

.search-wrap input {
  width: 100%;
  border: 2px solid color-mix(in srgb, var(--primary) 36%, var(--border));
  background: var(--surface);
  color: var(--text);
  padding: 13px 46px 13px 16px;
  border-radius: 14px;
  outline: none;
  font-size: 15px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}

.search-wrap button {
  position: absolute;
  right: 8px;
  top: 7px;
  border: 0;
  border-radius: 10px;
  width: 34px;
  height: 34px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-size: 16px;
}

.head-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.control-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
}

.control-group button {
  border: 0;
  border-radius: 8px;
  padding: 6px 10px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.control-group button.active {
  color: #fff;
  background: var(--primary);
}

.theme-btn,
.icon-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 12px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 18px;
}

.main-nav {
  padding: 0 0 12px;
}

.main-nav .row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.nav-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--muted);
  background: var(--chip);
}

.nav-chip strong {
  color: var(--text);
}

main {
  padding: 16px 0 28px;
}

.hero {
  background: var(--hero-grad);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 24px;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 20px;
  overflow: hidden;
}

.hero h1 {
  margin: 0;
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(30px, 4.2vw, 48px);
  line-height: 1.03;
}

.hero p {
  margin: 12px 0 0;
  font-size: 16px;
  color: var(--muted);
  max-width: 50ch;
}

.hero-points {
  margin: 18px 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.hero-point {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
}

.hero-point .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent);
}

.hero-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.btn.primary {
  background: var(--primary);
  color: #fff;
}

.btn.primary:hover {
  background: var(--primary-strong);
}

.btn.ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.offer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.offer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}

.offer-card small {
  color: var(--muted);
  font-size: 12px;
}

.offer-card h3 {
  margin: 8px 0;
  font-size: 16px;
  line-height: 1.25;
}

.offer-price {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  font-weight: 800;
  color: var(--primary);
}

.offer-card .meta {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.top-showcase .top-categories {
  margin-top: 0;
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 18px 12px;
}

.top-category-tile {
  border: 0;
  background: transparent;
  text-align: center;
  color: var(--top-tile-text);
  min-height: 108px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px 2px;
  border-radius: 12px;
}

.top-category-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  background: var(--top-icon-box-bg);
  border: 1px solid var(--top-icon-box-border);
  border-radius: 14px;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.top-category-icon.is-image {
  width: 108px;
  height: 58px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  overflow: hidden;
}

.top-category-icon.is-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.top-category-icon svg {
  width: 30px;
  height: 30px;
  stroke: var(--top-icon);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.top-category-tile:hover .top-category-icon,
.top-category-tile:focus-visible .top-category-icon {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--top-icon) 60%, transparent);
}

.top-category-tile:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--top-icon) 70%, transparent);
  outline-offset: 2px;
}

.top-category-tile:active .top-category-icon {
  transform: translateY(0);
}

.top-category-tile h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--top-tile-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.top-category-icon.tone-1,
.top-category-icon.tone-2,
.top-category-icon.tone-3,
.top-category-icon.tone-4,
.top-category-icon.tone-5,
.top-category-icon.tone-6,
.top-category-icon.tone-7,
.top-category-icon.tone-8 {
  color: inherit;
}

.top-category-icon circle[fill],
.top-category-icon path[fill],
.top-category-icon rect[fill] {
  fill: var(--top-icon);
}

.top-category-icon circle:not([fill]),
.top-category-icon path:not([fill]),
.top-category-icon rect:not([fill]) {
  fill: none;
}

.top-category-icon circle,
.top-category-icon path,
.top-category-icon rect {
  vector-effect: non-scaling-stroke;
}

.top-category-icon {
  line-height: 1;
}

.market-layout {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 12px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.sidebar {
  padding: 14px;
  position: sticky;
  top: 124px;
  height: fit-content;
  max-height: calc(100dvh - 142px);
  overflow: auto;
}

.sidebar h2,
.section h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.sidebar .hint {
  margin: -6px 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.sidebar-search {
  width: 100%;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 11px;
  outline: none;
}

.tree-view details {
  border-bottom: 1px dashed color-mix(in srgb, var(--border) 85%, transparent);
  padding: 2px 0 6px;
}

.tree-view summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  font-size: 14px;
}

.tree-view summary::-webkit-details-marker {
  display: none;
}

.tree-view .count {
  color: var(--muted);
  font-size: 12px;
}

.tree-view ul {
  margin: 0;
  padding: 0 0 6px 14px;
}

.tree-view li {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  font-size: 13px;
  color: color-mix(in srgb, var(--text) 86%, var(--muted));
}

.cat-h3 {
  display: inline-block;
  font-size: 1.17rem;
  font-weight: 700;
  line-height: 1.3;
}

.content {
  display: grid;
  gap: 12px;
}

.section {
  padding: 15px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.promo-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.brand-card-btn {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  min-height: 108px;
  transition: transform 0.18s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.brand-card-btn:hover,
.brand-card-btn:focus-visible {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
}

.brand-card-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--primary) 38%, transparent);
  outline-offset: 2px;
}

.brand-card-btn:active {
  transform: translateY(0);
}

.brand-card-caption {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-strong);
  color: var(--link);
}

.brand-card-name {
  margin-top: auto;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}

.brand-card-cta {
  margin-top: auto;
  font-size: 16px;
  color: var(--muted);
}

.promo-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
  padding: 12px;
}

.promo-card .tag {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-strong);
  color: var(--link);
}

.promo-card h3 {
  margin: 10px 0 8px;
  font-size: 15px;
  line-height: 1.26;
}

.promo-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.all-categories details {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 8px 11px;
  margin-bottom: 8px;
}

.all-categories summary {
  list-style: none;
  cursor: pointer;
  font-weight: 600;
}

.all-categories summary::-webkit-details-marker {
  display: none;
}

.all-categories ul {
  margin: 8px 0 0;
  padding-left: 15px;
}

.all-categories li {
  margin: 4px 0;
  color: var(--muted);
  font-size: 14px;
}

footer {
  margin: 18px 0 30px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 16px;
  padding: 14px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.footer-col h4 {
  margin: 0 0 8px;
  font-size: 14px;
}

.footer-col p,
.footer-col li {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.footer-col ul {
  margin: 0;
  padding-left: 16px;
}

.scroll-top-btn {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 48px;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  box-shadow: var(--shadow);
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
  z-index: 80;
}

.scroll-top-btn:hover {
  background: var(--primary-strong);
}

.scroll-top-btn.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.fade-in {
  animation: fadeIn 0.45s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1200px) {
  .top-showcase .top-categories {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .promo-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .top-nav-row {
    grid-template-columns: 1fr;
    gap: 12px;
    padding-top: 10px;
  }

  .brand-center {
    order: -1;
  }

  .top-left-tools {
    justify-content: space-between;
  }

  .top-right-tools {
    justify-content: space-between;
  }

  .top-search-zone {
    padding: 42px 0 48px;
  }

  .top-tagline {
    font-size: clamp(18px, 4.2vw, 28px);
  }

  .market-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    max-height: none;
  }

  .top-showcase .top-categories {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .promo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .container {
    width: calc(100% - 20px);
  }

  .top-showcase .brand-center img {
    width: 142px;
    max-width: 40vw;
  }

  .city-select {
    min-width: 180px;
    font-size: 14px;
    padding: 9px 34px 9px 10px;
  }

  .top-right-tools {
    justify-content: center;
    gap: 8px;
  }

  .top-search-zone {
    padding: 24px 0 30px;
  }

  .top-showcase .top-categories {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 8px;
  }

  .top-category-tile {
    min-height: 96px;
  }

  .top-category-icon.is-image {
    width: 86px;
    height: 47px;
  }

  .top-category-tile h3 {
    font-size: 13px;
  }

  .promo-grid {
    grid-template-columns: 1fr;
  }

  .scroll-top-btn {
    right: 12px;
    bottom: 12px;
    width: 44px;
    height: 44px;
  }
}
