/* ==========================================================================
   FOG Tank Model Viewer
   Layout follows the approved mockup; colours and type follow fogtank.com
   (Work Sans 800 headings, Montserrat body, lime CTA gradient, deep green).
   Everything is scoped to .ftv so the host theme cannot restyle it.
   ========================================================================== */

.ftv {
  --ftv-green: #1F7949;
  --ftv-green-deep: #16643A;
  --ftv-lime: #8DC44B;
  --ftv-lime-soft: #ACE06E;
  --ftv-ink: #272626;
  --ftv-text: #3c3e3e;
  --ftv-muted: #6b6f6f;
  --ftv-line: #e3e6e4;
  --ftv-line-strong: #d3d8d5;
  --ftv-tint: #f2f8eb;
  --ftv-tint-strong: #e6f2d8;
  --ftv-panel: #f6f7f6;
  --ftv-head: "Work Sans", "Helvetica Neue", Arial, sans-serif;
  --ftv-body: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --ftv-radius: 6px;

  display: block;
  background: #fff;
  color: var(--ftv-text);
  font-family: var(--ftv-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.ftv *, .ftv *::before, .ftv *::after { box-sizing: border-box; }
.ftv :where(h2, h3, p, ul, li, table, figure) { margin: 0; padding: 0; }
.ftv :where(h2, h3) { -webkit-hyphens: manual; hyphens: manual; overflow-wrap: normal; }
/* fogtank.com styles every <button> unless it carries .no-style; the viewer's buttons do. */
.ftv button.no-style { min-width: 0; }
.ftv :where(button) {
  font: inherit; color: inherit; background: none; border: 0; margin: 0; padding: 0;
  cursor: pointer; text-transform: none; letter-spacing: normal; box-shadow: none;
}
.ftv img { display: block; max-width: 100%; height: auto; border: 0; image-rendering: auto; }
.ftv svg { image-rendering: auto; }
.ftv svg { display: block; flex: none; }
/* Themes underline content links (Astra: .ast-single-post .entry-content a). */
.ftv a, .ftv a:hover, .ftv a:focus, .ftv a:visited { text-decoration: none !important; }
.ftv :focus-visible { outline: 2px solid var(--ftv-green); outline-offset: 2px; }

.ftv-sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Page-builder templates strip max-width from content children
   (Astra: .ast-page-builder-template .entry-content[data-ast-blocks-layout] > *). */
.ftv .ftv-wrap { max-width: 1240px !important; margin-left: auto !important; margin-right: auto !important; padding: 36px 24px 44px; }

.ftv-grid {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr) 340px;
  gap: 0 30px;
  align-items: start;
}

/* ---------------------------------------------------------------- rail */
.ftv-back {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 8px 0 22px; padding: 2px 0;
  font-family: var(--ftv-body); font-size: 13px; font-weight: 700;
  letter-spacing: .02em; text-transform: uppercase; color: var(--ftv-green);
}
.ftv-back svg { width: 20px; height: 20px; }
.ftv-back:hover { color: var(--ftv-green-deep); }

.ftv-rail-list { display: flex; flex-direction: column; gap: 10px; }

.ftv-card {
  position: relative;
  display: grid !important;
  grid-template-columns: 80px 1fr 16px;
  align-items: center; gap: 0 10px;
  width: 100%; min-height: 88px; padding: 8px 12px;
  text-align: left; background: #fff;
  border: 1px solid var(--ftv-line) !important; border-radius: var(--ftv-radius) !important;
  transition: border-color .18s, background-color .18s, box-shadow .18s;
}
.ftv-card:hover { border-color: var(--ftv-line-strong) !important; box-shadow: 0 2px 10px rgba(30, 40, 30, .06); }
.ftv-card[aria-pressed="true"] {
  background: var(--ftv-tint);
  border-color: var(--ftv-green) !important;
  box-shadow: inset 0 0 0 1px var(--ftv-green);
}
.ftv-card img { width: 80px; height: 64px; object-fit: contain; }
.ftv-card-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ftv-card-code {
  font-family: var(--ftv-head); font-weight: 800; font-size: 21px; line-height: 1.1;
  color: var(--ftv-ink); letter-spacing: -.01em;
}
.ftv-card-sub { font-size: 12.5px; color: var(--ftv-muted); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ftv-card svg { width: 16px; height: 16px; color: var(--ftv-green); }

/* --------------------------------------------------------------- stage */
.ftv-stage { min-width: 0; padding-top: 2px; }

.ftv-viewer {
  position: relative;
  aspect-ratio: 5 / 4;
  width: 100%;
  cursor: grab;
  touch-action: pan-y;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
  border-radius: var(--ftv-radius);
}
.ftv-viewer.is-dragging { cursor: grabbing; }
.ftv-frame {
  position: absolute; inset: 0; width: 100%; height: 100% !important;
  object-fit: contain; pointer-events: none;
  transition: opacity .2s ease;
}
.ftv-viewer.is-swapping .ftv-frame { opacity: 0; }

.ftv-nav {
  position: absolute; top: 46%; z-index: 2;
  display: grid !important; place-items: center;
  width: 46px; height: 46px; border-radius: 50% !important;
  background: rgba(244, 247, 242, .92) !important;
  border: 1px solid var(--ftv-line) !important;
  color: var(--ftv-green) !important;
  transform: translateY(-50%);
  transition: background-color .18s, border-color .18s;
}
.ftv-nav:hover { background: var(--ftv-tint-strong) !important; border-color: var(--ftv-lime) !important; }
.ftv-nav svg { width: 22px; height: 22px; }
.ftv-prev { left: 4px; }
.ftv-next { right: 4px; }

.ftv-progress {
  position: absolute; left: 50%; bottom: 6px; width: 120px; height: 3px; margin-left: -60px;
  background: var(--ftv-line); border-radius: 3px; overflow: hidden;
  transition: opacity .4s;
}
.ftv-progress span { display: block; height: 100%; width: 0; background: var(--ftv-lime); transition: width .2s; }
.ftv-progress.is-done { opacity: 0; }

.ftv-360 {
  display: flex; flex-direction: column; align-items: center;
  margin: 4px auto 18px; color: var(--ftv-ink);
}
.ftv-360-mark { position: relative; width: 92px; height: 40px; }
.ftv-360-mark svg { position: absolute; inset: 0; width: 92px; height: 40px; color: var(--ftv-ink); }
.ftv-360-deg {
  position: absolute; left: 0; right: 0; top: 2px; text-align: center;
  font-family: var(--ftv-head); font-weight: 800; font-size: 23px; line-height: 1; color: var(--ftv-ink);
}
.ftv-360-hint { margin-top: 4px; font-size: 13px; color: var(--ftv-text); }

.ftv-thumbs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.ftv-thumb {
  display: flex !important; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 4px 8px; background: #fff;
  border: 1px solid var(--ftv-line) !important; border-radius: var(--ftv-radius) !important;
  transition: border-color .18s, box-shadow .18s;
}
.ftv-thumb:hover { border-color: var(--ftv-line-strong) !important; }
.ftv-thumb[aria-pressed="true"] { border-color: var(--ftv-green) !important; box-shadow: inset 0 0 0 1px var(--ftv-green); }
.ftv-thumb img { width: 100%; aspect-ratio: 5 / 4; object-fit: contain; }
.ftv-thumb span { font-size: 12px; color: var(--ftv-text); line-height: 1.2; text-align: center; }

/* ---------------------------------------------------------------- info */
.ftv-info { min-width: 0; }
.ftv-eyebrow {
  padding-bottom: 7px; margin-bottom: 14px !important;
  border-bottom: 1px solid var(--ftv-line-strong);
  font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ftv-muted);
}
.ftv .ftv-title {
  margin: 0 !important;
  font-family: var(--ftv-head); font-weight: 800; font-size: 36px; line-height: 1.05;
  letter-spacing: -.015em; color: var(--ftv-ink); text-transform: none;
}
/* themes add a bottom margin to every content <p> (Astra: 1.6em) */
.ftv .ftv-tagline {
  margin: 8px 0 0 !important;
  font-size: 13.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ftv-green);
}
.ftv-desc { margin: 12px 0 18px !important; font-size: 14px; line-height: 1.55; color: var(--ftv-text); }

.ftv-box { border: 1px solid var(--ftv-line-strong); border-radius: 4px; margin-bottom: 14px; overflow: hidden; background: #fff; }
.ftv .ftv-box-head {
  margin: 0 !important;
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; background: var(--ftv-tint);
  border-bottom: 1px solid var(--ftv-line-strong);
  font-family: var(--ftv-body); font-size: 13.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ftv-green-deep); line-height: 1.3;
}
.ftv-box-head svg { width: 16px; height: 16px; color: var(--ftv-green); }

.ftv .ftv-specs table { width: 100%; border-collapse: collapse; border: 0; margin: 0 !important; background: none; }
.ftv-specs th, .ftv-specs td {
  padding: 7px 12px; border: 0; border-top: 1px solid var(--ftv-line);
  font-size: 12.75px; line-height: 1.35; text-align: left; vertical-align: top; background: none;
}
.ftv-specs tr:first-child th, .ftv-specs tr:first-child td { border-top: 0; }
.ftv-specs th { font-weight: 500; color: var(--ftv-text); }
.ftv-specs th .ftv-nb { white-space: nowrap; font-size: 11.5px; color: var(--ftv-muted); }
.ftv-specs td { width: 1%; white-space: nowrap; color: var(--ftv-ink); font-weight: 600; border-left: 1px solid var(--ftv-line); }

.ftv-fits-body { display: grid; grid-template-columns: 1fr 52px; }
.ftv-fit { display: grid; grid-template-columns: 46px 1fr; gap: 12px; align-items: center; padding: 11px 0 11px 14px; }
.ftv-fit + .ftv-fit { border-top: 1px solid var(--ftv-line); }
.ftv-fit svg { width: 46px; height: 38px; color: var(--ftv-ink); }
.ftv-fit strong { display: block; font-size: 13px; font-weight: 700; color: var(--ftv-ink); line-height: 1.3; }
.ftv-fit small { display: block; margin-top: 2px; font-size: 11.5px; color: var(--ftv-muted); }
.ftv-or {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 0; font-size: 12px; font-weight: 700; color: var(--ftv-ink); letter-spacing: .04em;
}
.ftv-or::before, .ftv-or::after { content: ""; width: 1px; flex: 1; background: var(--ftv-line-strong); }

.ftv-btn {
  display: flex !important; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 50px; padding: 12px 18px; margin-top: 12px;
  border-radius: 4px; font-family: var(--ftv-body); font-size: 14px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; line-height: 1.2; text-align: center;
  transition: filter .18s, background-color .18s, color .18s, box-shadow .18s;
}
.ftv-btn svg { width: 20px; height: 20px; }
.ftv-btn-primary {
  margin-top: 16px;
  background: linear-gradient(to top, var(--ftv-lime), var(--ftv-lime-soft));
  color: var(--ftv-ink) !important;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .04), inset 0 -1px 0 rgba(0, 0, 0, .06);
}
.ftv-btn-primary:hover { filter: brightness(1.04) saturate(1.05); box-shadow: 0 4px 14px rgba(141, 196, 75, .35); }
.ftv-btn-outline { background: #fff; color: var(--ftv-ink) !important; border: 1.5px solid var(--ftv-ink); }
.ftv-btn-outline:hover { background: var(--ftv-ink); color: #fff !important; }

/* --------------------------------------------------------------- trust */
.ftv-trust {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 38px; padding-top: 28px; border-top: 1px solid var(--ftv-line);
}
.ftv-trust-item { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 4px 18px; }
.ftv-trust-item + .ftv-trust-item { border-left: 1px solid var(--ftv-line-strong); }
.ftv-trust-item svg { width: 38px; height: 38px; color: var(--ftv-green); }
.ftv-trust-item strong { display: block; font-size: 14.5px; font-weight: 600; color: var(--ftv-ink); line-height: 1.3; }
.ftv-trust-item span { display: block; font-size: 13px; color: var(--ftv-muted); line-height: 1.3; }

/* fallback content (no JS / before JS renders) */
.ftv-fallback { max-width: 1240px; margin: 0 auto; padding: 24px; }
.ftv-fallback h3 { font-family: var(--ftv-head); font-weight: 800; font-size: 20px; color: var(--ftv-ink); margin: 18px 0 6px; }
.ftv-fallback ul { margin: 0 0 0 18px; }

/* ---------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .ftv-grid { grid-template-columns: 214px minmax(0, 1fr) 316px; gap: 0 22px; }
  .ftv-card { grid-template-columns: 64px 1fr 14px; gap: 0 9px; padding: 8px 10px; min-height: 78px; }
  .ftv-card img { width: 64px; height: 52px; }
  .ftv-card-code { font-size: 19px; }
  .ftv .ftv-title { font-size: 32px; }
}

@media (max-width: 980px) {
  .ftv-grid { grid-template-columns: minmax(0, 1fr) 300px; gap: 0 24px; }
  .ftv-rail { grid-column: 1 / -1; margin-bottom: 18px; }
  .ftv-back { margin: 0 0 14px; }
  .ftv-rail-list {
    flex-direction: row; overflow-x: auto; gap: 10px; padding: 2px 2px 8px;
    scroll-snap-type: x proximity; scrollbar-width: thin;
  }
  .ftv-card { flex: 0 0 212px; scroll-snap-align: start; }
  .ftv-card-sub { white-space: normal; }
}

@media (max-width: 760px) {
  .ftv .ftv-wrap { padding: 24px 16px 32px; }
  .ftv-grid { grid-template-columns: minmax(0, 1fr); }
  .ftv-card { flex-basis: 196px; grid-template-columns: 60px 1fr 14px; min-height: 72px; }
  .ftv-card img { width: 60px; height: 48px; }
  .ftv-card-code { font-size: 18px; }
  .ftv-nav { width: 40px; height: 40px; }
  .ftv-thumbs { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 88px; overflow-x: auto; padding-bottom: 6px; }
  .ftv-info { margin-top: 22px; }
  .ftv .ftv-title { font-size: 30px; }
  .ftv-trust { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 0; }
  .ftv-trust-item { justify-content: flex-start; padding: 4px 12px; }
  .ftv-trust-item:nth-child(3) { border-left: 0; }
}

@media (max-width: 420px) {
  .ftv-trust { grid-template-columns: minmax(0, 1fr); }
  .ftv-trust-item + .ftv-trust-item { border-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .ftv *, .ftv *::before, .ftv *::after { transition: none !important; }
}
