/* Add to compare button, bottom tray, comparison table and product specification table. */
.cmp-add { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); font-size: 13.5px; font-weight: 600; line-height: 1.2; cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.cmp-add:hover { border-color: var(--brand); color: var(--brand); }
.cmp-add:focus-visible, .cmp-chip button:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.cmp-add.is-on { border-color: #1a6b43; background: #e6f6eb; color: #1a6b43; }
.cmp-add-block { width: 100%; }
.prod-compare { margin: 0 0 14px; }

/* Tray */
.cmp-tray { position: fixed; left: 50%; bottom: 12px; z-index: 1040; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; width: min(980px, calc(100vw - 24px)); padding: 10px 12px; transform: translateX(-50%); border-radius: var(--radius); background: var(--ink); box-shadow: 0 12px 34px rgba(34, 32, 29, .35); color: #fff; }
.cmp-tray[hidden] { display: none; }
.cmp-tray-items { display: flex; flex: 1 1 280px; flex-wrap: wrap; gap: 6px; min-width: 0; }
.cmp-chip { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; padding-left: 10px; border-radius: 999px; background: rgba(255, 255, 255, .13); font-size: 13px; }
.cmp-chip > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cmp-chip button { flex: none; width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: #fff; cursor: pointer; }
.cmp-chip button:hover { background: rgba(255, 255, 255, .16); }
.cmp-tray-actions { display: flex; align-items: center; gap: 8px; }
.cmp-tray-go { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 18px; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 700; font-size: 14px; white-space: nowrap; }
.cmp-tray-go:hover { background: var(--accent-dark); color: #fff; text-decoration: none; }
.cmp-tray-go.is-disabled { background: rgba(255, 255, 255, .16); color: #dcd9d6; cursor: default; }
.cmp-tray-clear { min-height: 44px; padding: 0 10px; border: 0; background: transparent; color: #dcd9d6; font-size: 13px; text-decoration: underline; cursor: pointer; }
.cmp-tray-msg { flex: 1 1 100%; margin: 0; color: #ffb99c; font-size: 13px; }
body.has-cmp-tray { padding-bottom: 84px; }

/* Comparison table */
.cmp-result { margin-bottom: 32px; }
.cmp-result-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.cmp-result-head h2 { margin: 0; font-size: 26px; }
.cmp-result-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 14px; }
.cmp-result-tools label { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; margin: 0; cursor: pointer; }
.cmp-result-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; -webkit-overflow-scrolling: touch; }
.cmp-full { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; line-height: 1.45; }
.cmp-full th, .cmp-full td { min-width: 190px; padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: break-word; }
.cmp-full tbody tr:last-child > * { border-bottom: 0; }
.cmp-full .cmp-label { position: sticky; left: 0; z-index: 2; width: 180px; min-width: 130px; max-width: 180px; background: var(--soft); font-weight: 600; }
.cmp-full thead th { background: #fff; font-weight: 400; }
.cmp-full thead .cmp-label { background: #fff; }
.cmp-full .cmp-group th { background: var(--panel); font-size: 13px; font-weight: 700; }
.cmp-group-name { position: sticky; left: 14px; }
.cmp-full tr.is-diff td { background: #fff8f4; }
.cmp-full.diff-only tr.is-same { display: none; }
.cmp-full .cmp-none { color: var(--muted); }
.cmp-model { display: flex; flex-direction: column; gap: 8px; height: 100%; }
.cmp-model img { width: 110px; height: 110px; object-fit: contain; }
.cmp-model-name { color: var(--ink); font-size: 15px; font-weight: 700; line-height: 1.3; }
.cmp-model-remove { align-self: flex-start; display: inline-flex; align-items: center; gap: 5px; min-height: 32px; color: var(--muted); font-size: 13px; }
.cmp-model .btn { align-self: flex-start; }
.cmp-source { margin: 10px 0 0; color: var(--muted); font-size: 13px; }

/* Picker list */
.compare-table .cmp-add { white-space: nowrap; }

/* Specification table on the product page */
.spec-table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.5; }
.spec-table th, .spec-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.spec-table tbody th { width: 32%; font-weight: 600; }
.spec-table .spec-group th { width: auto; background: var(--panel); font-size: 13px; font-weight: 700; }
.spec-table tr:last-child > * { border-bottom: 0; }
.spec-note { margin: 10px 0 0; color: var(--muted); font-size: 13px; }

@media (max-width: 767px) {
  .cmp-tray { padding: 8px 10px; }
  .cmp-tray-items { flex-basis: 100%; }
  .cmp-tray-actions { width: 100%; justify-content: space-between; }
  .cmp-tray-go { flex: 1; justify-content: center; }
  body.has-cmp-tray { padding-bottom: 130px; }
  .cmp-result-head h2 { font-size: 22px; }
  .cmp-full th, .cmp-full td { min-width: 160px; padding: 9px 10px; font-size: 13.5px; }
  .cmp-full .cmp-label { width: 104px; min-width: 104px; max-width: 104px; }
  .cmp-model img { width: 84px; height: 84px; }
  .spec-table th, .spec-table td { padding: 9px 10px; font-size: 14px; }
  .spec-table tbody th { width: 38%; }
}
