:root {
  --rose-950: #4f0a22;
  --rose-900: #68102f;
  --rose-800: #85193f;
  --rose-700: #a61e4d;
  --rose-600: #bd2c5d;
  --rose-100: #f8dce7;
  --rose-50: #fff5f8;
  --ink: #21191d;
  --muted: #71646a;
  --line: #e5d7dc;
  --surface: #ffffff;
  --page: #f5f1f3;
  --base-code-width: 170px;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 0%, rgba(166, 30, 77, 0.11), transparent 32rem),
    var(--page);
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
.table-scroll:focus-visible,
.image-card a:focus-visible {
  outline: 3px solid rgba(166, 30, 77, 0.32);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-shell {
  width: 100%;
  max-width: 1920px;
  margin: 0 auto;
  padding: 22px clamp(14px, 2vw, 34px) 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 132px;
  padding: 25px 28px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 82% -40%, rgba(255, 255, 255, 0.19), transparent 25rem),
    linear-gradient(128deg, var(--rose-950), var(--rose-700));
  border: 1px solid rgba(79, 10, 34, 0.32);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 15px 38px rgba(79, 10, 34, 0.16);
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  place-items: center;
  color: var(--rose-900);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.04em;
  background: #fff;
  border: 3px solid rgba(255, 255, 255, 0.7);
  border-radius: 15px;
  box-shadow: 0 8px 24px rgba(51, 5, 21, 0.25);
}

.eyebrow,
.modal-eyebrow {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow {
  color: #f4c8d8;
}

h1 {
  margin: 0;
  font-size: clamp(27px, 3vw, 40px);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.subtitle {
  margin: 9px 0 0;
  color: #f8e8ee;
  font-size: 15px;
  line-height: 1.45;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.result-chip {
  min-width: 142px;
  padding: 10px 14px;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  backdrop-filter: blur(8px);
}

.reset-button {
  min-height: 41px;
  padding: 9px 15px;
  color: var(--rose-900);
  font-size: 14px;
  font-weight: 800;
  background: #fff;
  border: 1px solid #fff;
  border-radius: 10px;
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

.reset-button:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(50, 5, 21, 0.22);
}

.reset-button:disabled {
  cursor: default;
  opacity: 0.52;
}

.catalog-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 18px 18px;
  box-shadow: 0 15px 38px rgba(75, 39, 54, 0.1);
}

.table-scroll {
  width: 100%;
  min-height: 390px;
  max-height: calc(100vh - 285px);
  overflow: auto;
  scrollbar-color: #be8299 #f3e8ec;
  scrollbar-width: thin;
}

.catalog-table {
  width: 3435px;
  min-width: 100%;
  table-layout: fixed;
  border-spacing: 0;
  border-collapse: separate;
  font-size: 13px;
}

.catalog-table th,
.catalog-table td {
  padding: 10px 11px;
  overflow-wrap: anywhere;
  vertical-align: middle;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.catalog-table th:last-child,
.catalog-table td:last-child {
  border-right: 0;
}

.label-row th {
  position: sticky;
  z-index: 5;
  top: 0;
  height: 52px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  text-align: left;
  background: var(--rose-800);
  border-color: rgba(255, 255, 255, 0.18);
}

.search-row th {
  position: sticky;
  z-index: 5;
  top: 52px;
  height: 54px;
  padding: 8px;
  background: var(--rose-100);
  border-color: #d9bbc6;
}

.search-row input {
  width: 100%;
  height: 36px;
  padding: 7px 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cda8b7;
  border-radius: 8px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.search-row input::placeholder {
  color: #958a8f;
}

.search-row input:focus {
  border-color: var(--rose-700);
  box-shadow: 0 0 0 3px rgba(166, 30, 77, 0.12);
}

.catalog-table tbody td {
  min-height: 52px;
  color: #30272b;
  line-height: 1.4;
  background: #fff;
}

.catalog-table tbody tr:nth-child(even) td {
  background: #fcfafb;
}

.catalog-table tbody tr:hover td {
  background: var(--rose-50);
}

.catalog-table tbody tr.out-of-stock td {
  color: #62585d;
  background: #f6f3f4;
}

.catalog-table tbody tr.out-of-stock:nth-child(even) td {
  background: #f1edef;
}

.catalog-table tbody tr.out-of-stock:hover td {
  background: #fbeaf1;
}

.sticky-column {
  position: sticky;
  z-index: 3;
}

.sticky-base-code {
  left: 0;
}

.sticky-variant-code {
  left: var(--base-code-width);
  box-shadow: 7px 0 12px -10px rgba(45, 15, 27, 0.9);
}

.label-row .sticky-column,
.search-row .sticky-column {
  z-index: 8;
}

.column-0 { width: var(--base-code-width); }
.column-1 { width: 205px; }
.column-2 { width: 155px; }
.column-3 { width: 310px; }
.column-4 { width: 285px; }
.column-5 { width: 115px; text-align: center; }
.column-6 { width: 112px; text-align: center; }
.column-7 { width: 105px; }
.column-8 { width: 250px; }
.column-9 { width: 150px; }
.column-10 { width: 80px; }
.column-11 { width: 118px; }
.column-12 { width: 170px; }
.column-13 { width: 125px; }
.column-14 { width: 145px; }
.column-15 { width: 155px; }
.column-16 { width: 130px; }
.column-17 { width: 110px; }
.column-18 { width: 85px; }

.product-name-cell {
  font-weight: 650;
}

.number-cell {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.price-cell {
  font-weight: 800;
}

.action-cell {
  text-align: center;
}

.table-action {
  min-width: 72px;
  min-height: 34px;
  padding: 7px 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  background: var(--rose-700);
  border: 1px solid var(--rose-800);
  border-radius: 8px;
  box-shadow: 0 3px 8px rgba(104, 16, 47, 0.15);
  transition: background 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.table-action:hover {
  background: var(--rose-900);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(104, 16, 47, 0.22);
}

.loading-cell,
.error-cell,
.empty-cell {
  height: 190px;
  color: var(--muted) !important;
  font-size: 15px;
  text-align: center;
  background: #fff !important;
}

.error-cell {
  color: #9b1c3f !important;
}

.catalog-footer {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(280px, 1fr);
  align-items: center;
  gap: 16px;
  min-height: 70px;
  padding: 12px 18px;
  background: #fff;
  border-top: 1px solid var(--line);
}

.page-size-control {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.page-size-control select {
  height: 36px;
  padding: 5px 28px 5px 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #ccb9c0;
  border-radius: 8px;
}

.range-status {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.pagination span {
  min-width: 112px;
  color: #51444a;
  font-size: 13px;
  font-weight: 750;
  text-align: center;
}

.pagination button {
  min-height: 36px;
  padding: 7px 13px;
  color: var(--rose-900);
  font-size: 13px;
  font-weight: 800;
  background: var(--rose-50);
  border: 1px solid #d5aebe;
  border-radius: 8px;
}

.pagination button:not(:disabled):hover {
  color: #fff;
  background: var(--rose-800);
  border-color: var(--rose-800);
}

.pagination button:disabled {
  cursor: default;
  opacity: 0.42;
}

.page-note {
  margin: 12px 3px 0;
  color: var(--muted);
  font-size: 12px;
}

.modal-open {
  overflow: hidden;
}

.modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  background: rgba(31, 9, 18, 0.72);
  border: 0;
  cursor: default;
  backdrop-filter: blur(4px);
}

.modal-panel {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(900px, 96vw);
  max-height: min(88vh, 920px);
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(39, 7, 19, 0.4);
}

.modal-panel.gallery-panel {
  width: min(1180px, 96vw);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  color: #fff;
  background: linear-gradient(125deg, var(--rose-950), var(--rose-700));
}

.modal-header h2 {
  max-width: 950px;
  margin: 0;
  font-size: clamp(20px, 2.5vw, 29px);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.modal-eyebrow {
  min-height: 17px;
  color: #f4c8d8;
  letter-spacing: 0.08em;
  text-transform: none;
}

.modal-close {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  padding: 0 0 4px;
  color: #fff;
  font-size: 34px;
  font-weight: 300;
  line-height: 1;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 50%;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.22);
}

.modal-content {
  padding: 22px;
  overflow: auto;
  overscroll-behavior: contain;
}

.description-text {
  color: #33282d;
  font-size: 15px;
  line-height: 1.72;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.image-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  background: #faf7f8;
  border: 1px solid var(--line);
  border-radius: 13px;
}

.image-card a {
  display: grid;
  min-height: 245px;
  place-items: center;
  padding: 12px;
  color: var(--rose-800);
  text-decoration: none;
  background:
    linear-gradient(45deg, #f7f1f3 25%, transparent 25%),
    linear-gradient(-45deg, #f7f1f3 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f7f1f3 75%),
    linear-gradient(-45deg, transparent 75%, #f7f1f3 75%),
    #fff;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}

.image-card img {
  display: block;
  width: 100%;
  height: 245px;
  object-fit: contain;
}

.image-card > span {
  padding: 9px 12px;
  color: #6d5f65;
  font-size: 12px;
  font-weight: 750;
  text-align: center;
  background: #fff;
  border-top: 1px solid var(--line);
}

.image-card.image-error a {
  min-height: 190px;
}

.image-card.image-error p {
  margin: 0;
  padding: 20px;
  font-size: 13px;
  font-weight: 750;
  text-align: center;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
}

@media (max-width: 900px) {
  .page-shell {
    padding: 0 0 18px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    border-radius: 0;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .catalog-card {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .table-scroll {
    max-height: calc(100vh - 325px);
  }

  .catalog-table tbody .sticky-column {
    position: static;
  }

  .catalog-table thead .sticky-column {
    left: auto;
  }

  .catalog-footer {
    grid-template-columns: 1fr;
    gap: 11px;
  }

  .range-status {
    text-align: left;
  }

  .pagination {
    justify-content: space-between;
  }

  .page-note {
    margin-right: 15px;
    margin-left: 15px;
  }

  .modal {
    padding: 10px;
  }

  .modal-panel {
    width: 100%;
    max-height: 94vh;
    border-radius: 14px;
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: 21px 16px;
  }

  .brand-group {
    align-items: flex-start;
  }

  .brand-mark {
    flex-basis: 48px;
    width: 48px;
    height: 48px;
    border-radius: 12px;
  }

  .result-chip,
  .reset-button {
    flex: 1 1 145px;
  }

  .modal-header,
  .modal-content {
    padding: 16px;
  }

  .image-gallery {
    grid-template-columns: 1fr;
  }

  .image-card a,
  .image-card img {
    min-height: 0;
    height: min(72vw, 330px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
