/* ARCSTEP FX — motion & micro-interactions (owner: FX). transform/opacity only. */

/* ---------- Page transitions (cross-document View Transitions) ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 320ms; animation-timing-function: var(--ease); }
::view-transition-group(fx-product) { animation-duration: 450ms; animation-timing-function: var(--ease); }
.site-header { view-transition-name: fx-header; }
.gallery__slide:first-child img { view-transition-name: fx-product; }
.fx-vt-card .gallery__slide:first-child img { view-transition-name: none; }

/* ---------- Header: hide/show + scrolled state ---------- */
.site-header.fx-header {
  border-bottom-color: transparent;
  background: var(--c-white);
  -webkit-backdrop-filter: none; backdrop-filter: none;
  transition: transform 320ms var(--ease);
  will-change: transform;
}
.site-header.fx-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: var(--c-line); opacity: 0; transition: opacity 280ms var(--ease); pointer-events: none;
}
.site-header.fx-header.is-scrolled {
  background: var(--c-white);
}
.site-header.fx-header.is-scrolled::after { opacity: 1; }
.site-header.fx-header.is-hidden { transform: translateY(-100%); }
.menu-open .site-header.fx-header { transform: none; }

/* ---------- Announcement marquee (home) — in-flow, negative margin => zero layout shift ---------- */
.fx-marquee {
  position: relative; z-index: 2; height: 32px; margin-bottom: -32px; overflow: hidden;
  background: var(--c-black); color: var(--c-white);
  font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  display: flex; align-items: center;
}
.fx-marquee__track { display: flex; width: max-content; animation: fx-marquee 42s linear infinite; }
.fx-marquee:hover .fx-marquee__track { animation-play-state: paused; }
.fx-marquee__half { display: flex; flex: none; }
.fx-marquee__item { white-space: nowrap; padding: 0 28px; position: relative; }
.fx-marquee__item::after { content: "·"; position: absolute; right: -3px; opacity: .5; }
@keyframes fx-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Reveal: staggered fade-up ---------- */
.js .reveal { transition-delay: var(--fx-d, 0ms); transition-duration: 520ms; }
.js .reveal { transform: translateY(20px); }
.js .reveal.is-in { transform: none; }

/* ---------- Images fade in when loaded ---------- */
img.fx-fade { transition: opacity 450ms var(--ease), transform 600ms var(--ease); }
.js img.fx-fade:not(.is-loaded) { opacity: 0; }

/* ---------- Product cards ---------- */
.card__media img.card__alt { transform: scale(1.03); }
@media (hover: hover) and (pointer: fine) {
  .card:hover .card__media img.card__alt,
  .card:focus-within .card__media img.card__alt { opacity: 1; transform: scale(1.05); }
  .card:hover .card__media img.card__main,
  .card:focus-within .card__media img.card__main { transform: scale(1.05); }
}
@media (hover: hover) and (pointer: coarse) {
  .card:hover .card__media img.card__main { transform: none; }
  .card:hover .card__media img.card__alt { opacity: 0; }
}
.card__dots { display: none; }
@media (hover: none) {
  .card a { touch-action: pan-y pinch-zoom; }
  .card__media.is-alt img.card__alt { opacity: 1; transform: none; }
  .card__media.is-alt img.card__main { opacity: 0; }
  .card__dots {
    display: flex; gap: 4px; position: absolute; left: 50%; bottom: 8px; z-index: 1;
    transform: translateX(-50%); pointer-events: none;
  }
  .card__dots span { width: 5px; height: 5px; border-radius: 50%; background: var(--c-white); opacity: .45; box-shadow: 0 0 0 1px rgba(0,0,0,.12); transition: opacity 250ms var(--ease); }
  .card__media:not(.is-alt) .card__dots span:first-child,
  .card__media.is-alt .card__dots span:last-child { opacity: 1; }
}
.card__price { font-variant-numeric: tabular-nums; }
.card__sizes { font-size: 12px; color: var(--c-stone-text); letter-spacing: .02em; }
@supports selector(:has(*)) {
  .card__title a:focus-visible { outline: none; }
  .card:has(.card__title a:focus-visible) { outline: 2px solid var(--c-black); outline-offset: 4px; }
}

/* ---------- Recently viewed ---------- */
.fx-recent { padding-top: var(--s-8, 64px); padding-bottom: var(--s-8, 64px); border-top: 1px solid var(--c-line); margin-top: var(--s-8, 64px); }

/* ---------- Product gallery: hover zoom ---------- */
.gallery__slide { overflow: hidden; }
@media (hover: hover) and (pointer: fine) and (min-width: 900px) {
  .gallery__slide img { cursor: zoom-in; transition: opacity 450ms var(--ease), transform 320ms var(--ease); transform-origin: var(--fx-x, 50%) var(--fx-y, 50%); }
  .gallery__slide img.fx-zoom { transform: scale(1.9); transition-duration: 450ms, 200ms; }
}
@media (pointer: coarse) { .gallery__slide img { cursor: zoom-in; } }

/* ---------- Lightbox ---------- */
.fx-lb {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: rgba(11, 11, 11, .96); color: var(--c-white);
  opacity: 0; transition: opacity 220ms var(--ease); overscroll-behavior: contain; touch-action: pan-y pinch-zoom;
}
.fx-lb[open] { display: flex; align-items: center; justify-content: center; }
.fx-lb.is-open { opacity: 1; }
.fx-lb::backdrop { background: transparent; }
.fx-lb__img {
  max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain;
  user-select: none; -webkit-user-drag: none;
}
.fx-lb__img.is-in { animation: fx-lb-in 320ms var(--ease); }
@keyframes fx-lb-in { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }
.fx-lb__count { position: absolute; left: 16px; top: 16px; font-size: 12px; letter-spacing: .14em; font-variant-numeric: tabular-nums; opacity: .7; }
.fx-lb__btn {
  position: absolute; width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--c-white); background: rgba(11, 11, 11, .4); transition: opacity 200ms var(--ease), transform 200ms var(--ease);
}
.fx-lb__btn:hover { opacity: .7; }
.fx-lb__btn svg { width: 22px; height: 22px; }
.fx-lb__close { top: 8px; right: 8px; }
.fx-lb__prev { left: 8px; top: 50%; margin-top: -24px; }
.fx-lb__next { right: 8px; top: 50%; margin-top: -24px; }
.fx-lb :focus-visible { outline-color: var(--c-white); }

/* ---------- Micro-interactions ---------- */
.btn { transition: background var(--t) var(--ease), color var(--t) var(--ease), opacity var(--t) var(--ease), transform 200ms var(--ease); }
.btn:active:not([disabled]):not([aria-disabled="true"]),
.icon-btn:active, .chip:active, .lang-switch button:active, .fx-lb__btn:active { transform: scale(.96); }
.icon-btn, .chip, .lang-switch button { transition: transform 200ms var(--ease), background var(--t) var(--ease), color var(--t) var(--ease), border-color var(--t) var(--ease); }
.footer-col a { position: relative; }
.footer-col a:hover { text-decoration: none; }
.footer-col a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform 300ms var(--ease);
}
.footer-col a:hover::after, .footer-col a:focus-visible::after { transform: scaleX(1); transform-origin: left; }
.link-arrow { transition: opacity 250ms var(--ease); }
:focus-visible { transition: outline-offset 150ms var(--ease); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .fx-marquee__track { animation: none; width: 100%; justify-content: center; }
  .fx-marquee__half + .fx-marquee__half, .fx-marquee__item:nth-child(n+4) { display: none; }
  .fx-marquee__item:nth-child(3)::after { content: none; }
  .site-header.fx-header.is-hidden { transform: none; }
  .js .reveal { transform: none; transition: none; }
  .js img.fx-fade:not(.is-loaded) { opacity: 1; }
  .card__media img.card__alt, .card:hover .card__media img { transform: none !important; }
  .gallery__slide img.fx-zoom { transform: none; }
}
