/* The platform wraps each section in a container div; the wrapper must carry
   the sticky positioning so the bar can stick against the page flow. */
div:has(> .sticky-purchase-bar) {
  position: sticky;
  bottom: 0;
  z-index: 50;
}

.sticky-purchase-bar {
  --bar-pad-y: 12px;
  --bar-gap: 16px;
  --bar-img: 44px;
  --bar-title: 12px;
  --bar-price: 13px;
  --bar-price-gap: 2px;
  --bar-cmp-w: 0px;
  --bar-qty-w: 0px;
  --bar-cta-gap: 0px;
  --bar-trust-h: 0px;
  --bar-trust-m: 0px;
  --bar-grow-opacity: 0;
  --bar-cta-pad-y: 15px;
  --bar-cta-pad-x: 26px;
  position: sticky;
  bottom: 0;
  z-index: 50;
  box-sizing: border-box;
  padding: var(--bar-pad-y) 20px;
  border-top: 1px solid rgba(33, 78, 52, 0.2);
  background: #f7f4ec;
  box-shadow: 0 -2px 10px rgba(23, 56, 36, 0.04);
  font-family: "Montserrat", Arial, sans-serif;
  color: #222;
  transition: padding 0.14s linear, box-shadow 0.3s ease, transform 0.28s ease, opacity 0.28s ease;
}

/* Hidden until the real Add to cart button scrolls out of view (v2 #23). JS
   adds .is-revealed; without JS the bar stays visible rather than vanishing. */
.sticky-purchase-bar--gated {
  opacity: 0;
  pointer-events: none;
  transform: translateY(110%);
}

.sticky-purchase-bar--gated.is-revealed {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .sticky-purchase-bar {
    transition: none;
  }
}

.sticky-purchase-bar--shadow {
  box-shadow: 0 -10px 30px rgba(23, 56, 36, 0.13);
}

.sticky-purchase-bar__inner {
  display: flex;
  align-items: center;
  gap: var(--bar-gap);
  max-width: 1280px;
  margin: 0 auto;
  transition: gap 0.14s linear;
}

.sticky-purchase-bar__inner > img {
  width: var(--bar-img);
  height: var(--bar-img);
  flex: 0 0 auto;
  object-fit: contain;
  transition: width 0.14s linear, height 0.14s linear;
}

.sticky-purchase-bar__meta {
  flex: 1;
  min-width: 0;
}

.sticky-purchase-bar__title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #173824;
  font-size: var(--bar-title);
  font-weight: 700;
  transition: font-size 0.14s linear;
}

.sticky-purchase-bar__price-row {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-top: var(--bar-price-gap);
  transition: margin-top 0.14s linear;
}

.sticky-purchase-bar__price {
  color: #173824;
  font-size: var(--bar-price);
  font-weight: 700;
  transition: font-size 0.14s linear;
}

.sticky-purchase-bar__compare {
  overflow: hidden;
  max-width: var(--bar-cmp-w);
  white-space: nowrap;
  opacity: var(--bar-grow-opacity);
  color: #6b7a70;
  text-decoration: line-through;
  font-size: 13px;
  transition: max-width 0.14s linear, opacity 0.14s linear;
}

.sticky-purchase-bar__trust {
  overflow: hidden;
  max-height: var(--bar-trust-h);
  margin-top: var(--bar-trust-m);
  white-space: nowrap;
  opacity: var(--bar-grow-opacity);
  color: #5c6b60;
  font-size: 12px;
  line-height: 20px;
  transition: max-height 0.14s linear, margin-top 0.14s linear, opacity 0.14s linear;
}

.sticky-purchase-bar__actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: var(--bar-cta-gap);
  transition: gap 0.14s linear;
}

.sticky-purchase-bar__quantity {
  display: flex;
  align-items: center;
  overflow: hidden;
  width: var(--bar-qty-w);
  opacity: var(--bar-grow-opacity);
  border: 1px solid rgba(33, 78, 52, 0.3);
  border-radius: 999px;
  transition: width 0.14s linear, opacity 0.14s linear;
}

.sticky-purchase-bar__quantity button {
  height: 46px;
  padding: 0 14px;
  cursor: pointer;
  border: 0;
  background: none;
  color: #214e34;
  font: inherit;
  font-size: 17px;
  line-height: 1;
}

.sticky-purchase-bar__quantity span {
  min-width: 24px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
}

.sticky-purchase-bar__add {
  padding: var(--bar-cta-pad-y) var(--bar-cta-pad-x);
  cursor: pointer;
  border: 0;
  border-radius: 999px;
  background: #214e34;
  color: #f7f4ec;
  white-space: nowrap;
  font-family: "Montserrat", Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: padding 0.14s linear;
}

.sticky-purchase-bar__add:hover {
  background: #173824;
}

.sticky-purchase-bar button:focus-visible {
  outline: 2px solid #214e34;
  outline-offset: 3px;
}
