.template {
  height: 100%;
}
.main-card {
  height: 100%;
}
.config-box {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.content {
  flex: 1;
}
.goods-switch-panel {
  box-sizing: border-box;
  padding: 0 0 0.18rem;
  margin-bottom: 0.24rem;
  border-bottom: 1px solid #E7EAF0;
  background: #fff;
}
.goods-switch-row {
  display: flex;
  align-items: flex-start;
  gap: 0.16rem;
}
.goods-switch-second-row {
  min-height: 0.44rem;
}
.goods-switch-list {
  display: flex;
  flex: 1;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0;
  border-bottom: 1px solid #E7EAF0;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.goods-switch-list::-webkit-scrollbar {
  display: none;
}
.goods-switch-list .goods-switch-tag.el-tag {
  position: relative;
  flex: 0 0 auto;
  max-width: 2.2rem;
  height: 0.44rem;
  padding: 0 0.2rem 0 0;
  margin-right: 0.28rem;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #7A8497;
  font-size: 0.13rem;
  line-height: 0.44rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.goods-switch-list .goods-switch-tag.el-tag::after {
  content: "";
  position: absolute;
  right: 0.2rem;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: transparent;
  transition: background 0.2s ease;
}
.goods-switch-list .goods-switch-tag.el-tag:hover {
  border-color: transparent;
  color: var(--color-primary);
  background: transparent;
}
.goods-switch-list .goods-switch-tag.el-tag:focus {
  outline: none;
  border-color: transparent;
  color: var(--color-primary);
  background: transparent;
  box-shadow: none;
}
.goods-switch-list .goods-switch-tag.el-tag.active {
  border-color: transparent;
  color: #1F2937;
  background: transparent;
  box-shadow: none;
  font-weight: 600;
}
.goods-switch-list .goods-switch-tag.el-tag.active::after {
  background: var(--color-primary);
}
.goods-switch-list .goods-switch-tag.el-tag--plain {
  background: transparent;
}
.goods-switch-tag-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.goods-switch-product-btn {
  width: max-content;
  max-width: none;
  min-height: 0.38rem;
  padding: 0.08rem 0.12rem;
  border: 1px solid #E1E6EF;
  border-radius: 4px;
  background: #fff;
  color: #4B5565;
  font-size: 0.14rem;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  overflow: visible;
}
.goods-switch-product-btn:hover {
  border-color: rgba(57, 124, 252, 0.42);
  color: var(--color-primary);
  background: #fff;
  box-shadow: none;
  transform: none;
}
.goods-switch-product-btn:focus {
  outline: none;
  border-color: rgba(57, 124, 252, 0.56);
  color: var(--color-primary);
  background: #fff;
  box-shadow: none;
}
.goods-switch-product-btn.active {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: #fff;
  box-shadow: none;
  font-weight: 600;
}
.goods-switch-search {
  flex: 0 0 2.8rem;
  max-width: 100%;
}
.goods-switch-search .el-input__inner {
  height: 0.36rem;
  line-height: 0.36rem;
  border-color: #E6E7EB;
  border-radius: 4px;
}
.goods-switch-search .el-input__inner:focus {
  border-color: var(--color-primary);
}
.goods-switch-product-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(max-content, 1fr));
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap: 0.1rem;
  padding-top: 0.14rem;
  margin-top: 0.06rem;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}
.goods-switch-product-reference {
  display: block;
  width: max-content;
}
.goods-switch-product-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.1rem;
}
.goods-switch-product-btn.is-sold-out {
  position: relative;
  border-color: #E8D8C9;
  color: #B45309;
  background: #fff;
  cursor: not-allowed;
  opacity: 1;
  transform: none;
}
.goods-switch-product-btn.is-sold-out::after {
  display: none;
}
.goods-switch-product-btn.is-sold-out:hover,
.goods-switch-product-btn.is-sold-out:focus {
  border-color: #E8D8C9;
  color: #B45309;
  background: #fff;
  box-shadow: none;
  transform: none;
}
.goods-switch-product-btn.is-sold-out.active {
  border-color: #D97706;
  color: #B45309;
  background: #fff;
}
.goods-switch-product-main {
  min-width: 0;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0;
}
.goods-switch-product-name {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}
.goods-switch-sold-out-tag {
  flex: 0 0 auto;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.03rem;
  padding: 0 0.06rem;
  border: 1px solid #E8D8C9;
  border-radius: 3px;
  background: #fff;
  color: #B45309;
  font-size: 0.12rem;
  line-height: 0.2rem;
  font-weight: 500;
}
.goods-switch-sold-out-tip {
  display: flex;
  align-items: center;
  gap: 0.06rem;
  margin-bottom: 0.08rem;
  padding: 0.08rem 0.1rem;
  border: 1px solid #FED7AA;
  border-radius: 4px;
  background: #FFF7ED;
  color: #9A3412;
  font-size: 0.13rem;
  line-height: 1.4;
  font-weight: 600;
}
.goods-switch-sold-out-tip:last-child {
  margin-bottom: 0;
}
.goods-switch-product-popover {
  max-width: 3.4rem;
  padding: 0.14rem 0.16rem;
  border-color: #E8ECF3;
  border-radius: 4px;
  box-shadow: none;
}
.goods-switch-product-popover-content {
  max-height: 2rem;
  overflow-y: auto;
  color: #485169;
  font-size: 0.13rem;
  line-height: 1.7;
  word-break: break-word;
}
.goods-switch-product-popover-content * {
  max-width: 100%;
}
.goods-switch-product-popover-content p {
  margin: 0 0 0.08rem;
}
.goods-switch-product-popover-content p:last-child {
  margin-bottom: 0;
}
.goods-switch-product-popover-content img {
  height: auto;
}
@media screen and (max-width: 768px) {
  .goods-switch-panel {
    padding: 0.12rem;
  }
  .goods-switch-row {
    flex-direction: column;
  }
  .goods-switch-search {
    flex-basis: auto;
    width: 100%;
  }
  .goods-switch-product-btn {
    max-width: none;
  }
  .goods-switch-list .goods-switch-tag.el-tag {
    max-width: 2.1rem;
    height: 0.42rem;
    min-height: 0.42rem;
    white-space: nowrap;
  }
  .goods-switch-tag .goods-switch-tag-text {
    white-space: nowrap;
  }
  .goods-switch-product-row {
    grid-template-columns: repeat(auto-fit, minmax(max-content, 1fr));
  }
  .goods-switch-product-btn {
    white-space: nowrap;
  }
  .goods-switch-product-popover {
    max-width: calc(100vw - 0.32rem);
  }
}
