/* ── Sticky buy bar ─────────────────────────────────────────
   Figma: desktop 3033:88290 / 88302 / 88311, tablet 3033:88257,
   mobile 3033:88212 (no photo; the name small, over the state).
   Slides up from the bottom once the buy box is out of view.
   ─────────────────────────────────────────────────────────── */

.product-sticky {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 90;
    padding: 16px var(--pad-x);
    background: var(--color-white);
    box-shadow: 0 -4px 12px rgb(0 0 0 / 0.12);
    translate: 0 110%;
    transition: translate 250ms ease;
}

.product-sticky[hidden] {
    display: block;
    visibility: hidden;
}

.product-sticky.is-shown {
    visibility: visible;
    translate: 0 0;
}

.product-sticky__inner {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: var(--site-max-w);
    margin: 0 auto;
}

.product-sticky__image {
    flex: none;
    width: 64px;
    height: 64px;
    border-radius: 6px;
    object-fit: cover;
}

.product-sticky__copy {
    flex: 1;
    min-width: 0;
}

.product-sticky__name {
    overflow: hidden;
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 600;
    line-height: 25px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.product-sticky__state {
    line-height: 20.8px;
    color: var(--color-text-muted);
}

.product-sticky__price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.product-sticky__price[hidden] {
    display: none;
}

.product-sticky__price span {
    line-height: 20.8px;
    color: var(--color-text-muted);
}

.product-sticky__price strong {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 600;
    line-height: 32px;
    color: var(--color-secondary);
}

.product-sticky__button {
    flex: none;
    min-width: 232px;
}

/* Room at the bottom of the page, so the bar never covers the footer */
body:has(.product-sticky.is-shown) .site-footer {
    padding-bottom: calc(var(--sticky-h, 96px) + 24px);
}

/* ── Mobile: no photo, the name small over the state ────────── */
@media (max-width: 767px) {
    .product-sticky {
        padding: 12px var(--pad-x);
    }

    .product-sticky__image,
    .product-sticky__price span {
        display: none;
    }

    .product-sticky__name {
        font-family: var(--font-body);
        font-size: 14px;
        font-weight: 400;
        line-height: 18px;
        color: var(--color-text-muted);
    }

    .product-sticky__state {
        font-family: var(--font-heading);
        font-size: 18px;
        font-weight: 600;
        line-height: 24px;
        color: var(--color-secondary);
    }

    /* With a price: the name, the price, the button */
    .product-sticky:has(.product-sticky__price:not([hidden])) .product-sticky__state {
        display: none;
    }

    .product-sticky__price strong {
        font-size: 18px;
        line-height: 24px;
    }

    .product-sticky__inner {
        gap: 12px;
    }

    .product-sticky__button {
        min-width: 0;
        padding-inline: 20px;
    }
}
