/* Product comparison: the product-page checkbox (blocks/compare_button.liquid) and the bar on every
   page (blocks/compare_bar.liquid). The compare page's own styles are in server/routes/proxy/compare.js. */
.rekit-compare {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5em 1.25em;
  margin: .75em 0;
}

:is(.rekit-compare, .rekit-compare-bar)[hidden],
:is(.rekit-compare, .rekit-compare-bar) [hidden] {
  display: none !important;
}

.rekit-compare__toggle {
  display: inline-flex;
  align-items: center;
  gap: .5em;
  cursor: pointer;
}

.rekit-compare__toggle input {
  width: 1.125em;
  height: 1.125em;
  margin: 0;
  accent-color: currentColor;
  cursor: inherit;
}

.rekit-compare__toggle:has(input:disabled) {
  cursor: not-allowed;
  opacity: .6;
}

/* On product cards: above the link many themes stretch over the whole card (Dawn's is z-index 1),
   so it can be ticked, and under sticky headers (Dawn's is 3). */
.rekit-compare--card {
  position: relative;
  z-index: 2;
  margin: .5em 0 0;
  font-size: .875em;
}

.rekit-compare__link {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
}

/* A dark pill whatever the theme, above the page but under the theme's drawers and modals. */
.rekit-compare-bar {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 32px);
  padding: 8px;
  border-radius: 999px;
  background: #1a1a1a;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  font-size: 14px;
  line-height: 1.2;
  transform: translateX(-50%);
}

.rekit-compare-bar__items {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0 0 0 4px;
  list-style: none;
}

.rekit-compare-bar__items li {
  position: relative;
}

.rekit-compare-bar__items :is(img, span) {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  object-fit: cover;
}

.rekit-compare-bar__items button {
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 2px solid #1a1a1a;
  border-radius: 50%;
  background: #fff;
  color: #1a1a1a;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.rekit-compare-bar__go {
  padding: 10px 18px;
  border-radius: 999px;
  background: #fff;
  color: #1a1a1a;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.rekit-compare-bar__clear {
  padding: 8px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.rekit-compare-bar :focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Theme editor → Position. Bottom center is the bar above. Left and right: a slim tab docked to the
   screen edge (--side), rounded on the inner side only. */
.rekit-compare-bar--top {
  top: calc(16px + env(safe-area-inset-top, 0px));
  bottom: auto;
}

.rekit-compare-bar--side {
  top: 50%;
  bottom: auto;
  flex-direction: column;
  gap: 10px;
  padding: 12px 8px;
  font-size: 13px;
  transform: translateY(-50%);
}

.rekit-compare-bar--left {
  left: 0;
  border-radius: 0 16px 16px 0;
}

.rekit-compare-bar--right {
  left: auto;
  right: 0;
  border-radius: 16px 0 0 16px;
}

.rekit-compare-bar--side .rekit-compare-bar__items {
  flex-direction: column;
  padding: 6px 0 0;
}

.rekit-compare-bar--side .rekit-compare-bar__go {
  padding: 8px 12px;
}

.rekit-compare-bar--side .rekit-compare-bar__clear {
  padding: 0;
  font-size: 12px;
}

/* Phones: just "Compare (n)" and Clear, to cover as little of the page as possible. */
@media (max-width: 599px) {
  .rekit-compare-bar__items {
    display: none;
  }
}
