.compare-card {
  display:flex;
  flex-direction:column;
  min-width:0;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
}
.compare-card .collection-card { flex:1; border:0; border-radius:11px 11px 0 0; }
.compare-card:nth-child(4n+2) .collection-pack { background:radial-gradient(ellipse at 72% 23%,#eadbcb,#d4bda4); }
.compare-card:nth-child(4n+3) .collection-pack { background:radial-gradient(ellipse at 73% 29%,#ebd6be,#c19d7d); }
.compare-toggle {
  align-self:stretch;
  min-height:38px;
  padding:5px 12px;
  border:0;
  border-top:1px solid var(--line);
  border-radius:0 0 11px 11px;
  background:transparent;
  text-align:left;
  color:#315b55;
  font-size:.8rem;
  font-weight:650;
  cursor:pointer;
}
.compare-toggle:hover:not(:disabled), .compare-toggle[aria-pressed="true"] { background:#e7f0ec; }
.compare-toggle:disabled { color:#766f69; cursor:default; }
.compare-card:has([aria-pressed="true"]) { border-color:#47756c; }
.compare-toggle:focus-visible,.compare-card .collection-card:focus-visible { outline:2px solid #28645a; outline-offset:-3px; }
.compare-sr { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.comparing-products { padding-bottom:110px; }
html:has(.comparing-products) { scroll-padding-bottom:110px; }
#compare-tray {
  position:fixed;
  z-index:11;
  inset:auto 0 max(14px,env(safe-area-inset-bottom)) 0;
  margin-inline:auto;
  width:min(860px,calc(100% - 32px));
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding:12px 16px;
  border:1px solid #42615a;
  border-radius:14px;
  box-shadow:0 9px 32px #182a2440;
  background:#203d38;
  color:#fff;
}
.compare-selection,.compare-actions,#compare-list,.compare-remove { display:flex; align-items:center; }
.compare-selection { flex:1; min-width:0; gap:14px; }
.compare-selection strong { font-size:.84rem; white-space:nowrap; }
#compare-list { gap:6px; min-width:0; margin:0; padding:0; list-style:none; }
#compare-list li { min-width:0; }
.compare-remove {
  gap:6px;
  max-width:100%;
  min-height:34px;
  padding:4px 9px;
  border:1px solid #78958a;
  border-radius:6px;
  background:transparent;
  color:inherit;
  font-size:.78rem;
  text-align:left;
}
.compare-chip-name { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.compare-cross { flex:none; line-height:1; font-size:1.2rem; }
.compare-actions { flex:none; gap:8px; }
.compare-actions button { min-height:42px; border:0; padding:6px 13px; border-radius:8px; font-weight:650; }
#compare-clear { background:transparent; color:#fff; }
#compare-open { background:#f5e6d0; color:#243b32; }
#compare-open:disabled { background:#587069; color:#fff; }
#compare-tray button:focus-visible { outline:2px solid white; outline-offset:2px; }
body:has(#compare-dialog[open]) { overflow:hidden; }
#compare-dialog {
  inset:0;
  margin:auto;
  width:min(1020px,calc(100% - 32px));
  max-width:none;
  height:fit-content;
  max-height:calc(100dvh - 40px);
  border:1px solid var(--line);
  border-radius:18px;
  box-shadow:0 12px 66px #17252138;
}
#compare-dialog[open] { display:flex; flex-direction:column; overflow:hidden; }
.compare-heading {
  display:flex;
  flex:none;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:13px 24px;
  border-bottom:1px solid var(--line);
  background:var(--paper);
}
.compare-heading h2 { margin:0; font-size:1.45rem; font-family:var(--sans); font-weight:750; }
#compare-close { width:44px; height:44px; }
.compare-detail { min-height:0; padding:0 24px 20px; overflow:auto; overscroll-behavior:contain; }
.compare-detail:focus-visible { outline:2px solid #28645a; outline-offset:-2px; }
#compare-feedback { margin:18px 24px; }
#compare-feedback:empty { margin:0; }
#compare-retry { align-self:flex-start; margin:0 24px 18px; padding:6px 14px; border:1px solid var(--line); border-radius:8px; background:var(--paper); color:var(--ink); }
#compare-table { width:100%; border-collapse:separate; border-spacing:0; table-layout:fixed; color:var(--ink); font-size:.88rem; }
#compare-table th,#compare-table td { padding:10px 12px; border-bottom:1px solid var(--line); text-align:left; vertical-align:top; overflow-wrap:anywhere; }
#compare-table th:first-child { width:8rem; padding-left:0; }
#compare-table td:last-child,#compare-table th:last-child { padding-right:0; }
#compare-table thead th { position:sticky; top:0; z-index:2; background:var(--paper); vertical-align:bottom; }
#compare-table th:first-child { color:var(--muted); font-size:.8rem; font-weight:650; }
.compare-image { display:block; width:min(100%,75px); height:auto; aspect-ratio:1; object-fit:contain; }
.compare-name { display:block; font-size:.96rem; line-height:1.45; }
.compare-total td { color:#28594d; font-weight:750; }
.compare-warning { color:#86512f; }
.compare-medication span { display:block; }
.compare-link { display:inline-flex; align-items:center; min-height:40px; color:#265b52; font-weight:700; text-decoration:underline; text-underline-offset:4px; }
.compare-shipping-note { margin:13px 0 0; color:var(--muted); font-size:.8rem; line-height:1.6; }
@media (max-width:650px) {
  #compare-tray { display:grid; grid-template-columns:1fr auto; inset:auto 0 0; width:100%; padding:5px 12px max(8px,env(safe-area-inset-bottom)); border-radius:12px 12px 0 0; gap:2px 8px; }
  .compare-selection { display:contents; }
  .compare-selection strong { grid-column:1; grid-row:1; font-size:.8rem; }
  .compare-actions { grid-column:2; grid-row:1; gap:3px; }
  .compare-actions button { padding-inline:8px; min-height:44px; font-size:.84rem; }
  .compare-remove { padding:3px 5px; min-height:34px; gap:3px; }
  #compare-list { grid-column:1 / -1; grid-row:2; gap:4px; }
  #compare-list li { flex:0 1 auto; }
  .compare-toggle { min-height:44px; }
  #compare-dialog { width:calc(100% - 16px); max-height:calc(100dvh - 20px); border-radius:12px; }
  .compare-heading { padding:6px 12px; }
  .compare-detail { padding:0 0 14px; }
  #compare-table { min-width:340px; font-size:.84rem; }
  #compare-table[data-columns="3"] { min-width:620px; }
  #compare-table th,#compare-table td { padding:8px; }
  #compare-table td:last-child,#compare-table th:last-child { padding-right:8px; }
  #compare-table th:first-child { position:sticky; left:0; z-index:1; width:5rem; padding-left:10px; background:var(--paper); border-right:1px solid var(--line); }
  #compare-table thead th:first-child { z-index:3; }
  .compare-image { width:48px; }
  .compare-shipping-note { position:sticky; left:0; padding:0 10px; }
  .compare-name { font-size:.83rem; }
}
@media (max-height:430px) {
  .compare-image { display:none; }
}
