/* Bootstrap 5 向後兼容性樣式 */
/* 用於支援從 Bootstrap 3.3.7 升級到 Bootstrap 5.3.3 的過渡 */

/* form-horizontal 類在 Bootstrap 5 中已被移除 */
/* 這裡提供基本的向後兼容 */
.form-horizontal .form-group {
  margin-bottom: 1rem;
}

/* Bootstrap 3 的 form-group 在 Bootstrap 5 中需要額外的樣式 */
.form-group.row {
  margin-bottom: 1rem;
}

/* 確保 label 和 input 在同一行的佈局 */
.form-horizontal .col-form-label {
  padding-top: calc(0.375rem + 1px);
  padding-bottom: calc(0.375rem + 1px);
  margin-bottom: 0;
  font-size: inherit;
  line-height: 1.5;
}

/* Bootstrap 3 的 noline 類（如果專案中有使用） */
.form-group.noline {
  border-bottom: none;
  padding-bottom: 0;
}

/* 確保按鈕組的間距 */
.btn + .btn {
  margin-left: 0.5rem;
}

/* 表格樣式兼容性 */
/* 確保 caption 在表格上方顯示 */
.table caption {
  caption-side: top;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  color: inherit;
  text-align: left;
}

/* 購物清單表格樣式 */
.carlist .table {
  margin-bottom: 2rem;
}

.carlist .table thead th {
  border-bottom: 2px solid #dee2e6;
  vertical-align: bottom;
}

.carlist .table td, 
.carlist .table th {
  padding: 0.75rem;
  vertical-align: middle;
}

/* 確保表格內的按鈕容器置中 */
.carlist .table td.text-center {
  text-align: center;
}

/* 移除按鈕表格的所有邊框 */
.carlist .table-borderless td,
.carlist .table-borderless th {
  border: none !important;
}

/* Bootstrap 5 的 text-center 確保正常運作 */
.text-center {
  text-align: center !important;
}
