/* Product compare */

.dh-compare-btn {
  cursor: pointer;
  appearance: none;
  font-family: inherit;
  gap: 6px;
}
.dh-compare-btn__icon {
  flex: 0 0 auto;
  display: block;
}
.dh-compare-btn__on { display: none; }
.dh-compare-btn.is-on .dh-compare-btn__idle { display: none; }
.dh-compare-btn.is-on .dh-compare-btn__on { display: inline; }

.dh-compare-btn--pdp {
  display: inline-flex;
  align-items: center;
  margin-top: 12px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--dh-nav);
  font: 600 14px/1.3 var(--dh-font);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.dh-compare-btn--pdp:hover { color: var(--dh-orange); }
.dh-compare-btn--pdp.is-on {
  color: var(--dh-orange);
  text-decoration: none;
}

.dh-compare-btn--card {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 2px;
  padding: 6px 0 0;
  border: 0;
  background: none;
  color: var(--dh-muted);
  font: 600 12.5px/1.3 var(--dh-font);
  text-align: center;
}
.dh-compare-btn--card:hover { color: var(--dh-orange); }
.dh-compare-btn--card.is-on { color: var(--dh-orange); }

.dh-compare-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  background: #fff;
  border-top: 1px solid var(--dh-line);
  box-shadow: 0 -8px 24px rgba(15, 23, 42, .08);
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
}
.dh-compare-bar__inner {
  display: flex;
  align-items: center;
  gap: 12px 16px;
  flex-wrap: wrap;
}
.dh-compare-bar__thumbs {
  display: flex;
  gap: 8px;
}
.dh-compare-bar__thumb {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--dh-line);
  border-radius: var(--dh-r-sm);
  background: #fff;
  overflow: hidden;
}
.dh-compare-bar__thumb img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}
.dh-compare-bar__count {
  margin: 0;
  font-weight: 700;
  font-size: 14px;
}
.dh-compare-bar__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.dh-compare-bar__clear {
  border: 0;
  background: none;
  padding: 0;
  font: 600 14px var(--dh-font);
  color: var(--dh-muted);
  cursor: pointer;
}
.dh-compare-bar__clear:hover { color: var(--dh-ink); }
.dh-compare-bar__go {
  height: 40px;
  padding: 0 16px;
  font-size: 14px;
}
.dh-compare-bar__go.is-disabled {
  opacity: .45;
  pointer-events: none;
}

body.dh-compare-open {
  --dh-compare-bar-h: 72px;
  padding-bottom: var(--dh-compare-bar-h);
}
body.dh-compare-open .dh-pdp-bar.is-visible {
  bottom: var(--dh-compare-bar-h);
}
body.dh-compare-open .dh-chat {
  bottom: calc(20px + var(--dh-compare-bar-h));
}

.dh-compare-hero {
  padding: 28px 0 20px;
  background: linear-gradient(#fff, #f8fafc);
}
.dh-compare-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 3.4vw, 40px);
  letter-spacing: -0.035em;
  font-weight: 800;
}
.dh-compare-hero .dh-lead { margin-bottom: 0; max-width: 40rem; }

.dh-compare-empty {
  padding: 24px;
  border: 1px solid var(--dh-line);
  border-radius: var(--dh-r-lg);
  background: #fff;
}
.dh-compare-empty p { margin: 0 0 14px; color: var(--dh-muted); }

.dh-compare-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--dh-line);
  border-radius: var(--dh-r-lg);
  background: #fff;
}
.dh-compare-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 14.5px;
}
.dh-compare-table th,
.dh-compare-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--dh-line);
  vertical-align: top;
  text-align: left;
}
.dh-compare-table th:first-child,
.dh-compare-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  width: 140px;
  background: #fff;
  font-weight: 700;
  color: var(--dh-muted);
  font-size: 13px;
}
.dh-compare-table thead th {
  background: #f8fafc;
  font-weight: 700;
}
.dh-compare-table thead th:first-child { background: #f8fafc; }
.dh-compare-table tbody tr.is-diff td {
  background: #fffbeb;
}
.dh-compare-table tbody tr.is-diff td:first-child {
  background: #fffbeb;
}
.dh-compare-prod {
  display: grid;
  gap: 8px;
  min-width: 160px;
}
.dh-compare-prod img {
  width: 96px;
  height: 96px;
  object-fit: contain;
}
.dh-compare-prod a {
  color: var(--dh-ink);
  font-weight: 700;
  text-decoration: none;
}
.dh-compare-prod a:hover { color: var(--dh-orange); }
.dh-compare-prod__price { font-weight: 800; }
.dh-compare-prod__remove {
  border: 0;
  background: none;
  padding: 0;
  font: 600 13px var(--dh-font);
  color: var(--dh-muted);
  cursor: pointer;
  text-align: left;
}
.dh-compare-prod__remove:hover { color: var(--dh-ink); }
.dh-compare-prod .dh-btn {
  justify-self: start;
  height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

html[data-dh-view="list"] .dh-shop-wrap .dh-compare-btn--card {
  justify-content: flex-start;
  width: auto;
}

@media (max-width: 720px) {
  body.dh-compare-open { --dh-compare-bar-h: 84px; }
  .dh-compare-bar__inner { gap: 8px; }
  .dh-compare-bar__count { font-size: 13px; }
  .dh-compare-bar__go { height: 36px; padding: 0 12px; }
}
