:root {
  color-scheme: light;
  --ink: #201c18;
  --muted: #6f675e;
  --paper: #f6f3ee;
  --card: #fff;
  --line: #ded8cf;
  --accent: #5c3b25;
  --accent-dark: #3f2718;
  --success: #256344;
  --shadow: 0 10px 30px rgba(50, 39, 29, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.site-header {
  padding: 48px max(24px, calc((100vw - 1500px) / 2)) 28px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 85% -20%, rgba(166, 128, 89, 0.18), transparent 42%),
    #fbfaf7;
}

.header-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.5rem, 6vw, 5.25rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.intro {
  max-width: 600px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.catalog-count {
  flex: 0 0 auto;
  min-width: 130px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.6);
  text-align: right;
}

.catalog-count strong,
.catalog-count span {
  display: block;
}

.catalog-count strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  font-weight: 500;
}

.catalog-count span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 32px;
}

.search-box {
  position: relative;
  display: block;
  width: min(540px, 100%);
}

.search-box svg {
  position: absolute;
  top: 50%;
  left: 17px;
  width: 20px;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 1.8;
  transform: translateY(-50%);
}

.search-box input {
  width: 100%;
  height: 52px;
  padding: 0 18px 0 50px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  background: var(--card);
  box-shadow: 0 4px 14px rgba(50, 39, 29, 0.04);
}

.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(92, 59, 37, 0.12);
}

.result-count {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.order-info {
  display: grid;
  grid-template-columns: 0.85fr 1.2fr 1.45fr;
  gap: 12px;
  margin-top: 18px;
}

.order-info-item {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: inherit;
  background: rgba(255, 255, 255, 0.72);
  text-decoration: none;
}

.order-info-item span,
.order-info-item strong {
  display: block;
}

.order-info-item span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.order-info-item strong {
  overflow-wrap: anywhere;
  font-size: 0.9rem;
}

.order-info-item small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.contact-link {
  border-color: rgba(92, 59, 37, 0.32);
}

.contact-link:hover {
  border-color: var(--accent);
  background: #fff;
}

.contact-link strong {
  color: var(--accent);
}

main {
  max-width: 1720px;
  min-height: 50vh;
  margin: 0 auto;
  padding: 32px 24px 72px;
}

.catalog-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  align-items: start;
  gap: 26px;
}

.catalog-content {
  min-width: 0;
}

.catalog-sidebar {
  position: sticky;
  top: 20px;
  display: flex;
  height: calc(100vh - 40px);
  max-height: calc(100vh - 40px);
  min-height: 0;
  flex-direction: column;
  gap: 16px;
}

.selection-panel {
  max-height: min(45vh, 430px);
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.selection-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.selection-eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.selection-panel h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  font-weight: 500;
}

.selection-panel h2 span {
  display: inline-grid;
  min-width: 30px;
  height: 30px;
  margin-left: 4px;
  padding: 0 8px;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  font-family: Inter, ui-sans-serif, sans-serif;
  font-size: 0.85rem;
  font-weight: 750;
  place-items: center;
  vertical-align: 3px;
}

.selection-help {
  margin: 14px 0 16px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.selection-empty {
  margin: 18px 0;
  padding: 20px 12px;
  border: 1px dashed var(--line);
  border-radius: 9px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.selected-list {
  max-height: min(20vh, 180px);
  margin: 0;
  padding: 0 4px 0 0;
  overflow: auto;
  list-style: none;
}

.series-directory {
  display: flex;
  min-height: 180px;
  flex: 1;
  flex-direction: column;
  padding: 18px 12px 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.series-directory-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 0 6px 12px;
  border-bottom: 1px solid var(--line);
}

.series-directory-header h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 500;
}

.series-directory-count {
  display: grid;
  min-width: 28px;
  height: 28px;
  padding: 0 7px;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  font-size: 0.75rem;
  font-weight: 750;
  place-items: center;
}

.series-directory-list {
  margin: 0;
  padding: 6px 0 0;
  overflow-y: auto;
  list-style: none;
}

.series-directory-button {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border: 0;
  border-bottom: 1px solid #eee9e2;
  color: var(--ink);
  background: transparent;
  font-size: 0.8rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.series-directory-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.series-directory-button small {
  display: grid;
  min-width: 25px;
  height: 23px;
  padding: 0 6px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--paper);
  font-size: 0.66rem;
  place-items: center;
}

.series-directory-button:hover,
.series-directory-button:focus-visible {
  color: var(--accent);
  background: #f6f1eb;
  outline: none;
}

.selected-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 2px 9px 10px;
  border-bottom: 1px solid #eee9e2;
  font-size: 0.86rem;
  font-weight: 700;
}

.selected-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remove-selection,
.selection-close {
  display: grid;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  place-items: center;
}

.remove-selection {
  width: 28px;
  height: 28px;
  font-size: 1.1rem;
}

.remove-selection:hover {
  color: #fff;
  background: #9a3c32;
}

.selection-close {
  display: none;
  width: 36px;
  height: 36px;
  font-size: 1.4rem;
}

.selection-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 16px;
}

.copy-all-button,
.clear-all-button {
  width: 100%;
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 750;
  cursor: pointer;
}

.copy-all-button {
  border: 1px solid var(--accent);
  color: #fff;
  background: var(--accent);
}

.copy-all-button:hover:not(:disabled) {
  background: var(--accent-dark);
}

.copy-all-button.copied {
  border-color: var(--success);
  background: var(--success);
}

.clear-all-button {
  border: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
}

.clear-all-button:hover:not(:disabled) {
  border-color: #9a3c32;
  color: #9a3c32;
}

.copy-all-button:disabled,
.clear-all-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.mobile-selection-toggle,
.selection-backdrop {
  display: none;
}

.catalog-grid {
  display: flex;
  flex-direction: column;
  gap: 34px;
}

.series-group {
  min-width: 0;
  scroll-margin-top: 20px;
}

.series-heading-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.series-heading {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 2.3vw, 1.85rem);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.series-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

.sample-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.sample-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(92, 59, 37, 0.12), var(--shadow);
}

.image-button {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #e9e5de;
  cursor: zoom-in;
  aspect-ratio: 1 / 1;
}

.image-button:disabled {
  cursor: default;
}

.sample-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 180ms ease;
}

.image-button:not(:disabled):hover .sample-image {
  transform: scale(1.025);
}

.zoom-hint {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 7px 10px;
  border-radius: 999px;
  color: #fff;
  background: rgba(32, 28, 24, 0.72);
  font-size: 0.72rem;
  opacity: 0;
  transform: translateY(4px);
  transition: 160ms ease;
}

.image-button:hover .zoom-hint,
.image-button:focus-visible .zoom-hint {
  opacity: 1;
  transform: none;
}

.card-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 12px;
  padding: 15px;
}

.sample-title {
  display: -webkit-box;
  grid-column: 1 / -1;
  min-height: 2.65em;
  margin: 0;
  overflow: hidden;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.32;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.sample-id {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 0.82rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sample-description {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.sample-specs {
  display: flex;
  grid-column: 1 / -1;
  flex-direction: column;
  gap: 3px;
  padding-top: 10px;
  border-top: 1px solid #eee9e2;
}

.sample-specs strong {
  color: var(--accent);
  font-size: 0.84rem;
}

.sample-specs span {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.select-button {
  padding: 9px 12px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--accent);
  background: transparent;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.card-select {
  grid-column: 2;
  grid-row: 2;
}

.select-button:hover {
  color: #fff;
  background: var(--accent);
}

.select-button.is-selected {
  border-color: var(--success);
  color: #fff;
  background: var(--success);
}

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

.pagination-top {
  margin-bottom: 24px;
}

.pagination-bottom {
  margin-top: 40px;
}

.page-numbers {
  display: flex;
  align-items: center;
  gap: 5px;
}

.page-link {
  display: inline-grid;
  min-width: 38px;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--card);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  place-items: center;
}

.page-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.page-link.is-current {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

.page-link.is-disabled {
  color: #aaa39a;
  cursor: not-allowed;
  opacity: 0.65;
}

.pagination-ellipsis {
  padding: 0 3px;
  color: var(--muted);
}

.page-status {
  display: none;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.page-jump {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: 8px;
}

.page-jump label {
  color: var(--muted);
  font-size: 0.75rem;
}

.page-jump input {
  width: 62px;
  height: 38px;
  margin-left: 4px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: none;
}

.page-jump input:focus {
  border-color: var(--accent);
}

.page-jump button {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  color: #fff;
  background: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.notice,
.empty-state {
  padding: 50px 20px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  text-align: center;
}

.empty-state h2 {
  margin: 0 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}

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

.image-dialog {
  width: min(1120px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.32);
}

.image-dialog::backdrop {
  background: rgba(26, 22, 18, 0.78);
  backdrop-filter: blur(3px);
}

.dialog-image-wrap {
  display: grid;
  height: min(75vh, 780px);
  place-items: center;
  background: #171513;
}

.dialog-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.dialog-close {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, 0.58);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.dialog-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px;
}

.dialog-id {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
}

.dialog-description {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.dialog-specs {
  margin: 5px 0 0;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
}

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

.noscript-notice {
  max-width: 900px;
  margin: 20px auto;
}

.seo-content {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px 72px;
}

.seo-content h2 {
  margin: 0 0 16px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  font-weight: 500;
}

.seo-content p {
  max-width: 900px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.seo-content a,
.series-page a {
  color: var(--accent);
}

.series-page {
  max-width: 1500px;
  margin: 0 auto;
  padding: 42px 24px 80px;
}

.series-breadcrumb {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 0.85rem;
}

.series-page-header {
  max-width: 960px;
  margin-bottom: 34px;
}

.series-page-header h1 {
  font-size: clamp(2.2rem, 5vw, 4.5rem);
}

.series-page-intro {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.series-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.series-page-actions a {
  padding: 11px 16px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  text-decoration: none;
}

.series-page-actions .primary-action {
  color: #fff;
  background: var(--accent);
}

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

.static-product-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.static-product-card > a {
  display: block;
  color: inherit;
  text-decoration: none;
}

.static-product-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #e9e5de;
}

.static-product-card h2 {
  margin: 0;
  padding: 14px 14px 5px;
  font-size: 0.84rem;
  line-height: 1.4;
}

.static-product-card p {
  margin: 0;
  padding: 0 14px 14px;
  color: var(--muted);
  font-size: 0.76rem;
}

@media (max-width: 900px) {
  .static-series-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .catalog-layout {
    display: block;
  }

  .catalog-sidebar {
    position: static;
    display: block;
    height: auto;
    max-height: none;
  }

  .selection-panel {
    position: fixed;
    z-index: 20;
    top: auto;
    right: 10px;
    bottom: 10px;
    left: 10px;
    max-height: min(76vh, 650px);
    padding: 20px;
    transform: translateY(calc(100% + 24px));
    transition: transform 200ms ease;
  }

  .selection-panel.is-open {
    transform: translateY(0);
  }

  .selection-close {
    display: grid;
  }

  .selected-list {
    max-height: calc(76vh - 255px);
  }

  .series-directory {
    max-height: 300px;
    margin-bottom: 24px;
  }

  .selection-backdrop {
    position: fixed;
    z-index: 19;
    inset: 0;
    display: block;
    background: rgba(26, 22, 18, 0.58);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .selection-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-selection-toggle {
    position: fixed;
    z-index: 15;
    right: 16px;
    bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px 12px 18px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: var(--accent);
    box-shadow: 0 12px 32px rgba(50, 39, 29, 0.28);
    font-size: 0.82rem;
    font-weight: 750;
    cursor: pointer;
  }

  .mobile-selection-toggle strong {
    display: grid;
    min-width: 27px;
    height: 27px;
    padding: 0 7px;
    border-radius: 999px;
    color: var(--accent);
    background: #fff;
    font-size: 0.76rem;
    place-items: center;
  }

  body.selection-open {
    overflow: hidden;
  }
}

@media (max-width: 680px) {
  .site-header {
    padding: 30px 16px 22px;
  }

  .header-inner {
    align-items: flex-start;
  }

  .catalog-count {
    min-width: 92px;
    padding: 12px 14px;
  }

  .catalog-count strong {
    font-size: 1.45rem;
  }

  .intro {
    font-size: 0.9rem;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
    margin-top: 24px;
  }

  .order-info {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .result-count {
    padding-left: 2px;
  }

  .page-numbers {
    display: none;
  }

  .page-status {
    display: inline;
    order: 2;
  }

  .page-previous {
    order: 1;
  }

  .page-next {
    order: 3;
  }

  .page-jump {
    width: 100%;
    justify-content: center;
    order: 4;
    margin: 3px 0 0;
  }

  main {
    padding: 20px 12px 52px;
  }

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

  .catalog-grid {
    gap: 28px;
  }

  .series-heading-row {
    margin-bottom: 10px;
  }

  .sample-card {
    border-radius: 10px;
  }

  .card-body {
    grid-template-columns: 1fr;
    padding: 11px;
  }

  .card-select {
    grid-column: 1;
    grid-row: auto;
    width: 100%;
  }

  .sample-id {
    grid-row: auto;
  }

  .sample-description {
    grid-column: 1;
  }

  .zoom-hint {
    display: none;
  }

  .dialog-image-wrap {
    height: 70vh;
  }

  .seo-content,
  .series-page {
    padding-right: 16px;
    padding-left: 16px;
  }

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