/* Jinaria Logistics — 顾客端物流样式
   Codex 复核 v2：包裹卡片 + 自适应 Grid，配色复用 Pawcoo 主题变量（--gold/--cream/--ink/--line 等） */

.jp-track { max-width: 640px; margin: 28px auto 0; text-align: left; }
.jp-track-form .fr.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.jp-track-form label { display: block; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted, #8b8377); font-weight: 600; }
.jp-track-form input { width: 100%; margin-top: 6px; padding: 12px 14px; border: 1px solid var(--line, #e9e1d1); border-radius: 4px; font-family: var(--sans, Arial); font-size: 15px; color: var(--ink, #201c16); background: var(--white, #fff); }
.jp-track-form input:focus { outline: none; border-color: var(--gold, #c6a15b); }
.jp-track-result { margin-top: 20px; overflow-x: auto; }
.jp-alert { padding: 12px 16px; border-radius: 6px; margin: 14px 0; font-size: 14px; color: var(--ink, #201c16); background: var(--cream-2, #f5efe1); border: 1px solid var(--line, #e9e1d1); }
.jp-alert.err { background: #fdecea; border: 1px solid #f0c9c3; color: #b3261e; }

/* ========== 包裹卡片（所有端共用视觉容器） ========== */
.jp-pkg-card {
  background: var(--white, #ffffff);
  border: 1px solid var(--line, #e9e1d1);
  border-radius: 10px;
  padding: 18px 20px;
  margin: 0 0 18px;
  box-shadow: 0 1px 3px rgba(32, 28, 22, 0.05);
}
.jp-pkg-head { margin-bottom: 12px; }
.jp-pkg-title { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink, #201c16); letter-spacing: .02em; }

/* 信息区：三列等宽 Grid（桌面） */
.jp-pkg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.jp-pkg-field {
  background: var(--cream-2, #f5efe1);
  border-radius: 6px;
  padding: 10px 12px;
  min-width: 0;
}
.jp-pkg-label { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted, #8b8377); margin-bottom: 4px; font-weight: 600; }
.jp-pkg-value { display: block; font-size: 14px; color: var(--ink, #201c16); line-height: 1.5; }
.jp-tn { font-family: var(--mono, Consolas, Monaco, monospace); word-break: break-all; }
/* 状态：低饱和金棕色标签（不用大面积色块） */
.jp-pkg-status { display: inline-block; font-size: 13px; font-weight: 600; color: var(--gold-dark, #a8843c); background: var(--gold-soft, #e7d5ac); padding: 3px 10px; border-radius: 999px; line-height: 1.5; }

/* 按钮：深金棕底 + 白字，所有状态明确文字颜色（Codex 对比度 ≥4.5:1） */
.jp-pkg-actions { margin-top: 14px; display: flex; justify-content: flex-end; }
.jp-track-btn {
  display: inline-block;
  background: #806020;
  color: #ffffff !important;
  padding: 9px 20px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s;
}
.jp-track-btn:visited { color: #ffffff !important; }
.jp-track-btn:hover { background: #6d5219; color: #ffffff !important; text-decoration: none; }
.jp-track-btn:focus-visible { outline: 2px solid #806020; outline-offset: 2px; color: #ffffff !important; }

/* ========== 平板（iPad，601–1024px）：信息区两列，Status 占整行，按钮整行 ========== */
@media (max-width: 1024px) and (min-width: 601px) {
  .jp-pkg-grid { grid-template-columns: 1fr 1fr; }
  .jp-pkg-field:nth-child(3) { grid-column: 1 / -1; }
  .jp-pkg-actions { justify-content: stretch; }
  .jp-track-btn { width: 100%; text-align: center; }
}

/* ========== 手机（≤600px）：单列，按钮整行，无横向滚动 ========== */
@media (max-width: 600px) {
  .jp-pkg-card { padding: 14px 16px; }
  .jp-pkg-grid { grid-template-columns: 1fr; }
  .jp-pkg-actions { justify-content: stretch; }
  .jp-track-btn { width: 100%; text-align: center; }
  .jp-track-form .fr.two { grid-template-columns: 1fr; }
  .jp-timeline { padding-left: 14px; }
  .jp-timeline-item { padding-left: 14px; }
}

/* ========== 时间线（各端通用，金色主题） ========== */
.jp-ship-timeline { margin: 0 0 26px; }
.jp-timeline-title { margin: 0 0 12px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted, #8b8377); font-weight: 700; }
.jp-timeline { list-style: none; margin: 0; padding: 0 0 0 20px; border-left: 2px solid var(--gold, #c6a15b); }
.jp-timeline-item { position: relative; padding: 0 0 16px 18px; }
.jp-timeline-item:last-child { padding-bottom: 0; }
.jp-timeline-item::before { content: ''; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--gold, #c6a15b); }
.jp-timeline-time { display: block; font-size: 12px; color: var(--muted, #8b8377); margin-bottom: 2px; }
.jp-timeline-status { display: block; font-weight: 600; font-size: 14px; color: var(--ink, #201c16); }
.jp-timeline-loc { display: block; font-size: 13px; color: var(--muted, #8b8377); }
.jp-timeline-desc { display: block; font-size: 13px; color: var(--ink-2, #5b5348); }
.jp-reg-status { font-size: 11px; background: var(--cream-2, #f5efe1); color: var(--muted, #8b8377); padding: 2px 6px; border-radius: 3px; margin-left: 6px; }

/* ========== 订单详情页整体美化（My Account → View Order） ========== */
.woocommerce-table--order-details { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.6; margin: 0 0 26px; }
.woocommerce-table--order-details th,
.woocommerce-table--order-details td { border: 1px solid var(--line, #e9e1d1); padding: 12px 16px; text-align: left; vertical-align: middle; }
.woocommerce-table--order-details thead th { background: var(--cream-2, #f5efe1); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--ink, #201c16); }
.woocommerce-table--order-details tbody tr:nth-child(even) { background: var(--cream, #fbf8ef); }
.woocommerce-table--order-details tfoot th { background: var(--cream, #fbf8ef); font-weight: 600; }
.woocommerce-table--order-details tfoot td { background: var(--cream, #fbf8ef); }
.woocommerce-table--order-details tfoot tr.order-total th,
.woocommerce-table--order-details tfoot tr.order-total td { font-size: 16px; font-weight: 700; }
.woocommerce-order-details__title,
.woocommerce-order-details h2,
.woocommerce-customer-details h2,
.woocommerce-customer-details h3 { font-family: inherit; font-size: 18px; color: var(--ink, #201c16); margin: 28px 0 14px; }
.woocommerce-customer-details address { font-style: normal; line-height: 1.8; padding: 0; border: 0; margin: 0 0 26px; }
@media (max-width: 600px) {
  .woocommerce-table--order-details th,
  .woocommerce-table--order-details td { padding: 9px 12px; font-size: 13px; }
}

/* ========== v1.2.1：双层展示 / 新鲜度 / 复制 / 时间线展开 ========== */
.jp-progress { display: flex; align-items: center; flex-wrap: wrap; gap: 0; margin: 0 0 20px; padding: 14px 16px; background: #fff; border: 1px solid var(--line, #e9e1d1); border-radius: 8px; }
.jp-progress-step { font-size: 12px; font-weight: 700; color: var(--muted, #8a7f6d); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.jp-progress-step.on { color: var(--gold-dark, #806020); }
.jp-progress-bar { flex: 1; min-width: 18px; height: 3px; margin: 0 8px; border-radius: 2px; background: var(--line, #e9e1d1); }
.jp-progress-bar.on { background: var(--gold-dark, #806020); }
.jp-pkg-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.jp-pkg-fresh { font-size: 12px; font-weight: 600; color: var(--muted, #8a7f6d); }
.jp-pkg-fresh:empty { display: none; }
.jp-last-updated { font-size: 12px; color: var(--muted, #8a7f6d); margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line, #e9e1d1); }
.jp-copy-tn { margin-left: 8px; padding: 2px 10px; font-size: 11px; font-weight: 600; color: #fff; background: var(--gold-dark, #806020); border: 0; border-radius: 4px; cursor: pointer; vertical-align: middle; }
.jp-copy-tn:hover, .jp-copy-tn:focus-visible { background: #6d531b; outline: none; }
.jp-timeline-more { display: none; }
.jp-show-full { margin-top: 10px; padding: 8px 16px; font-size: 12px; font-weight: 600; color: var(--gold-dark, #806020); background: #fff; border: 1px solid var(--gold-dark, #806020); border-radius: 4px; cursor: pointer; }
.jp-show-full:hover, .jp-show-full:focus-visible { background: var(--cream, #fbf8ef); outline: none; }

/* ========== v1.3.0：My Account 订单列表配送进度摘要 ========== */
.jp-myorders-progress { font-size: 13px; line-height: 1.5; }
.jp-myorders-progress strong { color: #333; }
.jp-myorders-progress small { color: #8a7f6d; font-size: 12px; }
.jp-myorders-empty { color: #b0a893; font-size: 13px; }

/* 移动端：订单表格换行为卡片，配送进度列正常显示（不挤压原有列） */
@media (max-width: 768px) {
  .woocommerce-orders-table__cell-jp-logistics-progress { display: block; padding-top: 4px; }
  .jp-myorders-progress { margin-bottom: 6px; }
}

/* ========== v1.3.1：后台订单列表列宽优化（Codex 服务器复测意见） ========== */
@media (min-width: 783px) {
  body.woocommerce_page_wc-orders .wp-list-table .column-jp_logistics_status,
  body.post-type-shop_order .wp-list-table .column-jp_logistics_status {
    width: 30% !important;
    min-width: 240px;
    word-break: normal;
    overflow-wrap: break-word;
    line-height: 1.4;
  }
  body.woocommerce_page_wc-orders .wp-list-table .column-jp_logistics_status small,
  body.post-type-shop_order .wp-list-table .column-jp_logistics_status small {
    line-height: 1.4;
  }
  body.woocommerce_page_wc-orders .wp-list-table .column-order_status,
  body.post-type-shop_order .wp-list-table .column-order_status {
    width: 90px !important;
  }
  body.woocommerce_page_wc-orders .wp-list-table .column-order_origin,
  body.post-type-shop_order .wp-list-table .column-order_origin {
    width: 72px !important;
  }
}
