:root {
  --black: #111111;
  --red: #e02323;
  --dark-red: #b91515;
  --gray: #666;
  --light: #f6f6f7;
  --line: #e6e6e8;
  --white: #ffffff;
  --shadow: 0 18px 45px rgba(0,0,0,.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  color: var(--black);
  background: var(--white);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 76px;
  padding: 0 6vw;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: var(--black); color: white;
  border-radius: 12px;
  font-weight: 900;
}
.brand span { display: block; color: var(--gray); font-size: 12px; }

nav { display: flex; gap: 24px; }
nav a { color: var(--black); text-decoration: none; font-weight: 600; font-size: 14px; }

button { cursor: pointer; border: 0; font-weight: 800; border-radius: 12px; }
.primary-btn {
  background: var(--red);
  color: white;
  padding: 14px 22px;
  box-shadow: 0 12px 26px rgba(224,35,35,.22);
}
.primary-btn:hover { background: var(--dark-red); }
.ghost-btn, .small-btn {
  background: white;
  color: var(--black);
  border: 1px solid var(--line);
  padding: 13px 20px;
}
.small-btn { padding: 11px 16px; }

.hero {
  min-height: 620px;
  padding: 90px 6vw;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 50px;
  align-items: center;
  background:
    radial-gradient(circle at 78% 35%, rgba(224,35,35,.12), transparent 34%),
    linear-gradient(135deg, #fff, #f7f7f8);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--red);
  font-weight: 900;
  font-size: 13px;
}

h1 { font-size: clamp(44px, 6vw, 78px); line-height: .95; margin: 0 0 22px; }
h2 { font-size: clamp(30px, 4vw, 46px); margin: 0; }
.hero-text { color: var(--gray); font-size: 19px; max-width: 630px; line-height: 1.65; }
.hero-actions { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }

.hero-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.fake-preview {
  background: #fafafa;
  border: 1px dashed #bbb;
  border-radius: 22px;
  padding: 30px;
}
.fake-preview svg { width: 100%; height: auto; }
.fake-preview path, .fake-preview circle {
  fill: none;
  stroke: #111;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.quote-chip {
  margin-top: 18px;
  background: var(--black);
  color: white;
  display: inline-block;
  padding: 12px 16px;
  border-radius: 999px;
  font-weight: 900;
}

.steps {
  padding: 22px 6vw;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  background: var(--black);
}
.step {
  color: white;
  background: rgba(255,255,255,.08);
  padding: 16px;
  border-radius: 16px;
  font-weight: 900;
}
.step span { color: #ddd; margin-left: 8px; font-weight: 700; }

.materials-section, .checkout {
  padding: 90px 6vw;
}
.section-heading { max-width: 720px; margin-bottom: 35px; }
.section-heading p { color: var(--gray); }

.material-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 18px;
}
.material-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  background: white;
  box-shadow: 0 8px 24px rgba(0,0,0,.05);
}
.metal-texture { height: 110px; }
.material-body { padding: 18px; }
.material-body p { color: var(--gray); min-height: 58px; }
.price { color: var(--red); font-weight: 900; margin-bottom: 14px; }

.quote-app {
  padding: 90px 6vw;
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 26px;
  background: var(--light);
}
.sidebar {
  background: white;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
  height: fit-content;
  position: sticky;
  top: 98px;
}
.sidebar ol { padding-left: 20px; line-height: 2.4; color: var(--gray); font-weight: 700; }
.sidebar .active { color: var(--red); }

.quote-panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 24px;
  box-shadow: var(--shadow);
}
.progress {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}
.progress span {
  background: var(--light);
  padding: 12px 8px;
  border-radius: 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}
.progress .active { background: var(--red); color: white; }

.upload-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px;
}
.upload-card p { color: var(--gray); line-height: 1.6; }
.dropzone {
  min-height: 210px;
  border: 2px dashed #bbb;
  background: #fafafa;
  border-radius: 20px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 26px;
  margin-top: 18px;
}
.upload-icon {
  width: 58px; height: 58px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--red);
  color: white;
  font-size: 34px;
  font-weight: 900;
}
.dropzone span { color: var(--gray); }

.file-list {
  margin-top: 18px;
  display: grid;
  gap: 16px;
}
.file-item {
  display: grid;
  grid-template-columns: minmax(220px, 360px) 1fr auto;
  gap: 18px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: white;
}
.part-preview {
  min-height: 210px;
  background: #fbfbfb;
  border: 1px solid #ddd;
  border-radius: 14px;
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
}
.part-preview img,
.part-preview iframe,
.part-preview object {
  width: 100%;
  height: 210px;
  border: 0;
  object-fit: contain;
  background: white;
}
.part-preview svg {
  width: 94%;
  height: 200px;
}
.part-preview path, .part-preview circle, .part-preview line, .part-preview polyline {
  fill: none;
  stroke: #111;
  stroke-width: 2.5;
}
.preview-note {
  position: absolute;
  left: 10px;
  bottom: 10px;
  right: 10px;
  font-size: 11px;
  background: rgba(17,17,17,.82);
  color: white;
  padding: 7px 9px;
  border-radius: 10px;
}
.file-meta small { display: block; color: var(--gray); margin-top: 4px; }
.file-meta code {
  display: inline-block;
  background: var(--light);
  padding: 4px 7px;
  border-radius: 8px;
  margin-top: 8px;
}

.config-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.config-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
}
select, input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 15px;
  background: white;
}

.summary {
  margin-top: 20px;
  background: var(--black);
  color: white;
  border-radius: 24px;
  padding: 24px;
  display: flex;
  justify-content: space-between;
  gap: 22px;
}
.summary p, .price-box small { color: #d0d0d0; }
.price-box {
  min-width: 280px;
  background: rgba(255,255,255,.08);
  border-radius: 18px;
  padding: 18px;
}
.price-box span, .price-box small { display: block; }
.price-box strong { display: block; font-size: 38px; margin: 8px 0; }

.checkout-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr .8fr;
  gap: 18px;
}
.checkout-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  display: grid;
  gap: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.05);
}
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.full { width: 100%; }

footer {
  padding: 40px 6vw;
  background: var(--black);
  color: white;
}
footer p { color: #ccc; }

@media (max-width: 980px) {
  nav { display: none; }
  .hero, .quote-app, .checkout-grid { grid-template-columns: 1fr; }
  .steps, .material-grid, .config-grid, .progress { grid-template-columns: 1fr 1fr; }
  .sidebar { position: static; }
  .file-item { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .topbar { padding: 0 18px; }
  .hero, .materials-section, .quote-app, .checkout { padding: 56px 18px; }
  .steps, .material-grid, .config-grid, .progress, .two-col { grid-template-columns: 1fr; }
  .summary { flex-direction: column; }
}

.ai-warning {
  padding: 24px;
  text-align: center;
  align-content: center;
}
.ai-warning strong {
  display: block;
  margin: 10px 0;
}
.ai-warning p {
  color: var(--gray);
  max-width: 320px;
  margin: 8px auto;
  line-height: 1.45;
}
.ai-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: #2a1300;
  color: #ff9b2f;
  border: 2px solid #ff9b2f;
  display: grid;
  place-items: center;
  margin: 0 auto;
  font-weight: 900;
  font-size: 26px;
}

.part-preview iframe {
  display: block;
  background: #ffffff;
}


.preview-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

.zoom-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 12;
}

.zoom-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid #ccc;
  background: rgba(255,255,255,.95);
  font-size: 22px;
  font-weight: 900;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,.08);
}

.zoom-btn:hover {
  background: #f2f2f2;
}

.zoom-target {
  transform-origin: center center;
  transition: transform .2s ease;
}


.pan-controls {
  position: absolute;
  left: 10px;
  top: 10px;
  display: grid;
  grid-template-columns: 36px 36px 36px;
  grid-template-rows: 36px 36px 36px;
  gap: 6px;
  z-index: 12;
}

.pan-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid #ccc;
  background: rgba(255,255,255,.95);
  font-size: 18px;
  font-weight: 900;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,.08);
}

.pan-btn:hover {
  background: #f2f2f2;
}

.pan-up { grid-column: 2; grid-row: 1; }
.pan-left { grid-column: 1; grid-row: 2; }
.pan-center { grid-column: 2; grid-row: 2; font-size: 14px; }
.pan-right { grid-column: 3; grid-row: 2; }
.pan-down { grid-column: 2; grid-row: 3; }

.preview-wrapper {
  overflow: hidden;
  cursor: grab;
}

.preview-wrapper.dragging {
  cursor: grabbing;
}

.zoom-target {
  will-change: transform;
}


/* Clear zoom fix:
   SVG and DXF are vector and zoom cleanly.
   PDF/AI previews use native PDF zoom to avoid stretched/pixelated previews. */
.pdf-preview-frame {
  width: 100%;
  height: 210px;
  border: 0;
  background: #ffffff;
}

.part-preview svg {
  shape-rendering: geometricPrecision;
  text-rendering: geometricPrecision;
}

.zoom-target {
  image-rendering: auto;
  backface-visibility: hidden;
}


/* Clean preview controls update */
.preview-note {
  display: none !important;
}

.preview-wrapper {
  overflow: hidden;
  cursor: grab;
}

.preview-wrapper.dragging {
  cursor: grabbing;
}

.zoom-controls {
  top: auto !important;
  right: auto !important;
  left: 50% !important;
  bottom: 14px !important;
  transform: translateX(-50%);
  flex-direction: row !important;
  background: rgba(255,255,255,.92);
  border: 1px solid #e1e1e1;
  border-radius: 16px;
  padding: 8px;
  box-shadow: 0 10px 28px rgba(0,0,0,.12);
}

.pan-controls {
  left: auto !important;
  top: 50% !important;
  right: 14px !important;
  transform: translateY(-50%);
  background: rgba(255,255,255,.92);
  border: 1px solid #e1e1e1;
  border-radius: 16px;
  padding: 8px;
  box-shadow: 0 10px 28px rgba(0,0,0,.12);
}

.zoom-btn,
.pan-btn {
  background: #ffffff;
}

.part-preview {
  min-height: 360px;
}

.part-preview img,
.part-preview iframe,
.part-preview object {
  height: 360px;
}

.pdf-preview-frame {
  height: 360px !important;
}


/* Move pan buttons completely outside the preview object */
.file-item {
  grid-template-columns: minmax(280px, 520px) 1fr 135px !important;
  align-items: stretch !important;
}

.preview-wrapper .pan-controls {
  display: none !important;
}

.preview-side-controls {
  display: grid;
  place-items: center;
  min-width: 120px;
}

.preview-side-controls .pan-controls {
  position: static !important;
  transform: none !important;
  display: grid !important;
  background: rgba(255,255,255,.96);
  border: 1px solid #e1e1e1;
  border-radius: 18px;
  padding: 10px;
  box-shadow: 0 10px 28px rgba(0,0,0,.10);
}

.part-preview {
  width: 100%;
}

@media (max-width: 980px) {
  .file-item {
    grid-template-columns: 1fr !important;
  }

  .preview-side-controls {
    min-width: 100%;
    place-items: start;
  }

  .preview-side-controls .pan-controls {
    margin-top: 6px;
  }
}


.remove-file-btn {
  margin-top: 12px;
  background: #fff1f1;
  color: #d71919;
  border: 1px solid #ffd0d0;
  padding: 11px 16px;
  border-radius: 12px;
  font-weight: 900;
  cursor: pointer;
}

.remove-file-btn:hover {
  background: #d71919;
  color: #ffffff;
}

.file-meta .status-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}


/* Laser cutting preflight guideline cards */
.guideline-master-card {
  margin-top: 18px;
  border: 1px solid #e4e7ec;
  background: #fbfcfd;
  border-radius: 18px;
  padding: 18px;
}

.guideline-master-card h3 {
  margin: 0 0 8px;
}

.guideline-master-card p,
.guideline-master-card li {
  color: #5c6573;
  line-height: 1.55;
}

.guideline-master-card ul {
  margin: 10px 0 0;
  padding-left: 20px;
}

.preflight-card {
  margin-top: 14px;
  border: 1px solid #e4e7ec;
  border-radius: 16px;
  background: #ffffff;
  overflow: hidden;
}

.preflight-header {
  padding: 12px 14px;
  font-weight: 900;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.preflight-status-pass {
  color: #0f8a3b;
}

.preflight-status-warn {
  color: #b7791f;
}

.preflight-status-fail {
  color: #c62828;
}

.preflight-list {
  padding: 0 14px 14px;
  display: grid;
  gap: 8px;
}

.preflight-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 8px;
  color: #4b5563;
  line-height: 1.42;
  font-size: 14px;
}

.preflight-item.pass strong {
  color: #0f8a3b;
}

.preflight-item.warn strong {
  color: #b7791f;
}

.preflight-item.fail strong {
  color: #c62828;
}

.preflight-dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
  margin-top: 1px;
}

.preflight-item.pass .preflight-dot {
  background: #e7f7ed;
  color: #0f8a3b;
}

.preflight-item.warn .preflight-dot {
  background: #fff7e6;
  color: #b7791f;
}

.preflight-item.fail .preflight-dot {
  background: #ffecec;
  color: #c62828;
}

.minimum-rule-box {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f6f8fb;
  color: #4b5563;
  font-size: 13px;
  line-height: 1.4;
}


.tube-profile-box {
  margin-top: 10px;
  padding: 12px;
  border-radius: 12px;
  background: #f4f7fb;
  color: #4b5563;
  font-size: 13px;
  line-height: 1.45;
}

.tube-profile-box strong {
  color: #111111;
}

.tube-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3843a3;
  font-size: 12px;
  font-weight: 900;
}


/* Compact preflight badge + popup */
.preflight-card,
.tube-preflight-card {
  display: none !important;
}

.preflight-mini {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.preflight-mini-btn {
  border: 1px solid #e3e7ef;
  background: #ffffff;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  box-shadow: 0 4px 12px rgba(0,0,0,.06);
}

.preflight-mini-btn.pass {
  color: #0f8a3b;
  border-color: #ccebd7;
  background: #f3fbf6;
}

.preflight-mini-btn.warn {
  color: #9a6400;
  border-color: #ffe1a8;
  background: #fff9ed;
}

.preflight-mini-btn.fail {
  color: #c62828;
  border-color: #ffd0d0;
  background: #fff4f4;
}

.preflight-mini-dot {
  width: 9px;
  height: 9px;
  border-radius: 99px;
  background: currentColor;
}

.preflight-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, .55);
  display: none;
  z-index: 9999;
  padding: 24px;
}

.preflight-modal-overlay.open {
  display: grid;
  place-items: center;
}

.preflight-modal {
  width: min(760px, 96vw);
  max-height: 82vh;
  overflow: auto;
  background: #ffffff;
  border-radius: 22px;
  box-shadow: 0 30px 90px rgba(0,0,0,.28);
  border: 1px solid #e7e7e7;
}

.preflight-modal-header {
  position: sticky;
  top: 0;
  background: white;
  padding: 18px 22px;
  border-bottom: 1px solid #eeeeee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  z-index: 2;
}

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

.preflight-modal-close {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: #f4f4f5;
  font-size: 22px;
  line-height: 1;
}

.preflight-modal-body {
  padding: 18px 22px 22px;
}

.preflight-modal-body .preflight-card,
.preflight-modal-body .tube-preflight-card {
  display: block !important;
  margin-top: 0;
}

.preflight-modal-body .preflight-card + .preflight-card {
  margin-top: 14px;
}

.fit-vector-note {
  margin-top: 8px;
  color: #667085;
  font-size: 12px;
}

/* Give preview more clean working space */
.part-preview {
  background: #ffffff !important;
}


/* Per-file material/thickness/quantity controls */
.config-grid {
  display: none !important;
}

.file-item {
  grid-template-columns: minmax(280px, 430px) 1fr 135px !important;
}

.file-options {
  margin-top: 14px;
  border: 1px solid #e8ebf0;
  background: #fbfcff;
  border-radius: 16px;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 10px;
}

.file-option label {
  display: block;
  font-size: 12px;
  font-weight: 900;
  color: #4b5563;
  margin-bottom: 6px;
}

.file-option select,
.file-option input {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid #d9dee7;
  border-radius: 10px;
  background: white;
  font-size: 13px;
}

.file-line-price {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #111111;
  color: #ffffff;
  font-weight: 900;
  display: inline-block;
}

.file-line-price small {
  display: block;
  color: #d3d3d3;
  font-weight: 600;
  margin-top: 2px;
}

@media (max-width: 720px) {
  .file-options {
    grid-template-columns: 1fr;
  }
}


.part-count-box {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff8e8;
  border: 1px solid #ffe1a8;
  color: #805500;
  font-size: 13px;
  font-weight: 800;
}

.part-count-box small {
  display: block;
  color: #7a6a4b;
  font-weight: 600;
  margin-top: 4px;
}

.part-count-manual {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 8px;
  align-items: center;
}

.part-count-manual label {
  font-size: 12px;
  font-weight: 900;
  color: #4b5563;
}

.part-count-manual input {
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid #d9dee7;
}


/* Automatic design count only */
.part-count-manual {
  display: none !important;
}

.part-count-box {
  background: #eef7ff !important;
  border-color: #b9ddff !important;
  color: #175c8f !important;
}

.part-count-box strong {
  color: #0f3e63;
}

.auto-count-pill {
  display: inline-block;
  margin-top: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #cce7ff;
  color: #175c8f;
  font-size: 12px;
  font-weight: 900;
}

.part-size-list {
  margin-top: 6px;
  color: #596579;
  font-size: 12px;
  line-height: 1.35;
}

.part-count-manual { display: none !important; }
.part-count-box small { display: block; margin-top: 4px; }
.file-line-price small { line-height: 1.35; }

.part-size-list {
  max-width: 780px;
  line-height: 1.45;
}
