/* ==========================================================================
   ร้าน ส.วุฒิยนต์ — Workshop Blueprint & Honda Heritage Design System
   Distinctive technical parts fiche + Thai workshop clarity
   ========================================================================== */

:root {
  --bg-canvas: #F3F4F6;
  --bg-surface: #FFFCF5;
  --bg-subtle: #FAF6EC;
  --ink-primary: #14171C;
  --ink-secondary: #374151;
  --ink-muted: #5F6877;
  --border-light: #E2E5EB;
  --border-strong: #CBD1DC;

  --brand-red: #C8102E;
  --brand-red-dark: #A00C24;
  --brand-red-soft: #FDECEF;

  --genuine-navy: #1D3B5E;
  --genuine-soft: #EAF1FA;

  --line-green: #06C755;
  --line-green-dark: #05A847;

  --highlight-bg: #FFF4E2;
  --highlight-border: #F59E0B;

  --stock-ok-bg: #E9F7EF;
  --stock-ok-ink: #136F3A;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --font-sans: "IBM Plex Sans Thai", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background: var(--bg-canvas);
  color: var(--ink-primary);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
}

.container {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ==================== Utility Bar ==================== */
.utility-bar {
  background: #1B2028;
  color: #D7DCE4;
  font-size: 12.5px;
  border-bottom: 1px solid #2A313D;
}

.utility-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  flex-wrap: wrap;
  padding-top: 4px;
  padding-bottom: 4px;
}

.utility-left, .utility-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.utility-link {
  color: #FFFFFF;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.utility-hours {
  color: #AEB7C4;
}

.dealer-pill {
  background: rgba(200, 16, 46, 0.22);
  color: #FFD6DC;
  border: 1px solid rgba(200, 16, 46, 0.55);
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 12px;
}

.dealer-pill:hover {
  background: var(--brand-red);
  color: #FFFFFF;
}

/* ==================== Main Header ==================== */
.site-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 60;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 66px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--brand-red);
  color: #FFFFFF;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.18;
}

.brand-text strong {
  font-size: 16.5px;
  font-weight: 700;
  color: var(--ink-primary);
}

.brand-text small {
  font-size: 11.5px;
  color: var(--ink-muted);
}

.global-search-wrap {
  position: relative;
  flex: 1;
  max-width: 560px;
}

.search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-muted);
  pointer-events: none;
}

.global-search-input {
  width: 100%;
  height: 40px;
  padding: 0 14px 0 38px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--ink-primary);
  font-size: 14px;
  transition: border-color 0.15s, background 0.15s;
}

.global-search-input:focus {
  outline: none;
  background: var(--bg-surface);
  border-color: var(--brand-red);
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 36px rgba(20, 23, 28, 0.14);
  max-height: 420px;
  overflow-y: auto;
  z-index: 80;
}

.search-drop-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  width: 100%;
  text-align: left;
  background: transparent;
  border-left: 0;
  border-right: 0;
  border-top: 0;
}

.search-drop-item:hover {
  background: var(--bg-subtle);
}

.search-drop-item:last-child {
  border-bottom: 0;
}

.search-drop-name {
  font-weight: 500;
  font-size: 14px;
  color: var(--ink-primary);
}

.search-drop-meta {
  font-size: 12px;
  color: var(--ink-muted);
  font-family: var(--font-mono);
}

.search-drop-price {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--brand-red);
  white-space: nowrap;
}

.search-drop-footer {
  padding: 10px 14px;
  background: var(--bg-subtle);
  text-align: center;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

.nav-tab {
  height: 38px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-secondary);
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-tab:hover {
  background: var(--bg-subtle);
  color: var(--ink-primary);
}

.nav-tab.is-active {
  background: var(--brand-red-soft);
  color: var(--brand-red);
  border-color: rgba(200, 16, 46, 0.22);
}

.tab-count {
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: rgba(20, 23, 28, 0.07);
  padding: 1px 6px;
  border-radius: 999px;
}

.nav-tab.is-active .tab-count {
  background: rgba(200, 16, 46, 0.14);
}

.cart-trigger {
  height: 38px;
  padding: 0 14px;
  border: 1.5px solid var(--ink-primary);
  border-radius: var(--radius-sm);
  background: var(--ink-primary);
  color: #FFFFFF;
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: 4px;
}

.cart-trigger:hover {
  background: #272D37;
}

.cart-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--brand-red);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  display: inline-grid;
  place-items: center;
}

/* ==================== Model Banner Bar ==================== */
.model-bar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
}

.model-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 16px;
  padding-bottom: 16px;
  flex-wrap: wrap;
}

.model-identity {
  display: flex;
  align-items: center;
  gap: 16px;
}

.model-thumb {
  width: 96px;
  height: 72px;
  object-fit: contain;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 4px;
  flex-shrink: 0;
}

.model-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.model-title-row h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.hp-badge {
  background: var(--brand-red);
  color: #FFFFFF;
  font-size: 12.5px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 4px;
}

.model-subtitle {
  margin: 2px 0 8px;
  font-size: 13.5px;
  color: var(--ink-muted);
}

.model-actions-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.text-action-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  color: var(--ink-secondary);
  font-size: 12.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

.text-action-btn:hover {
  border-color: var(--ink-primary);
  color: var(--ink-primary);
}

.admin-toggle-btn.is-active {
  background: #1D3B5E;
  border-color: #1D3B5E;
  color: #FFFFFF;
}

.model-engine-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}

.engine-cta-info {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.engine-cta-label {
  font-size: 12px;
  color: var(--ink-muted);
}

.engine-cta-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.engine-cta-price {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 18px;
  color: var(--brand-red);
}

.engine-cta-old {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-muted);
  text-decoration: line-through;
}

/* Selector Drawer */
.selector-drawer {
  padding-top: 14px;
  padding-bottom: 16px;
  border-top: 1px dashed var(--border-strong);
}

.selector-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr)) 1.3fr;
  gap: 12px;
  align-items: end;
}

.selector-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.selector-field select {
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--ink-primary);
}

.selector-note {
  font-size: 12.5px;
  color: var(--ink-muted);
  background: var(--bg-subtle);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.inline-link-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--brand-red);
  font-weight: 600;
  text-decoration: underline;
}

/* ==================== Assembly Strip ==================== */
.assembly-strip-wrap {
  padding: 16px 0 14px;
}

.strip-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.strip-header h2 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
}

.strip-hint {
  font-size: 13px;
  color: var(--ink-muted);
}

.assembly-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.assembly-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  text-align: left;
  transition: border-color 0.14s, background 0.14s;
}

.assembly-card:hover {
  border-color: var(--ink-muted);
}

.assembly-card.is-active {
  border-color: var(--brand-red);
  background: #FFFDFD;
  box-shadow: inset 3px 0 0 var(--brand-red);
}

.assembly-thumb {
  width: 64px;
  height: 48px;
  object-fit: contain;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: 5px;
  padding: 2px;
  flex-shrink: 0;
}

.assembly-card-meta {
  min-width: 0;
}

.assembly-card-code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--brand-red);
}

.assembly-card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-primary);
  line-height: 1.3;
}

.assembly-card-count {
  font-size: 12px;
  color: var(--ink-muted);
}

/* ==================== Admin Toolbar ==================== */
.admin-toolbar {
  background: #1D3B5E;
  color: #FFFFFF;
  border-top: 1px solid #152D49;
  border-bottom: 1px solid #152D49;
  margin-bottom: 14px;
}

.admin-toolbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 10px;
  padding-bottom: 10px;
  flex-wrap: wrap;
}

.admin-toolbar-info {
  display: flex;
  flex-direction: column;
  font-size: 13px;
}

.admin-toolbar-info span {
  color: #C8D9EE;
  font-size: 12.5px;
}

.admin-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.file-upload-btn {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

/* ==================== Split-Pane Workspace ==================== */
.workspace-container {
  padding-bottom: 36px;
}

.split-workspace {
  display: grid;
  grid-template-columns: minmax(420px, 47%) minmax(460px, 53%);
  gap: 16px;
  align-items: start;
}

/* Put parts pane left, diagram pane right on desktop */
.parts-pane {
  order: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.diagram-pane {
  order: 2;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  position: sticky;
  top: 80px;
  overflow: hidden;
}

/* Diagram Viewer */
.diagram-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-subtle);
  flex-wrap: wrap;
}

.diagram-title-block {
  display: flex;
  align-items: center;
  gap: 10px;
}

.diagram-code {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--ink-primary);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.diagram-title-block h3 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
}

.diagram-title-block p {
  margin: 1px 0 0;
  font-size: 12px;
  color: var(--ink-muted);
}

.diagram-controls {
  display: flex;
  align-items: center;
  gap: 5px;
}

.icon-btn {
  height: 30px;
  min-width: 30px;
  padding: 0 8px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--bg-surface);
  color: var(--ink-primary);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  border-color: var(--ink-primary);
  background: var(--bg-subtle);
}

.zoom-readout {
  font-family: var(--font-mono);
  font-size: 12px;
  min-width: 44px;
  text-align: center;
  color: var(--ink-secondary);
}

.diagram-viewport {
  position: relative;
  background: #FFFFFF;
  overflow: auto;
  min-height: 440px;
  max-height: 620px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.diagram-stage {
  position: relative;
  width: 100%;
  max-width: 720px;
  transform-origin: center center;
  transition: transform 0.16s ease;
  user-select: none;
}

.diagram-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.hotspot-layer {
  position: absolute;
  inset: 0;
}

.hotspot-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 2px solid #FFFFFF;
  background: #14171C;
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  transition: transform 0.14s, background 0.14s;
  z-index: 5;
}

.hotspot-pin:hover {
  transform: translate(-50%, -50%) scale(1.16);
  background: var(--brand-red);
  z-index: 12;
}

.hotspot-pin.is-active {
  background: var(--brand-red);
  transform: translate(-50%, -50%) scale(1.22);
  box-shadow: 0 0 0 5px rgba(200, 16, 46, 0.22), 0 3px 10px rgba(200, 16, 46, 0.4);
  z-index: 15;
}

.hotspot-pin.is-draggable {
  cursor: grab;
  background: #1D3B5E;
  box-shadow: 0 0 0 4px rgba(29, 59, 94, 0.25);
}

.hotspot-pin.is-dragging {
  cursor: grabbing;
  background: var(--brand-red);
}

.diagram-hover-card {
  position: absolute;
  top: 12px;
  right: 12px;
  max-width: 260px;
  background: rgba(20, 23, 28, 0.94);
  color: #FFFFFF;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  pointer-events: none;
  z-index: 25;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.hover-card-num {
  display: inline-block;
  background: var(--brand-red);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 0 6px;
  border-radius: 4px;
  margin-right: 6px;
}

.hover-card-price {
  margin-top: 4px;
  font-family: var(--font-mono);
  color: #FDE68A;
  font-weight: 600;
}

.diagram-footnote {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 16px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-subtle);
  font-size: 12px;
  color: var(--ink-muted);
  flex-wrap: wrap;
}

/* ==================== Parts List Pane ==================== */
.parts-pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-subtle);
}

.parts-pane-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.parts-pane-title h3 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
}

.count-pill {
  font-family: var(--font-mono);
  font-size: 12px;
  background: #E5E8EE;
  color: var(--ink-secondary);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}

.parts-pane-legend {
  display: flex;
  gap: 6px;
}

.legend-chip {
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

.legend-chip.genuine {
  background: var(--genuine-soft);
  color: var(--genuine-navy);
}

.legend-chip.aftermarket {
  background: #EFEFF3;
  color: var(--ink-secondary);
}

.parts-list {
  display: flex;
  flex-direction: column;
}

.part-row {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.14s;
  cursor: pointer;
}

.part-row:hover {
  background: #FAFBFD;
}

.part-row.is-active {
  background: var(--highlight-bg);
  box-shadow: inset 4px 0 0 var(--brand-red);
}

.part-row-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.part-num-badge {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--ink-primary);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.part-row.is-active .part-num-badge {
  background: var(--brand-red);
}

.part-main {
  flex: 1;
  min-width: 0;
}

.part-title {
  font-weight: 600;
  font-size: 14.5px;
  color: var(--ink-primary);
  line-height: 1.35;
}

.part-sku-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-muted);
}

.sku-code {
  font-family: var(--font-mono);
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--ink-secondary);
}

.badge-genuine {
  background: var(--genuine-soft);
  color: var(--genuine-navy);
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 4px;
}

.badge-brand {
  background: #EFEFF3;
  color: var(--ink-secondary);
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 4px;
}

.badge-stock {
  background: var(--stock-ok-bg);
  color: var(--stock-ok-ink);
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 4px;
}

.part-note {
  margin-top: 5px;
  font-size: 12.5px;
  color: var(--ink-muted);
}

.part-buy-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.part-price {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 16px;
  color: var(--ink-primary);
  white-space: nowrap;
}

.part-price-old {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-muted);
  text-decoration: line-through;
  margin-right: 4px;
}

.part-price-ask {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-muted);
}

/* Variant Swatches (Oversize / Cap Type) */
.variant-row {
  margin-top: 10px;
  padding-left: 40px;
}

.variant-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-secondary);
  margin-bottom: 5px;
}

.variant-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.variant-chip {
  height: 28px;
  padding: 0 9px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--bg-surface);
  color: var(--ink-secondary);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
}

.variant-chip:hover {
  border-color: var(--ink-primary);
}

.variant-chip.is-selected {
  background: var(--ink-primary);
  border-color: var(--ink-primary);
  color: #FFFFFF;
}

/* Inline Alternatives Accordion (Genuine vs Aftermarket) */
.alt-wrap {
  margin-top: 10px;
  padding-left: 40px;
}

.alt-toggle-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  padding: 5px 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--genuine-navy);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.alt-toggle-btn:hover {
  background: var(--genuine-soft);
}

.alt-list {
  margin-top: 8px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  overflow: hidden;
}

.alt-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--border-light);
}

.alt-item:last-child {
  border-bottom: 0;
}

.alt-item-info {
  min-width: 0;
}

.alt-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-primary);
}

.alt-item-meta {
  font-size: 11.5px;
  color: var(--ink-muted);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.alt-item-action {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.parts-pane-help {
  padding: 14px 16px;
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.parts-pane-help p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-secondary);
}

/* ==================== Buttons ==================== */
.btn-primary {
  background: var(--brand-red);
  color: #FFFFFF;
  border: 1px solid var(--brand-red);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-weight: 600;
  font-size: 13.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-primary:hover {
  background: var(--brand-red-dark);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--ink-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-weight: 600;
  font-size: 13.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-secondary:hover {
  border-color: var(--ink-primary);
  background: var(--bg-subtle);
}

.btn-line {
  background: var(--line-green);
  color: #FFFFFF;
  border: 1px solid var(--line-green);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-weight: 600;
  font-size: 13.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-line:hover {
  background: var(--line-green-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-muted);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-weight: 600;
  font-size: 13px;
}

.btn-ghost:hover {
  color: var(--brand-red);
  background: var(--brand-red-soft);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12.5px;
  white-space: nowrap;
}

.btn-block {
  width: 100%;
  padding: 11px 16px;
  font-size: 14.5px;
}

/* ==================== Full Catalog View ==================== */
.catalog-wrap {
  padding-top: 22px;
  padding-bottom: 42px;
}

.catalog-header {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 14px;
}

.catalog-header h2 {
  margin: 0;
  font-size: 20px;
}

.catalog-sub {
  margin: 4px 0 14px;
  font-size: 13.5px;
  color: var(--ink-muted);
}

.catalog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.filter-input {
  flex: 1;
  min-width: 240px;
  height: 40px;
  padding: 0 12px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.filter-input:focus {
  outline: none;
  border-color: var(--brand-red);
}

.filter-select {
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  min-width: 170px;
}

.filter-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--ink-secondary);
  cursor: pointer;
}

.catalog-result-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 13.5px;
  color: var(--ink-secondary);
  font-weight: 600;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(295px, 1fr));
  gap: 12px;
}

.catalog-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.catalog-card-top {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.catalog-card-cat {
  font-size: 12px;
  color: var(--ink-muted);
}

.catalog-card-name {
  font-weight: 600;
  font-size: 14.5px;
  line-height: 1.38;
}

.catalog-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}

.catalog-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
}

.catalog-load-more-wrap {
  text-align: center;
  margin-top: 20px;
}

/* ==================== Cart Drawer ==================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 23, 28, 0.45);
  z-index: 90;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(440px, 100vw);
  background: var(--bg-surface);
  z-index: 100;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.18);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-light);
}

.drawer-header h3 {
  margin: 0;
  font-size: 17px;
}

.shipping-meter {
  padding: 10px 18px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-light);
  font-size: 12.5px;
  color: var(--ink-secondary);
}

.meter-bar {
  height: 6px;
  background: #DFE3EA;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}

.meter-fill {
  height: 100%;
  background: var(--line-green);
  transition: width 0.2s;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 18px;
}

.cart-empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--ink-muted);
}

.cart-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

.cart-item-info {
  min-width: 0;
}

.cart-item-name {
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1.35;
}

.cart-item-meta {
  font-size: 12px;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  margin-top: 2px;
}

.cart-item-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  overflow: hidden;
}

.qty-stepper button {
  width: 26px;
  height: 26px;
  border: 0;
  background: var(--bg-subtle);
  font-weight: 700;
}

.qty-stepper span {
  min-width: 28px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
}

.drawer-footer {
  padding: 14px 18px 18px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-subtle);
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
  font-size: 15px;
}

.cart-summary-row strong {
  font-family: var(--font-mono);
  font-size: 20px;
  color: var(--brand-red);
}

.cart-note {
  margin: 0 0 6px;
  font-size: 12px;
  color: #92400E;
}

.cart-policy {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--ink-muted);
}

.drawer-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-sub-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

/* ==================== Modals ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 23, 28, 0.56);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 120;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  width: min(640px, 100%);
  max-height: 86vh;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.lightbox-card {
  width: min(1040px, 100%);
  max-height: 92vh;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
}

.modal-header h3 {
  margin: 0;
  font-size: 16.5px;
}

.modal-body {
  padding: 16px 18px;
  overflow-y: auto;
}

.lightbox-body {
  padding: 16px;
  overflow: auto;
  display: flex;
  justify-content: center;
  background: #FFFFFF;
}

.lightbox-stage {
  max-width: 920px;
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
}

.specs-table tr {
  border-bottom: 1px solid var(--border-light);
}

.specs-table th {
  text-align: left;
  padding: 10px 12px 10px 0;
  width: 38%;
  color: var(--ink-muted);
  font-weight: 600;
  font-size: 13.5px;
  vertical-align: top;
}

.specs-table td {
  padding: 10px 0;
  font-size: 14px;
  color: var(--ink-primary);
}

/* ==================== Footer ==================== */
.site-footer {
  background: #1B2028;
  color: #D7DCE4;
  padding: 32px 0;
  margin-top: 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 0.8fr;
  gap: 28px;
}

.site-footer h4 {
  margin: 0 0 10px;
  color: #FFFFFF;
  font-size: 15px;
}

.site-footer p {
  margin: 0 0 8px;
  font-size: 13.5px;
  color: #B7C0CE;
}

.footer-meta a {
  color: #FFFFFF;
  text-decoration: underline;
}

.footer-list {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: #B7C0CE;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links .btn-secondary {
  background: #272E3A;
  color: #FFFFFF;
  border-color: #3A4354;
}

/* ==================== Toast ==================== */
.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: #14171C;
  color: #FFFFFF;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.25);
  z-index: 200;
}

/* ==================== Responsive ==================== */
@media (max-width: 1024px) {
  .split-workspace {
    grid-template-columns: 1fr;
  }
  .diagram-pane {
    order: 1;
    position: relative;
    top: 0;
  }
  .parts-pane {
    order: 2;
  }
  .assembly-strip {
    grid-template-columns: repeat(4, minmax(190px, 1fr));
  }
  .selector-grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .utility-hours {
    display: none;
  }
  .header-inner {
    flex-wrap: wrap;
    padding-top: 10px;
    padding-bottom: 10px;
    gap: 10px;
  }
  .global-search-wrap {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }
  .header-nav {
    margin-left: auto;
  }
  .nav-tab {
    padding: 0 10px;
    font-size: 13px;
  }
  .diagram-viewport {
    min-height: 290px;
  }
  .variant-row, .alt-wrap {
    padding-left: 0;
  }
  .selector-grid {
    grid-template-columns: 1fr;
  }
}


/* ==================== MOBILE-FIRST HOME & BESTSELLERS ==================== */
.home-wrap {
  padding: 20px 0 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.home-hero {
  background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 100%);
  color: #fff;
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.home-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.16);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.home-hero h1 {
  font-size: 24px;
  line-height: 1.25;
  margin: 0 0 6px;
}

.home-hero p {
  margin: 0;
  font-size: 14px;
  opacity: 0.92;
  max-width: 600px;
}

.home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.home-section-head h2 {
  font-size: 19px;
  margin: 0 0 4px;
  color: #111827;
}

.home-section-sub {
  margin: 0;
  font-size: 13px;
  color: #4b5563;
}

.home-cat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.home-cat-tile {
  background: var(--bg-surface);
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.home-cat-tile:hover {
  border-color: #1b4332;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.home-cat-tile .cat-ico {
  font-size: 24px;
  line-height: 1;
}

.home-cat-tile strong {
  font-size: 14px;
  color: #111827;
}

.home-cat-tile small {
  font-size: 11px;
  color: #6b7280;
}

.bestseller-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 0 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.bestseller-tabs::-webkit-scrollbar { display: none; }

.bs-chip {
  flex: 0 0 auto;
  border: 1px solid #d1d5db;
  background: var(--bg-surface);
  color: #374151;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.bs-chip.is-active {
  background: #1b4332;
  border-color: #1b4332;
  color: #fff;
}

.bestseller-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.bs-card {
  background: var(--bg-surface);
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bs-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.bs-tag {
  font-size: 11px;
  font-weight: 600;
  color: #1b4332;
  background: #e6f4ea;
  padding: 3px 8px;
  border-radius: 999px;
}

.bs-brand {
  font-size: 11px;
  color: #6b7280;
}

.bs-title {
  font-size: 14px;
  line-height: 1.4;
  margin: 0;
  color: #111827;
  min-height: 40px;
}

.bs-sku {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: #6b7280;
}

.bs-price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: auto;
}

.bs-price {
  font-size: 18px;
  color: #c1121f;
}

.bs-price-list {
  font-size: 12px;
  color: #9ca3af;
  text-decoration: line-through;
}

.bs-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 4px;
}

.bs-actions .btn-primary,
.bs-actions .btn-line {
  text-align: center;
  justify-content: center;
  padding: 8px 6px;
  font-size: 12px;
  border-radius: 8px;
}

.home-finder-callout {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.home-finder-callout p {
  margin: 4px 0 0;
  font-size: 13px;
  color: #475569;
}

.mobile-cart-bar {
  display: none;
}

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

@media (max-width: 640px) {
  .utility-bar { display: none; }
  .header-inner { gap: 10px; padding: 10px 0; }
  .header-nav {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 6px;
    padding-bottom: 2px;
  }
  .header-nav .nav-tab {
    flex: 0 0 auto;
    padding: 8px 12px;
    font-size: 13px;
  }
  .home-wrap { padding: 12px 0 84px; gap: 18px; }
  .home-hero { padding: 18px 16px; border-radius: 14px; }
  .home-hero h1 { font-size: 20px; }
  .home-hero-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .home-hero-actions a { text-align: center; justify-content: center; font-size: 13px; padding: 10px 8px; }
  .home-cat-grid { gap: 8px; }
  .home-cat-tile { padding: 12px 6px; }
  .home-cat-tile strong { font-size: 13px; }
  .bestseller-grid { gap: 8px; }
  .bs-card { padding: 11px; }
  .bs-title { font-size: 13px; min-height: 36px; }
  .bs-price { font-size: 16px; }
  .bs-actions { grid-template-columns: 1fr; }
  .mobile-cart-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    background: var(--bg-surface);
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }
  .mobile-cart-bar[hidden] { display: none; }
  .mobile-cart-info { display: flex; flex-direction: column; }
  .mobile-cart-info strong { font-size: 13px; color: #111827; }
  .mobile-cart-info span { font-size: 15px; font-weight: 700; color: #c1121f; }
}


/* ==================== AGRICULTURAL SHOP THEME & PRODUCT PHOTOS ==================== */
body {
  background: #F3EEE1;
}

.site-header {
  background: var(--bg-surface);
  border-bottom: 3px solid #14532d;
}

.brand-mark {
  background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
  color: #fef3c7;
  border: 2px solid #d97706;
}

.home-hero-photo {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(15, 58, 34, 0.90) 0%, rgba(20, 83, 45, 0.78) 55%, rgba(20, 83, 45, 0.55) 100%),
    url('images/t/shop-hero.webp') center 30% / cover no-repeat;
  border: 1px solid #14532d;
  box-shadow: 0 10px 26px rgba(20, 83, 45, 0.18);
  padding: 28px 24px;
}

.home-badge {
  background: rgba(217, 119, 6, 0.92);
  color: #fffbeb;
  letter-spacing: 0.01em;
}

.btn-hero-call {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.95);
  color: #14532d;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.agri-trust-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.trust-pill {
  background: var(--bg-surface);
  border: 1px solid #d9e2d5;
  border-left: 4px solid #166534;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #14532d;
}

.home-cat-tile {
  background: var(--bg-surface);
  border: 1px solid #d9e2d5;
  box-shadow: 0 2px 6px rgba(20, 83, 45, 0.04);
}

.home-cat-tile:hover {
  border-color: #166534;
  background: #f0fdf4;
}

.bs-card {
  padding: 0;
  overflow: hidden;
  border: 1px solid #dde3d8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.bs-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #ebe8de;
  overflow: hidden;
}

.bs-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bs-thumb .bs-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(20, 83, 45, 0.92);
  color: #fff;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
}

.bs-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.bs-brand {
  font-size: 11px;
  font-weight: 700;
  color: #166534;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.home-finder-callout {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-left: 5px solid #d97706;
}

@media (max-width: 768px) {
  .agri-trust-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .trust-pill {
    padding: 8px 10px;
    font-size: 12px;
  }
}

@media (max-width: 640px) {
  .home-hero-photo {
    padding: 20px 16px;
  }
  .bs-body {
    padding: 10px;
  }
}


/* ==================== CUSTOM SVG MACHINERY CATEGORY ICONS ==================== */
.cat-ico-wrap {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: radial-gradient(circle at 30% 25%, #ffffff 0%, #ecfdf3 55%, #dcfce7 100%);
  box-shadow: inset 0 0 0 1px #d1e7d8, 0 3px 8px rgba(20, 83, 45, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  transition: transform .15s ease;
}

.cat-svg {
  width: 54px;
  height: 54px;
  display: block;
}

.home-cat-tile:hover .cat-ico-wrap,
.home-cat-tile:active .cat-ico-wrap {
  transform: scale(1.06);
  box-shadow: inset 0 0 0 1.5px #16a34a, 0 4px 10px rgba(20, 83, 45, 0.14);
}

@media (max-width: 640px) {
  .cat-ico-wrap {
    width: 64px;
    height: 64px;
    border-radius: 18px;
  }
  .cat-svg {
    width: 48px;
    height: 48px;
  }
}

/* ==================== v2 (2026-12-05): product page, categories, multi-model finder ==================== */
.hotspot-pin { background: var(--brand-red); font-family: var(--font-sans); }
.hotspot-pin.is-ask { background: #6B7280; }
.hotspot-pin:hover { background: #14171C; }
.hotspot-pin.is-active { background: #14171C; box-shadow: 0 0 0 5px rgba(20, 23, 28, 0.25), 0 3px 10px rgba(0, 0, 0, 0.4); }
@media (max-width: 640px) {
  .hotspot-pin { width: 22px; height: 22px; font-size: 11px; border-width: 1.5px; }
}
.hover-card-coords { margin-top: 3px; opacity: .8; font-family: var(--font-mono); }

a.catalog-card-top { color: inherit; text-decoration: none; }
a.catalog-card-top:hover .catalog-card-name { color: var(--brand-red); }
.catalog-card-img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: var(--radius-sm); background: var(--bg-subtle); margin-bottom: 4px; }
.catalog-empty { grid-column: 1 / -1; background: var(--bg-surface); padding: 28px 18px; text-align: center; border: 1px solid var(--border-light); border-radius: 10px; color: var(--ink-muted); line-height: 2; }
.bs-title a { color: inherit; text-decoration: none; }
a.bs-thumb { display: block; }
.search-drop-item { text-decoration: none; color: inherit; }
.search-drop-empty { padding: 14px; color: var(--ink-muted); font-size: 13.5px; }

/* Category directory */
.cat-dir-wrap { margin: 6px 0 18px; }
.cat-dir-title { font-size: 17px; margin: 0 0 10px; }
.cat-dir { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.cat-dir-group { background: var(--bg-surface); border: 1px solid var(--border-light); border-radius: var(--radius-md); padding: 12px; }
.cat-dir-group h3 { font-size: 15px; margin: 0 0 8px; display: flex; justify-content: space-between; }
.cat-dir-group h3 span { color: var(--ink-muted); font-weight: 400; font-size: 13px; }
.cat-dir-list { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-dir-item { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; min-height: 36px; border: 1px solid var(--border-light); border-radius: 999px; background: var(--bg-subtle); font-size: 13.5px; text-decoration: none; color: var(--ink-primary); }
.cat-dir-item small { color: var(--ink-muted); font-size: 12px; }
.cat-dir-item:hover { border-color: var(--brand-red); color: var(--brand-red); }

/* Product detail */
.product-wrap { padding-top: 14px; padding-bottom: 40px; }
.crumbs { font-size: 13px; color: var(--ink-muted); margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 4px; }
.crumbs a { color: var(--ink-secondary); text-decoration: underline; text-underline-offset: 2px; }
.product-card { display: grid; grid-template-columns: minmax(0, 380px) 1fr; gap: 20px; background: var(--bg-surface); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 16px; }
.product-media { aspect-ratio: 1 / 1; border-radius: var(--radius-md); overflow: hidden; background: var(--bg-subtle); }
.product-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-media-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--ink-muted); text-align: center; font-size: 14px; }
.product-media-empty span:first-child { font-size: 40px; opacity: .5; }
.product-title { font-size: 21px; line-height: 1.35; margin: 4px 0 8px; }
.product-price-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.product-price { font-size: 28px; color: var(--brand-red); }
.product-unit { color: var(--ink-muted); font-size: 14px; }
.product-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.product-actions > * { min-height: 44px; }
.product-note { font-size: 12.5px; color: var(--ink-muted); margin: 12px 0; }
.product-table { width: 100%; }
@media (max-width: 720px) {
  .product-card { grid-template-columns: 1fr; padding: 12px; gap: 12px; }
  .product-media { aspect-ratio: 4 / 3; }
  .product-media.is-empty { aspect-ratio: auto; height: 120px; }
  .product-actions > * { flex: 1 1 100%; text-align: center; justify-content: center; }
  .product-title { font-size: 19px; }
}

/* Multi-model selector */
.model-grid { display: grid; gap: 12px; padding: 12px 0 6px; }
.model-group h3 { font-size: 14px; margin: 0 0 6px; color: var(--ink-secondary); }
.model-group-list { display: flex; flex-wrap: wrap; gap: 8px; }
.model-chip { display: flex; flex-direction: column; padding: 9px 13px; min-width: 120px; border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--bg-surface); text-decoration: none; color: var(--ink-primary); }
.model-chip small { color: var(--ink-muted); font-size: 12px; }
.model-chip.is-active { border-color: var(--brand-red); background: var(--brand-red-soft); }
.model-chip:hover { border-color: var(--brand-red); }

/* Parts list v2 */
.part-row.is-ask .part-num-badge { background: #6B7280; }
.part-title a { color: inherit; text-decoration: none; }
.part-title a:hover { color: var(--brand-red); text-decoration: underline; }
.part-en { font-size: 12px; color: var(--ink-muted); margin-top: 1px; }
.oem-code { font-family: var(--font-mono); font-size: 11.5px; color: var(--genuine-navy); background: var(--genuine-soft); padding: 1px 6px; border-radius: 4px; }
.badge-nopin { font-size: 11px; color: var(--ink-muted); border: 1px dashed var(--border-strong); padding: 0 6px; border-radius: 4px; }
.part-buy-pair { display: flex; gap: 5px; }
.cart-line-price { font-size: 14px; }
.diagram-img { height: auto; }

/* v2 layout fixes */
.assembly-strip { grid-template-columns: none !important; grid-auto-flow: column; grid-auto-columns: 220px; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 8px; }
.assembly-card { scroll-snap-align: start; }
@media (max-width: 640px) {
  .header-inner { padding-left: 12px; padding-right: 12px; }
  .home-wrap { padding-left: 12px; padding-right: 12px; }
  .header-nav .tab-count { display: none; }
  .cart-trigger span:not(.cart-badge) { display: none; }
  .assembly-strip { grid-auto-columns: 168px; gap: 8px; }
  .assembly-card { padding: 8px; gap: 8px; }
  .assembly-thumb { width: 48px; height: 36px; }
  .assembly-card-title { font-size: 12.5px; line-height: 1.3; }
  .cat-dir { grid-template-columns: 1fr; }
  .catalog-wrap, .product-wrap { padding-left: 12px; padding-right: 12px; }
}

/* trust strip: sub-conditions line */
.trust-pill small { display:block; font-size:11px; font-weight:400; color:#3f6212; line-height:1.35; margin-top:2px; }

/* shop logo in header (replaces the "สว" text badge) */
.brand-logo { flex: 0 0 auto; display: block; width: 44px; height: 44px; }
.brand-logo img { width: 44px; height: 44px; border-radius: 10px; display: block; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
@media (max-width: 640px) { .brand-logo, .brand-logo img { width: 40px; height: 40px; } }


/* ==================== ผ่าเครื่องกึ่ง 3 มิติ (ทดลอง) ==================== */
.x3d-open-btn { background: #B91C1C !important; color: #fff !important; border-color: #B91C1C !important; font-weight: 700; }
.x3d-open-btn[hidden] { display: none !important; }
body.x3d-open { overflow: hidden; }
.x3d-modal { position: fixed; inset: 0; z-index: 1000; background: radial-gradient(ellipse at 50% 40%, #FFFCF5 0%, #EFE7D6 100%); display: flex; flex-direction: column; }
.x3d-modal[hidden] { display: none; }
.x3d-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid #E2D7BF; background: rgba(255,252,245,.9); }
.x3d-title b { display: block; font-size: 16px; color: #14171C; }
.x3d-title span { font-size: 12.5px; color: #8A7A55; }
.x3d-close { width: 42px; height: 42px; border-radius: 50%; border: 1px solid #D9CDB2; background: #fff; font-size: 18px; cursor: pointer; flex: none; }
.x3d-scene { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; perspective: 1400px; overflow: hidden; touch-action: none; cursor: grab; padding: 10px; }
.x3d-scene:active { cursor: grabbing; }
.x3d-plane { position: relative; width: min(96vw, 1150px, calc((100vh - 230px) * 2)); transform-style: preserve-3d; transition: none; }
.x3d-ghost { position: absolute; inset: 0; width: 100%; height: 100%; mix-blend-mode: multiply; pointer-events: none; user-select: none; }
.x3d-layers, .x3d-pins { position: absolute; inset: 0; transform-style: preserve-3d; }
.x3d-part { position: absolute; display: block; pointer-events: none; user-select: none; will-change: transform; filter: drop-shadow(3px 8px 7px rgba(60,40,10,.22)); }
.x3d-pins { transform: translateZ(140px); opacity: 0; pointer-events: none; transition: opacity .3s; }
.x3d-pins.show { opacity: 1; pointer-events: auto; }
.x3d-pin { position: absolute; transform: translate(-50%,-50%); min-width: 24px; height: 24px; padding: 0 5px; border-radius: 12px; border: 2px solid #fff; background: #B91C1C; color: #fff; font-size: 12px; font-weight: 700; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.x3d-pin.is-ask { background: #6B7280; }
.x3d-bar { padding: 10px 14px 14px; background: rgba(255,252,245,.95); border-top: 1px solid #E2D7BF; }
.x3d-slider { display: flex; align-items: center; gap: 10px; font-size: 14px; color: #3A2E1A; font-weight: 600; max-width: 640px; margin: 0 auto; }
.x3d-slider input { flex: 1; accent-color: #B91C1C; height: 28px; }
.x3d-btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.x3d-btns button { min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid #D9CDB2; background: #fff; font-size: 14px; cursor: pointer; }
.x3d-btns #x3dPlay { background: #B91C1C; color: #fff; border-color: #B91C1C; font-weight: 600; }
.x3d-hint { margin: 8px auto 0; max-width: 640px; text-align: center; font-size: 12px; color: #6B5E44; line-height: 1.5; }
@media (max-width: 600px) { .x3d-plane { width: 98vw; } .x3d-hint { display: none; } }
