:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --text: #191c1f;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #6d28d9;
  --accent-hover: #5b21b6;
  --accent-soft: #ede9fe;
  --star: #f59e0b;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.app {
  min-height: 100vh;
}

.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 24px;
}

.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  height: 48px;
}

.logo img {
  display: block;
  height: 48px;
  width: auto;
  max-width: none;
  object-fit: contain;
  object-position: left center;
}

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

.btn-torlink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 14px 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(109, 40, 217, 0.35);
  background: var(--accent-soft);
  box-shadow: 0 1px 2px rgba(109, 40, 217, 0.08);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.btn-torlink__logo {
  display: block;
  height: 22px;
  width: auto;
  object-fit: contain;
}

.btn-torlink__arrow {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
  opacity: 0.9;
}

.btn-torlink:hover {
  border-color: rgba(109, 40, 217, 0.55);
  background: #e9e0ff;
  box-shadow: 0 4px 14px rgba(109, 40, 217, 0.16);
  transform: translateY(-1px);
}

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

.catalog {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px 48px;
}

/* ── Horizontal filter bar ── */
.filter-bar {
  position: sticky;
  top: 64px;
  z-index: 25;
  margin: 0 -20px;
  padding: 0 20px 12px;
  background: linear-gradient(180deg, #faf8ff 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}

.filter-bar__glow {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(600px, 80%);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.45;
  pointer-events: none;
}

.filter-bar__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 14px;
}

.filter-bar__row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-bar__row--main {
  flex-wrap: wrap;
}

.filter-bar__row--presets {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.filter-bar__row--presets::-webkit-scrollbar {
  display: none;
}

.filter-bar__icon {
  flex-shrink: 0;
  color: var(--accent);
  display: flex;
  align-items: center;
}

.filter-bar__icon--search {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.filter-bar__city {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  min-width: 0;
}

.filter-bar__search {
  position: relative;
  flex: 1;
  min-width: 180px;
}

.filter-bar__search-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 14px 9px 36px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.filter-bar__search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.filter-bar__search-input::placeholder {
  color: #9ca3af;
}

.filter-bar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

.btn-filter-more,
.btn-mobile-filters {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
}

.btn-filter-more:hover,
.btn-mobile-filters:hover,
.btn-filter-more[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.btn-mobile-filters {
  display: none;
}

.filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1;
}

.filter-presets {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
}

.preset-chip {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 6px 14px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(109, 40, 217, 0.06);
  transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
}

.preset-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.preset-chip.is-active {
  background: linear-gradient(135deg, var(--accent) 0%, #7c3aed 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 8px rgba(109, 40, 217, 0.35);
}

.filter-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px dashed var(--accent-soft);
  border-radius: 10px;
}

/* ── Advanced filters panel (desktop dropdown / mobile sheet) ── */
.filter-advanced {
  position: absolute;
  left: 20px;
  right: 20px;
  top: calc(100% - 4px);
  z-index: 30;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(109, 40, 217, 0.12), var(--shadow);
  overflow: hidden;
}

.filter-advanced__header {
  display: none;
}

.filter-advanced__body {
  padding: 16px 18px 14px;
}

.filter-advanced__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 16px;
}

.filter-advanced__section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.filter-advanced__section--range {
  grid-column: span 1;
}

.filter-advanced__label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.store-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.store-chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 11px;
  background: #fff;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.store-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.store-chip.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.btn--reset {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--muted);
}

.filter-select--field {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 12px;
  background: #fff;
  width: 100%;
  height: 40px;
  color: var(--text);
  appearance: none;
  cursor: pointer;
}

.filter-select--field:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.filter-range--inline {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-range--inline input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 10px;
  height: 40px;
  background: #fff;
  color: var(--text);
  font-size: 0.88rem;
}

.filter-range--inline input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.filter-range__sep {
  color: var(--muted);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.filter-range--inline input::placeholder {
  color: #9ca3af;
}

.filter-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 28;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
}

.filter-picker {
  position: relative;
}

.filter-picker__trigger {
  display: block;
  width: 100%;
  height: 56px;
  border: none;
  background: #fff;
  text-align: left;
  padding: 0 16px;
  cursor: pointer;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-picker--compact .filter-picker__trigger {
  height: auto;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  background: var(--surface);
  font-size: 0.88rem;
  font-weight: 500;
  max-width: 200px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.filter-picker--compact .filter-picker__trigger:hover,
.filter-picker--compact .filter-picker__trigger:focus {
  border-color: var(--accent);
  background: var(--surface);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.filter-picker--field .filter-picker__trigger {
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 12px;
  background: #fff;
  font-size: 0.88rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.filter-picker--field .filter-picker__trigger:hover,
.filter-picker--field .filter-picker__trigger:focus {
  border-color: var(--accent);
  background: #fff;
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.filter-picker__trigger.is-placeholder {
  color: #9ca3af;
}

.filter-picker__trigger:focus {
  outline: none;
  background: #fafafa;
}

.filter-picker--compact .filter-picker__trigger:focus,
.filter-picker--field .filter-picker__trigger:focus {
  background: var(--surface);
}

.filter-picker__panel {
  position: fixed;
  z-index: 120;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: min(720px, calc(100vh - 24px));
  padding: 12px 10px 12px 12px;
}

.filter-picker__panel.hidden {
  display: none !important;
}

.filter-picker__search-wrap {
  padding: 0 0 8px;
  border-bottom: none;
}

.filter-picker__search {
  width: 100%;
  height: 32px;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0 4px;
  color: var(--text);
}

.filter-picker__search:focus {
  outline: none;
}

.filter-picker__search::placeholder {
  color: #b1b1b1;
}

.filter-picker__list {
  overflow-y: auto;
  flex: 1;
}

.filter-picker__option {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: #fff;
  color: #b1b1b1;
  padding: 8px 16px;
  min-height: 40px;
  line-height: 24px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 400;
  user-select: none;
}

.filter-picker__option:hover {
  color: var(--accent);
}

.filter-picker__option.is-selected {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
}

.catalog-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 16px 0 14px;
}

.main {
  min-width: 0;
}

.sort-dropdown {
  position: relative;
}

.sort-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 14px;
  min-height: 36px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.sort-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.sort-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 170px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 40;
}

.sort-option {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.sort-option:hover,
.sort-option.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn--ghost {
  background: transparent;
  color: var(--text);
}

.btn--ghost:hover:not(:disabled) {
  background: var(--bg);
}

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

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

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

.btn--link {
  background: none;
  color: var(--accent);
  padding: 0;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.82rem;
}

.filter-chip button {
  border: none;
  background: transparent;
  cursor: pointer;
  color: inherit;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
}

.last-updated {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.last-updated.is-stale {
  color: #b45309;
}

.results-meta {
  margin: 0;
  color: var(--muted);
}

.section-title {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.products-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: box-shadow 0.15s;
}

.product-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.product-card__top {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 14px;
  padding: 14px;
}

.product-card__image {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 10px;
  background: var(--bg);
}

.product-card__title {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 600;
}

.product-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.stars {
  color: var(--star);
  letter-spacing: 1px;
  font-size: 0.85rem;
}

.product-card__shop {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 8px;
}

.product-card__shop img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}

.product-card__price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.product-card__price {
  font-weight: 700;
  font-size: 1.05rem;
}

.product-card__price small {
  font-weight: 400;
  color: var(--muted);
}

.store-badge img {
  height: 22px;
  width: auto;
}

.product-card__actions {
  margin-top: 10px;
}

.btn--store {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--accent) 0%, #8b5cf6 100%);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(109, 40, 217, 0.35);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}

.btn--store__icon {
  font-size: 1.05rem;
  line-height: 1;
  opacity: 0.95;
}

.btn--store:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(109, 40, 217, 0.45);
  color: #fff;
}

.btn--store-card {
  width: 100%;
  margin-top: 8px;
}

.btn--store-modal {
  width: 100%;
  margin-top: 6px;
  padding: 12px 20px;
  font-size: 1rem;
}

.btn--store[data-store-id="5"] {
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
}

.btn--store[data-store-id="3"] {
  background: linear-gradient(135deg, #ea580c 0%, #f97316 100%);
  box-shadow: 0 2px 10px rgba(234, 88, 12, 0.35);
}

.btn--store[data-store-id="3"]:hover {
  box-shadow: 0 4px 16px rgba(234, 88, 12, 0.45);
}

.btn--store[data-store-id="1"] {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.35);
}

.btn--sm {
  padding: 4px 10px;
  font-size: 0.8rem;
}

.stocks-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.stocks-header h3 {
  margin: 0;
}

.stocks-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.stocks-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.stocks-table th,
.stocks-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.stocks-table th {
  background: #f8f8f8;
  font-weight: 600;
  white-space: nowrap;
}

.stocks-table tr:last-child td {
  border-bottom: none;
}

.stocks-error {
  padding: 12px 0;
  text-align: left;
}

.product-card__locations {
  padding: 0 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.location-line {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.location-more {
  margin: 0;
  font-size: 0.78rem;
  color: var(--accent);
}

.product-card__desc-wrap {
  padding: 0 14px 10px;
}

.product-card__desc {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  white-space: pre-wrap;
}

.product-card__desc.is-collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.desc-toggle {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--accent);
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

.product-card__review {
  border-top: 1px solid var(--border);
  padding: 12px 14px;
  background: #fafafa;
}

.review-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.78rem;
  color: var(--muted);
}

.review-text {
  margin: 0;
  font-size: 0.85rem;
}

.shops-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.shop-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  display: flex;
  gap: 14px;
  align-items: center;
  box-shadow: var(--shadow);
}

.shop-card img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg);
}

.shop-card__name {
  margin: 0 0 4px;
  font-weight: 600;
}

.shop-card__meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
}

.page-info {
  color: var(--muted);
}

.modal.hidden {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.modal__dialog {
  position: relative;
  max-width: 900px;
  max-height: 90vh;
  margin: 4vh auto;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.modal__content {
  max-height: 90vh;
  overflow: auto;
  padding: 24px;
}

.modal-hero {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  margin-bottom: 20px;
}

.modal-hero__photo {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 12px;
  background: var(--bg);
}

.modal-hero__photo--round {
  max-width: 160px;
  max-height: 160px;
  border-radius: 50%;
  object-fit: cover;
}

.modal-hero__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-hero__body .product-card__meta,
.modal-hero__body .product-card__shop,
.modal-hero__body .product-card__actions {
  margin-bottom: 0;
}

.modal-hero__body .product-card__shop img {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.modal-hero__body .store-badge {
  flex-shrink: 0;
}

.modal-hero__body .store-badge img {
  height: 22px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
}

.modal-hero__body .results-meta {
  margin: 0;
}

.modal-title {
  margin: 0 0 8px;
  font-size: 1.4rem;
}

.modal-section {
  margin-top: 20px;
}

.modal-section h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.modal-desc {
  white-space: pre-wrap;
  font-size: 0.9rem;
}

.reviews-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.review-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: #fafafa;
}

.review-item__photo {
  max-width: 220px;
  border-radius: 8px;
  margin: 8px 0;
}

.review-item__response {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-size: 0.85rem;
  color: var(--muted);
}

.loading,
.error {
  text-align: center;
  padding: 48px;
  color: var(--muted);
}

.error {
  color: #b91c1c;
}

@media (max-width: 960px) {
  .filter-advanced__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .filter-bar__search {
    order: 3;
    flex: 1 1 100%;
  }
}

@media (max-width: 720px) {
  .header__inner {
    padding: 0 12px;
  }

  .btn-torlink {
    height: 36px;
    padding: 0 10px 0 12px;
    gap: 6px;
  }

  .btn-torlink__logo {
    height: 18px;
  }

  .btn-torlink__arrow {
    font-size: 12px;
  }

  .catalog {
    padding: 0 12px 40px;
  }

  .filter-bar {
    margin: 0 -12px;
    padding: 0 12px 10px;
  }

  .filter-bar__row--main {
    gap: 8px;
  }

  .filter-bar__city {
    flex: 1;
    min-width: 0;
  }

  .filter-picker--compact .filter-picker__trigger {
    max-width: none;
    width: 100%;
  }

  .filter-bar__search {
    order: unset;
    flex: 1 1 100%;
  }

  .btn-filter-more,
  .sort-dropdown {
    display: none;
  }

  .btn-mobile-filters {
    display: inline-flex;
    flex: 1;
    justify-content: center;
  }

  .filter-bar__actions {
    flex: 1 1 100%;
    margin-left: 0;
  }

  .filter-advanced {
    position: fixed;
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    border-radius: 16px 16px 0 0;
    max-height: 85vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.15);
  }

  .filter-advanced.is-sheet-open {
    transform: translateY(0);
  }

  .filter-advanced__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 1;
  }

  .filter-advanced__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
  }

  .filter-advanced__close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--bg);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    color: var(--muted);
  }

  .filter-advanced__grid {
    grid-template-columns: 1fr;
  }

  .product-card__top,
  .modal-hero {
    grid-template-columns: 1fr;
  }

  .product-card__image {
    width: 100%;
    height: 200px;
  }
}

/* ── Stats page ── */
.stats-page {
  min-height: 100vh;
  background: linear-gradient(180deg, #faf8ff 0%, var(--bg) 40%);
}

.stats-shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.stats-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.stats-header h1 {
  margin: 8px 0 4px;
  font-size: 1.6rem;
}

.stats-back {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.92rem;
}

.stats-muted {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.stats-total {
  background: linear-gradient(135deg, var(--accent) 0%, #8b5cf6 100%);
  color: #fff;
  border-radius: 14px;
  padding: 14px 18px;
  min-width: 110px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(109, 40, 217, 0.28);
}

.stats-total__label {
  display: block;
  font-size: 0.8rem;
  opacity: 0.9;
}

.stats-total__value {
  font-size: 1.8rem;
  line-height: 1.1;
}

.stats-card--highlight {
  border-color: #c4b5fd;
  box-shadow: 0 4px 20px rgba(109, 40, 217, 0.12);
}

.stats-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.stats-card h2 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.stats-card__hint {
  margin: 0 0 14px;
  font-size: 0.88rem;
}

.stats-table-wrap {
  overflow-x: auto;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.stats-table th,
.stats-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.stats-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stats-num {
  font-weight: 700;
  color: var(--accent);
}

.stats-empty {
  color: var(--muted);
  text-align: center;
}

.stats-login {
  max-width: 420px;
  margin: 48px auto 0;
}

.stats-login h1 {
  margin: 12px 0 6px;
}

.stats-login__form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.stats-login__form input {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.stats-login__error {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.92rem;
}

.stats-live::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: #22c55e;
  vertical-align: middle;
  animation: stats-pulse 1.5s ease-in-out infinite;
}

.stats-live--error::before {
  background: #ef4444;
  animation: none;
}

@keyframes stats-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

@media (max-width: 720px) {
  .stats-header {
    flex-direction: column;
  }

  .stats-total {
    align-self: flex-start;
  }

  .stats-grid-2 {
    grid-template-columns: 1fr;
  }
}

.stats-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.stats-tabs {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.stats-tabs__btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.92rem;
  cursor: pointer;
}

.stats-tabs__btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.stats-panel.hidden {
  display: none;
}

.admin-links-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.admin-links-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.admin-links-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
}

.admin-links-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.admin-links-table-wrap {
  overflow-x: auto;
}

.admin-links-table input {
  width: 100%;
  min-width: 220px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.92rem;
}

.admin-links-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.admin-links-actions .btn {
  min-width: 140px;
}

.stats-panel-only.hidden-by-tab {
  display: none !important;
}

.stats-period {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.stats-period__btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.85rem;
  cursor: pointer;
}

.stats-period__btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.stats-export {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
}

.stats-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.stats-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  min-height: 140px;
  padding-top: 8px;
}

.stats-bar {
  flex: 1;
  min-width: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  height: 120px;
}

.stats-bar__fill {
  width: 100%;
  max-width: 36px;
  background: linear-gradient(180deg, #a78bfa 0%, var(--accent) 100%);
  border-radius: 6px 6px 2px 2px;
  min-height: 8px;
}

.stats-bar__label {
  font-size: 0.72rem;
  color: var(--muted);
}
