/* ────────────────────────────────────────────────────────────────────────────
   Specs (PDP) + Comparison drawer + Compare page styles
   Reuses existing --brand-* tokens set by branding.js.
   ──────────────────────────────────────────────────────────────────────────── */

/* PDP specifications section */
.spec-section {
  margin: 32px 0;
  padding: 24px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}
.spec-section__title {
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 700;
  color: var(--brand-navy, #183363);
}
.spec-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.spec-highlights:empty {
  display: none;
}
.spec-chip {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(32, 193, 217, 0.08);
  border: 1px solid rgba(32, 193, 217, 0.3);
  font-size: 13px;
}
.spec-chip__label {
  color: #6b7280;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.spec-chip__value {
  font-weight: 700;
  color: var(--brand-navy, #183363);
}
.spec-groups {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.spec-group__title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
}
.spec-table {
  width: 100%;
  border-collapse: collapse;
}
.spec-table th,
.spec-table td {
  padding: 10px 12px;
  text-align: start;
  font-size: 14px;
  border-bottom: 1px solid #f1f5f9;
}
.spec-table tr:nth-child(even) {
  background: #fafafa;
}
.spec-table th {
  font-weight: 500;
  color: #6b7280;
  width: 40%;
  font-size: 13px;
}
.spec-table td {
  color: var(--brand-navy, #183363);
  font-weight: 500;
}

/* PDP "Add to compare" button */
.compare-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  padding: 10px 16px;
  background: transparent;
  color: var(--brand-navy, #183363);
  border: 1.5px solid var(--brand-navy, #183363);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.compare-btn:hover:not(:disabled) {
  background: var(--brand-navy, #183363);
  color: #fff;
}
.compare-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.compare-btn--added {
  background: var(--brand-cyan, #20c1d9);
  color: #fff;
  border-color: var(--brand-cyan, #20c1d9);
}

/* Sticky compare drawer */
.compare-drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.08);
}
.compare-drawer__items {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  flex: 1;
  overflow-x: auto;
}
.compare-drawer__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 28px 6px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f9fafb;
  min-width: 160px;
  max-width: 220px;
}
.compare-drawer__item img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 6px;
  flex-shrink: 0;
}
.compare-drawer__item-name {
  font-size: 12px;
  color: var(--brand-navy, #183363);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.compare-drawer__remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.08);
  border: none;
  color: #4b5563;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.compare-drawer__remove:hover {
  background: rgba(0, 0, 0, 0.16);
}
.compare-drawer__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.compare-drawer__clear {
  background: transparent;
  border: none;
  color: #6b7280;
  font-size: 13px;
  cursor: pointer;
  padding: 8px 10px;
}
.compare-drawer__clear:hover {
  color: var(--brand-navy, #183363);
  text-decoration: underline;
}
.compare-drawer__cta {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  border-radius: 8px;
  background: var(--brand-cyan, #20c1d9);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}
.compare-drawer__cta:hover {
  filter: brightness(0.95);
}

/* Compare page */
.compare-page {
  padding: 32px 0 96px;
}
.compare-page__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}
.compare-page__header h1 {
  margin: 0 0 4px;
  font-size: 24px;
  color: var(--brand-navy, #183363);
}
.compare-page__subtitle {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
}
.compare-page__controls {
  display: flex;
  align-items: center;
  gap: 16px;
}
.compare-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--brand-navy, #183363);
  cursor: pointer;
}

.compare-empty {
  padding: 48px 24px;
  text-align: center;
  background: #fff;
  border: 1px dashed #e5e7eb;
  border-radius: 12px;
  color: #6b7280;
}

.compare-scroll {
  overflow-x: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}

.compare-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 600px;
}
.compare-table th,
.compare-table td {
  padding: 12px 16px;
  font-size: 14px;
  text-align: start;
  vertical-align: top;
  border-bottom: 1px solid #f1f5f9;
}
.compare-table thead th {
  background: #f8fafc;
  border-bottom: 2px solid #e5e7eb;
  font-size: 13px;
  vertical-align: bottom;
}
.compare-table thead th .compare-product-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 500;
  color: var(--brand-navy, #183363);
}
.compare-table thead th img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 8px;
  align-self: flex-start;
}
.compare-table thead th .compare-product-card__name {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.3;
}
.compare-table thead th .compare-product-card__price {
  color: var(--brand-cyan, #20c1d9);
  font-weight: 700;
  font-size: 14px;
}
.compare-table thead th .compare-product-card__cta {
  display: inline-flex;
  align-self: flex-start;
  padding: 6px 14px;
  border-radius: 6px;
  background: var(--brand-navy, #183363);
  color: #fff;
  font-size: 12px;
  text-decoration: none;
}
.compare-table .compare-group-row td {
  padding: 14px 16px 6px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 12px;
  color: #6b7280;
  background: #fafafa;
  border-bottom: none;
}
.compare-table .compare-spec-row th {
  font-weight: 500;
  color: #6b7280;
  background: #fff;
  white-space: nowrap;
}
.compare-table th.compare-th-sticky {
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 1;
  box-shadow: 1px 0 0 #f1f5f9;
}
.compare-table .cell--diff {
  background: rgba(32, 193, 217, 0.08);
  color: var(--brand-navy, #183363);
  font-weight: 600;
}
.compare-table .compare-spec-row.same-across-all td.same-merged {
  text-align: center;
  color: #6b7280;
  font-style: italic;
  font-size: 13px;
}

@media (max-width: 720px) {
  .compare-drawer { padding: 10px 12px; }
  .compare-drawer__cta { padding: 8px 14px; font-size: 13px; }
  .compare-drawer__item { min-width: 120px; }
  .spec-section { padding: 16px; }
}
