:root {
  color-scheme: light;
  --page: #f4f6f8;
  --panel: #ffffff;
  --panel-strong: #f9fbfd;
  --line: #d8e0e8;
  --line-strong: #b9c5d1;
  --text: #1b2533;
  --muted: #687586;
  --blue: #1565c0;
  --blue-dark: #0d4f9e;
  --green: #16804f;
  --red: #b3261e;
  --yellow: #f4bd2f;
  --ink: #101820;
  --shadow: 0 8px 24px rgba(23, 39, 56, 0.08);
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-size: 14px;
  line-height: 1.42;
}

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

a:hover {
  text-decoration: underline;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

.shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 18px;
}

.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(16, 24, 32, 0.05);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topline {
  background: var(--ink);
  color: #d8e4ee;
  font-size: 12px;
}

.topline .shell {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topline a {
  color: #fff;
}

.topline-left,
.topline-right {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.header-main {
  display: grid;
  grid-template-columns: 230px minmax(360px, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 78px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  min-width: 0;
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.brand-name {
  font-size: 22px;
  font-weight: 800;
  color: #0f2942;
  white-space: nowrap;
}

.brand-sub {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  margin-top: -2px;
}

.header-search {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) auto 124px;
  border: 2px solid var(--blue);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  min-width: 0;
}

.header-search select,
.header-search input {
  border: 0;
  min-height: 44px;
  padding: 0 12px;
  outline: none;
  background: #fff;
}

.header-search select {
  border-right: 1px solid var(--line);
  color: var(--muted);
}

.header-search button {
  border: 0;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
}

.header-search button:hover {
  background: var(--blue-dark);
}

.search-history-link {
  min-height: 44px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-left: 1px solid var(--line);
  color: var(--blue);
  background: rgba(21, 101, 192, .08);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.search-history-link:hover,
.search-history-link:focus {
  background: rgba(21, 101, 192, .16);
  text-decoration: none;
}

.header-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(78px, auto));
  gap: 8px;
  align-items: center;
}

.quick-link {
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-strong);
  color: var(--text);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
}

button.quick-link {
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.logout-link {
  border-color: #ffd5d0;
  background: #fff8f7;
}

.quick-link:hover {
  border-color: var(--blue);
  text-decoration: none;
}

.quick-link strong {
  font-size: 13px;
  line-height: 1.1;
}

.quick-link span {
  color: var(--muted);
  font-size: 11px;
}

.main-nav {
  border-top: 1px solid var(--line);
}

.main-nav .shell {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
}

.main-nav a {
  display: block;
  padding: 12px 14px;
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--blue);
  border-bottom-color: var(--yellow);
  text-decoration: none;
}

.page {
  padding: 22px 0 44px;
}

.layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
}

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

.panel-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-header h1,
.panel-header h2,
.panel-header h3 {
  margin: 0;
  font-size: 18px;
}

.panel-body {
  padding: 16px;
}

.page-title {
  margin: 0 0 14px;
  font-size: 26px;
  color: #0f2942;
}

.section-title {
  margin: 0 0 10px;
  font-size: 18px;
}

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

.hint {
  color: var(--muted);
  font-size: 12px;
}

.status-line {
  min-height: 22px;
  color: var(--muted);
}

.status-line.error {
  color: var(--red);
}

.status-line.ok {
  color: var(--green);
}

.form-grid {
  display: grid;
  gap: 12px;
}

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

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

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
  outline: none;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.12);
}

.btn {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  padding: 8px 13px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.btn:hover {
  border-color: var(--blue);
  text-decoration: none;
}

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

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

.btn.warning {
  background: #fff7df;
  border-color: #e3b736;
  color: #614500;
}

.btn.danger {
  background: #fff1f0;
  border-color: #e2a19d;
  color: var(--red);
}

.btn.small {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 12px;
}

.btn:disabled,
.btn.is-disabled {
  background: #eef2f5;
  color: #8793a1;
  border-color: var(--line);
  cursor: not-allowed;
  pointer-events: none;
}

.notice {
  border: 1px solid #ccd8e4;
  background: #f7fafc;
  border-radius: 6px;
  padding: 12px 14px;
  color: var(--muted);
}

.notice.warning {
  border-color: #e3c66e;
  background: #fff9e8;
  color: #604a08;
}

.notice.error {
  border-color: #dfaaa7;
  background: #fff4f3;
  color: var(--red);
}

.search-desk {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}

.promo-slider {
  min-height: 310px;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: #111820;
}

.promo-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  background-size: cover;
  background-position: center;
  transition: opacity 420ms ease;
  display: flex;
  align-items: flex-end;
}

.promo-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(16, 24, 32, 0.82), rgba(16, 24, 32, 0.2));
}

.promo-slide.is-active {
  opacity: 1;
}

.promo-slide-plain {
  background: linear-gradient(135deg, #101820, #214567 55%, #caa736);
}

.promo-copy {
  position: relative;
  max-width: 610px;
  padding: 34px;
  color: #fff;
}

.promo-copy h1 {
  margin: 0 0 8px;
  font-size: 34px;
  line-height: 1.05;
}

.promo-copy p {
  margin: 0;
  color: #e5edf5;
  font-size: 16px;
}

.promo-controls {
  position: absolute;
  left: 34px;
  bottom: 18px;
  display: flex;
  gap: 8px;
  z-index: 2;
}

.promo-controls button {
  width: 34px;
  height: 5px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
}

.promo-controls button[aria-pressed="true"] {
  background: var(--yellow);
}

.search-box {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 160px 136px;
  gap: 10px;
}

.search-box .field {
  gap: 4px;
}

.search-box .btn {
  align-self: end;
}

.mode-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.mode-tabs button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 5px;
  padding: 7px 10px;
  font-weight: 700;
}

.mode-tabs button[aria-pressed="true"] {
  background: #e8f1fb;
  border-color: var(--blue);
  color: var(--blue);
}

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

.catalog-link {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 12px;
  color: var(--text);
  display: grid;
  align-content: center;
  gap: 3px;
}

.catalog-link:hover {
  border-color: var(--blue);
  box-shadow: 0 4px 16px rgba(21, 101, 192, 0.12);
  text-decoration: none;
}

.catalog-link strong {
  font-size: 14px;
}

.catalog-link span {
  color: var(--muted);
  font-size: 12px;
}

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

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

.metric {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 12px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 10px 11px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  background: #f2f6fa;
  color: #435063;
  font-size: 12px;
  text-transform: uppercase;
}

tbody tr:hover {
  background: #f9fbfd;
}

.price {
  font-weight: 800;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 2px 8px;
  background: #eef2f5;
  color: #526171;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge.ok {
  background: #e6f5ed;
  color: var(--green);
}

.badge.warn {
  background: #fff5d9;
  color: #795700;
}

.badge.blocked {
  background: #fff1f0;
  color: var(--red);
}

.article-link {
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 3px 0;
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.article-link:hover,
.article-link:focus {
  color: var(--blue-dark);
}

.offer-name-cell {
  max-width: 360px;
}

.offer-name-text {
  display: inline-block;
  max-width: min(360px, 38vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

/* Return policy badges */
.return-policy-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 600;
  white-space: nowrap;
  cursor: default;
}

.return-policy-returnable {
  background: #e6f4ea;
  color: #0d6b2e;
}

.return-policy-non-returnable {
  background: #fce8e6;
  color: #a50e0e;
}

.return-policy-conditional {
  background: #fef7e0;
  color: #b06000;
}

.return-policy-expired {
  background: #f1f3f4;
  color: #5f6368;
  text-decoration: line-through;
}

.return-policy-unknown {
  background: #f1f3f4;
  color: #80868b;
}

.brand-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.brand-choice {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  border-radius: 5px;
  padding: 8px 10px;
  font-weight: 700;
}

.brand-choice[aria-pressed="true"] {
  border-color: var(--blue);
  background: #e8f1fb;
  color: var(--blue);
}

.filters {
  display: grid;
  grid-template-columns: 130px 150px minmax(160px, 1fr) 180px;
  gap: 10px;
  align-items: end;
}

.search-status {
  margin-bottom: 8px;
}

.results-panel {
  margin-top: 10px;
}

.offer-filters {
  grid-template-columns: minmax(280px, 1.5fr) minmax(160px, .8fr) minmax(150px, .7fr);
  margin-bottom: 10px;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.filter-chips button {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  min-height: 36px;
  padding: 0 12px;
  font-weight: 800;
  cursor: pointer;
}

.filter-chips button[aria-pressed="true"] {
  border-color: var(--blue);
  background: #e8f1fb;
  color: var(--blue);
}

.search-progress {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
  border: 1px solid rgba(21, 101, 192, .65);
  border-radius: 6px;
  background: #101820;
  color: #d8ebff;
  box-shadow: 0 0 0 3px rgba(21, 101, 192, .10);
  padding: 10px 12px;
  font-weight: 800;
}

.search-progress[hidden] {
  display: none;
}

.search-progress i {
  position: relative;
  display: block;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
}

.search-progress i::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 42%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #67b7ff);
  animation: search-progress-slide 1.1s ease-in-out infinite;
}

@keyframes search-progress-slide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(250%); }
}

.order-card-row td {
  padding: 0;
  background: #fff;
}

.order-card-row td::before {
  display: none;
}

.order-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.order-card-head,
.order-card-meta,
.order-position {
  display: grid;
  gap: 8px;
}

.order-card-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.order-card-head span,
.order-position span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.order-card-meta {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  color: #435063;
  font-size: 13px;
}

.order-positions {
  display: grid;
  gap: 8px;
}

.order-position {
  grid-template-columns: minmax(0, 1.6fr) minmax(110px, .4fr) minmax(180px, .8fr) minmax(180px, .9fr);
  align-items: start;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.return-panel,
.return-request-form {
  display: grid;
  gap: 8px;
}

.return-status {
  border-radius: 6px;
  background: #eef8f1;
  color: #146c2e;
  padding: 8px 10px;
  font-weight: 700;
}

.return-request-form {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #fbfcfd;
}

.return-request-form summary {
  cursor: pointer;
  color: var(--blue);
  font-weight: 800;
}

.return-request-form form {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  font-weight: 700;
  color: var(--muted);
}

.checkbox-row input {
  width: 16px;
  height: 16px;
}

.empty-state {
  min-height: 160px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
  padding: 28px;
}

.side-list {
  display: grid;
  gap: 8px;
}

.side-item {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  padding: 10px;
  display: grid;
  gap: 3px;
  color: var(--text);
}

.side-item strong {
  font-size: 13px;
}

.side-item span {
  color: var(--muted);
  font-size: 12px;
}

button.side-item {
  text-align: left;
  cursor: pointer;
}

.logout-account-btn {
  border-color: #f0c9c6;
}

.logout-account-btn strong {
  color: var(--red);
}

.actions-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.api-box {
  background: #101820;
  color: #d5e8f8;
  border-radius: 6px;
  padding: 12px;
  overflow: auto;
  min-height: 220px;
  font-size: 12px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: 430px;
  z-index: 50;
  display: grid;
  gap: 8px;
}

.toast-item {
  background: #fff;
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--blue);
  box-shadow: var(--shadow);
  border-radius: 6px;
  padding: 12px 14px;
}

.toast-item.error {
  border-left-color: var(--red);
}

.toast-item.warning {
  border-left-color: var(--yellow);
}

.footer {
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  padding: 20px 0;
}

@media (max-width: 1040px) {
  .header-main {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px 0;
  }

  .header-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .search-desk,
  .layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  html,
  body {
    overflow-x: hidden;
  }

  .shell {
    padding: 0 12px;
    max-width: 100%;
  }

  .topline .shell,
  .topline-left,
  .topline-right {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    padding: 6px 12px;
  }

  .header-search,
  .search-box,
  .form-grid.cols-2,
  .form-grid.cols-3,
  .split-grid,
  .metric-row,
  .catalog-grid {
    grid-template-columns: 1fr;
  }

  .search-history-link {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .filters,
  .offer-filters {
    grid-template-columns: 1fr;
  }

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

  .page-title {
    font-size: 22px;
  }

  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .page {
    padding-top: 14px;
  }

  .header-main {
    gap: 10px;
  }

  .header-search {
    order: 3;
  }

  .filter-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    max-width: 100%;
  }

  .filter-chips button {
    white-space: nowrap;
  }

  .order-card-head,
  .order-card-meta,
  .order-position {
    grid-template-columns: 1fr;
  }

  .table-wrap {
    overflow: visible;
    max-width: 100%;
  }

  .table-wrap table,
  .table-wrap thead,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .table-wrap thead {
    display: none;
  }

  .table-wrap tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    margin-bottom: 10px;
    padding: 10px;
  }

  .table-wrap td {
    border: 0;
    padding: 7px 0;
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    word-break: break-word;
  }

  .table-wrap td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
  }

  .table-wrap td.price,
  .table-wrap .price {
    font-size: 20px;
  }

	  .table-wrap .btn {
	    min-height: 42px;
	    width: 100%;
	  }

	  .offer-name-cell {
	    max-width: 100%;
	  }

	  .offer-name-text {
	    max-width: 100%;
	  }

  .order-card-row td {
    display: block;
  }

  .group-toggle-row td {
    display: block;
  }

  .group-toggle-row td::before {
    content: "";
  }

  .group-toggle-row .hint {
    display: block;
    margin: 6px 0 0;
  }
}

/* DG grouped results and public warehouse masking */
.group-toggle-row td {
  background: #f7fafc;
  padding: 8px 11px;
}

.group-toggle-row .hint {
  margin-left: 8px;
}

.group-toggle-btn {
  min-width: 148px;
}

/* Return policy compact icon badges */
.return-policy-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 3px;
  font-size: 13px;
  line-height: 1;
  cursor: default;
  flex-shrink: 0;
}

.return-policy-returnable {
  color: #16804f;
  background: #e6f4ec;
}

.return-policy-conditional {
  color: #b08a00;
  background: #fdf3d0;
}

.return-policy-non_returnable {
  color: #b3261e;
  background: #fce4e4;
}

.return-policy-unknown {
  color: #687586;
  background: #eef1f4;
}

.return-policy-expired {
  color: #687586;
  background: #eef1f4;
  text-decoration: line-through;
}

.col-icon {
  width: 32px;
  text-align: center;
}
