:root {
  --sr-bg: #fff;
  --sr-overlay: rgba(15, 23, 42, 0.45);
  --sr-text: #1a1a1a;
  --sr-muted: #9ca3af;
  --sr-subtle: #6b7280;
  --sr-border: #e8eaee;
  --sr-line: #f0f2f5;
  --sr-accent: #2563eb;
  --sr-accent-soft: #eff4ff;
  --sr-badge: #e53935;
  --sr-badge-alt: #e53935;
  --sr-shadow: 0 16px 48px rgba(15, 23, 42, 0.16);
  --sr-radius: 4px;
  --sr-font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.sr-open {
  overflow: hidden !important;
}

.sr-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  background: var(--sr-overlay);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.sr-overlay.sr-visible {
  display: flex;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.sr-modal {
  width: min(1280px, calc(100vw - 48px));
  height: min(820px, calc(100vh - 48px));
  background: var(--sr-bg);
  border-radius: 10px;
  box-shadow: var(--sr-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(8px);
  transition: transform 0.18s ease;
  font-family: var(--sr-font);
  color: var(--sr-text);
}

.sr-overlay.sr-visible .sr-modal {
  transform: none;
}

.sr-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--sr-border);
  flex-shrink: 0;
}

.sr-search-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.sr-clear-q {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #9aa3af;
  font: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: grid;
  place-items: center;
}

.sr-clear-q:hover {
  background: #f3f4f6;
  color: #111;
}

.sr-search-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: #b0b7c3;
}

.sr-input-stack {
  position: relative;
  flex: 1;
  min-width: 0;
}

.sr-input {
  width: 100%;
  border: 0;
  outline: none;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 500;
  color: var(--sr-text);
  background: transparent;
  padding: 0;
  font-family: inherit;
}

.sr-input::-webkit-search-decoration,
.sr-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.sr-input::placeholder {
  color: #c5cad3;
  font-weight: 400;
}

.sr-close {
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #9aa3af;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background 0.12s ease, color 0.12s ease;
}

.sr-close:hover {
  background: #f3f4f6;
  color: #111;
}

.sr-body {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 0;
  flex: 1;
}

.sr-sidebar {
  border-right: 1px solid var(--sr-border);
  padding: 14px 12px 20px;
  overflow: auto;
  background: #fff;
}

.sr-side-block {
  margin: 0 0 16px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--sr-border);
}

.sr-side-block:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.sr-side-label {
  display: block;
  font-size: 12px;
  font-weight: 650;
  color: var(--sr-subtle);
  margin: 0 0 8px;
  padding: 0 4px;
}

.sr-idle-label {
  display: block;
  font-size: 12px;
  font-weight: 650;
  color: var(--sr-subtle);
  margin: 4px 0 8px;
  padding: 0 4px;
}

.sr-idle-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sr-recent-item {
  display: flex;
  align-items: stretch;
  gap: 2px;
  border-radius: 8px;
}

.sr-recent-item:hover {
  background: #eef1f5;
}

.sr-recent-item .sr-cat {
  flex: 1;
  min-width: 0;
}

.sr-recent-item .sr-cat:hover {
  background: transparent;
}

.sr-recent-remove {
  flex-shrink: 0;
  width: 32px;
  margin: 4px 4px 4px 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #9ca3af;
  font: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.sr-recent-item:hover .sr-recent-remove,
.sr-recent-remove:focus-visible {
  opacity: 1;
}

.sr-recent-remove:hover {
  background: #e5e7eb;
  color: #374151;
}

@media (hover: none) {
  .sr-recent-remove {
    opacity: 1;
  }
}

.sr-cat {
  width: 100%;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  cursor: pointer;
  font: inherit;
  color: var(--sr-text);
  text-align: left;
  border-radius: 6px;
  transition: background 0.12s ease;
}

.sr-cat:hover {
  background: #f3f4f6;
}

.sr-cat.is-active {
  background: #e8f0fe;
}

.sr-cat-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  line-height: 1.35;
  color: #374151;
  text-align: left;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  word-break: break-word;
}

.sr-cat.is-active .sr-cat-name {
  color: #1d4ed8;
  font-weight: 600;
}

.sr-cat-count {
  min-width: 28px;
  padding: 2px 7px;
  border-radius: 4px;
  background: #eef0f3;
  color: #6b7280;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
  flex-shrink: 0;
  line-height: 1.4;
}

.sr-cat.is-active .sr-cat-count {
  background: #2563eb;
  color: #fff;
}

.sr-linkish {
  border: 0;
  background: none;
  color: var(--sr-accent);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 6px 10px;
}

.sr-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: #fff;
}

.sr-main-scroll {
  flex: 1;
  overflow: auto;
  padding: 16px 22px 24px;
  min-height: 0;
}

.sr-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.sr-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--sr-subtle);
  min-width: 0;
}

.sr-breadcrumb button {
  border: 0;
  background: none;
  padding: 0;
  color: var(--sr-accent);
  cursor: pointer;
  font: inherit;
}

.sr-breadcrumb strong {
  color: var(--sr-text);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sr-corrected {
  margin: 0 0 16px;
  font-size: 14px;
  color: #6b7280;
}

.sr-corrected-link {
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 700;
  color: #2563eb;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sr-corrected-link:hover {
  color: #1d4ed8;
}

.sr-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 28px;
  align-items: start;
}

.sr-column {
  min-width: 0;
  padding-bottom: 4px;
}

.sr-column + .sr-column {
  border-left: 1px solid #eef0f3;
  padding-left: 28px;
}

.sr-column-head {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin: 0 0 12px;
  padding: 0 0 10px;
  border: 0;
  border-bottom: 1px solid #eef0f3;
  background: none;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: #111827;
}

.sr-column-head:hover {
  color: var(--sr-accent);
}

.sr-column-head-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
}

.sr-column-head svg {
  width: 13px;
  height: 13px;
  opacity: 0.4;
  flex-shrink: 0;
}

.sr-column-head:hover svg {
  opacity: 0.85;
  color: var(--sr-accent);
}

.sr-product {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 4px;
  margin: 0;
  text-decoration: none;
  color: inherit;
  border-radius: 4px;
  transition: background 0.1s ease;
}

.sr-product:hover,
.sr-product.is-focused {
  background: #f5f8ff;
}

.sr-product:hover .sr-product-title,
.sr-product.is-focused .sr-product-title {
  color: #2563eb;
}

.sr-thumb {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 4px;
  background: #fafafa;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid #f0f0f0;
  display: grid;
  place-items: center;
}

.sr-thumb img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  display: block;
}

.sr-badge {
  position: absolute;
  top: 3px;
  left: 3px;
  background: var(--sr-badge);
  color: #fff;
  font-size: 9px;
  line-height: 1;
  padding: 3px 5px;
  border-radius: 2px;
  font-weight: 700;
  letter-spacing: 0.01em;
  z-index: 1;
  text-transform: none;
}

.sr-badge.is-alt {
  background: var(--sr-badge-alt);
}

.sr-product-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

.sr-product-title {
  font-size: 13px;
  line-height: 1.35;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #222;
  transition: color 0.1s ease;
}

.sr-product-title mark {
  background: #dbeafe;
  color: inherit;
  padding: 0 1px;
  border-radius: 1px;
}

.sr-price-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sr-prices {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.25;
}

.sr-prices.is-inline {
  flex-direction: row;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
}

.sr-price {
  font-size: 13.5px;
  font-weight: 700;
  color: #111;
  font-variant-numeric: tabular-nums;
}

.sr-price.is-sale {
  color: #e11d48;
}

.sr-old-price {
  font-size: 12.5px;
  color: #9ca3af;
  text-decoration: line-through;
  font-variant-numeric: tabular-nums;
}

.sr-more {
  display: inline-flex;
  align-items: center;
  margin-top: 4px;
  padding: 6px 2px;
  border: 0;
  background: none;
  color: #8b93a1;
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}

.sr-more:hover {
  color: var(--sr-accent);
}

.sr-content-type {
  font-size: 11px;
  color: var(--sr-subtle);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sr-product.is-content .sr-thumb {
  background: #f3f4f6;
}

.sr-oos-tag {
  font-size: 11px;
  color: #b45309;
  background: #fff7ed;
  border-radius: 999px;
  padding: 2px 7px;
  font-weight: 600;
}

.sr-product.is-oos {
  opacity: 0.72;
}

/* Suggest */
.sr-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 5;
  background: #fff;
  border: 1px solid var(--sr-border);
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
  max-height: min(360px, 45vh);
  overflow: auto;
  padding: 6px;
}

.sr-suggest-block + .sr-suggest-block {
  border-top: 1px solid var(--sr-line);
  margin-top: 4px;
  padding-top: 4px;
}

.sr-suggest-label {
  font-size: 11px;
  color: var(--sr-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 6px 10px 4px;
}

.sr-suggest-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.sr-suggest-item:hover {
  background: var(--sr-accent-soft);
}

.sr-suggest-item svg {
  width: 16px;
  height: 16px;
  color: var(--sr-muted);
  flex-shrink: 0;
}

.sr-suggest-item em {
  margin-left: auto;
  font-style: normal;
  color: var(--sr-muted);
  font-size: 12px;
}

.sr-suggest-tag {
  font-size: 10px;
  color: var(--sr-accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sr-suggest-product {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
}

.sr-suggest-product:hover {
  background: var(--sr-accent-soft);
}

.sr-suggest-thumb {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  background: #fafafa;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}

.sr-suggest-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.sr-suggest-title {
  font-size: 13px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sr-suggest-price {
  font-size: 12px;
  color: var(--sr-subtle);
  margin-top: 2px;
}

/* List mode */
.sr-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 32px;
  padding: 4px 0 8px;
}

.sr-list .sr-product {
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  padding: 12px 8px;
  margin: 0 -8px;
  border-bottom: 1px solid var(--sr-line);
  border-radius: 0;
}

.sr-list .sr-product:hover,
.sr-list .sr-product.is-focused {
  background: #f7f9fc;
}

.sr-list .sr-thumb {
  width: 96px;
  height: 96px;
}

.sr-list .sr-product-title {
  -webkit-line-clamp: 3;
  font-size: 15px;
  line-height: 1.4;
  font-weight: 500;
}

.sr-list .sr-badge {
  font-size: 10px;
  padding: 4px 6px;
}

.sr-list .sr-price {
  font-size: 16px;
  font-weight: 700;
}

.sr-list .sr-old-price {
  font-size: 13px;
}

.sr-list .sr-oos-tag {
  font-size: 12px;
  margin-top: 2px;
}

.sr-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px 14px;
  border-top: 1px solid var(--sr-border);
  background: #fff;
}

.sr-meta {
  font-size: 12.5px;
  color: var(--sr-subtle);
}

.sr-pager {
  display: flex;
  align-items: center;
  gap: 4px;
}

.sr-page-btn {
  min-width: 32px;
  height: 32px;
  border: 1px solid var(--sr-border);
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  color: var(--sr-text);
}

.sr-page-btn:hover:not(:disabled) {
  border-color: var(--sr-accent);
  color: var(--sr-accent);
}

.sr-page-btn.is-active {
  background: var(--sr-accent);
  border-color: var(--sr-accent);
  color: #fff;
}

.sr-page-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.sr-page-ellipsis {
  color: var(--sr-muted);
  padding: 0 2px;
}

.sr-sort {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--sr-subtle);
}

.sr-sort-select {
  border: 1px solid var(--sr-border);
  border-radius: 6px;
  padding: 6px 8px;
  font: inherit;
  font-size: 13px;
  background: #fff;
}

.sr-price-filter {
  padding: 0 10px 8px;
}

.sr-price-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.sr-price-input {
  width: 100%;
  border: 1px solid var(--sr-border);
  border-radius: 6px;
  padding: 6px 8px;
  font: inherit;
  font-size: 13px;
}

.sr-range {
  width: 100%;
  margin: 0 0 8px;
}

.sr-price-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  background: var(--sr-accent);
  color: #fff;
  border-radius: 6px;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.sr-btn.sm {
  padding: 6px 10px;
  font-size: 12px;
}

.sr-btn:hover {
  filter: brightness(1.04);
}

.sr-empty,
.sr-hint {
  padding: 0;
  min-height: 100%;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sr-hint-stage {
  width: min(420px, 100%);
  padding: 24px 28px;
  text-align: center;
}

.sr-hint-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 10px;
  color: var(--sr-text);
}

.sr-hint-text {
  font-size: 15px;
  line-height: 1.45;
  color: var(--sr-subtle);
  margin: 0 0 22px;
}

.sr-idle-starters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 10px;
}

.sr-idle-starter-item {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border-radius: 6px;
  padding: 0 2px 0 0;
}

.sr-idle-starter-item:hover {
  background: #eef1f5;
}

.sr-idle-starter {
  border: 0;
  background: transparent;
  padding: 4px 6px;
  margin: 0;
  font: inherit;
  font-size: 14px;
  color: var(--sr-accent);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.12s ease, color 0.12s ease;
}

.sr-idle-starter:hover {
  text-decoration-color: currentColor;
  color: #1d4ed8;
}

.sr-idle-starter-remove {
  border: 0;
  background: transparent;
  width: 22px;
  height: 22px;
  padding: 0;
  margin: 0;
  border-radius: 4px;
  font: inherit;
  font-size: 15px;
  line-height: 1;
  color: #9ca3af;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.sr-idle-starter-item:hover .sr-idle-starter-remove,
.sr-idle-starter-remove:focus-visible {
  opacity: 1;
}

.sr-idle-starter-remove:hover {
  background: #e5e7eb;
  color: #374151;
}

@media (hover: none) {
  .sr-idle-starter-remove {
    opacity: 1;
  }
}

.sr-idle-dot {
  color: #c5cad3;
  font-size: 14px;
  user-select: none;
  padding: 0 2px;
}

.sr-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sr-chip {
  border: 1px solid var(--sr-border);
  background: #fff;
  border-radius: 6px;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  color: var(--sr-text);
}

.sr-chip:hover {
  border-color: var(--sr-accent);
  color: var(--sr-accent);
  background: var(--sr-accent-soft);
}

.sr-skeleton {
  display: grid;
  gap: 10px;
  padding: 4px 0;
}

.sr-skel-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: center;
}

.sr-skel-thumb {
  width: 72px;
  height: 72px;
  border-radius: 4px;
  background: #eef1f5;
}

.sr-skel-lines {
  display: grid;
  gap: 8px;
}

.sr-skel-line {
  height: 12px;
  border-radius: 4px;
  background: #eef1f5;
}

.sr-skel-line.short {
  width: 45%;
}

.sr-pulse {
  animation: sr-pulse 1.1s ease-in-out infinite;
}

@keyframes sr-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

.sr-overlay[data-theme="sanit"] {
  --sr-accent: #0b6bcb;
  --sr-accent-soft: #eaf3fb;
  --sr-badge: #e11d48;
  --sr-badge-alt: #e11d48;
}

.sr-overlay[data-theme="sanit"] .sr-input {
  font-weight: 600;
}

@media (max-width: 1100px) {
  .sr-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sr-column:nth-child(3) {
    display: none;
  }
}

@media (max-width: 900px) {
  .sr-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .sr-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--sr-border);
    max-height: 42vh;
    overflow: auto;
    padding: 12px 14px;
  }

  .sr-side-block {
    margin-bottom: 12px;
    padding-bottom: 12px;
  }

  .sr-cat {
    width: 100%;
  }

  .sr-columns {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .sr-column + .sr-column {
    border-left: 0;
    padding-left: 0;
    margin-left: 0;
    border-top: 1px solid var(--sr-line);
    padding-top: 14px;
  }

  .sr-column:nth-child(3) {
    display: block;
  }

  .sr-list {
    grid-template-columns: 1fr;
  }

  .sr-input {
    font-size: 20px;
  }
}

@media (max-width: 640px) {
  .sr-overlay {
    padding: 0;
  }

  .sr-modal {
    height: 100dvh;
    border-radius: 0;
  }

  .sr-input {
    font-size: 18px;
  }

  .sr-top {
    padding-top: calc(14px + env(safe-area-inset-top, 0px));
  }

  .sr-footer {
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
}
