/*
 * 賣場「選擇物流與付款」（待選訂單卡片內）＋個人資料「常用物流與付款」
 * 階段三百二十五 5-5；程式在 public/src/js/_method-pick.js
 *
 * 手機優先（375px 不可橫向捲動）：輸入框與按鈕一律 width:100% + border-box；按鈕文字單行（nowrap + 省略號）；
 * 輸入框字級 16px（iOS 小於 16px 會在聚焦時放大整頁）。底部選單沿用 main.css 的 .picker-sheet（已是 dvh + safe-area）。
 */

/* 卡片內的區塊：位置同付款回報（金額之後），各自帶分隔線 */
.lm-mp {
  border-top: 1px solid #f3f4f6;
  margin-top: 12px;
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.lm-mp:empty { display: none; }

/* 個人資料分頁裡：外框由「常用物流與付款」卡片負責（階段三百三十九），這裡不再自己畫框 */
.lm-mp.lm-mp-profile {
  border: 0;
  border-radius: 0;
  margin-top: 0;
  padding: 0;
}

.lm-mp-title { font-size: 15px; font-weight: 700; color: #111827; }
.lm-mp-hint { font-size: 13px; color: #6b7280; line-height: 1.5; margin-top: -6px; }
.lm-mp-muted { font-size: 12px; color: #9ca3af; line-height: 1.5; }
.lm-mp-line { font-size: 13px; color: #92400e; line-height: 1.6; }

.lm-mp-notice,
.lm-mp-warn {
  font-size: 13px;
  line-height: 1.6;
  border-radius: 8px;
  padding: 8px 10px;
  word-break: break-word;
}
.lm-mp-notice { background: #ecfdf5; color: #065f46; }
.lm-mp-warn { background: #fef2f2; color: #b91c1c; }

.lm-mp-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lm-mp-label { font-size: 13px; font-weight: 600; color: #374151; }
.lm-mp-req { color: #ef4444; }

.lm-mp-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 16px;
  color: #111827;
  background: #fff;
  outline: none;
  min-width: 0;
}
.lm-mp-input:focus { border-color: var(--color-primary, #e5625e); }

/* 選擇鍵（點開底部選單）*/
.lm-mp-select {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  font-size: 15px;
  color: #111827;
  text-align: left;
  cursor: pointer;
  min-width: 0;
}
.lm-mp-select:disabled { background: #f9fafb; color: #9ca3af; cursor: not-allowed; }
.lm-mp-select-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lm-mp-select-text.is-placeholder { color: #9ca3af; }
.lm-mp-caret { flex-shrink: 0; color: #6b7280; font-size: 12px; }

/* 面交地點快選（點了填進地址）：會換行、長名稱在膠囊內換行，不撐寬 */
.lm-mp-chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.lm-mp-chip {
  max-width: 100%;
  box-sizing: border-box;
  padding: 6px 12px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #fff;
  color: #374151;
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
  word-break: break-word;
  cursor: pointer;
  touch-action: manipulation;
}
.lm-mp-chip.is-on { border-color: var(--color-primary, #e5625e); color: var(--color-primary, #e5625e); background: #fff7f6; font-weight: 600; }

.lm-mp-store-chosen { font-size: 14px; color: #111827; word-break: break-word; }

.lm-mp-btn {
  box-sizing: border-box;
  padding: 11px 16px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #374151;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  touch-action: manipulation;
}
.lm-mp-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.lm-mp-btn-primary { background: var(--color-primary, #e5625e); border-color: var(--color-primary, #e5625e); color: var(--color-on-primary, #fff); }
.lm-mp-btn-outline { border: 1px solid var(--color-primary, #e5625e); color: var(--color-primary, #e5625e); background: #fff; }
.lm-mp-full { display: block; width: 100%; text-align: center; }

.lm-mp-actions { display: flex; gap: 10px; }
.lm-mp-actions .lm-mp-btn { flex: 1; min-width: 0; }

.lm-mp-check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #374151; cursor: pointer; }
.lm-mp-check input { width: 18px; height: 18px; margin: 0; flex-shrink: 0; }

/* 金額（後端試算）*/
.lm-mp-sum { background: #f9fafb; border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.lm-mp-sum-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: #4b5563; }
.lm-mp-sum-row span:last-child { white-space: nowrap; }
.lm-mp-sum-row.is-total { font-size: 15px; font-weight: 700; color: #111827; border-top: 1px solid #e5e7eb; padding-top: 6px; margin-top: 2px; }
.lm-mp-sum-row.is-split { color: #993C1D; }

.lm-mp-note { font-size: 12px; color: #9ca3af; text-align: center; margin-top: -4px; }

/* S1：未登入時登入表單上方的說明 */
.lm-mp-login-notice {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 13px;
  line-height: 1.6;
}
.lm-mp-login-notice-title { font-size: 15px; font-weight: 700; margin-bottom: 2px; }

/* S6：`?pick=` 找不到那張訂單 */
.lm-mp-top-notice {
  background: #fef2f2;
  color: #b91c1c;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 13px;
  line-height: 1.6;
}

/* 提示（底部）*/
.lm-mp-toast {
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  box-sizing: border-box;
  background: rgba(17, 24, 39, 0.92);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  z-index: 3000;
  text-align: center;
  pointer-events: none;
}

/* 確認視窗（應付總額有變動、清除常用設定）*/
.lm-mp-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: rgba(17, 24, 39, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}
.lm-mp-dialog {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  max-height: 90dvh;
  overflow: auto;
  box-sizing: border-box;
  padding: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}
.lm-mp-dialog-title { font-size: 17px; font-weight: 700; color: #111827; margin-bottom: 6px; }
.lm-mp-dialog-text { font-size: 14px; color: #4b5563; line-height: 1.6; margin-bottom: 16px; word-break: break-word; }
.lm-mp-dialog-actions { display: flex; gap: 10px; }
.lm-mp-dialog-actions .lm-mp-btn { flex: 1; min-width: 0; }

/* S3 聚焦（`?pick=`／LINE 一次性連結）用 scrollIntoView({block:'start'}) 捲到卡片：
   賣場頂部 .sf-head 是 sticky（約 65px），沒留空間會把訂單編號與「待選物流付款」標籤蓋住（dev 實機驗收 2026-10-29） */
.order-lookup-page .order-card { scroll-margin-top: 80px; }
