body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f5f7fa;
  color: #1f2937;
}

.line-spacing {
  padding-top: 80px;
}

.product-hero {
  height: 620px;
  display: flex;
  align-items: center;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(7, 18, 45, 0.66) 0%, rgba(7, 18, 45, 0.35) 55%, rgba(7, 18, 45, 0.18) 100%),
    url("/img/product/productbackground.png") center/cover no-repeat;
}

.hero-title {
  margin: 0;
  font-size: 44px;
  font-weight: 700;
  color: #fff;
}

.breadcrumb-wrap {
  margin-top: 14px;
}

.breadcrumb-custom,
.breadcrumb-custom a,
.breadcrumb-custom .current {
  color: #fff;
}

.breadcrumb-custom span {
  margin: 0 8px;
}

.filter-wrap {
  margin: 70px auto 34px;
}

.filter-wrap .form-group {
  margin-bottom: 0;
}

.filter-wrap .form-control {
  height: 56px;
  border-radius: 28px;
  border: 1px solid #dbe4f2;
  background: #fff;
  box-shadow: none;
  color: #516074;
  font-size: 15px;
}

.search-box {
  position: relative;
}

.search-box .fa-search {
  position: absolute;
  left: 18px;
  top: 19px;
  color: #a5b1c2;
  font-size: 16px;
}

.search-box input {
  padding-left: 42px;
}

.sort-select-native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.sort-dropdown {
  position: relative;
}

.sort-dropdown-trigger {
  width: 100%;
  text-align: left;
  background: #fff;
  padding-right: 52px;
}

.sort-dropdown-trigger .sort-label {
  color: #516074;
}

.sort-dropdown-trigger:after {
  content: "";
  position: absolute;
  right: 20px;
  top: 50%;
  margin-top: -3px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid #93a4bb;
  transition: transform 0.2s ease;
}

.sort-dropdown.open .sort-dropdown-trigger:after {
  transform: rotate(180deg);
}

.sort-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 20;
  list-style: none;
  margin: 0;
  padding: 8px 0;
  border-radius: 18px;
  border: 1px solid #d6e3f3;
  background: #fff;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.12);
  display: none;
}

.sort-dropdown.open .sort-dropdown-menu {
  display: block;
}

.sort-dropdown-menu button {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 15px;
  color: #4c5a6d;
  padding: 10px 20px;
}

.sort-dropdown-menu li.active button,
.sort-dropdown-menu button:hover {
  background: #f2f7ff;
  color: #0a72e8;
}

.content-area {
  padding: 8px 0 64px;
}

.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 0 8px;
}

.list-title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: #243247;
}

.list-desc {
  font-size: 14px;
  color: #7a8798;
}

.product-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.product-row {
  display: flex;
  gap: 24px;
  padding: 22px 26px;
  background: #fff;
  border: 1px solid #e6edf5;
  border-radius: 26px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.05);
}

.product-media {
  width: 140px;
  min-width: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border-radius: 20px;
  background: linear-gradient(180deg, #f5f9ff 0%, #edf3fb 100%);
}

.product-media img {
  max-width: 100%;
  max-height: 96px;
  object-fit: contain;
}

.product-summary {
  flex: 1.2;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.product-brand {
  display: inline-flex;
  align-self: flex-start;
  margin-bottom: 12px;
  padding: 6px 16px;
  border-radius: 999px;
  background: #fff1e6;
  color: #d87416;
  font-size: 14px;
  font-weight: 700;
}

.product-code {
  margin: 0 0 10px;
  font-size: 23px;
  font-weight: 700;
  line-height: 1.25;
  color: #243247;
  word-break: break-all;
}

.product-note {
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
  color: #7b8799;
}

.product-note strong {
  color: #526176;
}

.product-specs {
  flex: 1;
  display: flex;
  align-items: center;
}

.spec-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 10px 18px;
  width: 100%;
  padding: 16px 18px;
  border-radius: 20px;
  background: #f8fbff;
}

.spec-item {
  font-size: 14px;
  line-height: 1.6;
  color: #64748b;
}

.spec-item strong {
  display: inline-block;
  min-width: 64px;
  color: #334155;
}

.product-actions {
  width: 170px;
  min-width: 170px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

.btn-main,
.btn-sample,
.btn-compare {
  width: 100%;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

.btn-main {
  background: #0a72e8;
  border: 1px solid #0a72e8;
  color: #fff;
  padding: 11px 18px;
}

.btn-sample {
  background: #eef6ff;
  border: 1px solid #c9defd;
  color: #0a72e8;
  padding: 10px 18px;
}

.btn-compare {
  background: #f4f8ff;
  border: 1px solid #d6e4ff;
  color: #0a72e8;
  padding: 10px 18px;
}

.btn-compare.active {
  background: #e9f2ff;
  border-color: #bcd4ff;
}

.empty-data {
  text-align: center;
  color: #8a8a8f;
  background: #fff;
  border: 1px dashed #d9d9de;
  border-radius: 24px;
  padding: 60px 20px;
}

.pagination-container {
  text-align: center;
  margin-top: 34px;
}

.pagination > li > a,
.pagination > li > span {
  color: #0071e3;
  border-color: #dde3ea;
  border-radius: 999px !important;
  margin: 0 4px;
}

.pagination > .active > a,
.pagination > .active > span {
  background: #0071e3;
  border-color: #0071e3;
}

.compare-sidebar {
  position: fixed;
  top: 120px;
  left: 16px;
  width: 310px;
  max-height: calc(100vh - 150px);
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #dfe8f3;
  border-radius: 24px;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.14);
  overflow: hidden;
  z-index: 100;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.compare-sidebar.is-empty {
  transform: translateX(calc(-100% - 24px));
  opacity: 0;
  pointer-events: none;
}

.compare-sidebar.is-collapsed {
  transform: translateX(calc(-100% + 54px));
  opacity: 1;
  pointer-events: auto;
  cursor: pointer;
}

.compare-sidebar-handle {
  position: absolute;
  right: 0;
  top: 0;
  width: 54px;
  height: 100%;
  border: none;
  background: transparent;
  color: transparent;
  cursor: pointer;
  pointer-events: none;
}

.compare-sidebar.is-empty .compare-sidebar-handle {
  display: none;
}

.compare-sidebar.is-collapsed .compare-sidebar-handle {
  pointer-events: auto;
}

.compare-sidebar.is-collapsed .compare-header,
.compare-sidebar.is-collapsed .compare-list,
.compare-sidebar.is-collapsed .compare-footer {
  pointer-events: none;
  user-select: none;
}

.compare-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 14px;
  border-bottom: 1px solid #edf2f7;
}

.compare-header h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #243247;
}

.compare-limit-text {
  display: none;
  margin-left: 8px;
  margin-right: auto;
  color: #ff4d3f;
  font-size: 13px;
  font-weight: 600;
}

.compare-limit-text.is-visible {
  display: inline-block;
}

.compare-close,
.compare-remove {
  border: none;
  background: transparent;
  color: #7a8798;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.compare-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.compare-item {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e8eef6;
  border-radius: 16px;
  background: #fff;
}

.compare-item img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  border-radius: 12px;
  background: #f5f9ff;
  border: 1px solid #edf2f7;
}

.compare-item-body {
  flex: 1;
  min-width: 0;
}

.compare-item-title {
  margin: 0 18px 6px 0;
  font-size: 16px;
  font-weight: 700;
  color: #243247;
  line-height: 1.4;
  word-break: break-all;
}

.compare-item-meta {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: #7a8798;
}

.compare-remove {
  position: absolute;
  top: 10px;
  right: 10px;
}

.compare-footer {
  padding: 14px 16px 16px;
  border-top: 1px solid #edf2f7;
  background: #fff;
}

.compare-footer .btn {
  width: 100%;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
}

.compare-view {
  margin-bottom: 10px;
  background: #28a7f7;
  border-color: #28a7f7;
  color: #fff;
}

.compare-clear {
  background: #ff4d3f;
  border-color: #ff4d3f;
  color: #fff;
}


.compare-empty-text {
  padding: 24px 12px;
  text-align: center;
  color: #8b97a8;
  font-size: 14px;
}

@media (max-width: 1199px) {
  .product-row {
    flex-wrap: wrap;
  }

  .product-media {
    width: 120px;
    min-width: 120px;
  }

  .product-actions {
    width: 100%;
    min-width: 100%;
    flex-direction: row;
  }

  .compare-sidebar {
    width: 280px;
  }

  .compare-sidebar.is-collapsed {
    transform: translateX(calc(-100% + 50px));
  }

  .compare-sidebar-handle {
    width: 50px;
  }
}

@media (max-width: 767px) {
  .product-hero {
    padding: 36px 0 28px;
  }

  .hero-title {
    font-size: 32px;
  }

  .filter-wrap .row > div + div {
    margin-top: 14px;
  }

  .list-head {
    display: block;
  }

  .list-desc {
    margin-top: 6px;
  }

  .product-row {
    padding: 18px;
    gap: 18px;
  }

  .product-media,
  .product-summary,
  .product-specs,
  .product-actions {
    width: 100%;
    min-width: 100%;
  }

  .product-code {
    font-size: 24px;
  }

  .spec-list {
    grid-template-columns: 1fr;
  }

  .product-actions {
    flex-direction: column;
  }

  .compare-sidebar {
    top: auto;
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
    max-height: 58vh;
  }

  .compare-sidebar.is-collapsed {
    transform: translateX(calc(-100% + 58px));
  }

  .compare-sidebar-handle {
    width: 58px;
  }
}
