:root{
  --g-mega-open-duration:400ms;
  --g-mega-close-duration:240ms;
  --g-mega-family-duration:360ms;
  --g-mega-card-duration:420ms;
  --g-mega-card-shift:42px;
  --g-mega-perspective:1400px;
}

/* The upper edge stays anchored while the lower edge unfolds toward the viewer. */
.catalog-shop-header--floating-only .catalog-shop-viewport-wrapper{
  perspective:var(--g-mega-perspective)!important;
  perspective-origin:50% 0%!important;
  transform-style:preserve-3d;
}
.catalog-shop-header--floating-only .catalog-shop-viewport{
  transform-origin:50% 0%!important;
  transform-style:preserve-3d;
  backface-visibility:hidden;
  will-change:transform,opacity,clip-path,filter;
}
.catalog-shop-header--floating-only .catalog-shop-viewport[data-state="open"]{
  animation:catalog-mega-unfold-3d var(--g-mega-open-duration) var(--g-brand-ease-in) both!important;
}
.catalog-shop-header--floating-only .catalog-shop-viewport[data-state="closed"]{
  animation:catalog-mega-fold-3d var(--g-mega-close-duration) var(--g-brand-ease-out) both!important;
}
@keyframes catalog-mega-unfold-3d{
  0%{
    opacity:0;
    clip-path:inset(0 0 58% 0 round 12px);
    transform:translate3d(0,0,-78px) rotateX(-16deg) scaleY(.90);
    filter:blur(4px);
  }
  56%{
    opacity:1;
    clip-path:inset(0 0 10% 0 round 12px);
    transform:translate3d(0,0,-12px) rotateX(-3deg) scaleY(.985);
    filter:blur(.5px);
  }
  100%{
    opacity:1;
    clip-path:inset(0 0 0 0 round 12px);
    transform:translate3d(0,0,0) rotateX(0) scaleY(1);
    filter:none;
  }
}
@keyframes catalog-mega-fold-3d{
  0%{
    opacity:1;
    clip-path:inset(0 0 0 0 round 12px);
    transform:translate3d(0,0,0) rotateX(0) scaleY(1);
    filter:none;
  }
  100%{
    opacity:0;
    clip-path:inset(0 0 58% 0 round 12px);
    transform:translate3d(0,0,-72px) rotateX(-14deg) scaleY(.91);
    filter:blur(3px);
  }
}

/* Category switching does not move the whole menu. Text falls in vertically; cards track pointer direction. */
.catalog-shop-mega-content,
.catalog-shop-mega-content[data-enter-direction="next"],
.catalog-shop-mega-content[data-enter-direction="prev"],
.catalog-shop-mega-content[data-enter-direction="static"]{
  animation:none!important;
}
.catalog-shop-mega-grid>.catalog-shop-mega-column:nth-child(1){--mega-family-delay:0ms}
.catalog-shop-mega-grid>.catalog-shop-mega-column:nth-child(2){--mega-family-delay:45ms}
.catalog-shop-mega-grid>.catalog-shop-mega-column:nth-child(3){--mega-family-delay:90ms}
.catalog-shop-mega-grid>.catalog-shop-mega-column:nth-child(4){--mega-family-delay:135ms}

.catalog-shop-mega-column .catalog-shop-mega-heading{
  animation:catalog-mega-family-down var(--g-mega-family-duration) var(--g-brand-ease-in) both!important;
  animation-delay:var(--mega-family-delay,0ms)!important;
  will-change:transform,clip-path,filter,opacity;
}
@keyframes catalog-mega-family-down{
  0%{
    opacity:0;
    clip-path:inset(0 0 100% 0);
    transform:translate3d(0,-12px,0);
    filter:blur(2px);
  }
  100%{
    opacity:1;
    clip-path:inset(0 0 0 0);
    transform:translate3d(0,0,0);
    filter:none;
  }
}

.catalog-shop-mega-links li:nth-child(1){--mega-sub-delay:0ms}
.catalog-shop-mega-links li:nth-child(2){--mega-sub-delay:24ms}
.catalog-shop-mega-links li:nth-child(3){--mega-sub-delay:48ms}
.catalog-shop-mega-links li:nth-child(4){--mega-sub-delay:72ms}
.catalog-shop-mega-links li:nth-child(5){--mega-sub-delay:96ms}
.catalog-shop-mega-links li:nth-child(6){--mega-sub-delay:120ms}
.catalog-shop-mega-links li:nth-child(7){--mega-sub-delay:144ms}
.catalog-shop-mega-links li:nth-child(8){--mega-sub-delay:168ms}
.catalog-shop-mega-links li:nth-child(9){--mega-sub-delay:192ms}
.catalog-shop-mega-links a{
  animation:catalog-mega-subfamily-down 330ms var(--g-brand-ease-in) both!important;
  animation-delay:calc(var(--mega-family-delay,0ms) + var(--mega-sub-delay,0ms) + 62ms)!important;
  will-change:transform,clip-path,filter;
}
@keyframes catalog-mega-subfamily-down{
  0%{
    clip-path:inset(0 0 100% 0);
    transform:translate3d(0,-8px,0);
    filter:blur(1.5px);
  }
  100%{
    clip-path:inset(0 0 0 0);
    transform:translate3d(0,0,0);
    filter:none;
  }
}

.catalog-shop-mega-content [data-slot="floating-nav-tile"],
.catalog-shop-mega-content .catalog-shop-mega-tile{
  animation-duration:var(--g-mega-card-duration)!important;
  animation-timing-function:var(--g-brand-ease-in)!important;
  animation-fill-mode:both!important;
  animation-delay:72ms!important;
  will-change:transform,opacity,filter;
}
/* Moving across categories left → right: the card itself travels left → right. */
.catalog-shop-mega-content[data-enter-direction="next"] [data-slot="floating-nav-tile"],
.catalog-shop-mega-content[data-enter-direction="next"] .catalog-shop-mega-tile{
  animation-name:catalog-mega-card-left-to-right!important;
}
/* Moving across categories right → left: the card itself travels right → left. */
.catalog-shop-mega-content[data-enter-direction="prev"] [data-slot="floating-nav-tile"],
.catalog-shop-mega-content[data-enter-direction="prev"] .catalog-shop-mega-tile{
  animation-name:catalog-mega-card-right-to-left!important;
}
.catalog-shop-mega-content[data-enter-direction="static"] [data-slot="floating-nav-tile"],
.catalog-shop-mega-content[data-enter-direction="static"] .catalog-shop-mega-tile{
  animation-name:catalog-mega-card-static!important;
}
@keyframes catalog-mega-card-left-to-right{
  0%{opacity:0;transform:translate3d(calc(-1 * var(--g-mega-card-shift)),0,-22px) rotateY(3deg) scale(.982);filter:blur(3px)}
  100%{opacity:1;transform:translate3d(0,0,0) rotateY(0) scale(1);filter:none}
}
@keyframes catalog-mega-card-right-to-left{
  0%{opacity:0;transform:translate3d(var(--g-mega-card-shift),0,-22px) rotateY(-3deg) scale(.982);filter:blur(3px)}
  100%{opacity:1;transform:translate3d(0,0,0) rotateY(0) scale(1);filter:none}
}
@keyframes catalog-mega-card-static{
  0%{opacity:0;transform:translate3d(0,12px,-18px) scale(.985);filter:blur(3px)}
  100%{opacity:1;transform:translate3d(0,0,0) scale(1);filter:none}
}

@media(prefers-reduced-motion:reduce){
  .catalog-shop-header--floating-only .catalog-shop-viewport,
  .catalog-shop-mega-column .catalog-shop-mega-heading,
  .catalog-shop-mega-links a,
  .catalog-shop-mega-content [data-slot="floating-nav-tile"],
  .catalog-shop-mega-content .catalog-shop-mega-tile{
    animation:none!important;
    transform:none!important;
    clip-path:none!important;
    filter:none!important;
    opacity:1!important;
  }
}
