/* Shared package comparison styles (listing drawer + full compare page) */
:root {
  --cmp-label-w: 160px;
  --cmp-pkg-w: 190px;
}

.pkg-compare-table {
  min-width: calc(var(--cmp-label-w) + 2 * var(--cmp-pkg-w));
}

.pkg-compare-table.cols-3 {
  min-width: calc(var(--cmp-label-w) + 3 * var(--cmp-pkg-w));
}

.pkg-compare-row {
  display: flex;
  border-bottom: 1px solid #f0f0f0;
}

.pkg-compare-cell {
  padding: 9px 12px;
  font-size: 13px;
  flex-shrink: 0;
}

.pkg-compare-cell.label {
  width: var(--cmp-label-w);
  min-width: var(--cmp-label-w);
  max-width: var(--cmp-label-w);
  font-weight: 600;
  color: #555;
  background: #f8f9fa;
  position: sticky;
  left: 0;
  z-index: 2;
  border-right: 1px solid #e5e7eb;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
}

.pkg-compare-cell.pkg {
  flex: 1;
  min-width: var(--cmp-pkg-w);
  text-align: center;
  align-self: center;
}

.pkg-compare-header-row {
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 2px solid #005fa3;
}

.pkg-compare-header-row .pkg-compare-cell.label {
  background: #0077cc;
  border-right-color: #005fa3;
  z-index: 6;
  align-self: stretch;
}

.pkg-compare-header-row .pkg-compare-cell.pkg {
  background: #0077cc;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  line-height: 1.4;
  padding-top: 10px;
  padding-bottom: 10px;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.pkg-compare-section .pkg-compare-section-hdr .pkg-compare-cell.label {
  cursor: pointer;
  user-select: none;
  background: #f0f4f8;
  font-size: 11px;
  font-weight: 700;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: normal;
  word-break: break-word;
}

.pkg-compare-section-hdr .pkg-compare-cell.pkg {
  background: #f0f4f8;
  font-size: 12px;
}

.pkg-compare-section-hdr:hover .pkg-compare-cell {
  background: #e8eef5;
}

.pkg-compare-arrow {
  display: inline-block;
  font-size: 9px;
  color: #888;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.pkg-compare-section.open .pkg-compare-arrow {
  transform: rotate(90deg);
}

.pkg-compare-section-body {
  display: none;
}

.pkg-compare-section.open .pkg-compare-section-body {
  display: block;
}

.pkg-compare-test-row .pkg-compare-cell.label {
  font-weight: 400;
  font-size: 11px;
  color: #555;
  padding-left: 24px;
  background: #fff;
  white-space: normal;
  word-break: break-word;
  line-height: 1.4;
}

.pkg-compare-test-row.row-unique .pkg-compare-cell {
  background: #fffbeb;
}

.pkg-compare-test-row.row-unique .pkg-compare-cell.label {
  background: #fffbeb;
  color: #92400e;
  font-weight: 500;
}

.pkg-compare-tag {
  display: inline-block;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 10px;
  margin: 1px 0;
  font-weight: 600;
}

.pkg-compare-tag.yes {
  background: #dcfce7;
  color: #166534;
}

.pkg-compare-tag.no {
  background: #fee2e2;
  color: #991b1b;
}

.pkg-compare-check.present {
  color: #16a34a;
  font-weight: 700;
  font-size: 15px;
}

.pkg-compare-check.absent {
  color: #d1d5db;
  font-size: 14px;
}

.pkg-compare-table.diff-only .pkg-compare-section[data-same="true"] {
  display: none;
}

.pkg-compare-no-diff {
  display: none;
  text-align: center;
  padding: 20px;
  color: #6b7280;
  font-size: 13px;
}

.pkg-compare-table.diff-only .pkg-compare-no-diff {
  display: block;
}

.pkg-compare-table.diff-only .pkg-compare-section:not([data-same="true"]) ~ .pkg-compare-no-diff {
  display: none;
}

.pkg-compare-price {
  font-size: 16px;
  font-weight: 700;
  color: #e53e00;
  display: block;
}

.pkg-compare-orig-price {
  font-size: 11px;
  color: #999;
  text-decoration: line-through;
  display: block;
}

.pkg-compare-tests {
  font-size: 11px;
  color: #0077cc;
  font-weight: 600;
}

.pkg-compare-book-btn {
  display: inline-block;
  margin: 2px auto;
  background: #f07a6c;
  color: #fff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.pkg-compare-book-btn:hover {
  background: #d45f52;
}

.pkg-compare-book-row {
  border-top: 2px solid #e5e7eb;
}

.pkg-compare-book-row .pkg-compare-cell.label {
  background: #f8f9fa;
}

.pkg-compare-summary-row .pkg-compare-cell.pkg {
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 600px) {
  :root {
    --cmp-label-w: 118px;
    --cmp-pkg-w: 148px;
  }

  .pkg-compare-cell {
    padding: 7px 9px;
    font-size: 12px;
  }

  .pkg-compare-test-row .pkg-compare-cell.label {
    padding-left: 18px;
    font-size: 10px;
  }
}
