/* Storefront-only progressive enhancement. Content remains visible before JavaScript runs.
   Motion envelope (tokens in bgvp-design-tokens.css):
   - attack  (~160ms)  interaction feedback, the only tier used on cart / checkout / member surfaces;
   - sustain (~560ms)  reveals, staggered cards, masks, curtains;
   - reverb  (~1.2s)   brand storytelling on showcase surfaces only (intro, hero, scroll scenes, page transitions).
   Only compositor-friendly properties are animated: transform, opacity, clip-path (and SVG stroke offsets). */

/* ---------- Reveal contract (driven by bgvp-motion.js) ---------- */
body.storefront-surface.bgvp-motion-ready [data-bgvp-reveal] {
  opacity: 0;
  transform: translate3d(0, var(--bgvp-motion-reveal-distance), 0);
  will-change: opacity, transform;
  transition: opacity var(--bgvp-motion-reveal) var(--bgvp-motion-reveal-ease), transform var(--bgvp-motion-reveal) var(--bgvp-motion-reveal-ease);
  transition-delay: var(--bgvp-reveal-delay, 0ms);
}

body.storefront-surface.bgvp-motion-ready [data-bgvp-reveal="fade"] {
  transform: none;
}

/* Transactional surfaces stay quiet: short fade with a small lift. */
body.storefront-surface.bgvp-motion-ready [data-bgvp-reveal="quiet"] {
  transform: translate3d(0, var(--bgvp-motion-quiet-distance), 0);
  transition-duration: var(--bgvp-motion-quiet), var(--bgvp-motion-quiet);
}

/* Headings rise out of a mask without changing layout height. */
body.storefront-surface.bgvp-motion-ready [data-bgvp-reveal="mask"] {
  opacity: 1;
  clip-path: inset(0 0 100% 0);
  transform: translate3d(0, 0.45em, 0);
  will-change: clip-path, transform;
  transition: clip-path var(--bgvp-motion-hero-text) var(--bgvp-ease-decay), transform var(--bgvp-motion-hero-text) var(--bgvp-ease-decay);
  transition-delay: var(--bgvp-reveal-delay, 0ms);
}

/* Media opens like a curtain, then the photo settles from a slight zoom. */
body.storefront-surface.bgvp-motion-ready [data-bgvp-reveal="media"] {
  opacity: 1;
  transform: none;
  clip-path: inset(0 100% 0 0);
  will-change: clip-path;
  transition: clip-path var(--bgvp-motion-curtain) var(--bgvp-ease-curtain);
  transition-delay: var(--bgvp-reveal-delay, 0ms);
}

body.storefront-surface.bgvp-motion-ready [data-bgvp-reveal="media"] :is(#ProductMainImage, .brand-content-gallery img) {
  transform: scale(var(--bgvp-motion-media-scale));
  transition: transform var(--bgvp-motion-reverb) var(--bgvp-ease-decay), opacity var(--bgvp-motion-base) ease;
  transition-delay: var(--bgvp-reveal-delay, 0ms), 0ms;
}

body.storefront-surface.bgvp-motion-ready [data-bgvp-reveal].is-bgvp-revealed { opacity: 1; transform: none; }
body.storefront-surface.bgvp-motion-ready :is([data-bgvp-reveal="mask"], [data-bgvp-reveal="media"]).is-bgvp-revealed { clip-path: inset(0 0 0 0); }
body.storefront-surface.bgvp-motion-ready [data-bgvp-reveal="media"].is-bgvp-revealed :is(#ProductMainImage, .brand-content-gallery img) { transform: none; }
body.storefront-surface.bgvp-motion-ready [data-bgvp-reveal].is-bgvp-reveal-settled { will-change: auto; }
body.storefront-surface.bgvp-motion-ready :is([data-bgvp-reveal="mask"], [data-bgvp-reveal="media"]).is-bgvp-reveal-settled { clip-path: none; }

/* Line icons draw themselves once their block is revealed (shapes carry pathLength="1"). */
body.storefront-surface.bgvp-motion-ready [data-bgvp-reveal] [data-bgvp-draw] > :is(path, circle) {
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset var(--bgvp-motion-curtain) var(--bgvp-ease-decay);
  transition-delay: calc(var(--bgvp-reveal-delay, 0ms) + 160ms);
}

body.storefront-surface.bgvp-motion-ready [data-bgvp-reveal].is-bgvp-revealed [data-bgvp-draw] > :is(path, circle) {
  stroke-dashoffset: 0;
}

body.storefront-surface [data-bgvp-count] {
  font-variant-numeric: tabular-nums;
}

body.storefront-surface :is(.btn, button, [role="button"])[aria-busy="true"] {
  cursor: progress;
  opacity: 0.72;
}

body.storefront-surface :is(.product-cart-message, .cart-status-message, [data-site-toast-region]) {
  transition: color var(--bgvp-motion-fast) ease, opacity var(--bgvp-motion-fast) ease;
}

@media (prefers-reduced-motion: no-preference) {
  body.storefront-surface :is(.btn, button, [role="button"]):not(:disabled):active {
    transform: translate3d(0, 1px, 0) scale(0.99);
  }

  body.storefront-surface .hero-showcase .carousel-item.active :is(.home-carousel-image, .home-carousel-cropped-image) {
    animation: bgvp-home-media-settle var(--bgvp-motion-reverb) var(--bgvp-ease-decay) both;
    animation-delay: calc(var(--bgvp-intro-offset) + 160ms);
  }

  /* Hero stage: the two slides cross-fade; the incoming one is visible at once, the outgoing one hides
     only after its fade. */
  body.storefront-surface .bgvp-hero-stage-slide {
    transition: opacity 700ms var(--bgvp-ease-decay), visibility 0s linear 700ms;
  }

  body.storefront-surface .bgvp-hero-stage-slide[aria-hidden="false"] {
    transition: opacity 700ms var(--bgvp-ease-decay), visibility 0s;
  }

  /* The stage capsule: the thumb glides to the slide on show while the glass turns with the slide under it. */
  body.storefront-surface .bgvp-hero-stage-thumb {
    transition: transform 620ms var(--bgvp-ease-decay), background-color 700ms var(--bgvp-ease-decay);
  }

  body.storefront-surface .bgvp-hero-stage-nav {
    transition: background-color 700ms var(--bgvp-ease-decay), border-color 700ms var(--bgvp-ease-decay), box-shadow 700ms var(--bgvp-ease-decay);
  }

  body.storefront-surface .bgvp-hero-stage-dot::before {
    transition: opacity 360ms var(--bgvp-ease-decay) 180ms, transform var(--bgvp-motion-base) var(--bgvp-ease-attack), background-color 700ms var(--bgvp-ease-decay);
  }

  body.storefront-surface .bgvp-hero-stage-dot[aria-current="true"]::before {
    transition: opacity 120ms linear, transform var(--bgvp-motion-base) var(--bgvp-ease-attack), background-color 700ms var(--bgvp-ease-decay);
  }

  body.storefront-surface .bgvp-hero-stage-toggle {
    transition: color 700ms var(--bgvp-ease-decay), background-color var(--bgvp-motion-fast) ease;
  }
}

/* ---------- First-visit intro (landing page, once per session; see bgvp-motion-boot.js) ---------- */
html.bgvp-intro { --bgvp-intro-offset: 900ms; }

.bgvp-intro-overlay { display: none; }

html.bgvp-intro .bgvp-intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  color: #fbfcfd;
  background: var(--bgvp-color-nav-deep);
  animation: bgvp-intro-lift 520ms var(--bgvp-ease-curtain) 900ms both;
}

html.bgvp-intro.bgvp-intro-skipped .bgvp-intro-overlay {
  animation: bgvp-intro-fade 180ms ease both;
}

.bgvp-intro-emblem {
  position: relative;
  display: grid;
  width: 160px;
  height: 160px;
  place-items: center;
}

.bgvp-intro-ring {
  position: absolute;
  inset: 0;
  border: 1.5px solid var(--bgvp-color-cyan);
  border-radius: 50%;
  opacity: 0;
  animation: bgvp-intro-ripple 1100ms var(--bgvp-ease-decay) both;
}

.bgvp-intro-ring:nth-child(2) { animation-delay: 140ms; }
.bgvp-intro-ring:nth-child(3) { animation-delay: 280ms; }

.bgvp-intro-mark {
  position: relative;
  display: grid;
  width: 104px;
  height: 104px;
  place-items: center;
  border-radius: 50%;
  background: #fbfcfd;
  animation: bgvp-intro-mark 760ms var(--bgvp-ease-decay) 120ms both;
}

.bgvp-intro-mark img {
  width: 74px;
  height: 74px;
  object-fit: contain;
}

.bgvp-intro-wordmark {
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  white-space: nowrap;
  animation: bgvp-intro-rise 560ms var(--bgvp-ease-decay) 420ms both;
}

.bgvp-intro-rule {
  width: 48px;
  height: 1px;
  background: var(--bgvp-color-cyan);
  animation: bgvp-scale-in 560ms var(--bgvp-ease-decay) 480ms both;
}

@media (max-width: 575.98px) {
  html.bgvp-intro { --bgvp-intro-offset: 480ms; }
  html.bgvp-intro .bgvp-intro-overlay { animation-duration: 320ms; animation-delay: 480ms; }
  .bgvp-intro-ring { display: none; }
  .bgvp-intro-mark { animation-duration: 480ms; animation-delay: 0ms; }
  .bgvp-intro-wordmark { animation-duration: 400ms; animation-delay: 160ms; }
  .bgvp-intro-rule { animation-duration: 400ms; animation-delay: 200ms; }
}

/* ---------- Landing hero choreography (starts on first paint; offset by the intro when it plays) ---------- */
@media (prefers-reduced-motion: no-preference) {
  html.bgvp-js body.storefront-surface .bgvp-hero :is(.hero-identity, .hero-eyebrow, .hero-brand-slogan, .hero-intro, .hero-copy h2, .hero-buttons, .hero-features, .hero-empty-state) {
    animation: bgvp-hero-text-enter var(--bgvp-motion-hero-text) var(--bgvp-motion-reveal-ease) both;
    animation-delay: calc(var(--bgvp-intro-offset) + var(--bgvp-hero-step, 0ms));
  }

  html.bgvp-js body.storefront-surface .bgvp-hero .hero-eyebrow { --bgvp-hero-step: 60ms; }
  html.bgvp-js body.storefront-surface .bgvp-hero :is(.hero-intro, .hero-brand-slogan, .hero-copy h2) { --bgvp-hero-step: 300ms; }
  html.bgvp-js body.storefront-surface .bgvp-hero :is(.hero-buttons, .hero-features) { --bgvp-hero-step: 380ms; }

  html.bgvp-js body.storefront-surface .bgvp-hero .hero-copy-rule {
    transform-origin: left center;
    animation: bgvp-hero-rule-enter var(--bgvp-motion-hero-text) var(--bgvp-motion-reveal-ease) both;
    animation-delay: calc(var(--bgvp-intro-offset) + 80ms);
  }

  html.bgvp-js body.storefront-surface .bgvp-hero .hero-line > span {
    animation: bgvp-hero-line-up var(--bgvp-motion-hero-text) var(--bgvp-ease-decay) both;
    animation-delay: calc(var(--bgvp-intro-offset) + 120ms);
  }

  html.bgvp-js body.storefront-surface .bgvp-hero .hero-line + .hero-line > span {
    animation-delay: calc(var(--bgvp-intro-offset) + 200ms);
  }

  html.bgvp-js body.storefront-surface .bgvp-hero .hero-glass-frame {
    animation: bgvp-hero-media-enter var(--bgvp-motion-curtain) var(--bgvp-ease-curtain) backwards;
    animation-delay: calc(var(--bgvp-intro-offset) + 160ms);
  }

  html.bgvp-js body.storefront-surface .bgvp-hero :is(.hero-footer, .hero-side-note) {
    animation: bgvp-fade-in var(--bgvp-motion-sustain) ease both;
    animation-delay: calc(var(--bgvp-intro-offset) + 520ms);
  }

  html.bgvp-js body.storefront-surface .bgvp-hero .hero-orbit {
    animation: bgvp-orbit-settle var(--bgvp-motion-hero-media) var(--bgvp-motion-reveal-ease) both;
  }

  body.storefront-surface .bgvp-hero .hero-count-rule.is-bgvp-sweeping {
    transform-origin: left center;
    animation: bgvp-scale-in var(--bgvp-motion-curtain) var(--bgvp-ease-decay) both;
  }
}

/* Line masks keep descenders visible while still clipping the rising text. */
body.storefront-surface .bgvp-hero .hero-line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}

body.storefront-surface .bgvp-hero .hero-line > span {
  display: inline-block;
}

/* ---------- Scroll-linked scenes (CSS scroll-driven animations, no scroll listeners) ---------- */
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) and (min-width: 992px) {
    html.bgvp-js body.storefront-surface .bgvp-hero .hero-media-column {
      animation: bgvp-hero-parallax-media linear both;
      animation-timeline: scroll(root block);
      animation-range: 0px 900px;
    }

    html.bgvp-js body.storefront-surface .bgvp-hero .hero-copy {
      animation: bgvp-hero-parallax-copy linear both;
      animation-timeline: scroll(root block);
      animation-range: 0px 720px;
    }
  }

  @media (prefers-reduced-motion: no-preference) {
    html.bgvp-js body.storefront-surface .bgvp-scroll-progress {
      position: fixed;
      top: 0;
      right: 0;
      left: 0;
      z-index: 1001;
      display: block;
      height: 2px;
      background: var(--bgvp-color-cyan);
      transform: scaleX(0);
      transform-origin: 0 50%;
      pointer-events: none;
      animation: bgvp-scale-in linear both;
      animation-timeline: scroll(root block);
    }
  }
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    html.bgvp-js body.storefront-surface .home-brand-technical-art img {
      animation: bgvp-scan-reveal linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 55%;
    }
  }
}

.bgvp-scroll-progress { display: none; }

/* ---------- Navigation: hide on scroll down, recall on scroll up ---------- */
body.storefront-surface .site-header {
  transition: transform 360ms var(--bgvp-ease-decay), box-shadow var(--bgvp-motion-base) ease;
}

body.storefront-surface .site-header.is-bgvp-nav-scrolled {
  box-shadow: 0 12px 32px rgba(7, 16, 31, 0.16);
}

body.storefront-surface .site-header.is-bgvp-nav-hidden {
  transform: translate3d(0, -100%, 0);
}

/* ---------- Back to top ---------- */
.bgvp-top-sentinel {
  position: absolute;
  top: 600px;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

body.storefront-surface .bgvp-back-to-top {
  opacity: 0;
  visibility: hidden;
  transform: translate3d(0, 16px, 0);
  transition: opacity var(--bgvp-motion-base) ease, transform 420ms var(--bgvp-ease-decay), visibility 0s linear var(--bgvp-motion-base), background-color var(--bgvp-motion-attack) ease;
}

body.storefront-surface .bgvp-back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

/* ---------- Product cards ---------- */
body.storefront-surface .product-card.is-bgvp-entering {
  animation: bgvp-card-enter var(--bgvp-motion-reveal) var(--bgvp-motion-ease) backwards;
  animation-delay: var(--bgvp-stagger-delay, 0ms);
}

body.storefront-surface.bgvp-motion-ready .product-card-image {
  opacity: 0;
  transition: opacity var(--bgvp-motion-base) ease, scale 700ms var(--bgvp-ease-decay);
}
body.storefront-surface.bgvp-motion-ready .product-card-image.is-bgvp-image-ready,
body.storefront-surface.bgvp-motion-ready #ProductMainImage.is-bgvp-image-ready { opacity: 1; }
body.storefront-surface .product-card-quick-view { transition: opacity 180ms ease, transform 180ms ease; }

/* ---------- Shared link cards: every clickable card type behaves the same ----------
   Add a new card type HERE (and in tests/motion-module-boundary.check.mjs), never per page.
   Hover uses the independent `translate` / `scale` properties so it never fights the reveal and
   entrance animations, which own `transform`. */
body.storefront-surface :is(.product-card, .news-card, .custom-earphone-card) {
  transition: box-shadow var(--bgvp-motion-base) var(--bgvp-motion-ease), translate var(--bgvp-motion-base) var(--bgvp-ease-attack);
}
body.storefront-surface :is(.product-card-image, .news-card-cover img) {
  transition: opacity var(--bgvp-motion-base) ease, scale 700ms var(--bgvp-ease-decay);
}

@media (hover: hover) and (pointer: fine) {
  body.storefront-surface :is(.product-card, .news-card, .custom-earphone-card):is(:hover, :focus-within) {
    box-shadow: var(--bgvp-shadow-elevated);
    translate: 0 -6px;
  }
  body.storefront-surface :is(.product-card, .news-card):hover :is(.product-card-image, .news-card-cover img) {
    scale: 1.06;
  }
  body.storefront-surface .bgvp-hero-stage-dot:hover::before {
    transform: scale(1.35);
  }
}

body.storefront-surface :is(.product-card, .news-card, .custom-earphone-card):focus-within { outline: 3px solid rgba(47, 125, 244, 0.3); outline-offset: 3px; }

/* ---------- Shared trailing / leading arrows on links and buttons ---------- */
body.storefront-surface :is(.btn, .text-link, .news-card-link, .custom-earphone-card-link, .product-card-arrow) > span[aria-hidden="true"]:last-child,
body.storefront-surface .cart-continue-link > span[aria-hidden="true"]:first-child {
  display: inline-block;
  transition: transform var(--bgvp-motion-attack) var(--bgvp-ease-attack);
}

@media (hover: hover) and (pointer: fine) {
  body.storefront-surface :is(.btn, .text-link, .news-card-link, .custom-earphone-card-link):is(:hover, :focus-visible) > span[aria-hidden="true"]:last-child,
  body.storefront-surface :is(.product-card, .news-card, .custom-earphone-card):is(:hover, :focus-within) :is(.product-card-arrow, .news-card-link, .custom-earphone-card-link) > span[aria-hidden="true"]:last-child {
    transform: translate3d(4px, 0, 0);
  }
  body.storefront-surface .cart-continue-link:is(:hover, :focus-visible) > span[aria-hidden="true"]:first-child {
    transform: translate3d(-4px, 0, 0);
  }
}

body.storefront-surface .btn:focus-visible > span[aria-hidden="true"]:last-child {
  transform: translate3d(4px, 0, 0);
}

/* ---------- Catalog loading: existing cards become skeletons (no layout change, no CLS) ---------- */
body.storefront-surface [data-product-search-results] { position: relative; }
body.storefront-surface [data-product-search-results][aria-busy="true"] .product-card {
  pointer-events: none;
  animation: bgvp-skeleton-pulse 1100ms ease-in-out 150ms infinite;
}
body.storefront-surface [data-product-search-results][aria-busy="true"] .product-card-image-frame {
  animation: bgvp-skeleton-surface 1100ms ease-in-out 150ms infinite;
}
body.storefront-surface [data-product-search-results][aria-busy="true"] .product-card :is(.product-card-image, .product-card-quick-view) {
  animation: bgvp-skeleton-hide 1100ms linear 150ms infinite;
}
body.storefront-surface [data-product-search-results][aria-busy="true"] .product-card-content :is(h2, p, .product-stock-state, .product-card-arrow) {
  animation: bgvp-skeleton-text 1100ms ease-in-out 150ms infinite;
}
body.storefront-surface .catalog-filter.is-loading [data-product-search-submit]::after {
  content: "";
  display: inline-block;
  width: 0.8rem;
  height: 0.8rem;
  margin-left: 0.45rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: bgvp-spin 700ms linear infinite;
  vertical-align: -0.1rem;
}
body.storefront-surface [data-product-search-results].is-bgvp-results-updated { animation: bgvp-results-enter var(--bgvp-motion-base) var(--bgvp-motion-ease); }

/* ---------- Product details and cart feedback (attack tier) ---------- */
body.storefront-surface .product-detail-main-frame.is-bgvp-gallery-changing > img { opacity: 0; }
body.storefront-surface.bgvp-motion-ready .product-detail-main-frame > img { transition: opacity var(--bgvp-motion-base) ease; }
body.storefront-surface .product-detail-gallery-thumb[aria-pressed="true"] { box-shadow: 0 0 0 3px rgba(47, 125, 244, 0.24); }
body.storefront-surface .is-bgvp-value-updated { animation: bgvp-value-highlight 520ms var(--bgvp-ease-decay); }
body.storefront-surface .product-information-list details[open] > p { animation: bgvp-details-enter var(--bgvp-motion-base) ease both; }
body.storefront-surface .product-add-button.is-bgvp-pending,
body.storefront-surface .product-add-button.is-bgvp-success { pointer-events: none; }
body.storefront-surface .product-add-button { transition: background-color var(--bgvp-motion-base) ease, border-color var(--bgvp-motion-base) ease; }
body.storefront-surface .product-add-button.is-bgvp-success { background: var(--bgvp-color-success); border-color: var(--bgvp-color-success); }
body.storefront-surface [data-cart-summary-quantity].is-bgvp-popping { animation: bgvp-badge-pop 360ms var(--bgvp-ease-attack); }

.bgvp-cart-fly {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 3000;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: var(--bgvp-color-brand-blue);
  box-shadow: 0 0 0 4px rgba(23, 105, 209, 0.18);
  pointer-events: none;
}

/* ---------- Component motion (structure lives in bgvp-storefront.css) ---------- */
body.storefront-surface #SelectedSpecificationPrice.is-bgvp-value-updated {
  animation: bgvp-price-rise 420ms var(--bgvp-ease-decay), bgvp-value-highlight 520ms var(--bgvp-ease-decay);
}
body.storefront-surface input.is-bgvp-count-up { animation: bgvp-count-up 260ms var(--bgvp-ease-decay); }
body.storefront-surface input.is-bgvp-count-down { animation: bgvp-count-down 260ms var(--bgvp-ease-decay); }
body.storefront-surface .is-bgvp-leaving {
  opacity: 0;
  transform: translate3d(16px, 0, 0);
  pointer-events: none;
  transition: opacity var(--bgvp-motion-quiet) ease, transform var(--bgvp-motion-quiet) var(--bgvp-ease-decay);
}
body.storefront-surface .bgvp-magnifier { transition: opacity 160ms ease; }
body.storefront-surface .product-zoom-trigger { transition: background-color var(--bgvp-motion-attack) ease, color var(--bgvp-motion-attack) ease; }
.bgvp-lightbox[open] { animation: bgvp-fade-in 220ms ease both; }
.bgvp-lightbox.is-closing { animation: bgvp-vt-fade-out 180ms ease both; }
.bgvp-lightbox-image.is-bgvp-slide-next { animation: bgvp-slide-next 320ms var(--bgvp-ease-decay); }
.bgvp-lightbox-image.is-bgvp-slide-previous { animation: bgvp-slide-previous 320ms var(--bgvp-ease-decay); }

@media (prefers-reduced-motion: no-preference) {
  .bgvp-site .hero-count-rule.is-bgvp-timing::after {
    animation: bgvp-scale-in var(--bgvp-carousel-interval) linear both;
    animation-delay: var(--bgvp-timer-delay, 0ms);
  }
  .bgvp-site .hero-count-rule.is-bgvp-timer-paused::after {
    animation-play-state: paused;
  }
}

/* ---------- Shared on both surfaces (storefront and administration) ---------- */
.validation-field-shake { animation: validation-field-shake 420ms ease both; }
.horizontal-scroll-hint-icon { animation: bgvp-horizontal-scroll-hint 1.6s ease-in-out infinite; }

/* ---------- Cross-document page transitions (see bgvp-motion-boot.js for opt-outs) ---------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}

body.storefront-surface .site-header { view-transition-name: bgvp-site-header; }
::view-transition-old(root) { animation: bgvp-vt-fade-out 180ms var(--bgvp-ease-attack) both; }
::view-transition-new(root) { animation: bgvp-vt-rise-in 280ms var(--bgvp-ease-decay) 60ms both; }
html:active-view-transition-type(bgvp-back)::view-transition-new(root) { animation-name: bgvp-vt-drop-in; }
::view-transition-group(bgvp-product-hero) { animation-duration: 520ms; animation-timing-function: var(--bgvp-ease-decay); }
::view-transition-group(bgvp-site-header) { animation-duration: 0s; }

body.storefront-surface .site-navigation .dropdown-menu.show { animation: bgvp-dropdown-enter var(--bgvp-motion-fast) var(--bgvp-motion-ease); }
body.storefront-surface .site-navigation .nav-link,
body.storefront-surface .site-navigation .dropdown-item { text-decoration-thickness: 1px; text-underline-offset: 0.35em; }
@media (min-width: 992px) {
  body.storefront-surface .site-navigation .nav-link:hover,
  body.storefront-surface .site-navigation .nav-link:focus-visible,
  body.storefront-surface .site-navigation .nav-link.is-active { text-decoration: none; }

  body.storefront-surface .site-navigation .dropdown-item:hover,
  body.storefront-surface .site-navigation .dropdown-item:focus-visible,
  body.storefront-surface .site-navigation .dropdown-item.is-active { text-decoration: underline; }
}

body.storefront-surface .bgvp-filter-trigger { display: none; }
body.storefront-surface .bgvp-filter-trigger[hidden] { display: none; }
@media (max-width: 767.98px) {
  body.storefront-surface .bgvp-filter-trigger:not([hidden]) { display: inline-flex; align-items: center; justify-content: center; width: 100%; margin-bottom: 0.75rem; }
  body.storefront-surface .bgvp-filter-drawer {
    width: min(340px, 88vw);
    top: max(10px, env(safe-area-inset-top));
    bottom: auto;
    height: auto;
    max-height: calc(100dvh - 20px - env(safe-area-inset-top));
    background: #f8fafc;
    border-left: 1px solid rgba(7, 16, 31, 0.1);
    border-radius: 16px 0 0 16px;
    box-shadow: -1rem 0 2.5rem rgba(7, 16, 31, 0.16);
  }
  body.storefront-surface .bgvp-filter-drawer .offcanvas-header {
    padding: 16px 18px 10px;
    border-bottom: 1px solid rgba(7, 16, 31, 0.08);
  }
  body.storefront-surface .bgvp-filter-drawer .offcanvas-title {
    font-size: 22px;
    line-height: 1.2;
  }
  body.storefront-surface .bgvp-filter-drawer .btn-close {
    width: 44px;
    height: 44px;
    margin: -10px -10px -10px auto;
    background-size: 0.8rem;
  }
  body.storefront-surface .bgvp-filter-drawer .catalog-filter {
    display: grid;
    grid-template-columns: 1fr;
    flex: 0 0 auto;
    gap: 10px;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }
  body.storefront-surface .bgvp-filter-drawer .catalog-filter-field {
    display: grid;
    gap: 6px;
  }
  body.storefront-surface .bgvp-filter-drawer .catalog-filter-search { grid-column: 1 / -1; }
  body.storefront-surface .bgvp-filter-drawer :is(select, input) { height: 48px; }
  body.storefront-surface .bgvp-filter-drawer .catalog-filter-field label { font-size: 14px; }
  body.storefront-surface .bgvp-filter-drawer .offcanvas-body {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex: 0 1 auto;
    gap: 12px;
    min-height: 0;
    padding: 12px 16px 16px;
    overflow-y: auto;
  }
  body.storefront-surface .bgvp-filter-actions {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: minmax(100px, .75fr) minmax(0, 1.25fr);
    gap: 10px;
    margin-top: 8px;
    position: sticky;
    bottom: 0;
    padding: 12px 0 max(12px, env(safe-area-inset-bottom));
    background: linear-gradient(to bottom, rgba(248, 250, 252, 0.9), #f8fafc 20%);
    border-top: 1px solid rgba(7, 16, 31, 0.08);
  }
  body.storefront-surface .bgvp-filter-actions .btn {
    flex: 0 0 auto;
    min-height: 48px;
    height: 50px;
    padding: 0.65rem 0.75rem;
  }
  body.storefront-surface .product-card.is-bgvp-entering { animation-delay: 0ms; }
}

/* Hero stage safety net: if the stage script never starts, the poster held back for the film appears. */
html.bgvp-hero-film body.storefront-surface .bgvp-hero-stage:not([data-hero-stage-ready]) [data-hero-stage-slide="poster"] {
  animation: bgvp-hero-stage-fallback 0s linear 2.5s forwards;
}
@keyframes bgvp-hero-stage-fallback { to { visibility: visible; } }
@keyframes bgvp-hero-text-enter { from { opacity: 0; transform: translate3d(0, 20px, 0); } to { opacity: 1; transform: none; } }
@keyframes bgvp-hero-media-enter { from { clip-path: inset(100% -48px -48px -48px); } to { clip-path: inset(-48px -48px -48px -48px); } }
@keyframes bgvp-hero-rule-enter { from { opacity: 0; transform: scaleX(0); } to { opacity: 1; transform: scaleX(1); } }
@keyframes bgvp-hero-line-up { from { transform: translate3d(0, 105%, 0); } to { transform: none; } }
@keyframes bgvp-hero-parallax-media { to { transform: translate3d(0, 40px, 0); } }
@keyframes bgvp-hero-parallax-copy { to { opacity: 0.35; transform: translate3d(0, 48px, 0); } }
@keyframes bgvp-orbit-settle { from { transform: scale(0.96); } to { transform: scale(1); } }
@keyframes bgvp-home-media-settle { from { transform: scale(var(--bgvp-motion-media-scale)); } to { transform: none; } }
@keyframes bgvp-scan-reveal { from { clip-path: inset(0 100% 0 0); transform: translate3d(-24px, 0, 0); } to { clip-path: inset(0 0 0 0); transform: none; } }
@keyframes bgvp-intro-ripple { 0% { opacity: 0; transform: scale(0.35); } 15% { opacity: 0.9; } 100% { opacity: 0; transform: scale(2.6); } }
@keyframes bgvp-intro-mark { from { opacity: 0; transform: rotate(-120deg) scale(0.6); } to { opacity: 1; transform: none; } }
@keyframes bgvp-intro-rise { from { opacity: 0; transform: translate3d(0, 10px, 0); } to { opacity: 1; transform: none; } }
@keyframes bgvp-intro-lift { from { clip-path: inset(0 0 0 0); } to { clip-path: inset(0 0 100% 0); visibility: hidden; } }
@keyframes bgvp-intro-fade { to { opacity: 0; visibility: hidden; } }
@keyframes bgvp-scale-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes bgvp-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes bgvp-card-enter { from { opacity: 0; transform: translate3d(0, 24px, 0); } to { opacity: 1; transform: none; } }
@keyframes bgvp-results-enter { from { opacity: 0.35; } to { opacity: 1; } }
@keyframes bgvp-details-enter { from { opacity: 0; transform: translate3d(0, 6px, 0); } to { opacity: 1; transform: none; } }
@keyframes bgvp-value-highlight { 0% { background-color: rgba(100, 217, 245, 0.26); } 100% { background-color: transparent; } }
@keyframes bgvp-badge-pop { 45% { transform: scale(1.35); } }
@keyframes bgvp-dropdown-enter { from { opacity: 0; transform: translate3d(0, 6px, 0); } to { opacity: 1; transform: none; } }
@keyframes bgvp-spin { to { transform: rotate(360deg); } }
@keyframes bgvp-skeleton-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.62; } }
@keyframes bgvp-skeleton-surface { 0%, 100% { background-color: var(--bgvp-color-media-substrate); } 50% { background-color: var(--bgvp-color-metal-soft); } }
@keyframes bgvp-skeleton-hide { 0%, 100% { opacity: 0; } }
@keyframes bgvp-skeleton-text { 0%, 100% { color: transparent; background-color: var(--bgvp-color-metal-soft); border-radius: 6px; } }
@keyframes bgvp-vt-fade-out { to { opacity: 0; } }
@keyframes bgvp-vt-rise-in { from { opacity: 0; transform: translate3d(0, 8px, 0); } }
@keyframes bgvp-vt-drop-in { from { opacity: 0; transform: translate3d(0, -8px, 0); } }
@keyframes bgvp-price-rise { from { opacity: 0; transform: translate3d(0, 10px, 0); } to { opacity: 1; transform: none; } }
@keyframes bgvp-count-up { from { color: transparent; text-shadow: 0 0.9em 0 var(--bgvp-color-brand-ink); } to { color: transparent; text-shadow: 0 0 0 var(--bgvp-color-brand-ink); } }
@keyframes bgvp-count-down { from { color: transparent; text-shadow: 0 -0.9em 0 var(--bgvp-color-brand-ink); } to { color: transparent; text-shadow: 0 0 0 var(--bgvp-color-brand-ink); } }
@keyframes bgvp-slide-next { from { opacity: 0; transform: translate3d(32px, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes bgvp-slide-previous { from { opacity: 0; transform: translate3d(-32px, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes validation-field-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
@keyframes bgvp-horizontal-scroll-hint { 0%, 100% { transform: translateX(-0.12rem); } 50% { transform: translateX(0.12rem); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  .bgvp-intro-overlay { display: none !important; }
  .validation-field-shake,
  .horizontal-scroll-hint-icon,
  .bgvp-lightbox,
  .bgvp-lightbox-image { animation: none !important; }
  body.storefront-surface :is(.news-card, .custom-earphone-card, .news-card-cover img, .is-bgvp-leaving, .bgvp-magnifier),
  body.storefront-surface :is(.btn, .text-link, .news-card-link, .custom-earphone-card-link, .cart-continue-link) > span,
  body.storefront-surface input { animation: none !important; transition: none !important; }
  body.storefront-surface.bgvp-motion-ready [data-bgvp-reveal],
  body.storefront-surface.bgvp-motion-ready [data-bgvp-reveal] img,
  body.storefront-surface [data-bgvp-draw] > *,
  body.storefront-surface .bgvp-hero *,
  body.storefront-surface .site-header,
  body.storefront-surface .bgvp-back-to-top,
  body.storefront-surface .product-card,
  body.storefront-surface .product-card *,
  body.storefront-surface .product-detail-main-frame > img,
  body.storefront-surface .product-information-list details[open] > p,
  body.storefront-surface .product-add-button,
  body.storefront-surface [data-cart-summary-quantity],
  body.storefront-surface .catalog-filter,
  body.storefront-surface [data-product-search-results],
  body.storefront-surface .site-navigation .dropdown-menu,
  body.storefront-surface .bgvp-filter-drawer,
  body.storefront-surface .home-brand-technical-art img {
    animation: none !important;
    transition: none !important;
  }
  body.storefront-surface.bgvp-motion-ready [data-bgvp-reveal],
  body.storefront-surface.bgvp-motion-ready [data-bgvp-reveal] img,
  body.storefront-surface .product-detail-main-frame.is-bgvp-gallery-changing > img { opacity: 1 !important; transform: none !important; clip-path: none !important; }
  body.storefront-surface [data-bgvp-draw] > * { stroke-dashoffset: 0 !important; }
  body.storefront-surface .site-header.is-bgvp-nav-hidden { transform: none !important; }
}
