/* ==========================================================================
   quote.css — ระบบขอใบเสนอราคา (เลือกงาน → สเปก → รายการ → ส่ง)
   ========================================================================== */

/* แถบเข้มเต็มจอ: หัวข้อ+เช็คลิสต์แนวนอนด้านบน แล้วฟอร์ม/รายการเต็มความกว้างด้านล่าง */
.quote-band { overflow: hidden; }
.quote-intro { align-items: center; margin-bottom: 40px; }
.quote-intro .section-title,
.quote-intro .section-lead { margin-bottom: 0; }
.quote-intro__list { display: flex; flex-direction: column; gap: 10px; flex: none; }
.quote-intro__list li { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #dce8f9; white-space: nowrap; }
.quote-intro__list svg { width: 18px; height: 18px; color: var(--c-open); flex: none; }

.quote {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 24px;
  align-items: start;
}

.panel {
  padding: 28px;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.panel__title { margin: 0; font-size: 18px; }

/* ---------- Step heading ---------- */
.q-step { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 16px; color: var(--c-navy); }
.q-step span {
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--c-primary);
  color: #fff;
  font-size: 13px;
}
.q-step--inline { display: inline-flex; margin: 0; }
.q-block + .q-block { margin-top: 28px; padding-top: 24px; border-top: 1px dashed var(--c-line); }

/* ---------- Type picker (radio cards) ---------- */
.type-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.type-pick__opt { position: relative; }
.type-pick__opt input { position: absolute; opacity: 0; pointer-events: none; }
.type-pick__opt label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  padding: 14px 8px 12px;
  border: 1.5px solid var(--c-line);
  border-radius: var(--radius);
  background: #fff;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  color: var(--c-navy);
  cursor: pointer;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.type-pick__opt label svg { width: 26px; height: 26px; color: var(--c-primary); }
.type-pick__opt label:hover { border-color: #b3cbeb; }
.type-pick__opt input:checked + label {
  border-color: var(--c-primary);
  background: var(--c-tint);
  box-shadow: 0 0 0 3px rgba(22, 86, 184, .12);
}
.type-pick__opt input:focus-visible + label { outline: 3px solid rgba(47, 143, 224, .45); outline-offset: 2px; }

/* ---------- Spec grid ---------- */
.q-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.q-grid .col-2 { grid-column: span 2; }
.q-grid .col-3 { grid-column: span 3; }
.q-grid .col-6 { grid-column: 1 / -1; }

/* Stepper จำนวน */
.qty-wrap { display: flex; gap: 8px; }
.qty-wrap .input { flex: 1; }

/* ตัวเลือกเสริม (checkbox chips) */
.opt-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.opt-chip input { position: absolute; opacity: 0; pointer-events: none; }
.opt-chip span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--c-line);
  border-radius: 999px;
  background: #fff;
  font-size: 13.5px;
  color: var(--c-navy-2);
  cursor: pointer;
  transition: all .2s;
}
.opt-chip span::before {
  content: "";
  width: 14px; height: 14px;
  border: 1.5px solid #b3c5dd;
  border-radius: 4px;
  transition: all .2s;
}
.opt-chip input:checked + span { border-color: var(--c-primary); background: var(--c-tint); color: var(--c-primary); font-weight: 700; }
.opt-chip input:checked + span::before {
  border-color: var(--c-primary);
  background: var(--c-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E") center / 10px no-repeat;
}
.opt-chip input:focus-visible + span { outline: 3px solid rgba(47, 143, 224, .45); outline-offset: 2px; }

/* ---------- Upload + submit ---------- */
.q-foot {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: stretch;
  margin-top: 20px;
}
.upload {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px dashed #bcd0ea;
  border-radius: var(--radius-sm);
  background: var(--c-tint-2);
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.upload:hover { border-color: var(--c-sky); background: var(--c-tint); }
.upload svg { width: 30px; height: 30px; flex: none; color: var(--c-primary); }
.upload strong { display: block; font-size: 14px; color: var(--c-navy); word-break: break-all; }
.upload small { display: block; font-size: 12px; color: var(--c-muted); line-height: 1.4; }
.upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.q-foot__btns { display: flex; gap: 8px; }
.q-foot .btn { min-width: 180px; }
.quote-form.is-editing .q-foot .btn--primary { background: var(--c-navy-2); }

/* ---------- Cart (sticky) ---------- */
.quote-cart { position: sticky; top: calc(var(--header-h) + 16px); }
.quote-ref {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: -4px 0 14px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--c-tint-2);
  font-size: 12.5px;
  color: var(--c-muted);
}
.quote-ref b { color: var(--c-navy); letter-spacing: .04em; }

.cart-count {
  margin-left: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--c-tint);
  color: var(--c-primary);
  font-size: 12.5px;
  font-weight: 700;
  vertical-align: middle;
}
.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--c-primary);
  font-size: 13px;
  font-weight: 700;
}
.link-btn:hover { text-decoration: underline; }

.cart { max-height: 330px; margin-bottom: 18px; overflow-y: auto; }
.cart__item {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid var(--c-line);
  animation: fade-up .3s var(--ease);
}
.cart__item.is-editing { background: var(--c-tint-2); margin-inline: -8px; padding-inline: 8px; border-radius: var(--radius-sm); }
.cart__thumb {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: var(--radius-sm);
  background: var(--c-tint);
  color: var(--c-primary);
}
.cart__thumb svg { width: 22px; height: 22px; }
.cart__name { margin: 0; font-size: 14.5px; font-weight: 700; color: var(--c-navy); line-height: 1.4; }
.cart__meta { margin: 0; font-size: 12.5px; color: var(--c-muted); line-height: 1.55; }
.cart__tools { display: flex; gap: 2px; }
.cart__tool {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #8ea2bf;
}
.cart__tool svg { width: 16px; height: 16px; }
.cart__tool:hover { background: var(--c-tint); color: var(--c-primary); }
.cart__tool--del:hover { background: #fdecec; color: #d93b3b; }
.cart__empty {
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 26px 12px;
  border: 1px dashed var(--c-line);
  border-radius: var(--radius);
  color: var(--c-muted);
  font-size: 14px;
  text-align: center;
}
.cart__empty svg { width: 34px; height: 34px; color: #b6c8e0; }

.quote-contact { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
.quote-contact .col-full { grid-column: 1 / -1; }
.quote-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.quote-actions .btn--line,
.quote-actions .btn--navy { grid-column: 1 / -1; }
.quote-note { margin: 12px 0 0; font-size: 12.5px; color: var(--c-muted); text-align: center; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%; bottom: 28px;
  z-index: 400;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 32px);
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--c-navy);
  color: #fff;
  font-size: 14.5px;
  box-shadow: var(--shadow);
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- พื้นที่สำหรับพิมพ์ใบขอราคา (แสดงเฉพาะตอนพิมพ์) ---------- */
.print-area { display: none; }
