/* bm-comparison: compare buttons, sticky bar, toast and comparison table.
   Neutral tokens; override the custom properties from the theme. */
:root {
  --bmc-ink: #1f2933;
  --bmc-muted: #6b7280;
  --bmc-line: #ececec;
  --bmc-soft: #f7f7f7;
  --bmc-bg: #fff;
  --bmc-radius: 10px;
  --bmc-label-w: 150px;
  --bmc-col-w: 210px;
}

.bm-compare-sr,
.bm-compare-page .screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── Add-to-comparison button ─────────────────────────────────────────── */
.bm-compare-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  border: 1px solid var(--bmc-line); background: var(--bmc-bg); color: var(--bmc-ink);
  font: inherit; line-height: 1; cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s;
}
.bm-compare-btn__icon { width: 18px; height: 18px; flex: 0 0 auto; }
.bm-compare-btn:focus-visible { outline: 2px solid var(--bmc-ink); outline-offset: 2px; }
.bm-compare-btn.is-active { background: var(--bmc-ink); border-color: var(--bmc-ink); color: #fff; }

.bm-compare-btn--card { width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: 50%; }
.bm-compare-btn--card .bm-compare-btn__label { display: none; }
.bm-compare-btn--card:hover { border-color: var(--bmc-ink); }

.bm-compare-btn--pdp { border: 0; background: transparent; padding: .25rem 0; font-size: .95rem; font-weight: 500; }
.bm-compare-btn--pdp:hover { text-decoration: underline; }
.bm-compare-btn--pdp.is-active { background: transparent; color: var(--bmc-ink); }
.bm-compare-btn--pdp.is-active .bm-compare-btn__icon { color: #15803d; }

.bm-compare-btn--inline { min-height: 40px; padding: .5rem .85rem; border-radius: 999px; font-size: .9rem; }

/* ── Sticky bottom-left bar ───────────────────────────────────────────── */
.bm-compare-bar {
  position: fixed; left: 16px; bottom: 16px; z-index: 1200;
  width: min(320px, calc(100vw - 32px)); box-sizing: border-box;
  background: var(--bmc-bg); border-radius: 14px; padding: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .14);
}
.bm-compare-bar[hidden] { display: none; }
.bm-compare-bar__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.bm-compare-bar__title { margin: 0; font-size: .95rem; font-weight: 700; color: var(--bmc-ink); line-height: 1.2; }
.bm-compare-bar__clear {
  border: 0; background: transparent; color: var(--bmc-muted); font: inherit; font-size: .82rem;
  padding: 4px; cursor: pointer; text-decoration: underline;
}
.bm-compare-bar__clear:hover { color: var(--bmc-ink); }
.bm-compare-bar__items { display: flex; gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.bm-compare-bar__item { position: relative; width: 60px; height: 60px; flex: 0 0 auto; margin: 0; }
.bm-compare-bar__thumb { display: block; width: 100%; height: 100%; border-radius: 8px; overflow: hidden; background: var(--bmc-soft); }
.bm-compare-bar__thumb img { width: 100%; height: 100%; object-fit: contain; display: block; background: #fff; }
.bm-compare-bar__noimg { display: block; padding: 4px; font-size: .6rem; line-height: 1.2; overflow: hidden; height: 100%; box-sizing: border-box; color: var(--bmc-muted); }
.bm-compare-bar__remove {
  position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%;
  border: 0; background: var(--bmc-ink); color: #fff; font-size: 14px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.bm-compare-bar__remove:hover { background: #b91c1c; }
.bm-compare-bar__item--empty { border-radius: 8px; background: var(--bmc-soft); display: flex; align-items: center; justify-content: center; }
.bm-compare-bar__slot { color: #c4c4c4; font-size: .85rem; font-weight: 700; }
.bm-compare-bar__cta {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  background: var(--bmc-ink); color: #fff; border-radius: 8px; padding: 11px 14px;
  font-weight: 700; font-size: .95rem; text-decoration: none;
}
.bm-compare-bar__cta:hover, .bm-compare-bar__cta:focus { color: #fff; filter: brightness(1.15); }
.bm-compare-bar__count { background: rgba(255, 255, 255, .22); border-radius: 999px; min-width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; padding: 0 6px; }
.bm-compare-bar__cta.is-disabled { background: #c9ccd2; cursor: not-allowed; filter: none; }

/* ── Toast ────────────────────────────────────────────────────────────── */
.bm-compare-toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 1300; max-width: calc(100vw - 32px);
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  background: var(--bmc-ink); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: .9rem; transition: opacity .2s, transform .2s;
}
.bm-compare-toast.is-shown { opacity: 1; transform: translate(-50%, 0); }

/* ── Comparison page ──────────────────────────────────────────────────── */
.bm-compare-page { max-width: 1280px; margin: 0 auto; padding: 0 0 48px; color: var(--bmc-ink); }
.bm-compare-page.is-loading .bm-compare-page__content { opacity: .5; transition: opacity .15s; }

.bm-compare-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; margin-bottom: 16px; }
.bm-compare-toolbar__count { margin: 0; font-weight: 600; }
.bm-compare-toolbar__actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; font-size: .92rem; }
.bm-compare-toolbar__diff { display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; }
.bm-compare-toolbar__continue { color: inherit; text-decoration: underline; }
.bm-compare-toolbar__clear { border: 0; background: transparent; color: var(--bmc-muted); font: inherit; padding: 0; cursor: pointer; text-decoration: underline; }
.bm-compare-toolbar__clear:hover { color: #b91c1c; }

.bm-compare-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--bmc-bg); }
.bm-compare-table-wrap:focus-visible { outline: 2px solid var(--bmc-ink); outline-offset: 2px; }
.bm-compare-table {
  width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0;
  min-width: calc(var(--bmc-label-w) + var(--cmp-cols, 3) * var(--bmc-col-w));
  margin: 0; background: var(--bmc-bg); border: 0;
}
.bm-compare-table th, .bm-compare-table td { border: 0; border-bottom: 1px solid var(--bmc-line); }

/* Sticky label column */
.bm-compare-table__rowhead {
  position: sticky; left: 0; z-index: 2; width: var(--bmc-label-w); box-sizing: border-box;
  background: var(--bmc-bg); text-align: left; font-weight: 600; font-size: .88rem;
  padding: 12px 14px 12px 0; line-height: 1.35; word-break: break-word;
  box-shadow: 1px 0 0 var(--bmc-line);
}
.bm-compare-table__head .bm-compare-table__rowhead { border-bottom: 0; box-shadow: none; }

.bm-compare-col { position: relative; vertical-align: top; text-align: center; padding: 14px 12px 18px; font-weight: 400; }
.bm-compare-col__remove {
  position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%;
  border: 0; background: var(--bmc-soft); color: var(--bmc-muted); font-size: 17px; line-height: 1;
  display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer;
}
.bm-compare-col__remove:hover { background: #b91c1c; color: #fff; }
.bm-compare-col__media { display: flex; align-items: center; justify-content: center; height: 140px; margin: 0 auto 10px; }
.bm-compare-col__img { max-width: 100%; max-height: 140px; width: auto; height: auto; object-fit: contain; }
.bm-compare-col__name {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.6em; margin: 0 0 8px; color: inherit; font-weight: 600; font-size: .95rem; line-height: 1.3; text-decoration: none;
}
.bm-compare-col__name:hover { text-decoration: underline; }
.bm-compare-col__price { margin-bottom: 10px; min-height: 1.5em; font-weight: 700; }
.bm-compare-col__price del { color: var(--bmc-muted); font-weight: 400; font-size: .85em; }
.bm-compare-col__price ins { text-decoration: none; }
.bm-compare-col__cart {
  display: inline-flex; align-items: center; justify-content: center; width: 100%; box-sizing: border-box;
  min-height: 42px; padding: 10px 14px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 700; font-size: .92rem; line-height: 1.1; text-decoration: none;
}
.bm-compare-col__cart--buy { background: var(--bmc-cart, #16A34A); color: #fff; }
.bm-compare-col__cart--buy:hover, .bm-compare-col__cart--buy:focus { color: #fff; filter: brightness(.93); }
.bm-compare-col__cart--view { background: var(--bmc-bg); border-color: var(--bmc-line); color: var(--bmc-ink); }
.bm-compare-col__cart--view:hover { background: var(--bmc-soft); color: var(--bmc-ink); }
.bm-compare-col__cart.added { display: none; }
.bm-compare-col .added_to_cart { display: block; margin-top: 6px; font-size: .85rem; }

.bm-compare-table__cell { text-align: center; padding: 12px; font-size: .9rem; line-height: 1.45; vertical-align: middle; word-break: break-word; }
.bm-compare-table__row:hover .bm-compare-table__cell, .bm-compare-table__row:hover .bm-compare-table__rowhead { background: #fafafa; }
.bm-compare-table__empty { color: #c4c4c4; }
.bm-compare-table__nofeatures { color: var(--bmc-muted); font-style: italic; text-align: left; }
.bm-compare-table__section .bm-compare-table__rowhead {
  position: static; width: auto; box-shadow: none; padding: 22px 0 8px;
  font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--bmc-muted);
}
.bm-compare-table__section:hover .bm-compare-table__rowhead { background: var(--bmc-bg); }

/* "Vis kun forskelle" */
.bm-compare-page.is-diff-only .bm-compare-table__row.is-same { display: none; }

/* Empty state */
.bm-compare-empty { text-align: center; padding: 56px 16px; color: var(--bmc-muted); }
.bm-compare-empty__icon { width: 48px; height: 48px; color: #c4c4c4; margin-bottom: 12px; }
.bm-compare-empty__text { font-size: 1.05rem; margin: 0 0 18px; }

/* ── Small screens (works down to 320px) ──────────────────────────────── */
@media (max-width: 575px) {
  :root { --bmc-label-w: 96px; --bmc-col-w: 148px; }
  .bm-compare-bar { left: 8px; right: 8px; bottom: 8px; width: auto; padding: 10px; }
  .bm-compare-bar__items { gap: 7px; margin-bottom: 10px; }
  .bm-compare-bar__item { width: 46px; height: 46px; }
  .bm-compare-bar__item--empty { display: none; }
  .bm-compare-bar__cta { padding: 10px 12px; }

  .bm-compare-toolbar { flex-direction: column; align-items: flex-start; }
  .bm-compare-table__rowhead { padding: 10px 8px 10px 0; font-size: .78rem; }
  .bm-compare-col { padding: 10px 6px 12px; }
  .bm-compare-col__media { height: 88px; }
  .bm-compare-col__img { max-height: 88px; }
  .bm-compare-col__name { font-size: .82rem; }
  .bm-compare-col__cart { padding: 9px 8px; font-size: .8rem; min-height: 40px; }
  .bm-compare-table__cell { padding: 10px 6px; font-size: .82rem; }
}

@media (prefers-reduced-motion: reduce) {
  .bm-compare-btn, .bm-compare-toast { transition: none; }
}

/* Keep the bar from covering content at the very bottom of the page. */
body.bm-compare-open { padding-bottom: 0; }
@media (max-width: 575px) { body.bm-compare-open { padding-bottom: 150px; } }
