/* Sticky buy bar — views/sections/sticky_buy_bar.php. Fixed above the mobile bottom nav; product.js adds
   .is-visible (and html.has-sticky-buy) only while every buy box on the page is out of view. */

.rr-section.rr-section--sticky_buy_bar {
  margin: 0;
  padding: 0;
}

.sticky-buy {
  position: fixed;
  left: 0;
  right: 0;
  bottom: var(--mobile-nav-h, 0px);
  z-index: var(--z-sticky);
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 -12px 32px -20px rgba(20, 21, 26, .45);
  visibility: hidden;
  transform: translateY(110%);
  transition: transform var(--dur-3) var(--ease-out), visibility 0s linear var(--dur-3);
}

/* The section is full bleed, and sections.css puts full-bleed children back in the flow (position: relative,
   z-index 1): keep the bar pinned to the viewport, above the page. */
.rr-section.rr-section--sticky_buy_bar > .sticky-buy {
  position: fixed;
  z-index: var(--z-sticky);
}

.sticky-buy.is-visible {
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

@media (min-width: 1024px) {
  .sticky-buy {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

.sticky-buy__inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 68px;
  padding-block: 0.6rem;
}

.sticky-buy__thumb {
  flex: none;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
}

.sticky-buy__thumb :is(picture, img) {
  width: 100%;
  height: 100%;
}

.sticky-buy__thumb img {
  object-fit: cover;
}

.sticky-buy__info {
  display: grid;
  flex: 1;
  gap: 0.1rem;
  min-width: 0;
}

.sticky-buy__name {
  overflow: hidden;
  font-size: 0.9375rem;
  font-weight: 650;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sticky-buy__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  color: var(--color-text-muted);
  font-size: var(--step--1);
}

.sticky-buy__variant {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sticky-buy .pd-pricing,
.sticky-buy .pd-pricing__row {
  gap: 0.35rem;
}

/* The price reads a step above the name, as the bar's main fact. */
.sticky-buy .price {
  --price-size: 1.0625rem;
  flex-wrap: nowrap;
}

.sticky-buy__actions {
  display: flex;
  flex: none;
  gap: 0.5rem;
}

.sticky-buy__btn {
  min-height: 46px;
  padding-inline: 1.15rem;
}

.sticky-buy__secondary {
  display: none;
}

@media (min-width: 768px) {
  .sticky-buy__secondary {
    display: inline-flex;
  }

  .sticky-buy__thumb {
    width: 52px;
    height: 52px;
  }
}

@media (max-width: 479.98px) {
  .sticky-buy__thumb {
    display: none;
  }

  .sticky-buy__btn {
    padding-inline: 0.95rem;
  }

  .sticky-buy__btn .icon {
    display: none;
  }
}

/* Keep toasts, the WhatsApp button and the last footer row clear of the bar. */
html.has-sticky-buy body {
  --toast-offset: 76px;
}

html.has-sticky-buy body.has-whatsapp {
  --toast-offset: 140px;
}

/* `translate` composes with the button's own hover `transform: scale()`. */
html.has-sticky-buy .whatsapp-button {
  translate: 0 -72px;
}

html.has-sticky-buy .site-footer {
  padding-bottom: calc(1.5rem + 72px);
}

.whatsapp-button {
  transition: transform var(--dur-2) var(--ease-out), translate var(--dur-3) var(--ease-out);
}
