:root {
  --bg: #f6f7f8;
  --surface: #ffffff;
  --surface-2: #eef2f1;
  --line: #d8dedc;
  --text: #18201f;
  --muted: #65716f;
  --accent: #16746b;
  --accent-2: #255f8f;
  --warning: #a56a12;
  --danger: #9b2f2f;
  --shadow: 0 16px 40px rgba(17, 24, 39, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

body.has-modal {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

.app-page {
  display: none;
}

.app-page.is-active {
  display: block;
}

.app-shell {
  display: none;
  grid-template-columns: 370px minmax(0, 1fr) 340px;
  min-height: 100vh;
}

.app-shell.is-active {
  display: grid;
}

.home-page {
  min-height: 100vh;
  padding: 34px;
}

.home-header,
.portal-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.home-logo {
  width: 124px;
  height: auto;
  object-fit: contain;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  max-width: 1180px;
  margin-top: 44px;
}

.home-tile {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  min-height: 168px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 20px;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(17, 24, 39, 0.02);
}

.home-tile:hover,
.home-tile:focus-visible {
  border-color: rgba(22, 116, 107, 0.42);
  box-shadow: var(--shadow);
}

.home-tile.is-primary {
  border-color: rgba(22, 116, 107, 0.3);
  background: #eef8f5;
}

.home-tile__icon {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border: 1px solid rgba(22, 116, 107, 0.18);
  border-radius: 8px;
  background: #f8faf9;
  color: var(--accent);
}

.home-tile__icon svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

.home-tile strong {
  display: block;
  margin-bottom: 7px;
  font-size: 22px;
  line-height: 1.15;
}

.home-tile small {
  display: block;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.portal-page {
  min-height: 100vh;
  padding: 28px;
}

.portal-logo {
  width: 112px;
  height: auto;
  object-fit: contain;
}

.portal-back {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

.portal-back:hover,
.portal-back:focus-visible {
  border-color: rgba(22, 116, 107, 0.35);
  color: var(--accent);
}

.portal-back svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.portal-content {
  max-width: 920px;
  margin-top: 42px;
}

.portal-content h1 {
  font-size: 30px;
}

.placeholder-panel {
  display: grid;
  gap: 8px;
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
}

.placeholder-panel strong {
  font-size: 18px;
}

.placeholder-panel span {
  color: var(--muted);
}

.account-search {
  position: relative;
  display: grid;
  gap: 8px;
  margin-top: 20px;
  max-width: 720px;
}

.account-search__field {
  display: grid;
  gap: 7px;
}

.account-search__field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.account-search__field input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 0 14px;
  font-weight: 750;
}

.account-search__field input:focus {
  border-color: rgba(22, 116, 107, 0.45);
  outline: 3px solid rgba(22, 116, 107, 0.1);
}

.account-search__results {
  position: absolute;
  z-index: 20;
  top: 73px;
  left: 0;
  right: 0;
  display: grid;
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.account-search__results[hidden] {
  display: none;
}

.account-search-result {
  display: grid;
  gap: 4px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
}

.account-search-result:last-child {
  border-bottom: 0;
}

.account-search-result:hover,
.account-search-result:focus-visible {
  background: #eef8f5;
}

.account-search-result strong {
  font-size: 15px;
}

.account-search-result span,
.account-search-status,
.account-search__active {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.account-search-status {
  padding: 14px;
}

.account-search__active {
  min-height: 18px;
  margin: 0;
}

.account-panel {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.account-loading,
.account-empty,
.account-empty-line {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
  color: var(--muted);
  font-weight: 700;
}

.account-empty {
  display: grid;
  gap: 9px;
}

.account-empty strong {
  color: var(--text);
  font-size: 18px;
}

.account-empty button {
  width: max-content;
  min-height: 38px;
  border: 1px solid rgba(22, 116, 107, 0.32);
  border-radius: 8px;
  background: #eef8f5;
  color: var(--accent);
  padding: 0 14px;
  font-weight: 800;
  cursor: pointer;
}

.account-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 16px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
}

.account-hero h2 {
  margin: 8px 0 6px;
  font-size: 26px;
  line-height: 1.15;
}

.account-hero p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.account-code,
.account-type {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  border-radius: 999px;
  background: #eef8f5;
  color: var(--accent);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
}

.account-balance-card,
.account-metric {
  display: grid;
  align-content: center;
  gap: 7px;
  border: 1px solid rgba(22, 116, 107, 0.18);
  border-radius: 8px;
  background: #f8faf9;
  padding: 16px;
}

.account-balance-card span,
.account-metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.account-balance-card strong {
  font-size: 26px;
  line-height: 1;
}

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

.account-metric strong {
  font-size: 22px;
}

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

.account-info-card,
.account-documents {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
}

.account-info-card h2,
.account-documents h2 {
  margin: 0;
  font-size: 18px;
}

.account-info-card dl {
  display: grid;
  gap: 11px;
  margin: 14px 0 0;
}

.account-info-card dl > div {
  display: grid;
  gap: 3px;
}

.account-info-card dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.account-info-card dd {
  margin: 0;
  font-weight: 750;
  line-height: 1.35;
}

.account-documents {
  display: grid;
  gap: 14px;
}

.account-lines-panel {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(22, 116, 107, 0.28);
  border-radius: 8px;
  background: #f8faf9;
  padding: 16px;
}

.account-lines-panel[hidden] {
  display: none;
}

.account-lines__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
}

.account-lines__header span,
.account-lines__summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.account-lines__header h2 {
  margin: 4px 0 0;
  font-size: 20px;
}

.account-lines__summary {
  display: grid;
  gap: 2px;
  justify-items: end;
}

.account-lines__summary strong {
  font-size: 15px;
}

.account-lines-close,
.account-line-button {
  min-height: 34px;
  border: 1px solid rgba(22, 116, 107, 0.28);
  border-radius: 8px;
  background: #eef8f5;
  color: var(--accent);
  padding: 0 10px;
  font-weight: 850;
  cursor: pointer;
}

.account-lines-close:hover,
.account-lines-close:focus-visible,
.account-line-button:hover,
.account-line-button:focus-visible {
  border-color: rgba(22, 116, 107, 0.5);
  background: #e1f2ee;
}

.account-lines-table td:nth-child(2) {
  min-width: 260px;
}

.account-documents__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.account-documents__header span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

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

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

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

.account-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.account-table tr:last-child td {
  border-bottom: 0;
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.account-actions a,
.account-actions button {
  display: inline-grid;
  min-height: 34px;
  place-items: center;
  border: 1px solid rgba(37, 95, 143, 0.22);
  border-radius: 8px;
  color: var(--accent-2);
  padding: 0 10px;
  text-decoration: none;
  font-weight: 850;
}

.account-actions button {
  background: var(--surface);
  cursor: pointer;
}

.account-actions a:hover,
.account-actions a:focus-visible,
.account-actions button:hover,
.account-actions button:focus-visible {
  background: #edf5fb;
}

.account-muted {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.catalogues-layout {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.catalogue-brands {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.catalogue-brand {
  display: grid;
  gap: 8px;
  align-content: center;
  justify-items: center;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  padding: 12px;
  cursor: pointer;
}

.catalogue-brand:hover,
.catalogue-brand:focus-visible,
.catalogue-brand.is-active {
  border-color: rgba(22, 116, 107, 0.42);
  background: #eef8f5;
  color: var(--accent);
}

.catalogue-brand img {
  display: block;
  max-width: 128px;
  max-height: 38px;
  object-fit: contain;
}

.catalogue-brand span {
  font-size: 12px;
  font-weight: 800;
}

.catalogue-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  border-bottom: 1px solid var(--line);
}

.catalogue-toolbar strong {
  font-size: 18px;
}

.catalogue-toolbar span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

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

.catalogue-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

.catalogue-card:hover {
  border-color: rgba(22, 116, 107, 0.34);
  box-shadow: var(--shadow);
}

.catalogue-card__icon {
  display: grid;
  width: 54px;
  height: 62px;
  place-items: center;
  border-radius: 8px;
  background: #fff2f2;
  color: #b52d2d;
}

.catalogue-card__icon svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

.catalogue-card__body {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.catalogue-card__body strong {
  font-size: 16px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.catalogue-card__body span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.catalogue-card__actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  align-self: end;
}

.catalogue-open,
.catalogue-download {
  display: inline-grid;
  min-height: 36px;
  place-items: center;
  border: 1px solid rgba(22, 116, 107, 0.28);
  border-radius: 8px;
  background: #e8f4f1;
  color: var(--accent);
  padding: 0 12px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.catalogue-download {
  background: var(--surface);
  color: var(--accent-2);
}

.catalogue-open:hover,
.catalogue-open:focus-visible,
.catalogue-download:hover,
.catalogue-download:focus-visible {
  border-color: rgba(22, 116, 107, 0.5);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: #fbfbfa;
  padding: 24px 20px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-logo {
  display: block;
  width: 108px;
  max-width: 42%;
  height: auto;
  object-fit: contain;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.1;
}

.category-list {
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 8px;
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding-right: 4px;
}

.category-search {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 38px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 0 10px;
}

.category-search svg {
  width: 17px;
  height: 17px;
  color: var(--muted);
  fill: currentColor;
}

.category-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
}

.category-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding-left: calc(var(--level, 0) * 8px);
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 15px;
}

.category-row:hover,
.category-row.is-active {
  border-color: var(--line);
  background: var(--surface);
}

.category-row.is-active {
  color: var(--accent);
  font-weight: 700;
  border-color: rgba(22, 116, 107, 0.28);
  background: #edf8f5;
}

.category-row.is-ancestor {
  background: #f5faf8;
  color: #214b47;
}

.category-row.is-path-root {
  border-color: rgba(22, 116, 107, 0.22);
}

.category-row.is-active .category-name,
.category-row.is-ancestor .category-name {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.category-row.is-path-root .category-name {
  text-decoration-thickness: 3px;
}

.category-toggle,
.category-toggle-spacer {
  display: grid;
  width: 30px;
  height: 40px;
  place-items: center;
}

.category-toggle {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.category-toggle:hover {
  background: var(--surface-2);
  color: var(--accent);
}

.category-toggle svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
  transition: transform 140ms ease;
}

.category-toggle.is-open svg {
  transform: rotate(90deg);
}

.category-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 40px;
  width: 100%;
  padding: 10px 10px 10px 2px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.category-row[style*="--level:1"],
.category-row[style*="--level:2"],
.category-row[style*="--level:3"],
.category-row[style*="--level:4"] {
  font-size: 14.5px;
}

.category-row[style*="--level:2"],
.category-row[style*="--level:3"],
.category-row[style*="--level:4"] {
  color: #263331;
}

.category-name {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.category-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  padding-left: 10px;
  align-self: center;
}

.workspace {
  min-width: 0;
  padding: 22px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 18;
  display: grid;
  grid-template-columns: minmax(260px, 620px) auto;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin: -22px -22px 0;
  padding: 22px 22px 14px;
  background: rgba(246, 247, 248, 0.96);
  backdrop-filter: blur(8px);
}

.product-back {
  flex: 0 0 auto;
}

.mobile-product-header {
  display: none;
}

.search-shell {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 0 14px;
}

.search-shell svg,
.icon-button svg,
.close-button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.search-shell svg {
  color: var(--muted);
}

.search-shell input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
}

.mobile-filter-button,
.mobile-filter-close,
.mobile-filter-backdrop,
.mobile-filter-section {
  display: none;
}

.filter-row {
  position: sticky;
  top: 82px;
  z-index: 17;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin: 0 -22px 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.filter-control {
  display: grid;
  gap: 5px;
  min-width: min(240px, 100%);
}

.filter-control.compact {
  min-width: 118px;
  width: 132px;
}

.filter-control span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.filter-control select,
.filter-control input {
  min-height: 38px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbfa;
  color: var(--text);
  padding: 0 10px;
}

.clear-filters-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbfa;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.clear-filters-button:hover {
  color: var(--accent);
  border-color: rgba(22, 116, 107, 0.35);
}

.apply-filters-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(22, 116, 107, 0.36);
  border-radius: 8px;
  background: #e8f4f1;
  color: var(--accent);
  font-weight: 800;
  cursor: pointer;
}

.apply-filters-button:hover,
.apply-filters-button:focus-visible {
  border-color: rgba(22, 116, 107, 0.56);
  background: #dff0ec;
}

.icon-button,
.close-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.cart-button {
  position: relative;
  display: inline-grid;
  grid-template-columns: 20px auto minmax(24px, auto);
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid rgba(22, 116, 107, 0.28);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent);
  font-weight: 800;
  cursor: pointer;
}

.cart-button:hover,
.cart-button.has-items {
  border-color: rgba(22, 116, 107, 0.48);
  background: #e8f4f1;
}

.cart-button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.cart-button strong {
  display: inline-grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 12px;
  line-height: 1;
}

.toolbar .mobile-filter-button {
  display: none;
}

.icon-button:hover,
.icon-button.is-active,
.icon-button[aria-pressed="true"] {
  border-color: rgba(22, 116, 107, 0.35);
  color: var(--accent);
}

.status-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 14px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warning);
}

.status-strip.is-live .status-dot {
  background: var(--accent);
}

.status-strip.is-error .status-dot {
  background: var(--danger);
}

#countText {
  margin-left: auto;
}

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

.product-grid.is-list {
  grid-template-columns: 1fr;
}

.product-card {
  display: grid;
  grid-template-rows: 196px minmax(244px, 1fr);
  min-height: 440px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(17, 24, 39, 0.02);
  cursor: pointer;
}

.product-card:hover {
  border-color: rgba(22, 116, 107, 0.45);
  box-shadow: var(--shadow);
}

.product-grid.is-list .product-card {
  grid-template-columns: 178px minmax(0, 1fr);
  grid-template-rows: minmax(178px, auto);
  min-height: 178px;
}

.product-grid.is-list .product-image {
  min-height: 178px;
  border-right: 1px solid var(--line);
  border-bottom: 0;
}

.product-grid.is-list .product-meta {
  min-height: 178px;
  align-content: stretch;
}

.product-grid.is-list .product-category {
  min-height: 0;
  -webkit-line-clamp: 1;
}

.product-grid.is-list .product-title {
  min-height: 0;
  -webkit-line-clamp: 2;
}

.product-grid.is-list .product-brand {
  min-height: 0;
}

.product-image {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #f8faf9;
  padding: 12px;
}

.product-image img {
  position: absolute;
  inset: 12px;
  width: calc(100% - 24px);
  height: calc(100% - 24px);
  object-fit: contain;
  display: block;
}

.photo-count {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid rgba(22, 116, 107, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(17, 24, 39, 0.08);
}

.card-photo-controls {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  pointer-events: none;
}

.card-photo-arrow {
  display: grid;
  width: 34px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(216, 222, 220, 0.86);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--accent-2);
  box-shadow: 0 8px 22px rgba(17, 24, 39, 0.12);
  cursor: pointer;
  opacity: 0;
  pointer-events: auto;
  transform: translateY(2px);
  transition: opacity 140ms ease, transform 140ms ease, color 140ms ease, border-color 140ms ease;
}

.product-card:hover .card-photo-arrow,
.product-card:focus-within .card-photo-arrow {
  opacity: 1;
  transform: translateY(0);
}

.card-photo-arrow:hover,
.card-photo-arrow:focus-visible {
  border-color: rgba(22, 116, 107, 0.42);
  color: var(--accent);
}

.card-photo-arrow svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.product-meta {
  display: grid;
  gap: 9px;
  align-content: start;
  min-width: 0;
  padding: 14px;
}

.product-kicker {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.product-code {
  color: #596866;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.product-category {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  min-height: 30px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.product-title {
  margin: 0;
  min-height: 84px;
  font-size: 16px;
  line-height: 1.18;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

.product-title.is-medium {
  font-size: 15px;
}

.product-title.is-long {
  font-size: 14px;
  line-height: 1.16;
}

.product-brand {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
}

.product-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
}

.product-purchase-controls {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 40px;
}

.product-qty-stepper {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  min-height: 40px;
  overflow: hidden;
  border: 1px solid rgba(22, 116, 107, 0.26);
  border-radius: 8px;
  background: #ffffff;
}

.product-qty-button {
  display: grid;
  height: 40px;
  place-items: center;
  border: 0;
  background: #f4f7f6;
  color: var(--accent);
  cursor: pointer;
}

.product-qty-button:hover,
.product-qty-button:focus-visible {
  background: #dff0ec;
}

.product-qty-button:disabled {
  color: var(--muted);
  cursor: default;
  opacity: 0.45;
}

.product-qty-button svg,
.add-cart-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.product-pending-qty {
  display: grid;
  min-width: 0;
  height: 40px;
  place-items: center;
  border-left: 1px solid rgba(216, 222, 220, 0.95);
  border-right: 1px solid rgba(216, 222, 220, 0.95);
  background: #ffffff;
  color: var(--text);
  font-weight: 900;
}

.add-cart-button {
  display: inline-grid;
  grid-template-columns: 18px auto;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  min-width: 0;
  border: 1px solid rgba(22, 116, 107, 0.3);
  border-radius: 8px;
  background: #e8f4f1;
  color: var(--accent);
  font-weight: 900;
  cursor: pointer;
}

.add-cart-button:hover,
.add-cart-button:focus-visible {
  border-color: rgba(22, 116, 107, 0.52);
  background: #dff0ec;
}

.stock-pill {
  display: inline-flex;
  align-items: center;
  max-width: 150px;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  background: #e8f4f1;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.stock-pill.is-low {
  background: #fff3dd;
  color: var(--warning);
}

.price-label {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

.detail-panel {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  border-left: 1px solid var(--line);
  background: var(--surface);
  padding: 18px;
}

.close-button {
  display: none;
  margin-left: auto;
}

.detail-content {
  display: grid;
  gap: 16px;
}

.detail-content.empty-state {
  min-height: calc(100vh - 36px);
  place-items: center;
  color: var(--muted);
}

.detail-gallery {
  display: grid;
  gap: 10px;
}

.detail-photo {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.detail-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
}

.image-zoom-button {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  display: inline-grid;
  grid-template-columns: 18px auto;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(37, 95, 143, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--accent-2);
  font-weight: 800;
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.14);
  cursor: zoom-in;
}

.image-zoom-button:hover,
.image-zoom-button:focus-visible {
  border-color: rgba(22, 116, 107, 0.45);
  color: var(--accent);
}

.image-zoom-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(62px, 1fr));
  gap: 8px;
}

.gallery-thumb {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbfa;
  padding: 5px;
  cursor: pointer;
}

.gallery-thumb:hover,
.gallery-thumb.is-active {
  border-color: rgba(22, 116, 107, 0.55);
  box-shadow: 0 0 0 2px rgba(22, 116, 107, 0.12);
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.detail-heading h2 {
  margin: 0 0 8px;
  font-size: 23px;
  line-height: 1.18;
}

.detail-heading p {
  margin: 0;
  color: var(--muted);
}

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

.stat {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

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

.stat strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.file-link {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent-2);
  text-decoration: none;
}

.info-button {
  display: grid;
  min-height: 42px;
  place-items: center start;
  border: 1px solid rgba(22, 116, 107, 0.26);
  border-radius: 8px;
  background: #e8f4f1;
  color: var(--accent);
  padding: 0 12px;
  font-weight: 800;
  cursor: pointer;
}

.detail-cart-controls {
  display: grid;
  gap: 7px;
}

.detail-cart-controls > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-cart-controls .product-purchase-controls {
  min-height: 44px;
  grid-template-columns: 132px minmax(0, 1fr);
}

.detail-cart-controls .product-qty-stepper {
  grid-template-columns: 44px minmax(0, 1fr) 44px;
}

.detail-cart-controls .product-qty-button,
.detail-cart-controls .product-pending-qty,
.detail-cart-controls .add-cart-button {
  height: 44px;
}

.info-button:hover,
.info-button:focus-visible {
  border-color: rgba(22, 116, 107, 0.48);
  background: #dff0ec;
}

.file-link svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.file-link.is-disabled {
  color: var(--muted);
  pointer-events: none;
}

.spec-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.spec-list li {
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
}

.empty-results {
  display: grid;
  min-height: 260px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.load-more-shell {
  display: flex;
  justify-content: center;
  min-height: 56px;
  padding: 18px 0 4px;
}

.load-more-button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(22, 116, 107, 0.35);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
}

.load-more-button:hover {
  background: #e8f4f1;
}

.load-more-button.is-hidden {
  display: none;
}

.back-to-top {
  position: fixed;
  right: calc(340px + 22px);
  bottom: 22px;
  z-index: 45;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(22, 116, 107, 0.34);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--accent);
  box-shadow: 0 16px 36px rgba(17, 24, 39, 0.18);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 160ms ease, transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover,
.back-to-top:focus-visible {
  border-color: rgba(22, 116, 107, 0.55);
  background: #e8f4f1;
}

.back-to-top svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

body.has-modal .back-to-top {
  opacity: 0;
  pointer-events: none;
}

.pdf-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  padding: 22px;
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: none;
  padding: 22px;
}

.info-modal {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: none;
  padding: 22px;
}

.order-lines-modal {
  position: fixed;
  inset: 0;
  z-index: 145;
  display: none;
  padding: 22px;
}

.cart-modal {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: none;
}

.cart-modal.is-open {
  display: block;
}

.cart-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 32, 31, 0.54);
}

.cart-dialog {
  position: absolute;
  inset: 0 0 0 auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(520px, 100%);
  height: 100%;
  overflow: hidden;
  border-left: 1px solid rgba(255, 255, 255, 0.36);
  background: var(--surface);
  box-shadow: -24px 0 70px rgba(17, 24, 39, 0.22);
}

.cart-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 78px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfbfa;
}

.cart-dialog__header h2 {
  margin: 0 0 4px;
  font-size: 22px;
  line-height: 1.1;
}

.cart-dialog__header p,
.cart-dialog__footer p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.cart-close {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.cart-close:hover {
  border-color: rgba(22, 116, 107, 0.35);
  color: var(--accent);
}

.cart-close svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.cart-items {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding: 16px;
}

.cart-empty {
  display: grid;
  gap: 8px;
  min-height: 240px;
  place-items: center;
  align-content: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.cart-empty strong {
  color: var(--text);
  font-size: 18px;
}

.cart-line {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbfa;
  padding: 10px;
}

.cart-line > img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 6px;
}

.cart-line__body {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.cart-line__title {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.cart-line__title strong {
  font-size: 14px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.cart-line__title span,
.cart-line__meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.cart-line__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.cart-line__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.cart-quantity {
  display: inline-grid;
  grid-template-columns: 34px 62px 34px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.cart-quantity-button {
  display: grid;
  place-items: center;
  border: 0;
  background: #f4f7f6;
  color: var(--accent);
  cursor: pointer;
}

.cart-quantity-button:disabled {
  color: var(--muted);
  cursor: default;
  opacity: 0.55;
}

.cart-quantity-button svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.cart-quantity-input {
  width: 62px;
  border: 0;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  text-align: center;
  font-weight: 800;
}

.cart-view,
.cart-remove,
.cart-clear {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 0 10px;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.cart-view:hover {
  border-color: rgba(22, 116, 107, 0.35);
  color: var(--accent);
}

.cart-remove:hover,
.cart-clear:hover {
  border-color: rgba(155, 47, 47, 0.35);
  color: var(--danger);
}

.cart-clear:disabled {
  cursor: default;
  opacity: 0.45;
}

.cart-dialog__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  background: #fbfbfa;
}

.info-modal.is-open {
  display: grid;
  place-items: center;
}

.info-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 32, 31, 0.62);
}

.info-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(920px, 100%);
  height: min(680px, calc(100vh - 44px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(17, 24, 39, 0.28);
}

.info-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 10px 12px 10px 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfbfa;
}

.info-dialog__header h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
}

.info-close {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.info-close:hover {
  border-color: rgba(22, 116, 107, 0.35);
  color: var(--accent);
}

.info-close svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.info-body {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: auto;
  padding: 24px;
  background: #ffffff;
}

.order-lines-modal.is-open {
  display: grid;
  place-items: center;
}

.order-lines-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 32, 31, 0.62);
}

.order-lines-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(980px, 100%);
  height: min(720px, calc(100vh - 44px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(17, 24, 39, 0.28);
}

.order-lines-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 12px 14px 12px 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfbfa;
}

.order-lines-dialog__header span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.order-lines-dialog__header h2 {
  margin: 3px 0 0;
  font-size: 20px;
  line-height: 1.15;
}

.order-lines-close {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.order-lines-close:hover,
.order-lines-close:focus-visible {
  color: var(--accent);
  border-color: rgba(22, 116, 107, 0.35);
}

.order-lines-close svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.order-lines-body {
  overflow: auto;
  padding: 16px;
}

.order-lines-footer {
  min-height: 62px;
  border-top: 1px solid var(--line);
  background: #fbfbfa;
  padding: 12px 16px;
}

.order-lines-total {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.order-lines-total span {
  color: var(--muted);
  font-weight: 900;
}

.order-lines-total strong {
  font-size: 24px;
}

.info-description {
  max-width: 760px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
}

.info-description p {
  margin: 0 0 12px;
}

.info-description span {
  color: inherit !important;
  background: transparent !important;
  font-family: inherit !important;
  font-size: inherit !important;
  line-height: inherit !important;
}

.info-description ul,
.info-description ol {
  margin: 0 0 14px;
  padding-left: 24px;
}

.info-description li {
  margin: 0 0 7px;
}

.info-description table {
  width: 100%;
  margin: 0 0 14px;
  border-collapse: collapse;
}

.info-description td,
.info-description th {
  padding: 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.info-description img {
  max-width: 100%;
  height: auto;
}

.info-empty {
  margin: 0;
  color: var(--muted);
}

.image-modal.is-open {
  display: grid;
  place-items: center;
}

.image-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 32, 31, 0.72);
}

.image-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(1180px, 100%);
  height: min(900px, calc(100vh - 44px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: #f7f8f8;
  box-shadow: 0 24px 80px rgba(17, 24, 39, 0.32);
}

.image-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 10px 12px 10px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.image-dialog__header h2 {
  min-width: 0;
  flex: 1;
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
}

.image-dialog__actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.image-download,
.image-close,
.image-nav {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--muted);
  cursor: pointer;
}

.image-download {
  grid-template-columns: 18px auto;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  color: var(--accent-2);
  font-weight: 800;
  text-decoration: none;
}

.image-close {
  width: 38px;
  height: 38px;
}

.image-download:hover,
.image-close:hover,
.image-nav:hover {
  border-color: rgba(22, 116, 107, 0.35);
  color: var(--accent);
}

.image-download svg,
.image-close svg,
.image-nav svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.image-viewer {
  position: relative;
  display: grid;
  min-height: 0;
  place-items: center;
  background: #eef2f1;
  padding: 20px 72px;
}

.image-viewer img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  background: white;
  box-shadow: 0 10px 30px rgba(17, 24, 39, 0.12);
}

.image-nav {
  position: absolute;
  top: 50%;
  width: 44px;
  height: 56px;
  transform: translateY(-50%);
  color: var(--accent-2);
  box-shadow: 0 12px 30px rgba(17, 24, 39, 0.16);
}

.image-nav--prev {
  left: 16px;
}

.image-nav--next {
  right: 16px;
}

.image-nav:disabled {
  opacity: 0.35;
  cursor: default;
}

.image-counter {
  min-height: 38px;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.pdf-modal.is-open {
  display: grid;
  place-items: center;
}

.pdf-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 32, 31, 0.58);
}

.pdf-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1120px, 100%);
  height: min(860px, calc(100vh - 44px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(17, 24, 39, 0.26);
}

.pdf-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 10px 12px 10px 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfbfa;
}

.pdf-dialog__header h2 {
  min-width: 0;
  flex: 1;
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
}

.pdf-dialog__actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pdf-action,
.pdf-download,
.pdf-close {
  display: inline-grid;
  place-items: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent-2);
  cursor: pointer;
}

.pdf-action,
.pdf-download {
  grid-template-columns: 18px auto;
  gap: 8px;
  padding: 0 12px;
  font-weight: 700;
  text-decoration: none;
}

.pdf-close {
  width: 38px;
  place-items: center;
  padding: 0;
  color: var(--muted);
}

.pdf-action:hover,
.pdf-download:hover,
.pdf-close:hover {
  border-color: rgba(22, 116, 107, 0.35);
  color: var(--accent);
}

.pdf-action:disabled {
  color: var(--muted);
  cursor: wait;
  opacity: 0.62;
}

.pdf-action svg,
.pdf-download svg,
.pdf-close svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.pdf-frame-shell {
  position: relative;
  min-height: 0;
  background: #e8eceb;
}

.pdf-loading {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  place-items: center;
  background: linear-gradient(180deg, rgba(251, 251, 250, 0.96), rgba(238, 242, 241, 0.94));
  color: var(--muted);
  padding: 24px;
  text-align: center;
}

.pdf-frame-shell.is-loading .pdf-loading {
  display: grid;
}

.pdf-loading__bar {
  position: relative;
  width: min(360px, 82vw);
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #d9e2df;
}

.pdf-loading__bar span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 45%;
  border-radius: inherit;
  background: var(--accent);
  animation: pdf-loading-bar 1.05s ease-in-out infinite;
}

.pdf-loading p {
  margin: 14px 0 0;
  font-size: 14px;
  font-weight: 700;
}

.pdf-frame-shell iframe {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border: 0;
  background: white;
}

.pdf-fallback {
  position: absolute;
  inset: auto 16px 16px;
  z-index: 0;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

@keyframes pdf-loading-bar {
  0% {
    transform: translateX(-110%);
  }

  100% {
    transform: translateX(245%);
  }
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 300px minmax(0, 1fr);
  }

  .home-grid {
    grid-template-columns: 1fr;
    max-width: 760px;
  }

  .detail-panel {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 20;
    width: min(420px, 100%);
    transform: translateX(100%);
    transition: transform 180ms ease;
    box-shadow: var(--shadow);
  }

  .detail-panel.is-open {
    transform: translateX(0);
  }

  .close-button {
    display: grid;
  }

  .back-to-top {
    right: 18px;
    bottom: 18px;
  }
}

@media (max-width: 760px) {
  body.mobile-filters-open {
    overflow: hidden;
  }

  .app-shell,
  .app-shell.is-active {
    display: block;
  }

  .app-shell.app-page:not(.is-active) {
    display: none;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 62;
    width: min(360px, calc(100vw - 28px));
    height: 100vh;
    overflow: auto;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    padding: 16px;
    box-shadow: 20px 0 54px rgba(17, 24, 39, 0.22);
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  body.mobile-filters-open .sidebar {
    transform: translateX(0);
  }

  .mobile-filter-backdrop {
    position: fixed;
    inset: 0;
    z-index: 61;
    display: none;
    background: rgba(24, 32, 31, 0.48);
  }

  body.mobile-filters-open .mobile-filter-backdrop {
    display: block;
  }

  .brand-block {
    position: sticky;
    top: -16px;
    z-index: 2;
    margin: -16px -16px 16px;
    padding: 16px;
    border-bottom: 1px solid var(--line);
    background: #fbfbfa;
  }

  .brand-logo {
    width: 86px;
    max-width: 36%;
  }

  .brand-block h1 {
    font-size: 19px;
  }

  .mobile-filter-close {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    margin-left: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
  }

  .mobile-filter-close svg {
    width: 19px;
    height: 19px;
    fill: currentColor;
  }

  .mobile-filter-section {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
  }

  .mobile-price-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .mobile-filter-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .category-list {
    display: grid;
    gap: 8px;
    overflow: auto;
    max-height: none;
    padding-bottom: 2px;
  }

  .category-search {
    margin-bottom: 10px;
  }

  .category-button {
    grid-template-columns: minmax(0, 1fr) auto;
    width: auto;
  }

  .category-row {
    min-width: 100%;
  }

  .workspace {
    padding: 16px;
  }

  .home-page,
  .portal-page {
    padding: 18px;
  }

  .home-header,
  .portal-header {
    align-items: flex-start;
  }

  .home-logo,
  .portal-logo {
    width: 96px;
  }

  .home-grid {
    gap: 12px;
    margin-top: 28px;
  }

  .home-tile {
    grid-template-columns: 48px minmax(0, 1fr);
    min-height: 126px;
    padding: 14px;
  }

  .home-tile__icon {
    width: 48px;
    height: 48px;
  }

  .home-tile__icon svg {
    width: 24px;
    height: 24px;
  }

  .home-tile strong {
    font-size: 18px;
  }

  .home-tile small {
    font-size: 13px;
  }

  .account-search {
    max-width: none;
  }

  .account-search__results {
    max-height: 300px;
  }

  .account-hero,
  .account-summary-grid,
  .account-info-grid {
    grid-template-columns: 1fr;
  }

  .account-hero h2 {
    font-size: 22px;
  }

  .account-balance-card strong {
    font-size: 24px;
  }

  .account-documents {
    padding: 12px;
  }

  .account-documents__header {
    align-items: flex-start;
    flex-direction: column;
  }

  .account-lines__header {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .account-lines__summary {
    justify-items: start;
  }

  .account-lines-close {
    width: 100%;
  }

  .account-table {
    min-width: 0;
  }

  .account-table thead {
    display: none;
  }

  .account-table,
  .account-table tbody,
  .account-table tr,
  .account-table td {
    display: block;
    width: 100%;
  }

  .account-table tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px;
  }

  .account-table tr + tr {
    margin-top: 10px;
  }

  .account-table td {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 8px;
    border-bottom: 0;
    padding: 6px;
  }

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

  .account-actions {
    align-items: center;
  }

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

  .catalogue-brand {
    min-height: 82px;
  }

  .catalogue-brand img {
    max-width: 112px;
    max-height: 32px;
  }

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

  .topbar {
    top: 0;
    grid-template-columns: 1fr;
    margin: -16px -16px 0;
    padding: 16px 16px 12px;
  }

  .mobile-product-header {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
  }

  .mobile-product-header .brand-logo {
    width: 78px;
    max-width: none;
  }

  .mobile-product-header h1 {
    font-size: 19px;
  }

  .mobile-product-header .portal-back {
    flex: 0 0 auto;
  }

  .filter-row {
    display: none;
  }

  .toolbar {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto 1fr 42px 42px auto;
    gap: 7px;
    align-items: center;
  }

  .toolbar .mobile-filter-button {
    display: inline-grid;
    grid-column: 1;
    grid-template-columns: 18px auto minmax(22px, auto);
    width: auto;
    min-width: 118px;
    padding: 0 10px;
    color: var(--accent);
    font-weight: 800;
  }

  #gridView {
    grid-column: 3;
  }

  #listView {
    grid-column: 4;
  }

  .mobile-filter-button strong {
    display: inline-grid;
    min-width: 22px;
    height: 22px;
    place-items: center;
    border-radius: 999px;
    background: var(--accent);
    color: #ffffff;
    font-size: 11px;
  }

  .mobile-filter-button strong[hidden] {
    display: none;
  }

  .mobile-filter-button.has-active-filters {
    border-color: rgba(22, 116, 107, 0.45);
    background: #e8f4f1;
  }

  .cart-button {
    grid-column: 5;
    grid-template-columns: 20px minmax(24px, auto);
  }

  .cart-button span {
    display: none;
  }

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

  .product-grid.is-list .product-card {
    grid-template-columns: 120px minmax(0, 1fr);
    grid-template-rows: minmax(150px, auto);
  }

  .product-grid.is-list .product-image,
  .product-grid.is-list .product-meta {
    min-height: 150px;
  }

  .product-card {
    grid-template-rows: 150px minmax(252px, auto);
    min-height: 0;
  }

  .product-image {
    padding: 8px;
  }

  .product-image img {
    inset: 8px;
    width: calc(100% - 16px);
    height: calc(100% - 16px);
  }

  .card-photo-arrow {
    width: 30px;
    height: 38px;
    opacity: 1;
    transform: none;
  }

  .product-meta {
    gap: 8px;
    padding: 10px;
  }

  .product-code {
    font-size: 12px;
  }

  .product-category {
    min-height: 16px;
    font-size: 11px;
    -webkit-line-clamp: 1;
  }

  .product-title,
  .product-title.is-medium,
  .product-title.is-long {
    min-height: 58px;
    font-size: 13px;
    line-height: 1.16;
    -webkit-line-clamp: 4;
  }

  .product-brand {
    min-height: 18px;
    font-size: 12px;
  }

  .product-foot {
    display: grid;
    align-items: start;
    gap: 7px;
  }

  .stock-pill {
    max-width: 100%;
    width: max-content;
    min-height: 25px;
    font-size: 11px;
  }

  .price-label {
    text-align: left;
  }

  .product-purchase-controls {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .product-qty-stepper {
    grid-template-columns: 34px minmax(0, 1fr) 34px;
  }

  .add-cart-button {
    width: 100%;
    min-height: 38px;
    font-size: 12px;
  }

  .detail-panel {
    z-index: 72;
    width: min(420px, calc(100% - 28px));
    border-radius: 10px 0 0 10px;
    box-shadow: -18px 0 48px rgba(17, 24, 39, 0.28);
  }

  .back-to-top {
    width: 42px;
    height: 42px;
    right: 14px;
    bottom: 14px;
  }

  .cart-dialog {
    width: 100%;
  }

  .cart-line {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .cart-line > img {
    width: 82px;
    height: 82px;
  }

  .cart-dialog__footer {
    align-items: stretch;
    flex-direction: column;
  }

  .pdf-modal {
    padding: 10px;
  }

  .image-modal {
    padding: 10px;
  }

  .info-modal {
    padding: 10px;
  }

  .order-lines-modal {
    padding: 10px;
  }

  .info-dialog {
    height: calc(100vh - 20px);
  }

  .order-lines-dialog {
    height: calc(100vh - 20px);
  }

  .order-lines-body {
    padding: 12px;
  }

  .image-dialog {
    height: calc(100vh - 20px);
  }

  .image-viewer {
    padding: 14px 52px;
  }

  .image-nav {
    width: 38px;
    height: 48px;
  }

  .image-nav--prev {
    left: 8px;
  }

  .image-nav--next {
    right: 8px;
  }

  .image-zoom-button span {
    display: none;
  }

  .image-zoom-button {
    grid-template-columns: 1fr;
    width: 38px;
    height: 38px;
    min-height: 38px;
    place-items: center;
    padding: 0;
  }

  .image-download span {
    display: none;
  }

  .image-download {
    grid-template-columns: 1fr;
    width: 38px;
    height: 38px;
    min-height: 38px;
    place-items: center;
    padding: 0;
  }

  .pdf-dialog {
    height: calc(100vh - 20px);
  }

  .pdf-dialog__header {
    align-items: center;
  }

  .pdf-action span,
  .pdf-download span {
    display: none;
  }

  .pdf-action,
  .pdf-download {
    grid-template-columns: 1fr;
    width: 38px;
    height: 38px;
    min-height: 38px;
    place-items: center;
    padding: 0;
  }
}

@media (max-width: 380px) {
  .product-grid,
  .product-grid.is-list {
    grid-template-columns: 1fr;
  }

  .product-card {
    grid-template-rows: 168px minmax(230px, auto);
  }
}
