/* EFS product compare (EFS-325). Markup: inc/product-compare.php, behaviour: assets/js/efs-compare.js.
   The shortlist page reuses the page frame, help panel and browse links styled here. */

/* ---------- Toggle on product cards ---------- */
body.efs .efs-cmp-toggle {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 4px 2px;
  border: 0;
  background: none;
  color: var(--efs-navy);
  font: 500 14px/1.2 var(--efs-body);
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  box-shadow: none;
}
@media (hover: hover) { body.efs .efs-cmp-toggle--card:hover .efs-cmp-toggle__label { color: var(--efs-green); text-decoration: underline; text-underline-offset: 4px; } }
body.efs .efs-cmp-toggle:focus-visible { outline: 2px solid var(--efs-green); outline-offset: 2px; border-radius: 6px; }
.efs-cmp-toggle__box {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border: 1.5px solid #8a94a3;
  border-radius: 5px;
  background: #fff;
  color: transparent;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.efs-cmp-toggle__box svg { width: 13px; height: 13px; display: block; }
body.efs .efs-cmp-toggle:hover .efs-cmp-toggle__box { border-color: var(--efs-green); }
body.efs .efs-cmp-toggle[aria-pressed="true"] .efs-cmp-toggle__box { background: var(--efs-green); border-color: var(--efs-green); color: #fff; }
body.efs .efs-cmp-toggle.is-full { opacity: .55; }

/* Shop cards (Bricks): own line under Add to basket. */
.efs-product-card__body .efs-cmp-toggle--card { align-self: flex-start; margin: -4px 0 -6px; }
/* Woo loop cards (related products): aligned with the card text. */
.efs-relprod ul.products li.product .efs-cmp-toggle--card,
ul.products li.product .efs-cmp-toggle--card { margin: 2px 0 0; width: auto; }

/* ---------- Product page: heart + compare under the basket button ---------- */
body.efs .efs-cmp-pdp { flex: 1 0 100%; width: 100%; display: flex; align-items: center; gap: 10px; margin: 2px 0 0; }
body.efs .efs-cmp-toggle--pdp {
  flex: 1 1 auto;
  justify-content: center;
  min-height: 46px;
  padding: 8px 18px;
  border: 1.5px solid var(--efs-line);
  border-radius: 999px;
  background: #fff;
  font-weight: 500;
  font-size: 15px;
}
body.efs .efs-cmp-toggle--pdp:hover { border-color: var(--efs-green); color: var(--efs-green); }
body.efs .efs-cmp-toggle--pdp[aria-pressed="true"] { border-color: rgba(0, 104, 56, .45); background: var(--efs-tint); color: var(--efs-green); }

/* ---------- Tray ---------- */
.efs-cmp-tray {
  position: fixed;
  left: 50%;
  bottom: calc(var(--efs-cmp-offset, 0px) + 14px);
  z-index: 990;
  width: min(820px, calc(100% - 24px));
  transform: translateX(-50%);
  background: var(--efs-navy);
  color: #fff;
  border-radius: 18px;
  box-shadow: 0 18px 50px -18px rgba(17, 35, 55, .6), 0 2px 8px rgba(17, 35, 55, .18);
  font-family: var(--efs-body);
}
.efs-cmp-tray[hidden] { display: none !important; }
html.efs-menu-open .efs-cmp-tray,
body:has(.efs-cart .cart-detail.active) .efs-cmp-tray { display: none !important; }
.efs-cmp-tray__inner { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; padding: 10px 12px 10px 10px; }
body.efs .efs-cmp-tray__items { display: flex; gap: 12px; margin: 0; padding: 0; list-style: none; }
body.efs .efs-cmp-tray__items li { position: relative; width: 52px; height: 52px; margin: 0; padding: 0; border-radius: 12px; overflow: visible; }
body.efs .efs-cmp-tray__items li.is-empty { display: grid; place-items: center; border: 1.5px dashed rgba(255, 255, 255, .45); color: rgba(255, 255, 255, .6); }
.efs-cmp-tray__items li.is-empty svg { width: 16px; height: 16px; }
.efs-cmp-tray__items li.is-filled img { width: 52px; height: 52px; display: block; object-fit: contain; background: #fff; border-radius: 12px; padding: 3px; box-sizing: border-box; }
.efs-cmp-tray__name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
body.efs .efs-cmp-tray__rm {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  top: -7px;
  right: -7px;
  width: 22px;
  height: 22px;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 0;
  border: 2px solid var(--efs-navy);
  border-radius: 50%;
  background: #fff;
  color: var(--efs-navy);
  cursor: pointer;
}
.efs-cmp-tray__rm::after { content: ""; position: absolute; inset: -10px; }
.efs-cmp-tray__rm svg { width: 10px; height: 10px; display: block; }
body.efs .efs-cmp-tray__count { margin: 0; font-size: 14.5px; font-weight: 500; line-height: 1.3; color: #fff; }
body.efs .efs-cmp-tray__count.is-warn { color: #d9f0b8; }
.efs-cmp-tray__actions { display: flex; align-items: center; gap: 6px; }
body.efs .efs-cmp-tray__go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--efs-lime);
  color: var(--efs-navy) !important;
  font-family: var(--efs-head);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none !important;
  white-space: nowrap;
}
body.efs .efs-cmp-tray__go:hover { background: #9fd352; }
body.efs .efs-cmp-tray__go.is-disabled { background: rgba(255, 255, 255, .16); color: rgba(255, 255, 255, .75) !important; cursor: default; }
body.efs .efs-cmp-tray__clear {
  -webkit-appearance: none;
  appearance: none;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, .88);
  font: 500 14px/1 var(--efs-body);
  cursor: pointer;
  box-shadow: none;
}
body.efs .efs-cmp-tray__clear:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 640px) {
  .efs-cmp-tray { width: calc(100% - 16px); bottom: calc(var(--efs-cmp-offset, 0px) + 6px); border-radius: 16px; }
  .efs-cmp-tray__inner { grid-template-columns: 1fr auto; grid-template-areas: "items go" "count clear"; gap: 2px 10px; padding: 10px 10px 2px 12px; }
  body.efs .efs-cmp-tray__items { grid-area: items; gap: 9px; padding-top: 4px; }
  body.efs .efs-cmp-tray__items li, .efs-cmp-tray__items li.is-filled img { width: 40px; height: 40px; border-radius: 10px; }
  body.efs .efs-cmp-tray__rm { top: -6px; right: -6px; width: 20px; height: 20px; }
  .efs-cmp-tray__actions { display: contents; }
  body.efs .efs-cmp-tray__go { grid-area: go; padding: 0 16px; font-size: 14px; align-self: center; }
  body.efs .efs-cmp-tray__count { grid-area: count; align-self: center; font-size: 12.5px; }
  body.efs .efs-cmp-tray__clear { grid-area: clear; justify-self: end; min-height: 36px; padding: 0 4px 0 8px; margin-right: -4px; font-size: 13px; }
}
/* Room at the end of the page so the tray never hides the footer's last line (navy, so no white strip shows). */
html.efs-cmp-tray-on #brx-footer { padding-bottom: 96px; background: var(--efs-navy); }

/* ---------- Compare and shortlist page frame ---------- */
/* The default page template is a narrow prose column: widen it to the site width for these pages. */
body.efs-cmp-template .efs-prose { max-width: none !important; width: 100%; }
body.efs-cmp-template .efs-sec { padding-top: 40px; }
body.efs .efs-cmp-page, body.efs .efs-sl-page { width: 100%; margin: 0; padding: 0 0 40px; font-family: var(--efs-body); color: var(--efs-ink); }
body.efs .efs-cmp-page__head { margin: 0 0 18px; }
body.efs .efs-cmp-page .efs-cmp-page__lead, body.efs .efs-sl-page .efs-sl-lead { margin: 0; font-size: 17px; line-height: 1.55; color: var(--efs-muted); max-width: 720px; }
.efs-cmp-page__tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
body.efs .efs-cmp-diff {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 18px 0 14px;
  border: 1.5px solid var(--efs-line);
  border-radius: 999px;
  background: #fff;
  color: var(--efs-navy);
  font-weight: 500;
  font-size: 15px;
  cursor: pointer;
}
body.efs .efs-cmp-diff:hover { border-color: var(--efs-green); }
body.efs .efs-cmp-diff input { width: 18px; height: 18px; margin: 0; accent-color: var(--efs-green); }
.efs-cmp-page__hint { display: none; font-size: 13.5px; color: var(--efs-muted); }

/* ---------- Compare table ---------- */
body.efs .efs-cmp-scroll { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--efs-line); border-radius: var(--efs-radius); background: #fff; }
body.efs .efs-cmp-scroll:focus-visible { outline: 2px solid var(--efs-green); outline-offset: 2px; }
body.efs .efs-prose .efs-cmp-table, body.efs .efs-cmp-table {
  width: 100%;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  margin: 0 !important;
  border: 0;
  font-size: 15px;
  line-height: 1.45;
  box-shadow: none;
  border-radius: 0;
  /* Article tables are display:block + overflow:hidden; this one must stay a real table (equal columns, sticky labels). */
  display: table;
  overflow: visible;
  background: #fff;
}
body.efs .efs-prose .efs-cmp-table th, body.efs .efs-prose .efs-cmp-table td {
  box-sizing: border-box;
  padding: 13px 18px;
  border: 0;
  border-bottom: 1px solid var(--efs-line);
  text-align: left;
  vertical-align: top;
  background: #fff;
  color: var(--efs-ink);
  font-size: 15px;
}
body.efs .efs-prose .efs-cmp-table tbody th[scope="row"], body.efs .efs-prose .efs-cmp-table .efs-cmp-corner {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 220px;
  font-family: var(--efs-body);
  font-weight: 600;
  color: var(--efs-navy);
  border-right: 1px solid var(--efs-line);
}
body.efs .efs-prose .efs-cmp-table.efs-cmp-table--n2 { min-width: 760px; }
body.efs .efs-prose .efs-cmp-table.efs-cmp-table--n3 { min-width: 960px; }
body.efs .efs-prose .efs-cmp-table.efs-cmp-table--n4 { min-width: 1160px; }
body.efs .efs-cmp-scroll.is-scrolled tbody th[scope="row"], body.efs .efs-cmp-scroll.is-scrolled .efs-cmp-corner { box-shadow: 8px 0 14px -10px rgba(17, 35, 55, .3); }

body.efs .efs-prose .efs-cmp-products th { padding-top: 20px; padding-bottom: 6px; border-bottom: 0; font-weight: 400; }
.efs-cmp-product__media { position: relative; margin: 0 0 12px; }
body.efs .efs-cmp-product__img { display: block; aspect-ratio: 1 / 1; border-radius: 12px; overflow: hidden; background: #fff; border: 1px solid #eef2eb; }
body.efs .efs-cmp-product__img img { width: 100% !important; height: 100% !important; object-fit: contain; display: block; margin: 0 !important; padding: 10px; box-sizing: border-box; border-radius: 0; box-shadow: none; }
body.efs .efs-cmp-remove {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--efs-line);
  border-radius: 50%;
  background: #fff;
  color: var(--efs-navy);
  box-shadow: 0 4px 12px -6px rgba(17, 35, 55, .35);
  cursor: pointer;
}
.efs-cmp-remove::after { content: ""; position: absolute; inset: -5px; }
.efs-cmp-remove svg { width: 13px; height: 13px; display: block; }
body.efs .efs-cmp-remove:hover { background: var(--efs-green); border-color: var(--efs-green); color: #fff; }
body.efs .efs-prose a.efs-cmp-product__link { display: block; color: var(--efs-navy); text-decoration: none; }
.efs-cmp-product__name { display: block; font-family: var(--efs-head); font-size: 16px; font-weight: 500; line-height: 1.35; letter-spacing: -0.005em; text-wrap: balance; }
body.efs .efs-prose a.efs-cmp-product__link:hover .efs-cmp-product__name { color: var(--efs-green); }
body.efs .efs-cmp-product__price { display: block; margin: 0 0 12px; font-family: var(--efs-head); font-size: 19px; font-weight: 600; line-height: 1.25; color: var(--efs-navy); }
body.efs .efs-cmp-product__price del { font-size: 14px; font-weight: 400; color: var(--efs-muted); }
body.efs .efs-cmp-product__price ins { text-decoration: none; }
body.efs .efs-cmp-product__price small { white-space: nowrap; font-family: var(--efs-body); font-weight: 400; font-size: 13px; color: var(--efs-muted); }
body.efs .efs-prose .efs-cmp-actions td { padding-top: 6px; padding-bottom: 20px; vertical-align: bottom; }
body.efs .efs-prose a.efs-cmp-view {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--efs-green);
  color: #fff;
  font-family: var(--efs-head);
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
}
body.efs .efs-prose a.efs-cmp-view:hover { background: var(--efs-green-d); color: #fff; }

body.efs .efs-prose .efs-cmp-section th { position: static; padding: 12px 18px; background: var(--efs-tint) !important; border-right: 0 !important; }
.efs-cmp-section th > span { position: sticky; left: 18px; font-family: var(--efs-head); font-size: 14.5px; font-weight: 600; color: var(--efs-green); }
body.efs .efs-prose .efs-cmp-row td { overflow-wrap: break-word; }
body.efs .efs-prose .efs-cmp-row td.is-empty { color: #7a8494; font-size: 14px; }
.efs-cmp-row.is-more { display: none; }
.efs-cmp-page.is-more-open .efs-cmp-row.is-more { display: table-row; }
body.efs .efs-prose .efs-cmp-section--more th { background: #fff !important; padding-top: 10px; padding-bottom: 10px; }
body.efs .efs-cmp-more {
  -webkit-appearance: none;
  appearance: none;
  position: sticky;
  left: 18px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-height: 44px;
  padding: 0 18px;
  border: 1.5px solid var(--efs-line);
  border-radius: 999px;
  background: #fff;
  color: var(--efs-navy);
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
}
body.efs .efs-cmp-more:hover { border-color: var(--efs-green); }
.efs-cmp-more__label { font-size: 14.5px; font-weight: 600; }
.efs-cmp-more__label::after { content: ""; display: inline-block; width: 7px; height: 7px; margin: 0 0 2px 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); vertical-align: middle; }
.efs-cmp-more[aria-expanded="true"] .efs-cmp-more__label::after { transform: rotate(-135deg); margin-bottom: -2px; }
.efs-cmp-more__note { font-size: 13.5px; font-weight: 400; color: var(--efs-muted); }
body.efs .efs-prose .efs-cmp-foot th, body.efs .efs-prose .efs-cmp-foot td { border-bottom: 0; padding-top: 18px; padding-bottom: 22px; }
.efs-cmp-page.is-diff-only .efs-cmp-row.is-same,
.efs-cmp-page.is-diff-only .efs-cmp-section.is-same { display: none; }

/* ---------- Help panel (compare + shortlist) ---------- */
body.efs .efs-cmp-help {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 28px;
  padding: 26px 30px;
  border-radius: var(--efs-radius);
  background: var(--efs-green);
  color: #fff;
}
body.efs .efs-prose .efs-cmp-help h2 { margin: 0 0 6px !important; padding: 0; font-family: var(--efs-head); font-size: 22px; line-height: 1.2; color: #fff; }
body.efs .efs-prose .efs-cmp-help p { margin: 0; color: rgba(255, 255, 255, .9); font-size: 16px; line-height: 1.5; max-width: 620px; }
.efs-cmp-help__actions { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 8px; }
body.efs .efs-prose .efs-cmp-help .efs-btn { text-decoration: none; }
body.efs .efs-prose a.efs-cmp-help__tel { color: #fff; font-size: 14.5px; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Empty and single states ---------- */
body.efs .efs-cmp-single { position: relative; display: flex; align-items: center; gap: 14px; margin: 18px 0 22px; padding: 14px 60px 14px 14px; border: 1px solid var(--efs-line); border-radius: var(--efs-radius); background: #fff; max-width: 640px; }
body.efs .efs-prose .efs-cmp-single a { display: flex; align-items: center; gap: 14px; color: var(--efs-navy); font-family: var(--efs-head); font-weight: 500; text-decoration: none; }
body.efs .efs-prose .efs-cmp-single img { width: 72px !important; height: 72px !important; object-fit: contain; border-radius: 10px; margin: 0 !important; flex: 0 0 72px; box-shadow: none; }
.efs-cmp-single .efs-cmp-remove { top: 50% !important; transform: translateY(-50%); }
.efs-cmp-browse { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
body.efs .efs-prose .efs-cmp-browse a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 20px;
  border: 1.5px solid rgba(0, 104, 56, .3);
  border-radius: 999px;
  background: #fff;
  color: var(--efs-green);
  font-family: var(--efs-head);
  font-weight: 500;
  text-decoration: none;
}
body.efs .efs-prose .efs-cmp-browse a:hover { background: var(--efs-green); border-color: var(--efs-green); color: #fff; }

@media (max-width: 767px) {
  body.efs-cmp-template .efs-sec { padding-top: 24px; }
  body.efs .efs-cmp-page .efs-cmp-page__lead, body.efs .efs-sl-page .efs-sl-lead { font-size: 15.5px; }
  .efs-cmp-page.has-overflow .efs-cmp-page__hint { display: inline; }
  body.efs .efs-cmp-scroll { margin: 0 calc(var(--efs-gutter) * -1); border-left: 0; border-right: 0; border-radius: 0; }
  body.efs .efs-prose .efs-cmp-table th, body.efs .efs-prose .efs-cmp-table td { padding: 11px 12px; font-size: 14px; }
  body.efs .efs-prose .efs-cmp-table tbody th[scope="row"], body.efs .efs-prose .efs-cmp-table .efs-cmp-corner { width: 108px; font-size: 13px; padding-left: var(--efs-gutter); }
  /* Each product column keeps ~150px so words never break mid-word; 3-4 products scroll sideways. */
  body.efs .efs-prose .efs-cmp-table.efs-cmp-table--n2 { min-width: 100%; }
  body.efs .efs-prose .efs-cmp-table.efs-cmp-table--n3 { min-width: 560px; }
  body.efs .efs-prose .efs-cmp-table.efs-cmp-table--n4 { min-width: 710px; }
  body.efs .efs-prose .efs-cmp-row td { overflow-wrap: break-word; hyphens: auto; }
  .efs-cmp-product__name { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; }
  body.efs .efs-cmp-product__price { font-size: 16px; margin-bottom: 10px; }
  body.efs .efs-prose a.efs-cmp-view { width: 100%; min-height: 40px; padding: 6px 10px; font-size: 13.5px; white-space: normal; text-align: center; line-height: 1.2; }
  body.efs .efs-cmp-remove { top: 6px; right: 6px; width: 32px; height: 32px; }
  body.efs .efs-prose .efs-cmp-section th { padding: 11px 12px 11px var(--efs-gutter); }
  .efs-cmp-section th > span, body.efs .efs-cmp-more { left: var(--efs-gutter); }
  .efs-cmp-more__note { display: none; }
  body.efs .efs-cmp-help { flex-direction: column; align-items: flex-start; padding: 22px; }
  .efs-cmp-help__actions { width: 100%; align-items: stretch; text-align: center; }
}
