/* ===============================
  FILTER / TOOLBAR
=============================== */
.order-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 26px;
}

.order-toolbar select,
.order-toolbar input,
.order-form input,
.order-form textarea {
  border: 1px solid #d8dee4;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: #111;
  box-sizing: border-box;
}

.order-toolbar select,
.order-toolbar input {
  min-width: 180px;
}

.order-toolbar .search {
  min-width: 260px;
}

/* ===============================
  SUMMARY BAR
=============================== */
.order-summary-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 0 0 24px;
  padding: 18px 22px;
  border: 1px solid #eceff1;
  border-radius: 18px;
  background: rgba(255,255,255,0.95);
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.04);
}

.cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.cart-badge {
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

/* ===============================
  TABLE
=============================== */
.order-table-wrap {
  overflow-x: auto;
  border: 1px solid #eceff1;
  border-radius: 20px;
  background: rgba(255,255,255,0.96);
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.04);
}

.order-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.order-table th,
.order-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #edf1f3;
  font-size: 14px;
  vertical-align: middle;
}

.order-table th {
  background: #f8faf9;
  color: #46505b;
  font-size: 12px;
  letter-spacing: 0.06em;
}

.order-table tbody tr:hover {
  background: #fbfcfc;
}

.order-table .qty-input {
  width: 72px;
  border: 1px solid #d8dee4;
  border-radius: 10px;
  padding: 10px 12px;
  text-align: center;
}

.order-table .stock-zero {
  color: #aa4c4c;
  font-weight: 500;
}

.order-table .stock-ok {
  color: #295e4a;
  font-weight: 500;
}

/* ===============================
  BUTTONS
=============================== */
.order-table .mini-btn,
.cart-actions .mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  background: linear-gradient(180deg, #124636 0%, #0c3b2e 100%);
  color: #fff;
  border: 0;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
  word-break: keep-all;
}

.order-table .mini-btn {
  min-width: 118px;
}

.order-table .mini-btn[disabled] {
  background: #c7cdd3;
  cursor: not-allowed;
  box-shadow: none;
}

.order-table td:last-child {
  width: 140px;
}

/* ===============================
  LAYOUT
=============================== */
.cart-grid,
.confirm-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 28px;
}

.panel {
  border: 1px solid #eceff1;
  border-radius: 20px;
  background: rgba(255,255,255,0.96);
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.04);
  padding: 28px;
}

.panel h2 {
  font-size: 22px;
  margin: 0 0 18px;
}

/* ===============================
  LIST / ITEM
=============================== */
.cart-list,
.confirm-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cart-item,
.confirm-item {
  border: 1px solid #edf1f3;
  border-radius: 16px;
  padding: 18px;
  display: grid;
  gap: 8px;
}

.cart-item-header,
.confirm-item-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.item-meta {
  color: #5f6874;
  font-size: 13px;
  line-height: 1.7;
}

/* ===============================
  CART
=============================== */
.cart-qty-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.cart-qty-row input {
  width: 72px;
  border: 1px solid #d8dee4;
  border-radius: 10px;
  padding: 10px 12px;
  text-align: center;
}

.cart-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.link-btn {
  color: #4a5563;
  text-decoration: none;
}

.link-btn:hover {
  text-decoration: underline;
}

/* ===============================
  FORM（checkoutを元の見やすさへ戻す）
=============================== */
.order-form {
  display: grid;
  gap: 18px;
}

.order-form .field {
  display: grid;
  gap: 8px;
}

.order-form label {
  font-size: 13px;
  color: #4a5563;
  font-weight: 500;
}

.order-form input {
  width: 100%;
  max-width: 100%;
}

.order-form textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ===============================
  KEY VALUE / SUMMARY
=============================== */
.key-value {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px 16px;
  font-size: 14px;
  line-height: 1.8;
}

.key-value dt {
  color: #6c7480;
}

.key-value dd {
  margin: 0;
}

.notice {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 14px;
  background: #f7faf8;
  color: #4c5866;
  font-size: 13px;
  line-height: 1.8;
}

.total-box {
  display: grid;
  gap: 12px;
}

.total-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
}

.total-line strong {
  font-size: 18px;
  color: #0c3b2e;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #5f6874;
}

/* ===============================
  COMPLETE ACTIONS
=============================== */
.complete-actions {
  margin-top: 32px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.subtle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  background: #ffffff;
  color: #0c3b2e;
  border: 1px solid #d8dee4;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.subtle-btn:hover {
  background: #f7faf8;
  border-color: #bcc6ce;
  transform: translateY(-1px);
}

/* ===============================
  TOAST
=============================== */
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  background: #0c3b2e;
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  box-shadow: 0 14px 28px rgba(12, 59, 46, 0.24);
  font-size: 13px;
  letter-spacing: 0.02em;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-show {
  opacity: 1;
  transform: translateY(0);
}

/* ===============================
  RESPONSIVE
=============================== */
@media (max-width: 900px) {
  .cart-grid,
  .confirm-grid,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .order-summary-bar,
  .cart-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .complete-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .complete-actions .btn,
  .complete-actions .subtle-btn {
    width: 100%;
  }
}
/* ===============================
  UI TUNING
=============================== */

/* フィルター領域をひとかたまりに見せる */
.order-toolbar {
  padding: 16px;
  border: 1px solid #eceff1;
  border-radius: 18px;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.03);
  margin-bottom: 22px;
}

/* フィルター要素を少し強調 */
.order-toolbar select,
.order-toolbar input {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.order-toolbar select:focus,
.order-toolbar input:focus {
  outline: none;
  border-color: #7fa595;
  box-shadow: 0 0 0 4px rgba(12, 59, 46, 0.08);
  background: #fff;
}

/* 選択済みっぽさを少し出す */
.order-toolbar select:not([value=""]),
.order-toolbar input:not(:placeholder-shown) {
  background: #fcfdfc;
}

/* 件数表示を少し強く */
.order-summary-bar strong {
  font-size: 18px;
  color: #0c3b2e;
}

/* テーブルの可読性向上 */
.order-table tbody tr:nth-child(even) {
  background: #fcfcfc;
}

.order-table tbody tr:hover {
  background: #f7faf8;
}

/* ヘッダー固定感を少し出す */
.order-table th {
  position: sticky;
  top: 0;
  z-index: 1;
}

/* 商品番号とモデルの見やすさを少し改善 */
.order-table td:nth-child(3),
.order-table td:nth-child(5) {
  font-weight: 500;
}

/* 在庫なし行の視認性UP */
.order-table tr.is-out-of-stock {
  background: #fafafa !important;
  opacity: 0.72;
}

.order-table tr.is-out-of-stock:hover {
  background: #f7f7f7 !important;
}

/* 在庫なしボタンはさらに弱く */
.order-table .mini-btn[disabled] {
  background: #cfd5da;
  color: #f8fafb;
}

/* カート追加ボタンを少し強化 */
.order-table .mini-btn {
  min-width: 118px;
  white-space: nowrap;
  word-break: keep-all;
  text-align: center;
  justify-content: center;
  letter-spacing: 0.02em;
  font-weight: 600;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.order-table .mini-btn:not([disabled]):hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(12, 59, 46, 0.18);
}

/* 数量inputも少し押しやすく */
.order-table .qty-input {
  background: #fff;
}

.order-table .qty-input:focus {
  outline: none;
  border-color: #7fa595;
  box-shadow: 0 0 0 4px rgba(12, 59, 46, 0.08);
}

/* 在庫表示の見せ方 */
.order-table .stock-ok {
  display: inline-block;
  min-width: 40px;
}

.order-table .stock-zero {
  display: inline-block;
  min-width: 52px;
}

/* 結果なし */
.empty-state {
  text-align: center;
  padding: 52px 20px;
  color: #5f6874;
  font-size: 14px;
  line-height: 1.8;
}

/* カートボタンを少し目立たせる */
.order-summary-bar .btn {
  white-space: nowrap;
}

/* フィルター変更時に結果へ目線が流れやすいよう、テーブル上に余白 */
.order-table-wrap {
  scroll-margin-top: 24px;
}

/* モバイル微調整 */
@media (max-width: 900px) {
  .order-toolbar {
    padding: 14px;
  }

  .order-summary-bar {
    align-items: stretch;
  }

  .order-summary-bar .btn {
    text-align: center;
  }
}