:root {
  color-scheme: light;
  --ink: #18191c;
  --muted: #62646c;
  --line: #e4e5e8;
  --accent: #8c365f;
  --code-orange: #c45100;
  --product-image-bg: #ebebeb;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: #fff; font-family: Arial, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; line-height: 1.5; }
body.modal-open { overflow: hidden; }
button, input, select { font: inherit; }
button, summary, select { cursor: pointer; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
button:disabled { opacity: .35; cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
a { color: inherit; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 10; padding: 12px 20px; background: var(--ink); color: #fff; }
.skip-link:focus { top: 12px; }
.topbar, .app-shell, .catalog-footer { width: min(1440px, calc(100% - 48px)); margin-inline: auto; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 32px; padding-block: 30px 24px; }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .06em; }
.brand-block h1 { margin: 4px 0 6px; font-size: 32px; line-height: 1.25; letter-spacing: -.04em; }
.brand-block p { margin: 0; color: var(--muted); font-size: 14px; }
.search-field { width: min(420px, 45%); display: grid; gap: 6px; }
.search-field span, .filter-panel label > span { color: var(--muted); font-size: 12px; }
.search-field input, .filter-panel input, .filter-panel select, .result-options select {
  width: 100%; min-width: 0; min-height: 44px; padding: 9px 12px;
  color: var(--ink); border: 1px solid var(--line); border-radius: 6px; background: #fff;
}
.search-field input { background: #f7f7f8; }
input:focus, select:focus { border-color: var(--accent); }
.app-shell { margin-bottom: 48px; }
.tabs { display: flex; gap: 24px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.tab { min-height: 48px; padding: 12px 0; color: var(--muted); border: 0; border-bottom: 2px solid transparent; background: transparent; font-size: 15px; font-weight: 700; }
.tab.is-active { border-bottom-color: var(--ink); color: var(--ink); }
.panel.is-hidden { display: none; }
.subcategory-panel { padding: 20px; border: 1px solid var(--line); border-radius: 10px; }
.subcategory-panel h2 { margin: 0 0 12px; font-size: 14px; }
.category-links { display: flex; flex-wrap: wrap; gap: 8px; }
.category-links a { display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 44px; padding: 9px 16px; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; font-size: 13px; }
.category-links a span { font-size: 11px; color: var(--muted); }
.category-links a:hover { border-color: var(--ink); }
.category-links a[aria-current="page"] { border-color: var(--ink); background: var(--ink); color: #fff; }
.category-links a[aria-current="page"] span { color: #ddd; }
.filter-panel { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto auto; align-items: end; gap: 12px; margin-top: 18px; }
.filter-panel label { display: grid; gap: 6px; min-width: 0; }
.ghost-button, .advanced-filters summary { min-height: 44px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: 13px; }
.advanced-filters summary { color: var(--muted); }
.advanced-filters[open] { grid-column: 1 / -1; order: 1; }
.advanced-filters[open] summary { width: max-content; margin-bottom: 12px; }
.advanced-filter-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 16px; background: #f7f7f8; border-radius: 6px; }
.result-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 30px 0 18px; }
.result-bar h2 { margin: 0 0 3px; font-size: 20px; scroll-margin-top: 16px; }
.result-bar p { margin: 0; color: var(--muted); font-size: 13px; }
.result-options { display: flex; gap: 12px; }
.result-options label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.result-options select { width: auto; }
.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 20px; }
.product-card { min-width: 0; }
.product-image-button { position: relative; display: block; width: 100%; padding: 16px; border: 0; border-radius: 8px; background: var(--product-image-bg); aspect-ratio: 1 / 1.06; overflow: hidden; }
.product-image-button img { width: 100%; height: 100%; object-fit: contain; transition: transform .2s ease; }
.product-image-button:hover img { transform: scale(1.025); }
.image-fallback { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; color: var(--muted); font-size: 14px; text-align: center; }
.image-fallback[hidden] { display: none; }
.card-copy { padding: 12px 2px 0; }
.catalog-code { display: flex; width: fit-content; margin-left: auto; overflow: hidden; border: 1px solid var(--code-orange); border-radius: 3px; font-size: 12px; white-space: nowrap; }
.catalog-code-label { padding: 3px 6px; color: #fff; background: var(--code-orange); }
.catalog-code-value { padding: 3px 6px; color: #000; background: #fff; font-weight: 700; }
.product-title { display: block; width: 100%; min-height: 44px; padding: 4px 0; border: 0; background: transparent; color: var(--ink); font-size: 15px; font-weight: 700; text-align: left; overflow-wrap: anywhere; }
.product-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.dimensions { min-height: 20px; margin: 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.price { margin: 8px 0; color: #c40000; font-size: 21px; font-weight: 700; letter-spacing: -.025em; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { min-height: 44px; padding: 8px 10px; border: 0; border-radius: 5px; color: var(--muted); background: #f5f5f6; font-size: 12px; }
.tag:hover { color: var(--ink); background: #eaeaec; }
.empty-state { grid-column: 1 / -1; padding: 72px 20px; text-align: center; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; }
.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 36px; }
.pagination button { min-width: 44px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--ink); font-size: 13px; }
.pagination button.is-active { border-color: var(--ink); color: #fff; background: var(--ink); }
.pagination-gap { display: grid; place-items: center; width: 24px; color: var(--muted); }
.catalog-footer { padding-block: 24px 32px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.catalog-footer strong { color: var(--ink); font-weight: 400; }
.text-intro { padding: 28px; background: #f7f7f8; border-radius: 10px; }
.text-intro h2 { margin: 6px 0 8px; font-size: 26px; }
.text-intro p { margin: 0; color: var(--muted); }
.document-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.document-filter { min-height: 44px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--muted); }
.document-filter.is-active { border-color: var(--ink); background: var(--ink); color: #fff; }
.document-result-bar { margin: 16px 0 10px; color: var(--muted); font-size: 13px; }
.document-result-bar p { margin: 0; }
.documents { display: grid; gap: 16px; margin-top: 12px; }
.document-card { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 8px; }
.document-card-header { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 12px; }
.document-type-badge { padding: 5px 9px; border-radius: 5px; background: #f5f5f6; color: var(--muted); font-size: 11px; }
.document-card h3 { margin: 12px 0 16px; font-size: 18px; }
.document-table-wrap { overflow-x: auto; }
.document-card table { width: 100%; border-collapse: collapse; font-size: 13px; }
.document-card th, .document-card td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.document-card thead th { color: var(--muted); font-size: 12px; }
.document-page { margin-top: 12px; color: var(--accent); font-size: 12px; }
.document-lines p { margin: 0; padding: 9px 0; border-bottom: 1px dotted var(--line); line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.document-layout-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 24px; max-width: 900px; margin: 24px auto 0; }
.document-layout { display: block; width: 100%; height: auto; overflow: visible; user-select: text; }
.document-layout text { white-space: pre; }
.document-layout:only-child { grid-column: 1 / -1; }
.document-empty-copy { color: var(--muted); }
.preview-modal { width: min(1080px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: 10px; background: #fff; box-shadow: 0 24px 90px rgba(0,0,0,.25); overflow: hidden; }
.preview-modal::backdrop { background: rgba(24,25,28,.65); }
.modal-body { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr); max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain; }
.modal-media { min-height: 520px; display: grid; place-items: center; padding: 24px; background: var(--product-image-bg); }
.modal-media img { max-width: 100%; max-height: calc(100dvh - 80px); object-fit: contain; }
.modal-media .image-fallback { position: static; min-height: 45dvh; }
.modal-copy { min-width: 0; padding: 44px 28px 28px; overflow: auto; }
.modal-kicker { color: var(--accent); font-size: 14px; font-weight: 700; letter-spacing: .06em; }
.modal-copy h2 { margin: 8px 0 14px; font-size: 24px; overflow-wrap: anywhere; }
.modal-price { margin-bottom: 18px; color: #c40000; font-size: 28px; font-weight: 700; }
.modal-copy dl { margin: 24px 0; border-top: 1px solid var(--line); }
.modal-copy dl div { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.modal-copy dt { color: var(--muted); font-size: 12px; }
.modal-copy dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.modal-close { position: absolute; z-index: 2; top: 12px; right: 12px; width: 44px; height: 44px; border: 0; border-radius: 50%; color: #fff; background: var(--ink); font-size: 28px; line-height: 1; }
.modal-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.modal-nav button { min-height: 44px; padding: 10px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--ink); font-size: 13px; }
@media (max-width: 1100px) {
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .topbar, .app-shell, .catalog-footer { width: calc(100% - 28px); }
  .topbar { display: block; padding-block: 24px 18px; }
  .brand-block h1 { font-size: 28px; }
  .search-field { width: 100%; margin-top: 18px; }
  .tabs { gap: 20px; margin-bottom: 18px; }
  .tab { font-size: 14px; }
  .subcategory-panel { padding: 14px; }
  .category-links { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .category-links a { gap: 4px; padding: 8px 4px; font-size: 12px; }
  .category-links a span { font-size: 10px; }
  .filter-panel { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .filter-panel select { padding-inline: 6px; font-size: 14px; }
  .advanced-filters { grid-column: span 2; }
  .advanced-filters[open] { grid-column: 1 / -1; }
  .ghost-button { padding-inline: 6px; }
  .advanced-filter-fields { grid-template-columns: 1fr 1fr; padding: 12px; }
  .advanced-filter-fields label:last-child { grid-column: 1 / -1; }
  .result-bar { align-items: start; margin-block: 24px 14px; }
  .result-bar h2 { font-size: 18px; }
  .result-options { gap: 6px; }
  .result-options label { display: grid; gap: 2px; }
  .result-options select { padding: 8px 6px; font-size: 12px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
  .product-image-button { padding: 10px; border-radius: 6px; }
  .product-title { font-size: 14px; }
  .dimensions { font-size: 12px; }
  .price { font-size: 19px; }
  .tag { font-size: 11px; padding-inline: 8px; }
  .modal-body { display: block; }
  .modal-media { min-height: 300px; height: 46dvh; padding: 20px; }
  .modal-media img { max-height: calc(46dvh - 40px); }
  .modal-copy { padding: 24px 20px; }
  .modal-copy h2 { font-size: 22px; }
  .document-card { padding: 16px; }
  .document-layout-columns { grid-template-columns: 1fr; gap: 24px; }
  .text-intro { padding: 22px; }
  .text-intro h2 { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
