/* Underterra — inventory page restyle (2026 redesign).
   Only restyles the existing catalog markup; card HTML / data-* stay untouched
   so the scraper, admin panel and filters keep working. */
body.ut { background: var(--concrete); color: var(--ink); font-family: var(--f-sans); }

.ut .catalog { background: var(--concrete); max-width: var(--max); margin: 0 auto; padding: 32px 24px 96px; }
.ut .catalog-header { display: flex; flex-direction: column; align-items: stretch; gap: 16px; margin-bottom: 28px; background: var(--paper); border: 2px solid var(--ink); padding: 20px; }
.ut .catalog-header > * { min-width: 0; max-width: 100%; }
.ut .catalog-header .section-tag,
.ut .catalog-header .section-title { display: none; }
.ut .catalog-count { font-family: var(--f-mono); font-size: 13px; color: var(--body); letter-spacing: 0.02em; margin: 0; }

.ut .filter-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.ut .filter-tabs-brand { border-top: 1px solid var(--rule-soft); padding-top: 16px; }
.ut .filter-btn { font-family: var(--f-sans); font-size: 14px; font-weight: 600; letter-spacing: 0; text-transform: none; background: var(--paper); color: var(--ink); border: 2px solid var(--rule); border-radius: 0; padding: 10px 14px; min-height: 44px; min-width: 0; box-shadow: none; transform: none; }
.ut .filter-btn:hover { border-color: var(--ink); background: var(--paper); color: var(--ink); transform: none; }
.ut .filter-btn.active { background: var(--ink); color: var(--on-dark); border-color: var(--ink); }
.ut .filter-btn-brand { font-weight: 700; }
.ut .filter-btn-brand[style] { border-width: 2px; }
.ut .filter-btn-brand[style]:hover { transform: none; box-shadow: none; filter: brightness(1.1); }
.ut .filter-btn-brand[style].active { transform: none; outline: none; filter: none; box-shadow: 4px 4px 0 var(--ink); }
.ut .filter-btn-brand:not([style]).active { background: var(--ink); color: var(--on-dark); border-color: var(--ink); box-shadow: none; transform: none; }

.ut .catalog-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 36px 32px; padding: 0 8px 8px 0; }
.ut .machine-card { background: var(--paper); border: 2px solid var(--ink); border-radius: 0; box-shadow: 8px 8px 0 var(--ink); transition: transform .15s, box-shadow .15s; }
.ut .machine-card:hover { border-color: var(--ink); transform: translate(-3px, -3px); box-shadow: 11px 11px 0 var(--ink); }
.ut .machine-img { background: var(--rule-soft); border-bottom: 2px solid var(--ink); }
.ut .machine-card:hover .carousel-img.active { transform: none; }
.ut .carousel-counter { border-radius: 0; background: rgba(17,17,16,0.85); font-family: var(--f-mono); font-size: 11px; letter-spacing: 0; }
.ut .mc-btn, .ut .carousel-btn { width: 36px; height: 36px; border-radius: 0; background: rgba(17,17,16,0.8); }
.ut .machine-img-label { border-radius: 0; font-family: var(--f-mono); letter-spacing: 0.06em; }
.ut .machine-brand { color: rgba(255,255,255,0.7); font-family: var(--f-mono); }
.ut .machine-body { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.ut .machine-stock { font-family: var(--f-mono); color: var(--muted); letter-spacing: 0.04em; margin: 0; }
.ut .machine-category { font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.04em; color: var(--muted); margin: 0; }
.ut .machine-name { font-family: var(--f-sans); font-weight: 900; font-stretch: 75%; font-size: 30px; line-height: 1; letter-spacing: 0; color: var(--ink); margin: 0; }
.ut .machine-specs { gap: 6px; margin: 0; padding-bottom: 14px; border-bottom: 1px solid var(--rule-soft); }
.ut .spec { background: var(--concrete); color: var(--ink); font-size: 13px; font-weight: 700; padding: 6px 10px; }
.ut .spec-dot { display: none; }
.ut .machine-footer { gap: 8px; align-items: center; margin-top: 2px; }
.ut .machine-price { font-family: var(--f-sans); font-weight: 900; font-stretch: 75%; font-size: 28px; color: var(--ink); letter-spacing: 0; }
.ut .machine-price span { font-family: var(--f-mono); font-size: 10px; color: var(--muted); letter-spacing: 0.06em; font-weight: 400; }
.ut .quote-btn { background: var(--ink); color: var(--on-dark); border: 2px solid var(--ink); border-radius: 0; font-family: var(--f-sans); font-weight: 800; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; padding: 12px 14px; min-height: 44px; }
.ut .quote-btn:hover { background: var(--accent); color: var(--ink); border-color: var(--ink); }
.ut .mt-btn { border: 2px solid var(--ink); color: var(--ink); border-radius: 0; background: transparent; font-family: var(--f-mono); min-height: 44px; padding: 0 10px; }
.ut .mt-btn:hover { background: var(--ink); color: var(--on-dark); }

@media (max-width: 900px) {
  .ut .catalog { padding: 0 0 48px; }
  .ut .catalog-header { position: sticky; top: 64px; z-index: 50; border-width: 0 0 2px; padding: 12px 0 10px; gap: 10px; margin-bottom: 16px; background: var(--concrete); }
  .ut .catalog-count { padding: 0 16px; font-size: 12px; order: 3; }
  .ut .filter-tabs { flex-wrap: nowrap; overflow-x: auto; padding: 0 16px; scrollbar-width: none; }
  .ut .filter-tabs::-webkit-scrollbar { display: none; }
  .ut .filter-btn { flex: none; white-space: nowrap; }
  .ut .filter-tabs-brand { border-top: 0; padding-top: 0; }
  .ut .catalog-grid { padding: 0 22px 6px 16px; gap: 28px; }
  .ut .machine-card { box-shadow: 6px 6px 0 var(--ink); }
}

/* card footer: price on its own row, actions below */
.ut .catalog-grid { align-items: stretch; }
.ut .machine-card { display: flex; flex-direction: column; }
.ut .machine-body { flex-grow: 1; }
.ut .machine-footer { flex-wrap: wrap; margin-top: auto; }
.ut .machine-price { flex-basis: 100%; display: flex; flex-direction: column; gap: 2px; }
.ut .quote-btn { flex: 1 1 auto; }

/* ── Machine detail modal: light theme ─────────────────────── */
.ut .detail-overlay { background: rgba(17,17,16,0.82); padding: 40px 20px; }
.ut .detail-modal { background: var(--paper); color: var(--ink); border: 2px solid var(--ink); border-radius: 0; box-shadow: 10px 10px 0 var(--accent); }
.ut .detail-close { background: var(--ink); color: var(--on-dark); border: 2px solid var(--ink); border-radius: 0; width: 44px; height: 44px; font-size: 1.5rem; }
.ut .detail-close:hover { background: var(--accent); color: var(--ink); }
.ut .detail-gallery { background: var(--concrete); border-right: 2px solid var(--ink); }
.ut .detail-gallery-img { object-fit: contain; }
.ut .detail-gallery-thumbs { padding: 14px 4px 4px; scrollbar-color: var(--ink) transparent; }
.ut .detail-gallery-thumbs::-webkit-scrollbar-thumb { background: var(--on-dark-3); }
.ut .detail-thumb { border-radius: 0; border: 2px solid transparent; opacity: 0.6; }
.ut .detail-thumb.active, .ut .detail-thumb:hover { opacity: 1; border-color: var(--accent); }
.ut .detail-info { padding: 32px; gap: 16px; }
.ut .detail-tag { font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.06em; color: var(--muted); }
.ut .detail-title { font-family: var(--f-sans); font-weight: 900; font-stretch: 75%; font-size: 40px; letter-spacing: 0; text-transform: uppercase; color: var(--ink); line-height: 0.95; }
.ut .detail-stock-row { margin: 0; }
.ut .detail-stock-label { font-family: var(--f-mono); font-weight: 400; letter-spacing: 0.04em; color: var(--muted); }
.ut .detail-stock-num { font-family: var(--f-mono); color: var(--ink); background: var(--concrete); border: 1px solid var(--rule); border-radius: 0; letter-spacing: 0.04em; }
.ut .detail-price-row { border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule-soft); padding: 14px 0; justify-content: space-between; }
.ut .detail-price-val { font-family: var(--f-sans); font-weight: 900; font-stretch: 75%; font-size: 40px; color: var(--ink); }
.ut .detail-badge { background: var(--accent); color: var(--ink); border: 2px solid var(--ink); border-radius: 0; font-family: var(--f-mono); font-weight: 600; letter-spacing: 0.06em; padding: 5px 10px; }
.ut .detail-specs-grid { gap: 8px; }
.ut .detail-spec-item { background: var(--concrete); border-radius: 0; border-left: 3px solid var(--ink); padding: 10px 12px; }
.ut .detail-spec-label { font-family: var(--f-mono); letter-spacing: 0.04em; color: var(--muted); font-size: 11px; }
.ut .detail-spec-val { color: var(--ink); font-weight: 700; font-size: 15px; }
.ut .detail-dims-header { font-family: var(--f-mono); color: var(--ink); border-bottom: 2px solid var(--ink); letter-spacing: 0.06em; }
.ut .detail-divider { background: var(--rule-soft); }
.ut .detail-description { color: var(--body); font-size: 15px; }
.ut .detail-location { color: var(--body); font-size: 14px; }
.ut .detail-location svg { color: var(--ink); }
.ut .btn-detail-primary, .ut .btn-detail-secondary, .ut .btn-detail-outline { font-family: var(--f-sans); font-weight: 800; font-size: 14px; letter-spacing: 0.06em; border-radius: 0; min-height: 48px; }
.ut .btn-detail-primary { background: var(--accent); color: var(--ink); border: 2px solid var(--ink); }
.ut .btn-detail-primary:hover { background: var(--ink); color: var(--accent); }
.ut .btn-detail-secondary { background: var(--paper); color: var(--ink); border: 2px solid var(--ink); }
.ut .btn-detail-secondary:hover { background: var(--ink); color: var(--on-dark); border-color: var(--ink); }
.ut .btn-detail-outline { background: var(--ink); color: var(--on-dark); border: 2px solid var(--ink); }
.ut .btn-detail-outline:hover { background: var(--accent); color: var(--ink); border-color: var(--ink); }
@media (max-width: 900px) {
  .ut .detail-overlay { padding: 12px; }
  .ut .detail-modal { box-shadow: 6px 6px 0 var(--accent); }
  .ut .detail-gallery { border-right: 0; border-bottom: 2px solid var(--ink); }
  .ut .detail-info { padding: 20px; }
  .ut .detail-title, .ut .detail-price-val { font-size: 32px; }
}
.ut .detail-price-val span { display: block; font-family: var(--f-mono); font-weight: 400; font-size: 11px; letter-spacing: 0.06em; color: var(--muted); text-transform: uppercase; }
/* arrows always visible on touch screens, bigger tap target */
@media (hover: none) { .ut .mc-btn, .ut .carousel-btn { opacity: 1; width: 44px; height: 44px; } }
.ut .mc-btn, .ut .carousel-btn { cursor: pointer; }
/* MT description lives hidden on the card; shown in the detail window */
.ut .machine-desc { display: none; }
.ut .detail-description { white-space: pre-line; }

/* detail window: photo arrows + counter */
.ut .detail-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 48px; height: 64px; border: 0; background: rgba(0,0,0,0.65); color: var(--accent); font-size: 22px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.ut .detail-nav:hover { background: var(--accent); color: var(--ink); }
.ut .detail-nav-prev { left: 0; }
.ut .detail-nav-next { right: 0; }
.ut .detail-count { position: absolute; right: 12px; bottom: 12px; z-index: 3; background: rgba(0,0,0,0.75); color: #fff; font-family: var(--f-mono); font-size: 12px; padding: 5px 9px; }
@media (max-width: 900px) { .ut .detail-nav { width: 40px; height: 52px; font-size: 18px; } }

/* detail window: zoom button + full-screen zoom viewer */
.ut .detail-gallery-img.active { cursor: zoom-in; }
.ut .detail-zoom-btn { position: absolute; right: 12px; top: 12px; z-index: 3; width: 40px; height: 40px; border: 0; background: rgba(0,0,0,0.7); color: var(--accent); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.ut .detail-zoom-btn:hover { background: var(--accent); color: var(--ink); }
.zoom-viewer { position: fixed; inset: 0; z-index: 10000; background: rgba(0,0,0,0.96); display: none; }
.zoom-viewer.open { display: block; }
.zoom-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: none; cursor: zoom-in; }
.zoom-viewer.zoomed .zoom-stage { cursor: grab; }
.zoom-viewer.zoomed .zoom-stage:active { cursor: grabbing; }
.zoom-stage img { max-width: 100vw; max-height: 100vh; object-fit: contain; user-select: none; -webkit-user-drag: none; transform-origin: center center; will-change: transform; }
.zoom-close { position: absolute; top: 14px; right: 14px; z-index: 2; width: 48px; height: 48px; border: 0; background: #FFD51E; color: #111110; font-size: 20px; font-weight: 800; cursor: pointer; }
.zoom-viewer .zoom-nav { position: absolute; z-index: 2; }
.zoom-hint { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); background: rgba(0,0,0,0.7); color: #fff; font-family: 'JetBrains Mono', monospace; font-size: 12px; padding: 6px 12px; transition: opacity .6s; pointer-events: none; }
@media (hover: none) { .zoom-hint::after { content: ''; } }
