/* Producten vergelijken: zwevende balk (compare.js) en de vergelijkpagina (vergelijken.html). */
.compare-bar[hidden] { display: none !important; }
.compare-bar {
  position: fixed; left: 50%; bottom: 16px; z-index: 900; transform: translateX(-50%);
  display: flex; align-items: center; gap: 16px; width: min(960px, calc(100% - 32px)); padding: 10px 12px;
  background: #fff; border: 1px solid #d8e2ed; border-radius: 10px; box-shadow: 0 10px 30px rgba(20, 40, 62, .18);
  color: #14283e; font-size: 13px;
}
.compare-bar-items { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; flex: 1; min-width: 0; }
.compare-bar-item { position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 48px; padding: 4px 26px 4px 4px; border: 1px solid #e1e6ee; border-radius: 8px; }
.compare-bar-item img { width: 52px; height: 40px; object-fit: contain; flex: none; }
.compare-bar-item span { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; font-weight: 600; }
.compare-bar-item.is-empty { justify-content: center; padding-right: 4px; border-style: dashed; color: #6b7686; }
.compare-bar-item.is-empty span { font-weight: 400; }
.compare-bar-item button { position: absolute; top: 2px; right: 4px; padding: 2px 4px; border: 0; background: none; color: #6b7686; font-size: 18px; line-height: 1; cursor: pointer; }
.compare-bar-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.compare-bar-go { display: inline-flex; align-items: center; min-height: 42px; padding: 0 18px; border-radius: 8px; background: #006bd1; color: #fff; font-weight: 700; text-decoration: none; white-space: nowrap; }
.compare-bar-go.is-disabled { background: #b9c6d4; pointer-events: none; }
.compare-bar-clear { padding: 0; border: 0; background: none; color: #6b7686; font-size: 13px; text-decoration: underline; cursor: pointer; }
.compare-bar-notice { margin: 0; color: #a5520c; font-weight: 600; max-width: 180px; }
@media (max-width: 720px) {
  .compare-bar { flex-wrap: wrap; gap: 8px; bottom: calc(72px + env(safe-area-inset-bottom, 0px)); width: calc(100% - 16px); padding: 8px; }
  .compare-bar-items { flex-basis: 100%; gap: 6px; }
  .compare-bar-item img { display: none; }
  .compare-bar-item { min-height: 36px; padding: 4px 22px 4px 6px; }
  .compare-bar-item span { -webkit-line-clamp: 1; font-size: 12px; }
  .compare-bar-actions { flex: 1; flex-wrap: wrap; justify-content: space-between; }
  .compare-bar-notice { flex-basis: 100%; max-width: none; order: -1; }
  .compare-bar-go { flex: 1; justify-content: center; }
  .compare-bar-clear { white-space: nowrap; }
}

/* Knop op de productpagina */
.product-compare-toggle[hidden] { display: none !important; }
.product-compare-toggle { justify-self: start; display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: #006bd1; font-size: 14px; font-weight: 700; cursor: pointer; }
.product-compare-toggle[aria-pressed="true"]::before { content: "✓"; }
.product-compare-toggle[aria-pressed="false"]::before { content: "⇄"; }

/* Vergelijkpagina */
.compare-page { max-width: 1200px; margin: 0 auto; padding: 16px 16px 48px; color: #14283e; }
.compare-page h1 { margin: 8px 0 4px; font-size: 28px; }
.compare-page-intro { margin: 0 0 16px; color: #4c5b6d; }
.compare-page-tools[hidden] { display: none; }
.compare-page-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 12px; font-size: 14px; }
.compare-page-tools label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.compare-page-tools button { padding: 0; border: 0; background: none; color: #6b7686; text-decoration: underline; cursor: pointer; font-size: 14px; }
.compare-table-wrap { overflow-x: auto; border: 1px solid #d8e2ed; border-radius: 10px; background: #fff; }
.compare-table { width: 100%; min-width: 640px; border-collapse: collapse; table-layout: fixed; font-size: 14px; }
.compare-table th, .compare-table td { padding: 10px 12px; border-bottom: 1px solid #e9eef4; text-align: left; vertical-align: top; }
.compare-table tbody th { width: 180px; color: #4c5b6d; font-weight: 600; background: #f7f9fc; }
.compare-table tr.is-different td { background: #fffaf0; }
.compare-table thead td { vertical-align: top; }
.compare-head { display: grid; gap: 8px; }
.compare-head img { width: 100%; max-width: 220px; height: 150px; object-fit: contain; }
.compare-head a.compare-name { color: #14283e; font-weight: 700; text-decoration: none; line-height: 1.3; }
.compare-head .compare-price { font-size: 20px; font-weight: 800; }
.compare-head .compare-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.compare-head .compare-view { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 8px; background: #006bd1; color: #fff; font-weight: 700; text-decoration: none; }
.compare-head .compare-remove { padding: 0; border: 0; background: none; color: #6b7686; text-decoration: underline; cursor: pointer; font-size: 13px; }
.compare-stock-good { color: #187a3a; font-weight: 600; }
.compare-stock-warn { color: #a5520c; font-weight: 600; }
.compare-stock-bad { color: #b42318; font-weight: 600; }
.compare-empty { padding: 32px; border: 1px dashed #c9d5e2; border-radius: 10px; text-align: center; background: #fff; }
.compare-empty a { color: #006bd1; font-weight: 700; }

/* Vinkje op de productkaarten (categoriepagina); stond verborgen zolang het nog niets deed. */
.product-wedge-grid .product-wedge-compare { display: inline-flex; gap: 6px; margin-top: 6px; color: #087cf0; font-size: 13px; font-weight: 600; }
.product-wedge-grid .product-wedge-compare span { white-space: nowrap; }
.product-wedge-grid .product-wedge-compare input[type="checkbox"] { flex: none; width: 16px !important; height: 16px !important; min-width: 0; min-height: 0; }
@media (max-width: 720px) {
  .compare-page h1 { font-size: 24px; }
  .compare-table { min-width: 0; width: max-content; table-layout: auto; font-size: 13px; }
  .compare-table th, .compare-table td { padding: 8px; }
  .compare-table td { width: 150px; min-width: 150px; max-width: 150px; }
  .compare-table tbody th, .compare-table thead td:first-child { position: sticky; left: 0; z-index: 1; width: 96px; min-width: 96px; max-width: 96px; background: #f7f9fc; }
  .compare-head img { height: 100px; }
  .compare-head .compare-price { font-size: 17px; }
}
