html:has(.catalog-dialog[open]) { overflow: hidden; }
.catalog-dialog, .catalog-dialog * { box-sizing: border-box; }
.catalog-dialog {
  --cat-ink: #26241f;
  --cat-paper: #fffefb;
  --cat-line: #dedbd4;
  color: var(--cat-ink);
  background: var(--cat-paper);
  font-family: inherit;
  inset: 0;
  position: fixed;
  margin: auto;
  width: min(1010px, calc(100% - 48px));
  height: min(720px, calc(100dvh - 64px));
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: 20px;
  box-shadow: 0 28px 120px #211d1950;
}
.catalog-dialog::backdrop { background: #1816119c; backdrop-filter: blur(6px); }
.catalog-dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.catalog-dialog button, .catalog-dialog a { font: inherit; color: inherit; }
.catalog-dialog button { cursor: pointer; }
.catalog-dialog :is(button, a):focus-visible { outline: 3px solid #3376aa; outline-offset: 2px; }
.catalog-bar { padding: 14px 20px 14px 28px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--cat-line); }
.catalog-bar h2 { margin: 0; font-size: 1.15rem; font-weight: 600; }
.catalog-round { display: inline-grid; place-items: center; padding: 0; height: 42px; width: 42px; border-radius: 50%; border: 1px solid #dcd9d2; background: #ffffffe8; color: #272522; }
.catalog-round:hover { background: #fff; border-color: #b0aba1; }
.catalog-round svg { width: 20px; height: 20px; display: block; }
.catalog-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(290px, 1fr); min-height: 0; }
.catalog-visual { position: relative; min-height: 0; background: #f1efeb; overflow: hidden; }
.catalog-visual img { width: 100%; height: 100%; display: block; object-fit: contain; }
.catalog-photo-btn { width: 100%; height: 100%; display: block; padding: 0; border: none; background: none; cursor: zoom-in !important; }
.catalog-photo-btn:focus-visible { outline-offset: -4px !important; }
.catalog-photo-tools { position: absolute; bottom: 16px; left: 16px; right: 16px; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.catalog-photo-tools button { pointer-events: auto; box-shadow: 0 2px 12px #30291e12; }
.catalog-steps { display: flex; gap: 6px; }
.catalog-controls { min-height: 0; overflow: auto; padding: clamp(22px,3.2vw,40px); display: flex; flex-direction: column; align-items: stretch; }
.catalog-count { font-size: .82rem; line-height: 1.6; color: #625d54; font-variant-numeric: tabular-nums; margin: 0 0 12px; }
.catalog-item-title { margin: 0; font: 500 clamp(1.25rem,2.35vw,2rem)/1.18 -apple-system,BlinkMacSystemFont,"Helvetica Neue",sans-serif; letter-spacing: -.035em; }
.catalog-item-info { line-height: 1.65; margin: 12px 0 20px; font-size: .98rem; color: #5a554c; }
.catalog-thumbs { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; margin: 0 0 22px; }
.catalog-thumb { display: block; width: 100%; aspect-ratio: 1; padding: 2px; background: transparent; border: 1.5px solid transparent; border-radius: 10px; overflow: hidden; }
.catalog-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.catalog-thumb[aria-current="true"] { border-color: var(--cat-ink); }
.catalog-thumb:hover { background: #e9e5df; }
.catalog-contact { display: inline-flex; justify-content: center; align-items: center; min-height: 46px; padding: 10px 16px; margin-top: auto; background: var(--cat-ink); color: #fff !important; text-decoration: none; text-align: center; border-radius: 30px; font-size: .94rem !important; font-weight: 500 !important; line-height: 1.5; }
.catalog-contact:hover { background: #433f37; }
.catalog-dialog.catalog-large { width: min(1400px, calc(100% - 24px)); height: calc(100dvh - 24px); }
.catalog-large .catalog-layout { grid-template-columns: minmax(0,1fr); }
.catalog-large .catalog-controls { display: none; }
.catalog-large .catalog-photo-btn { cursor: zoom-out !important; }
@media (max-width: 710px) {
  .catalog-dialog { width: calc(100% - 16px); height: min(860px, calc(100dvh - 16px)); border-radius: 15px; }
  .catalog-bar { padding: 7px 11px 7px 17px; }
  .catalog-bar h2 { font-size: 1rem; }
  .catalog-layout { display: flex; flex-direction: column; overflow: auto; }
  .catalog-visual { flex: 1 0 min(39dvh, 290px); min-height: 160px; }
  .catalog-controls { flex: 0 0 auto; padding: 14px 17px 18px; overflow: visible; }
  .catalog-count { margin-bottom: 5px; }
  .catalog-item-title { font-size: 1.3rem; }
  .catalog-item-info { margin: 5px 0 12px; font-size: .9rem; }
  .catalog-thumbs { display: flex; overflow-x: auto; gap: 5px; padding: 3px; margin: -3px -3px 10px; }
  .catalog-thumb { width: 53px; flex: 0 0 53px; }
  .catalog-photo-tools { left: 9px; right: 9px; bottom: 8px; }
  .catalog-round { width: 39px; height: 39px; }
  .catalog-contact { align-self: stretch; }
  .catalog-dialog.catalog-large { width: calc(100% - 8px); height: calc(100dvh - 8px); }
  .catalog-large .catalog-visual { flex: 1 1 100%; }
}
.catalog-dialog.catalog-list {
  width: min(620px,calc(100% - 24px));
  grid-template-rows: auto minmax(0,1fr) auto;
  height: min(720px,calc(100dvh - 32px));
}
.catalog-model-list { overflow: auto; padding: 0 clamp(16px,4vw,30px); }
.catalog-model-list details { border-bottom: 1px solid var(--cat-line); }
.catalog-model-list details:last-child { border: none; }
.catalog-model-list summary { padding: 17px 28px 17px 0; font-weight: 500; line-height: 1.4; list-style: none; cursor: pointer; position: relative; }
.catalog-model-list summary:focus-visible { outline: 2px solid #3376aa; outline-offset: -2px; }
.catalog-model-list summary::-webkit-details-marker { display: none; }
.catalog-model-list summary::after { content: '+'; position: absolute; right: 3px; top: 50%; transform: translateY(-50%); }
.catalog-model-list details[open] summary::after { content: '−'; }
.catalog-model-list details p { margin: -3px 0 16px; color: #59554e; line-height: 1.65; }
.catalog-list-footer { padding: 14px clamp(16px,4vw,30px); border-top: 1px solid var(--cat-line); }
.catalog-list-footer a { width: 100%; }
.catalog-all-models { margin: 0 auto 18px 0; padding: 2px 0; line-height: 1.45; color: #59554e !important; text-decoration: underline; text-underline-offset: 4px; border: none; background: transparent; font-size: .90rem !important; }
.catalog-steps[hidden] { display: none; }
@media (max-width: 710px) { .catalog-all-models { margin-bottom: 10px; } }
.catalog-secondary-links { display:flex; flex-wrap:wrap; gap:6px 18px; margin-bottom:16px; align-items:center; }
.catalog-secondary-links .catalog-all-models { margin:0; }
.catalog-source { font-size:.9rem !important; color:#59554e !important; text-underline-offset:4px; }

.catalog-filters { display:grid; gap:8px; margin-bottom:16px; }
.catalog-filters[hidden], .catalog-filters label[hidden], .catalog-source[hidden] { display:none; }
.catalog-filters label { display:grid; gap:3px; color:#59554e; font-size:.82rem; }
.catalog-filters select { width:100%; min-height:36px; background:#fff; color:#26241f; padding:4px 9px; border:1px solid var(--cat-line); border-radius:6px; font:inherit; font-size:.95rem; }
#order-strap-photos button { background:none; border:1px solid #d9d5ce; padding:2px; margin:2px; border-radius:6px; cursor:pointer; }

.catalog-dialog .catalog-order:not([hidden]) { display: grid; place-items: center; min-height: 44px; border-radius: 2rem; padding: .55rem 1rem; background: #152a37; color: white; text-decoration: none; font-weight: 600; margin-bottom: .9rem; }

.catalog-contact[hidden], .catalog-copy-result:empty { display:none; }
.catalog-copy-example { border:0; }
.catalog-copy-result { margin-top:.5rem; font-size:.9rem; line-height:1.5; overflow-wrap:anywhere; }
.catalog-copy-result textarea { display:block; width:100%; min-height:6rem; margin-top:.5rem; padding:.6rem; font:inherit; }
.catalog-copy-result .inbox-after-copy { color:white; margin-top:.4rem; }
