/* Product compare — brand-led, mobile-first */

.compare-page {
  padding: 20px 0 100px;
  background:
    radial-gradient(ellipse 70% 45% at 100% 0%, rgba(255, 136, 0, 0.12), transparent 55%),
    linear-gradient(180deg, #f6f7f9 0%, #fff 48%);
  min-height: 60vh;
}

.compare-head {
  margin-bottom: 20px;
}

.compare-head__eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--main-2, #d35400);
  margin-bottom: 6px;
}

.compare-head h1 {
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 800;
}

.compare-head p {
  margin: 0;
  color: #6b7280;
  font-size: 0.95rem;
  max-width: 40rem;
  line-height: 1.7;
}

.compare-vs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 22px;
}

.compare-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 18px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
  overflow: hidden;
}

.compare-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--main, #ff8800), var(--main-2, #d35400));
}

.compare-card__img {
  aspect-ratio: 1;
  border-radius: 14px;
  background: #f4f5f7;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 12px;
}

.compare-card__img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
}

.compare-card__name {
  font-weight: 800;
  font-size: 0.98rem;
  margin: 0 0 6px;
  line-height: 1.45;
}

.compare-card__name a {
  color: inherit;
  text-decoration: none;
}

.compare-card__name a:hover {
  color: var(--main-2, #d35400);
}

.compare-card__meta {
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 10px;
}

.compare-card__price {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--main-2, #d35400);
  margin-bottom: 12px;
}

.compare-card__actions {
  display: grid;
  gap: 8px;
  margin-top: auto;
}

.compare-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.88rem;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  background: var(--main, #ff8800);
  color: #fff;
}

.compare-btn:hover {
  background: var(--main-2, #d35400);
  color: #fff;
}

.compare-btn--ghost {
  background: #fff;
  color: #444;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.compare-btn--ghost:hover {
  border-color: var(--main, #ff8800);
  color: var(--main-2, #d35400);
}

.compare-btn--danger {
  background: #fff;
  color: #b42318;
  border: 1px solid rgba(180, 35, 24, 0.25);
}

.compare-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-top: 40px;
}

.compare-mid__badge {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 0.95rem;
  color: #fff;
  background: linear-gradient(145deg, #23272d, #14171b);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.compare-mid__diff {
  font-size: 0.75rem;
  font-weight: 700;
  color: #6b7280;
  text-align: center;
  max-width: 5.5rem;
}

.compare-slot {
  border: 2px dashed rgba(255, 136, 0, 0.45);
  background:
    linear-gradient(180deg, rgba(255, 136, 0, 0.06), transparent 60%),
    #fff;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px 14px;
  gap: 10px;
}

.compare-slot strong {
  font-size: 1rem;
}

.compare-slot p {
  margin: 0;
  color: #777;
  font-size: 0.88rem;
  line-height: 1.6;
}

.compare-table-wrap {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 18px;
  overflow: hidden;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.compare-table th,
.compare-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f0f1f3;
  vertical-align: top;
}

.compare-table thead th {
  background: #161a20;
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
}

.compare-table tbody th {
  width: 28%;
  background: #fafafa;
  font-weight: 700;
  color: #374151;
  text-align: right;
}

.compare-table td {
  width: 36%;
  text-align: center;
}

.compare-table tr.is-diff td {
  background: rgba(255, 136, 0, 0.08);
  font-weight: 700;
}

.compare-table tr.is-diff th {
  background: rgba(255, 136, 0, 0.12);
  color: var(--main-2, #d35400);
}

.compare-table tr.is-same td {
  color: #4b5563;
}

.compare-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0 0;
  font-size: 0.8rem;
  color: #6b7280;
}

.compare-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.compare-legend i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}

.compare-legend .diff {
  background: rgba(255, 136, 0, 0.45);
}

.compare-legend .same {
  background: #e5e7eb;
}

.compare-peers {
  margin-top: 28px;
}

.compare-peers h2 {
  font-size: 1.1rem;
  font-weight: 800;
  margin: 0 0 12px;
}

.compare-peer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.compare-peer {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.compare-peer__img {
  aspect-ratio: 1;
  border-radius: 10px;
  background: #f4f5f7;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.compare-peer__img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

.compare-peer__name {
  font-weight: 700;
  font-size: 0.88rem;
  margin: 0;
  line-height: 1.4;
}

.compare-peer__name a {
  color: inherit;
  text-decoration: none;
}

.compare-empty {
  text-align: center;
  padding: 48px 20px;
  background: #fff;
  border-radius: 18px;
  border: 1px dashed rgba(0, 0, 0, 0.12);
}

.compare-empty h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.compare-empty p {
  color: #6b7280;
  margin: 0 0 16px;
}

/* Sticky compare dock */
.compare-dock {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 1150;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(22, 26, 32, 0.94);
  color: #fff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
}

.compare-dock__text {
  flex: 1;
  min-width: 0;
  font-size: 0.85rem;
  line-height: 1.45;
}

.compare-dock__text strong {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 2px;
}

.compare-dock__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.compare-dock .compare-btn {
  min-height: 40px;
  padding: 8px 12px;
  font-size: 0.82rem;
}

.compare-dock .compare-btn--ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

/* Product page compare button */
.btn-compare {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 14px;
  font-size: 0.875rem;
  font-weight: 700;
  border-radius: 10px;
  border: 1px solid rgba(255, 136, 0, 0.4);
  background: rgba(255, 136, 0, 0.08);
  color: var(--main-2, #d35400);
  text-decoration: none;
  cursor: pointer;
}

.btn-compare:hover {
  background: var(--main, #ff8800);
  border-color: var(--main, #ff8800);
  color: #fff;
}

.pd-related-card__compare {
  display: block;
  margin-top: 8px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--main-2, #d35400);
  text-decoration: none;
}

@media (min-width: 768px) {
  .compare-page {
    padding: 32px 0 48px;
  }

  .compare-vs {
    gap: 18px;
  }

  .compare-card {
    padding: 18px;
  }

  .compare-peer-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .compare-dock {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(720px, calc(100% - 48px));
  }
}

@media (max-width: 640px) {
  .compare-vs {
    grid-template-columns: 1fr;
  }

  .compare-mid {
    padding: 0;
    flex-direction: row;
    justify-content: center;
  }

  .compare-table thead {
    display: none;
  }

  .compare-table,
  .compare-table tbody,
  .compare-table tr,
  .compare-table th,
  .compare-table td {
    display: block;
    width: 100%;
  }

  .compare-table tr {
    padding: 12px 14px;
    border-bottom: 1px solid #eee;
  }

  .compare-table tbody th {
    background: transparent;
    padding: 0 0 8px;
    width: 100%;
  }

  .compare-table td {
    text-align: right;
    padding: 4px 0;
    width: 100%;
  }

  .compare-table td::before {
    content: attr(data-side) ": ";
    color: #888;
    font-weight: 700;
    font-size: 0.78rem;
  }

  .compare-table tr.is-diff {
    background: rgba(255, 136, 0, 0.08);
  }
}
