/* Motion is an enhancement: every section is visible before JavaScript starts. */
:root {
    --motion-enter-duration: 400ms;
    --motion-interaction-duration: 180ms;
    --motion-enter-distance: 14px;
}

.town-enter {
    animation: town-enter var(--motion-enter-duration) var(--ease-out, ease-out) both;
}

@keyframes town-enter {
    from { opacity: .55; translate: 0 var(--motion-enter-distance); }
    to { opacity: 1; translate: 0 0; }
}

/* Keep product movement restrained, including on devices with a pointer. */
.product-card-image .image-frame img {
    transition-duration: 360ms;
}

.button > svg,
.button > span[aria-hidden="true"]:not(.button-spinner):not(.inline-spinner),
.button-text > svg {
    transition: translate var(--motion-interaction-duration) var(--ease-out, ease-out);
}

@media (hover: hover) and (pointer: fine) {
    .button:hover > svg,
    .button:hover > span[aria-hidden="true"]:not(.button-spinner):not(.inline-spinner),
    .button-text:hover > svg { translate: 2px -2px; }

    .button:active:not(:disabled) { translate: 0 1px; }
}

/* A compact status pill never blocks the page while interactivity starts. */
.site-loading {
    position: fixed;
    left: max(1rem, env(safe-area-inset-left));
    bottom: max(1rem, env(safe-area-inset-bottom));
    z-index: 90;
    display: flex;
    align-items: center;
    gap: .7rem;
    max-width: calc(100vw - 2rem);
    padding: .8rem 1rem;
    border: 1px solid #70773335;
    border-radius: 3rem;
    background: var(--color-light, #F7F2DC);
    color: var(--color-text, #25271D);
    box-shadow: 0 4px 22px #25271d12;
    font-size: .72rem;
    line-height: 1.4;
    pointer-events: none;
    transition: opacity 200ms ease, translate 200ms ease, visibility 0s 200ms;
}

.site-loading.is-ready {
    opacity: 0;
    visibility: hidden;
    translate: 0 8px;
}

.site-loading > span,
.inline-spinner,
.button-spinner {
    display: inline-block;
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    border: 1.5px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    vertical-align: middle;
    animation: town-spin 700ms linear infinite;
}

.site-loading > span { color: var(--town-green, #707733); }
.button[aria-busy="true"],
.button.is-saving { cursor: wait; opacity: .8; }
.is-saving .inline-spinner,
.is-saving .button-spinner { margin-right: .3rem; }

@keyframes town-spin { to { rotate: 360deg; } }

@media (max-width: 700px) {
    .main-nav.is-open { animation: town-menu-open 180ms ease-out both; }
    .site-loading { font-size: .68rem; padding: .7rem .9rem; }
}

@keyframes town-menu-open {
    from { opacity: .7; translate: 0 -5px; }
    to { opacity: 1; translate: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
    .town-enter,
    .main-nav.is-open,
    .site-loading > span,
    .inline-spinner,
    .button-spinner { animation: none !important; }

    .town-enter { opacity: 1; translate: none; }
    .site-loading,
    .button > svg,
    .button > span,
    .button-text > svg,
    .product-card-image .image-frame img { transition: none !important; }

    .button:hover > svg,
    .button:hover > span[aria-hidden="true"],
    .button-text:hover > svg,
    .button:active:not(:disabled) { translate: none; }
    .product-card-image:hover .image-frame img { transform: none; }
}
/* Failed native images must not keep their loading overlay indefinitely. */
.image-frame.image-error .image-loader { display: none; }
