/* =========================================================
   估價機（/valuation/、/office/）專用樣式
   只在這兩頁載入（functions.php）。所有選擇器以 .bw-estimator 開頭，不污染其他頁。
   表單基礎（文字欄位、select、label、送出鈕）由主題 .bw-form 接手；
   這裡補的是 .bw-form 沒管到的：number 欄位、fieldset、勾選格線、結果區、表格。
   ========================================================= */

.bw-estimator-wrap { display: flex; flex-direction: column; gap: 1.4rem; }

/* 免責提示：奶茶淺底＋奶茶左線，深藍字 */
.bw-estimator__notice {
	background: var(--bw-tan-light); color: var(--bw-navy);
	border-left: 4px solid var(--bw-tan); border-radius: 0 10px 10px 0;
	padding: .9rem 1.1rem; margin: 0; font-size: .93rem; line-height: 1.7;
}

/* ---------- 表單 ---------- */
.bw-estimator__title { font-size: 1.3rem; margin: 0 0 1rem; padding-bottom: .6rem; border-bottom: 2px solid var(--bw-tan); }

.bw-estimator input[type="number"] {
	width: 100%; font: inherit; padding: .7rem .9rem; border: 1.5px solid var(--bw-rule); border-radius: 10px;
	background: #fff; color: var(--bw-ink); -moz-appearance: textfield;
}
.bw-estimator input[type="number"]:focus { border-color: var(--bw-navy); outline: none; box-shadow: 0 0 0 3px rgba(42, 59, 89, .12); }

.bw-estimator__set { border: 1px solid var(--bw-rule); border-radius: 12px; padding: 1.1rem 1.2rem .2rem; margin: 0 0 1.2rem; min-width: 0; }
.bw-estimator__set legend { font-weight: 800; color: var(--bw-navy); padding: 0 .5rem; font-size: 1.02rem; }

.bw-estimator__row { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bw-estimator__row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* 勾選格線：覆蓋 .bw-form label 的 block／粗體，改成一行一個勾選 */
.bw-estimator__checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem .9rem; margin-bottom: 1rem; }
.bw-estimator label.bw-estimator__check {
	display: flex; align-items: center; gap: .5rem; font-weight: 500; color: var(--bw-ink);
	margin: 0 0 .5rem; font-size: .93rem; cursor: pointer;
}
.bw-estimator .bw-estimator__check input { accent-color: var(--bw-navy); width: 18px; height: 18px; margin: 0; flex: 0 0 auto; }

.bw-estimator__submit { margin-top: .4rem; }
/* 辦公室版是 type="button"，主題只樣式化 submit，這裡補齊成同一個樣子 */
.bw-estimator button {
	width: 100%; font: 700 1rem var(--bw-sans); background: var(--bw-navy); color: #fff; border: 0; border-radius: 10px;
	padding: .95rem; cursor: pointer; transition: background .2s; margin-top: .6rem;
}
.bw-estimator button:hover { background: var(--bw-navy-dark); }

/* 「標籤＋輸入」一行（辦公室版） */
.bw-estimator__kv { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: .5rem 1rem; align-items: center; margin-bottom: .45rem; }
.bw-estimator__kv label { margin: 0; }
.bw-estimator__hint { font-size: .83rem; color: var(--bw-muted); border-left: 2px solid var(--bw-rule); padding-left: .7rem; margin: 0 0 1rem; line-height: 1.6; }
.bw-estimator__sub { font-size: 1rem; color: var(--bw-navy); margin: 1.4rem 0 .7rem; padding-top: 1rem; border-top: 1px solid var(--bw-rule); }

/* ---------- 結果區 ---------- */
.bw-estimator__result {
	background: #fff; border: 1px solid var(--bw-rule); border-top: 4px solid var(--bw-tan); border-radius: var(--bw-radius);
	padding: 1.4rem 1.4rem 1.6rem; box-shadow: var(--bw-shadow); margin-top: 1.2rem;
}
.bw-estimator__result h2 { font-size: 1.35rem; margin: 0 0 1rem; text-align: center; }
.bw-estimator__result h3 { font-size: 1.1rem; margin: 0 0 .8rem; }
.bw-estimator__breakdown h3 { margin-top: 1.4rem; }

.bw-estimator__summary { text-align: center; margin-bottom: 1.2rem; }
.bw-estimator__summary p { margin: 0 0 .5rem; color: var(--bw-muted); }
.bw-estimator__total {
	display: inline-block; font: 800 clamp(1.4rem, 4.5vw, 2rem)/1.2 var(--bw-round); font-variant-numeric: tabular-nums;
	color: var(--bw-navy); background: var(--bw-cream); border-radius: 12px; padding: .7rem 1.2rem;
}

/* 明細表：手機可橫向捲動，不撐破版面 */
.bw-estimator__scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.bw-estimator__result table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 480px; }
.bw-estimator__result th { background: var(--bw-navy); color: #fff; text-align: left; padding: .6rem .75rem; font-weight: 700; white-space: nowrap; }
.bw-estimator__result td { padding: .6rem .75rem; border-bottom: 1px solid var(--bw-rule); vertical-align: top; }
.bw-estimator__result td:nth-child(2) { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bw-estimator__result tbody tr:nth-child(even) td { background: var(--bw-cream); }
.bw-estimator__result tfoot td { background: var(--bw-tan-light); color: var(--bw-navy); font-weight: 700; }
.bw-estimator__result td em { font-style: normal; color: var(--bw-muted); font-size: .88em; }

.bw-estimator__notes { background: var(--bw-cream); border: 1px solid var(--bw-rule); border-radius: 10px; padding: 1rem 1.1rem; font-size: .9rem; margin-top: 1.2rem; line-height: 1.7; }
.bw-estimator__notes h4 { margin: 0 0 .6rem; font-size: 1rem; }
.bw-estimator__notes p { margin: .5rem 0; }
.bw-estimator__notes ul { margin: .2rem 0 .6rem; padding-left: 1.2rem; color: var(--bw-ink); }
.bw-estimator__final { color: #8A2A20; }

.bw-estimator__next { text-align: center; margin-top: 1.5rem; padding-top: 1.2rem; border-top: 1px solid var(--bw-rule); }
.bw-estimator__next h3 { margin-top: 0; }
.bw-estimator__next .wp-block-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; }

/* 逐行結果（辦公室版）：名稱靠左、金額靠右等寬數字 */
.bw-estimator__lines { margin: 0; display: grid; gap: 0; }
.bw-estimator__lines > div { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px dashed var(--bw-rule); font-size: .95rem; }
.bw-estimator__lines dt { color: var(--bw-muted); margin: 0; }
.bw-estimator__lines dd { margin: 0; font-family: var(--bw-round); font-variant-numeric: tabular-nums; font-weight: 700; color: var(--bw-navy); white-space: nowrap; }
.bw-estimator__lines > div.is-total { border-bottom: 0; border-top: 2px solid var(--bw-navy); margin-top: .3rem; padding-top: .7rem; }
.bw-estimator__lines > div.is-total dt { color: var(--bw-ink); font-weight: 700; }
.bw-estimator__lines .bw-estimator__grand { font-size: 1.3rem; }
.bw-estimator__summary-card { border-top-color: var(--bw-navy); }
.bw-estimator__foot { font-size: .85rem; color: var(--bw-muted); margin: .9rem 0 0; line-height: 1.6; }

/* ---------- 手機 ---------- */
@media (max-width: 640px) {
	.bw-estimator__row, .bw-estimator__row--3, .bw-estimator__kv { grid-template-columns: 1fr; }
	.bw-estimator__set { padding: .9rem .9rem .1rem; }
	.bw-estimator__result { padding: 1.1rem 1rem 1.3rem; }
	.bw-estimator__total { display: block; }
	.bw-estimator__lines > div { flex-direction: column; gap: .1rem; }
	.bw-estimator__lines dd { white-space: normal; }
	.bw-estimator__next .wp-block-button { width: 100%; }
	.bw-estimator__next .wp-block-button__link { display: block; text-align: center; }
}
