@charset "utf-8";

.table-wrap {
  width: 100% !important;
  display: block !important;
  margin-bottom: 2rem;
  background: #fff;
  border: none;
  box-sizing: border-box;
}
.order-table {
  width: 100%;
  border-collapse: collapse;
  background-color: #fff;
  font-size: 0.9rem;
  border: 1px solid #ccc;
}
.order-table th,
.order-table td {
  padding: 10px 15px;
  border: 1px solid  var(--border-line-color);
  vertical-align: middle;
  word-break: break-all;
  line-height: 1.4;
  color: #333;
}
.order-table thead th {
  font-weight: bold;
  background-color: #f9f9f9;
  text-align: center;
  color: #333;
}
.order-table td {
  text-align: left;
}
.order-table td:first-child {
  text-align: center;
}
.order-table a {
  color: #333;
  text-decoration: none;
}
.order-table a:hover {
  text-decoration: underline;
  opacity: 0.7;
}
.w-5 {
  width: 5%;
}
.w-12 {
  width: 12%;
}
.w-23 {
  width: 23%;
}
.w-24 {
  width: 24%;
}
.bg-premium,
.bg-frame,
.bg-noframe,
.bg-disabled {
  text-align: center !important;
}
.bg-premium {
  background-color: #fffef2 !important;
  color: #333;
}
.bg-frame {
  background-color: #f5fffa !important;
  color: #333;
}
.bg-noframe {
  background-color: #fffafa !important;
  color: #333;
}
.bg-disabled {
  background-color: #f8f8f8 !important;
  color: #666;
  font-weight: bold;
}
.warning-box p.note-link {
  margin-top: 10px;
}
.table-wrap {
  scrollbar-width: thin;
  scrollbar-color: #ccc transparent;
}
.table-wrap::-webkit-scrollbar {
  height: 10px;
}
.table-wrap::-webkit-scrollbar-track {
  background: transparent;
}
.table-wrap::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 5px;
}
.table-wrap::-webkit-scrollbar-thumb:hover {
  background: #999;
}
.scroll-note {
  font-size: 0.8rem;
  margin-bottom: 5px;
  display: none;
  color: #333;
}
.order-table tbody tr:hover td.col-product {
  background-color: #f2f2f2 !important;
  transition: background-color 0.2s ease;
}
.order-table tbody td:hover {
  background-color: #f2f2f2 !important;
  transition: background-color 0.2s ease;
}
.order-table tbody td:first-child:hover {
  background-color: transparent !important;
}
.order-table tbody td:not(:first-child):not(.bg-disabled):hover {
  background-color: #f2f2f2 !important;
  transition: background-color 0.2s ease;
}
.order-table tbody td.bg-disabled {
  pointer-events: none;
}
.order-table td:has(a) {
  padding: 0 !important;
}
.order-table td a {
  display: block;
  width: 100%;
  height: 100%;
  padding: 10px 15px;
  box-sizing: border-box;
}

/* =========================================================
   モバイル・レスポンシブ (1023px以下) - 表を崩さず固定スクロール
   ========================================================= */
@media screen and (max-width: 1023px) {

  /* 1. スクロールの受け皿 */
  .table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
    padding-bottom: 15px; 
  }

  /* 2. 表のバグ回避設定（重要） */
  .order-table.list-mode {
    display: table !important;
    width: 100% !important;
    min-width: 800px;
    border-collapse: separate !important; 
    border-spacing: 0 !important;  
    border: none !important; 
    border-top: 1px solid var(--border-line-color) !important;
  }

  /* 3. 各セルのバグ回避設定 */
  .order-table.list-mode th,
  .order-table.list-mode td {
    display: table-cell !important;
    white-space: nowrap;
    vertical-align: middle;
    border: none !important; 
    border-bottom: 1px solid var(--border-line-color) !important; 
    border-right: 1px solid var(--border-line-color) !important;  
  }

  /* --- 以下、列の固定設定 --- */

  /* 1列目（No.）の固定 */
  .order-table.list-mode th:nth-child(1),
  .order-table.list-mode td:nth-child(1) {
    width: 45px !important;
    min-width: 45px !important;
    max-width: 45px !important;
    position: sticky;
    left: 0;
    z-index: 3; 
    background-color: #fff;
    border-left: 1px solid var(--border-line-color) !important;
  }
  .order-table.list-mode th:nth-child(1) {
    background-color: #f8f9fa;
  }

  /* 2列目（商品名）の固定 */
  .order-table.list-mode th:nth-child(2),
  .order-table.list-mode td:nth-child(2) {
    position: sticky;
    left: 45px; 
    z-index: 2; 
    background-color: #fff;
    box-shadow: none;
  }
  .order-table.list-mode th:nth-child(2) {
    background-color: #f8f9fa;
  }
}

@media screen and (min-width: 1024px) {
  .table-wrap {
    overflow-x: visible;
    padding-bottom: 0;
  }
  .order-table.list-mode {
    width: 100% !important;
    table-layout: fixed;
  }
  .order-table.profile-mode {
    width: 700px !important;
    margin: 0 auto;
  }
}