/* ============================================================
   Product Compare — Frontend Styles
   ============================================================ */

/* Page wrapper */
.pc-page {
  font-family: inherit;
  color: #222;
  padding: 40px 0 60px;
  padding-top: 150px;
}
.pc-page-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Heading */
.pc-page-heading {
  text-align: center;
  margin-bottom: 80px;
}
.pc-page-heading h1 {
  color: #000;
  text-align: center;
  font-family: Montserrat;
  font-size: 40px;
  font-style: normal;
  font-weight: 700;
  line-height: normal;
  margin-bottom: 12px;
}
.pc-page-sub {
  color: #000;
  text-align: center;
  font-family: Montserrat;
  font-size: 16px;
  font-style: normal;
  font-weight: 600;
  line-height: normal;
  margin-bottom: 12px;
}

/* ── Table layout ── */
.pc-table-wrap {
  overflow-x: auto;
}

.pc-table {
  width: 100%;
  min-width: 560px;
}

.pc-row {
  display: flex;
}
.pc-row:last-child {
  border-bottom: none;
}

.pc-cell {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-width: 0;
}

/* Label column */
.pc-label-cell {
  flex: 0 0 200px;
  justify-content: flex-start;
  text-align: left;
  background: #fff;
  padding: 0px;
}
.pc-row-wrapper .pc-row.pc-row-group-title.pc-rowv2 .pc-label-cell {
  flex: 1 0 0;
}
.pc-label-text {
  color: #000;
  font-family: Montserrat;
  font-size: 24px;
  font-style: normal;
  font-weight: 600;
  line-height: normal;
}

/* ── Product header row ── */
.pc-row-products {
  border-bottom: 2px solid #000;
  border-top: 2px solid #000;
  padding-top: 40px;
  align-items: flex-start;
  padding-bottom: 40px;
}
.pc-product-col {
  flex-direction: column;
  gap: 22px;
  align-items: center;
}

/* Searchable select */
.pc-select-wrap {
  position: relative;
  width: 100%;
}
.pc-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-radius: 100px;
  border: 1px solid #b5b5b5;
  padding: 12px;
  cursor: pointer;
  background: #fff;
  font-size: 13px;
  color: #333;
  transition: border-color 0.15s;
  user-select: none;
}
.pc-select-trigger:hover {
  border-color: #999;
}
.pc-select-trigger.open {
  border-color: #333;
}
.pc-select-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #000;
  text-align: center;
  font-family: Montserrat;
  font-size: 16px;
  font-style: normal;
  font-weight: 600;
  line-height: normal;
}
.pc-select-arrow {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  color: #00d3d7;
  transition: transform 0.2s;
}
.pc-select-trigger.open .pc-select-arrow {
  transform: rotate(180deg);
}

.pc-select-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  z-index: 100;
  overflow: hidden;
}
.pc-select-dropdown.open {
  display: block;
}

.pc-select-search-wrap {
  padding: 8px;
  border-bottom: 1px solid #eee;
}
.pc-select-search {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 13px;
  outline: none;
}
.pc-select-search:focus {
  border-color: #333;
}

.pc-select-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  max-height: 220px;
  overflow-y: auto;
}
.pc-select-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  color: #333;
  transition: background 0.1s;
}
.pc-select-list li:hover {
  background: #f5f5f5;
}
.pc-select-list li.selected {
  color: #999;
  cursor: not-allowed;
  background: #fafafa;
}
.pc-select-list li.hidden {
  display: none;
}
.pc-select-list li img {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
}
.pc-select-list li .pc-opt-name {
  flex: 1;
  line-height: 1.3;
}
.pc-select-list li .pc-opt-used {
  font-size: 11px;
  color: #bbb;
  white-space: nowrap;
}

/* Product image */
.pc-product-img-link {
  display: block;
}
.pc-product-img {
  width: 100%;
  max-width: 224px;
  height: auto;
  display: block;
  margin: 0 auto;
  object-fit: cover;
}

/* ── Group title row ── */
.pc-row-group-title {
  background: #fff;
  border-bottom: none;
}
.pc-row-group-title.pc-rowv2 {
  margin-bottom: 60px;
}
.pc-group-name {
  color: #000;
  font-family: Montserrat;
  font-size: 24px;
  font-style: normal;
  font-weight: 600;
  line-height: normal;
}
.pc-cell.pc-icon-col {
  padding: 0;
}
/* ── Icon group row (Tính năng) ── */
.pc-row-icon-group {
  border-bottom: 1px solid #000;
  padding: 40px 0;
}
.pc-icon-col {
  flex-direction: column;
  gap: 24px;
  padding: 20px 12px;
  align-items: center;
}
.pc-icon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  text-align: center;
  padding: 8px 0;
}
.pc-feat-icon {
  width: 80px;
  height: 80px;
  aspect-ratio: 1/1;
  object-fit: contain;
}
.pc-feat-text {
  color: #000;
  text-align: center;
  font-family: Montserrat;
  font-size: 20px;
  font-style: normal;
  font-weight: 500;
  line-height: normal;
  min-height: 60px;
  display: block;
}

/* ── Field rows ── */
.pc-row-field {
  align-items: flex-start;
}
.pc-row-wrapper .pc-row-field {
  align-items: center;
  padding: 8px 0;
}
.pc-field-label {
  width: 100%;
  color: #000;
  text-align: center;
  font-family: Montserrat;
  font-size: 20px;
  font-style: normal;
  font-weight: 500;
  line-height: normal;
}

.pc-value-cell {
  font-size: 13px;
  color: #333;
  line-height: 1.5;
  flex-direction: column;
  gap: 2px;
}
.pc-value-cell .pc-text {
  display: block;
  color: #000;
  text-align: center;
  font-family: Montserrat;
  font-size: 20px;
  font-style: normal;
  font-weight: 500;
  line-height: normal;
}
.pc-empty {
  color: #ccc;
}

/* Checkbox */
.pc-check {
  font-size: 16px;
  font-weight: 700;
}
.pc-yes {
  color: #2ecc71;
}
.pc-no {
  color: #e74c3c;
}

/* Loading overlay khi đổi sản phẩm */
.pc-product-col.loading {
  opacity: 0.5;
  pointer-events: none;
}
.pc-row-wrapper {
  padding-top: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid #000;
}
.pc-row-wrapper:last-child {
  border-bottom: none;
}
/* ── Responsive ── */
@media (max-width: 768px) {
  /* ── Page ── */
  .pc-page {
    padding: 90px 0 40px;
  }
  .pc-page-inner {
    padding: 0 16px;
  }
  .pc-page-heading {
    margin-bottom: 28px;
  }
  .pc-page-heading h1 {
    font-size: 22px;
    margin-bottom: 6px;
  }
  .pc-page-sub {
    font-size: 13px;
  }

  /* ── Table: bỏ min-width, cho scroll dọc ── */
  .pc-table-wrap {
    overflow-x: visible;
  }
  .pc-table {
    min-width: unset;
    width: 100%;
  }

  /* ── Ẩn label cell cột trái trên mobile ── */
  .pc-label-cell {
    display: none;
  }

  /* ── Mỗi row thành block, label hiện trên đầu ── */
  .pc-row {
    flex-wrap: wrap;
    border-bottom: none;
  }

  /* ── Product header ── */
  .pc-row-products {
    border-top: 1.5px solid #000;
    border-bottom: 1.5px solid #000;
    padding: 20px 0;
    gap: 0;
  }
  .pc-product-col {
    flex: 1;
    gap: 12px;
    padding: 0 8px;
  }
  /* Chỉ hiện 2 cột đầu trên mobile */
  .pc-product-col:nth-child(n + 4) {
    display: none;
  }

  .pc-select-trigger {
    padding: 8px 10px;
    border-radius: 100px;
  }
  .pc-select-label {
    font-size: 12px;
  }
  .pc-product-img {
    max-width: 130px;
  }

  /* ── Group title: hiện lại, full width ── */
  .pc-row-group-title {
    display: block;
    padding: 20px 0 8px;
    border-top: 1.5px solid #000;
  }
  .pc-row-group-title .pc-label-cell {
    display: block;
  }
  .pc-row-group-title .pc-cell:not(.pc-label-cell) {
    display: none;
  }
  .pc-group-name {
    font-size: 16px;
    font-weight: 700;
  }

  /* ── Icon group row ── */
  .pc-row-icon-group {
    flex-wrap: nowrap;
    padding: 16px 0;
    border-bottom: 1.5px solid #000;
  }
  /* Ẩn label cell nhưng giữ layout 2 cột */
  .pc-row-icon-group .pc-label-cell {
    display: none;
  }
  .pc-icon-col {
    flex: 1;
    padding: 0 8px;
    gap: 16px;
  }
  /* Chỉ hiện 2 cột đầu */
  .pc-icon-col:nth-child(n + 4) {
    display: none;
  }

  .pc-icon-item {
    gap: 10px;
  }
  .pc-feat-icon {
    width: 48px;
    height: 48px;
  }
  .pc-feat-text {
    font-size: 12px;
  }

  /* ── Field rows: label hiện full width trên đầu ── */
  .pc-row-field {
    flex-wrap: wrap;
    padding: 12px 0;
    border-bottom: 1px solid #e8e8e8;
    align-items: stretch;
  }
  .pc-row-field .pc-label-cell {
    display: block;
    flex: 0 0 100%;
    padding: 0 0 8px 0;
    border-bottom: none;
  }
  .pc-field-label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
  }

  .pc-value-cell {
    flex: 1;
    padding: 0 8px;
    font-size: 13px;
    justify-content: center;
    align-items: center;
  }
  /* Chỉ hiện 2 cột đầu */
  .pc-value-cell:nth-child(n + 4) {
    display: none;
  }

  .pc-value-cell .pc-text {
    font-size: 13px;
  }

  /* ── Row wrapper (nhóm text/checkbox) ── */
  .pc-row-wrapper {
    padding: 0;
    border-bottom: none;
  }
  .pc-row-wrapper .pc-row-group-title {
    border-top: 1.5px solid #000;
    padding: 16px 0 4px;
  }
  .pc-row-wrapper .pc-row-group-title .pc-label-cell {
    display: block;
  }

  /* ── Sticky header mobile ── */
  .pc-sticky-label {
    display: none;
  }
  .pc-sticky-col {
    padding: 6px 8px;
  }
  .pc-sticky-col:nth-child(n + 4) {
    display: none;
  }
  .pc-sticky-inner {
    padding: 0 16px;
  }
  .pc-sticky-col .pc-select-trigger {
    padding: 6px 8px;
  }
  .pc-sticky-col .pc-select-label {
    font-size: 11px;
  }
  .pc-row-group-title.pc-rowv2 {
    margin-bottom: 0;
  }
}

/* ===== Sticky product header ===== */
.pc-sticky-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: #fff;
  border-bottom: 2px solid #e0e0e0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-100%);
  transition: transform 0.25s ease;
  pointer-events: none;
}
.pc-sticky-header.visible {
  transform: translateY(70px);
  pointer-events: auto;
}

.pc-sticky-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
}

.pc-sticky-label {
  flex: 0 0 140px;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  padding: 10px 8px 10px 0;
}

.pc-sticky-col {
  flex: 1;
  padding: 8px 10px;
  min-width: 0;
}

/* Select trong sticky giống select gốc */
.pc-sticky-col .pc-select-wrap {
  width: 100%;
}
.pc-sticky-col .pc-select-trigger {
  font-size: 12px;
  padding: 6px 8px;
}
.pc-row.pc-row-icon-group .pc-cell.pc-label-cell {
  align-items: start;
  padding: 0;
}

@media (max-width: 680px) {
  .pc-sticky-label {
    flex: 0 0 90px;
    font-size: 11px;
  }
  .pc-sticky-col {
    padding: 6px 6px;
  }
}
