/* 询盘弹窗 Quote modal — inc/quote-modal.php + assets/js/quote-modal.js */
.qm { position: fixed; inset: 0; z-index: 100010; display: flex; align-items: center; justify-content: center; padding: 20px; }
.qm[hidden] { display: none; }
.qm__backdrop { position: absolute; inset: 0; background: rgba(7, 22, 41, .62); backdrop-filter: blur(3px); animation: qmfade .2s ease; }
.qm__dialog { position: relative; width: 100%; max-width: 760px; max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); display: flex; flex-direction: column; background: #fff; border-radius: 14px; box-shadow: 0 24px 70px rgba(7, 22, 41, .35); overflow: hidden; animation: qmpop .24s cubic-bezier(.2, .8, .2, 1); }
@keyframes qmfade { from { opacity: 0; } }
@keyframes qmpop { from { opacity: 0; transform: translateY(14px) scale(.98); } }
html.qm-lock, html.qm-lock body { overflow: hidden; }

/* Head */
.qm__head { position: relative; padding: 22px 64px 0 28px; background: var(--navy); color: #fff; background-image: radial-gradient(circle at 100% 0, rgba(242, 101, 34, .28), transparent 55%); }
.qm__kicker { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--orange-2); }
.qm__kicker .ico { width: 15px; height: 15px; }
.qm__title { margin: 0; font-size: 24px; line-height: 1.25; color: #fff; }
.qm__sub { margin: 6px 0 0; font-size: 14px; color: rgba(255, 255, 255, .78); }
.qm__sub strong { color: #fff; }
.qm__x { position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .1); color: #fff; cursor: pointer; transition: background .15s; }
.qm__x:hover { background: var(--orange); }
.qm__x .ico { width: 20px; height: 20px; }
.qm__steps { display: flex; gap: 22px; margin: 18px 0 0; padding: 0; list-style: none; font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, .55); }
.qm__steps li { display: flex; align-items: center; gap: 8px; padding-bottom: 12px; border-bottom: 3px solid transparent; }
.qm__steps li span { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .14); font-size: 12px; }
.qm__steps li.is-on { color: #fff; border-color: var(--orange); }
.qm__steps li.is-on span { background: var(--orange); }
.qm__steps li.is-done span { background: var(--wa); }

/* Body */
.qm__form { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 22px 28px 24px; }
.qm__step { margin: 0; padding: 0; border: 0; min-width: 0; }
.qm__row { margin-bottom: 18px; }
.qm__lbl { margin: 0 0 8px; font-size: 14px; font-weight: 700; color: var(--ink); }
.qm__lbl small { font-weight: 500; color: var(--muted); }
.qm em { color: var(--orange); font-style: normal; }

.qm__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.qchip { position: relative; cursor: pointer; }
.qchip input { position: absolute; opacity: 0; pointer-events: none; }
.qchip span { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border: 1.5px solid var(--line); border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink-2); background: #fff; transition: border-color .15s, background .15s, color .15s; }
.qchip span::before { content: ""; width: 14px; height: 14px; border: 1.5px solid #b8c1cd; border-radius: 4px; flex: none; transition: all .15s; }
.qchip:hover span { border-color: var(--navy); }
.qchip input:checked + span { border-color: var(--orange); background: #fff3ec; color: var(--orange-dark); }
.qchip input:checked + span::before { border-color: var(--orange); background: var(--orange) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 11px no-repeat; }
.qchip input:focus-visible + span { outline: 2px solid var(--orange); outline-offset: 2px; }
.qchip--sm span { padding: 6px 11px; font-size: 13px; font-weight: 500; }
.qchip--sm span::before { width: 12px; height: 12px; }

.qm__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; margin-bottom: 18px; }
.qf { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.qf--full { grid-column: 1 / -1; }
.qf > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.qf input, .qf select, .qf textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: var(--radius); font: inherit; font-size: 15px; color: var(--ink); background: #fff; transition: border-color .15s, box-shadow .15s; }
.qf textarea { min-height: 84px; resize: vertical; }
.qf select { appearance: none; padding-right: 34px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23677386' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 10px center / 16px no-repeat; }
.qf input:focus, .qf select:focus, .qf textarea:focus { outline: 0; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(242, 101, 34, .15); }
.qf input.is-bad { border-color: #d92d20; box-shadow: 0 0 0 3px rgba(217, 45, 32, .12); }
.qf input[readonly] { background: var(--grey); }
.qf__pair { display: grid; grid-template-columns: 1fr 170px; gap: 8px; }
.qf__tip { font-size: 12px; color: #b54708; }

.qm__err { margin: 0 0 12px; padding: 10px 12px; border-radius: var(--radius); background: #fdecec; color: #b42318; font-size: 14px; font-weight: 600; }
.qm__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.qm__foot .btn { min-height: 46px; }
.qm__hint, .qm__note { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; color: var(--muted); }
.qm__hint .ico, .qm__note .ico { width: 15px; height: 15px; color: var(--wa); flex: none; }
.qm__note { margin-top: 12px; }
.qm [data-qm-submit][disabled] { opacity: .7; cursor: progress; }
.qm [data-qm-submit].is-loading span::after { content: "…"; }

/* Done */
.qm__done { padding: 18px 0 6px; text-align: center; }
.qm__tick { width: 68px; height: 68px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 50%; background: #e8f6ee; color: #137a42; animation: qmpop .3s ease; }
.qm__tick .ico { width: 34px; height: 34px; stroke-width: 2.6; }
.qm__done h3 { margin: 0 0 8px; font-size: 22px; }
.qm__done p { max-width: 460px; margin: 0 auto 20px; color: var(--ink-2); }
.qm__done-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* Mobile: full-height bottom sheet */
@media (max-width: 640px) {
	.qm { padding: 0; align-items: flex-end; }
	.qm__dialog { max-width: none; max-height: 94vh; max-height: 94dvh; border-radius: 16px 16px 0 0; animation-name: qmsheet; }
	@keyframes qmsheet { from { transform: translateY(40px); opacity: 0; } }
	.qm__head { padding: 18px 56px 0 18px; }
	.qm__title { font-size: 20px; }
	.qm__sub { font-size: 13px; }
	.qm__form { padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); }
	.qm__grid { grid-template-columns: 1fr; }
	.qf input, .qf select, .qf textarea { font-size: 16px; } /* stops iOS zoom */
	.qf__pair { grid-template-columns: 1fr 140px; }
	.qm__hint { display: none; }
	.qm__foot { position: sticky; bottom: -18px; margin: 0 -18px; padding: 12px 18px; background: #fff; }
	.qm__foot .btn--primary { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
	.qm__backdrop, .qm__dialog, .qm__tick { animation: none; }
}
