/**
 * PUBLIC CATALOG — PAGINATION, then THE ITEM DETAIL PAGE: the two-column
 * layout, the gallery (main image, nav arrows, thumbnail rail, cover picker),
 * the title / description / tags column, the read-only listing-state strip with
 * its price, channel and upstream-source chips, and the print-request form.
 *
 * FIFTH of ten sheets — after styles-browse.css, before styles-controls.css.
 * Read the load-order block at the top of styles.css before moving a rule
 * between sheets: the split is a contiguous slice of one original file and the
 * cascade depends on it.
 *
 * Pagination leads the file because it led this stretch of the original and the
 * split is contiguous. It is browse furniture, not detail furniture.
 *
 * The operator-only EDITABLE cards that render below the strip are in
 * styles-listing-cards.css (sheet 9), not here.
 */
/* ── Pagination ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 32px;
  padding-bottom: 20px;
  flex-wrap: wrap;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  background: var(--bg-card);
  border: var(--border-1);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
}
.page-btn:hover { border-color: var(--accent); color: var(--text); }
.page-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.page-btn.disabled {
  opacity: 0.3;
  pointer-events: none;
}
.page-ellipsis {
  min-width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 14px;
}

/* ── Detail page ── */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 28px;
  align-items: start;
}
/* Grid/flex children default to min-width: min-content, so intrinsic-wide
   children (full-bleed gallery image, listing-strip chips) blew the column
   past the viewport. Forcing min-width:0 lets each track honor 1fr. */
.detail-layout > * { min-width: 0; }
@media (max-width: 900px) {
  .detail-layout { grid-template-columns: 1fr; gap: 14px; }
  .detail-info { padding: 18px; }
  .detail-page-header {
    gap: 10px;
    margin-bottom: 10px;
  }
  .detail-page-summary {
    justify-content: flex-start;
  }
  .detail-page-summary .catalog-pill { flex: 1 1 100%; }
  .detail-title {
    max-width: none;
  }
  .breadcrumbs {
    margin-bottom: 12px;
  }
  .back-btn {
    margin-bottom: 12px;
  }
}
.detail-gallery {
  position: relative;
  align-self: start;
  /* Belt-and-braces: parent .detail-layout > * already sets this, but
     keeping it on the gallery itself defends against the rule being
     overridden by a future selector at higher specificity. */
  min-width: 0;
  max-width: 100%;
  border-radius: 26px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.012)),
    linear-gradient(135deg, rgba(255, 107, 44, 0.04), transparent 56%);
  border: var(--border-1);
  box-shadow: var(--shadow);
}
@media (min-width: 901px) {
  .detail-gallery {
    position: sticky;
    top: calc(var(--header-height) + 18px);
  }
}
.detail-main-img {
  width: 100%;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.detail-main-img img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
}
.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background 0.2s;
}
.gallery-nav:hover { background: rgba(0,0,0,0.85); }
.gallery-nav.prev { left: 12px; }
.gallery-nav.next { right: 12px; }
.gallery-counter {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  z-index: 10;
}
.gallery-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px;
  max-height: 320px;
  overflow-y: auto;
  background: rgba(255,255,255,0.02);
}
.gallery-thumbs-capped {
  flex-wrap: nowrap;
  max-height: none;
  overflow-x: auto;
  overflow-y: hidden;
}
.gallery-thumb {
  width: 60px;
  height: 45px;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  flex-shrink: 0;
  transition: border-color 0.15s, opacity 0.15s;
  opacity: 0.5;
}
.gallery-thumb.active { border-color: var(--accent); opacity: 1; }
.gallery-thumb:hover { opacity: 1; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb.is-cover { box-shadow: 0 0 0 1px var(--accent) inset; }
.gallery-thumb-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.gallery-cover-pill {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #0c0a10;
  line-height: 1.4;
}
.gallery-set-cover {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--accent);
  border: var(--border-1);
  cursor: pointer;
  line-height: 1.4;
  white-space: nowrap;
}
.gallery-set-cover:hover { background: var(--bg-hover); border-color: var(--accent); }
.gallery-set-cover:disabled { opacity: 0.5; cursor: wait; }
.gallery-cover-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}
.gallery-auto-pick-cover {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  cursor: pointer;
  line-height: 1.4;
}
.gallery-auto-pick-cover:hover { background: var(--bg-hover); }
.gallery-auto-pick-cover:disabled { opacity: 0.5; cursor: wait; }
.gallery-thumbs-capped .gallery-thumb-wrap:nth-child(n+17) { display: none; }
.gallery-thumbs-capped .gallery-thumb:nth-child(n+17) { display: none; }
/* Tall expanded gallery would fight sticky positioning on long content */
@media (min-width: 901px) {
  .detail-gallery:has(.gallery-thumbs:not(.gallery-thumbs-capped)) {
    position: static;
  }
}
.gallery-thumbs-toggle {
  margin: 6px 10px 10px;
  padding: 6px 12px;
  background: transparent;
  color: var(--accent);
  border: var(--border-1);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.gallery-thumbs-toggle:hover { background: var(--bg-hover); border-color: var(--accent); }

.detail-info {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.detail-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
  max-width: 20ch;
  /* Titles are uploader-supplied, so a single word can be longer than the 20ch
     column at 42px — German compounds, CJK runs, chemical/part numbers. Without
     this the word cannot break and the product's own NAME renders clipped at the
     panel edge (measured in Chromium 2026-08-09: /1301616 "Schlüsselanhänger
     NFC Tag für Hunde", scrollWidth 386 vs clientWidth 354 at 1440px). Mobile
     escaped it because the clamp lands smaller there. */
  overflow-wrap: break-word;
}
.detail-desc {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0;
  max-width: 58ch;
}
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}
.detail-tag {
  padding: 6px 12px;
  background: rgba(255,255,255,0.04);
  border: var(--border-1);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.detail-tag:hover { border-color: var(--accent); color: var(--accent); }
.detail-empty-icon {
  color: var(--text-dim);
  font-size: 64px;
}
.similar-empty-icon {
  color: var(--text-dim);
  font-size: 32px;
}

/* ── Listing-state strip (detail page, logged-in only) ──
   Phase 2.5: compact horizontal row of chips that surfaces cost / sale
   price / channels / last activity. The mount stays empty when the
   visitor isn't authed, so the visual surface only appears for Adam /
   operator sessions. Read-only here — edits live on the file-vault
   detail page. */
.catalog-listing-strip-mount {
  margin: 6px 0 12px;
}
.catalog-listing-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: var(--pill-pad-lg);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  min-height: 32px;
  font-size: 12px;
  line-height: 1.2;
  /* Defensive: with .detail-layout > * now at min-width:0 the chips will
     wrap, but pin the parent's bounded width explicitly so a future
     non-grid mount (e.g. a sidebar variant) can't blow the viewport. */
  max-width: 100%;
  min-width: 0;
}
.catalog-listing-strip .strip-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: var(--pill-pad-md);
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
}
.catalog-listing-strip .strip-chip[hidden] { display: none; }
.catalog-listing-strip .strip-chip-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.catalog-listing-strip .strip-chip-value {
  font-weight: 600;
  color: var(--text);
}
.catalog-listing-strip .strip-cost-chip { /* muted: cost is read-only */ }
.catalog-listing-strip .strip-price-chip--set {
  border-color: rgba(255, 107, 44, 0.24);
  background: rgba(255, 107, 44, 0.1);
}
.catalog-listing-strip .strip-price-chip--set .strip-chip-value { color: var(--accent); }
.catalog-listing-strip .strip-price-chip--unset {
  border-color: rgba(255, 209, 102, 0.24);
  background: rgba(255, 209, 102, 0.06);
}
.catalog-listing-strip .strip-set-price-link {
  color: var(--accent-strong);
  text-decoration: underline;
}
.catalog-listing-strip .strip-channels {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}
.catalog-listing-strip .strip-channel-chip {
  padding: 3px 9px;
  font-size: 11px;
}
.catalog-listing-strip .strip-channel-chip--empty { color: var(--text-dim); font-style: italic; }
.catalog-listing-strip .strip-channel-chip[href]:hover { border-color: var(--accent); color: var(--accent); }
/* Phase 2.6: upstream-source chips (MakerWorld / Printables / Thingiverse /
   Other). Same chip silhouette as channel chips so the strip stays a single
   horizontal row at 412 viewport, with a tiny monogram badge in front to
   visually separate "where the design comes from" from "where it sells". */
.catalog-listing-strip .strip-sources {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}
.catalog-listing-strip .strip-source-chip {
  padding: 3px 9px 3px 4px;
  font-size: 11px;
  gap: 5px;
}
.catalog-listing-strip .strip-source-chip[href]:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.catalog-listing-strip .strip-source-chip-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  flex: 0 0 16px;
}
.catalog-listing-strip .strip-source-chip--makerworld .strip-source-chip-badge { background: rgba(56, 189, 248, 0.22); color: #7dd3fc; }
.catalog-listing-strip .strip-source-chip--printables .strip-source-chip-badge { background: rgba(249, 115, 22, 0.22); color: #fdba74; }
.catalog-listing-strip .strip-source-chip--thingiverse .strip-source-chip-badge { background: rgba(34, 197, 94, 0.22); color: #86efac; }
.catalog-listing-strip .strip-source-chip-label { color: var(--text-muted); }
.catalog-listing-strip .strip-activity {
  font-size: 11px;
  color: var(--text-dim);
  margin-left: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 40ch;
}
.catalog-listing-strip .strip-activity[hidden] { display: none; }

/* ── Request form (detail page) ── */
.request-form {
  margin-top: 20px;
  padding: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015)), var(--bg-card);
  border: var(--border-1);
  border-radius: 22px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.14);
}
.request-form-inline {
  margin-top: 16px;
}
.request-form h3 {
  font-family: var(--font-display);
  font-size: 16px;
  margin-bottom: 16px;
  color: var(--accent);
}
.form-row { display: flex; gap: 12px; margin-bottom: 12px; }
@media (max-width: 500px) { .form-row { flex-direction: column; } }
.form-group { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.form-group input, .form-group textarea, .form-group select {
  padding: 11px 12px;
  background: rgba(255,255,255,0.03);
  border: var(--border-1);
  border-radius: 12px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  font-family: inherit;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  border-color: rgba(255, 107, 44, 0.6);
  box-shadow: 0 0 0 4px rgba(255, 107, 44, 0.1);
}
.form-group textarea { resize: vertical; min-height: 60px; }
.form-msg { font-size: 13px; padding: 8px 12px; border-radius: 6px; margin-top: 8px; }
.form-msg.success { background: rgba(34,197,94,0.1); color: var(--green); }
.form-msg.error { background: rgba(239,68,68,0.1); color: var(--red); }
.request-form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}

