/**
 * Sticky Free-Sample Bar (Phase 96)
 *
 * Catalog-only sticky bar at viewport bottom: "Still browsing? Take 4 free posts →"
 * - One-per-session dismiss via × (sessionStorage)
 * - Mobile collapse to corner pill on scroll-down past 150px (D-09)
 * - Respects prefers-reduced-motion (component-scoped + global)
 */

.sticky-promo-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: var(--z-sticky-promo);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--color-cream);
    box-shadow: var(--shadow-warm-lg);
    transition: transform 200ms ease-out, width 200ms ease-out, border-radius 200ms ease-out;
    will-change: transform;
}

.sticky-promo-bar__cta {
    flex: 1;
    color: var(--color-burgundy);
    font-family: var(--font-heading, inherit);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    line-height: 1.3;
}

.sticky-promo-bar__cta:hover,
.sticky-promo-bar__cta:focus {
    text-decoration: underline;
}

.sticky-promo-bar__cta strong {
    font-weight: 700;
}

.sticky-promo-bar__dismiss {
    flex: 0 0 auto;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    background: transparent;
    border: none;
    color: var(--color-burgundy);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    border-radius: var(--radius-md, 8px);
}

.sticky-promo-bar__dismiss:hover,
.sticky-promo-bar__dismiss:focus {
    background: rgb(0 0 0 / 5%);
}

/* Mobile collapsed pill: corner icon + price */
@media (width <= 768px) {
    .sticky-promo-bar--collapsed {
        left: auto;
        right: var(--space-md);
        bottom: var(--space-md);
        width: auto;
        padding: var(--space-sm) var(--space-md);
        border-radius: 999px;
        box-shadow: var(--shadow-warm-lg);
    }

    .sticky-promo-bar--collapsed .sticky-promo-bar__cta {
        font-size: 0.875rem;
        white-space: nowrap;
    }

    .sticky-promo-bar--collapsed .sticky-promo-bar__cta-full {
        display: none;
    }

    .sticky-promo-bar__cta-pill {
        display: none;
    }

    .sticky-promo-bar--collapsed .sticky-promo-bar__cta-pill {
        display: inline;
    }

    .sticky-promo-bar--collapsed .sticky-promo-bar__dismiss {
        min-width: 32px;
        min-height: 32px;
        font-size: 1.125rem;
    }
}

/* Component-scoped reduced-motion override (defense-in-depth; site-wide block lives at tokens.css:260-286) */
@media (prefers-reduced-motion: reduce) {
    .sticky-promo-bar {
        transition: none;
    }

    .sticky-promo-bar--collapsed {
        transform: none;
    }
}
