.bb-motion {
  display: block;
  isolation: isolate;
  overflow: hidden;
  position: relative;
}

.bb-motion__frame {
  display: none;
  inset: 0;
  position: absolute;
  width: 100%;
  height: 100%;
}

.bb-motion--winter-snow {
  container-type: inline-size;
}

.bb-motion__winter {
  display: none;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  position: absolute;
}

@media (prefers-reduced-motion: no-preference) {
  .bb-motion--playing .bb-motion__frame {
    display: block;
  }

  .bb-motion--playing .bb-motion__base,
  .bb-motion--playing .bb-motion__text-base,
  .bb-motion--playing .bb-motion__gift-base {
    z-index: 1;
  }

  .bb-motion--playing .bb-motion__product,
  .bb-motion--playing .bb-motion__text-title {
    animation: bb-motion-reveal 420ms ease-out 90ms both;
    z-index: 2;
  }

  .bb-motion--playing:not(.bb-motion--background-shine):not(.bb-motion--winter-snow) .bb-motion__full {
    animation: bb-motion-reveal 260ms ease-out 550ms both;
    position: relative;
    z-index: 3;
  }

  .bb-motion--gift-open.bb-motion--playing .bb-motion__full {
    animation-delay: 690ms;
  }

  .bb-motion--playing .bb-motion__gift-lid {
    animation: bb-motion-lift 630ms cubic-bezier(.18, .7, .2, 1) both;
    z-index: 4;
  }

  .bb-motion--playing .bb-motion__light {
    animation: bb-motion-shine 1450ms ease-in-out both;
    mask-image: linear-gradient(to right, transparent 38%, black 50%, transparent 62%);
    mask-repeat: no-repeat;
    mask-size: 200% 100%;
    z-index: 1;
  }

  .bb-motion--playing .bb-motion__winter-back {
    z-index: 1;
  }

  .bb-motion--playing .bb-motion__winter {
    display: block;
    z-index: 2;
  }

  .bb-motion--playing .bb-motion__winter-front {
    z-index: 3;
  }

  .bb-winter__fall {
    animation: bb-winter-fall var(--fall-time) linear var(--fall-delay) both;
    height: 100%;
    left: var(--fall-x);
    position: absolute;
    top: 0;
  }

  .bb-winter__fall > span {
    display: block;
    line-height: 1;
  }

  .bb-winter__snow {
    color: #fff;
    font-size: clamp(10px, 2.15cqw, 25px);
    text-shadow: 0 1px 3px #597a94;
  }

  .bb-winter__snow:nth-child(1) { --fall-x: 7%; --fall-time: 3.5s; --fall-delay: 0s; --drift: 1.4rem; }
  .bb-winter__snow:nth-child(2) { --fall-x: 24%; --fall-time: 3.7s; --fall-delay: .45s; --drift: -.7rem; }
  .bb-winter__snow:nth-child(3) { --fall-x: 47%; --fall-time: 3.2s; --fall-delay: .8s; --drift: 1rem; }
  .bb-winter__snow:nth-child(4) { --fall-x: 69%; --fall-time: 3.7s; --fall-delay: .15s; --drift: -.9rem; }
  .bb-winter__snow:nth-child(5) { --fall-x: 91%; --fall-time: 3.45s; --fall-delay: .65s; --drift: .35rem; }

  .bb-winter__star {
    animation: bb-winter-twinkle 1.5s var(--delay) ease-in-out both;
    color: #b4e3ff;
    font-size: clamp(8px, 1.5cqw, 18px);
    left: var(--x);
    line-height: 1;
    position: absolute;
    text-shadow: 0 0 9px #6ac8ffbb;
    top: var(--y);
  }

  .bb-winter__star--upper { --x: 37%; --y: 24%; --delay: .45s; }
  .bb-winter__star--lower { --x: 44%; --y: 75%; --delay: 1.6s; color: #84ceff; }
  .bb-winter__star--edge { --x: 92%; --y: 17%; --delay: 2.75s; }

  .bb-winter__gift {
    --fall-x: 50%;
    --fall-time: 4s;
    --fall-delay: .6s;
    --drift: 13px;
    animation-name: bb-winter-gift-fall;
    animation-timing-function: ease-in-out;
  }

  .bb-winter__package {
    --opening-flash: 1.78s;
    filter: drop-shadow(0 6px 7px #08244066);
    position: relative;
    transform: rotate(-7deg);
    width: clamp(42px, 9cqw, 116px);
  }

  .bb-winter__box {
    aspect-ratio: 1.7;
    background: linear-gradient(90deg, transparent 14%, #c9eafa99 14% 21%, transparent 21%),
      linear-gradient(145deg, #197ed5, #064492 83%);
    border: 1px solid #8bd5ff96;
    border-radius: 3px 3px 6px 6px;
    box-shadow: inset -6px -4px 0 #052f6c47;
    box-sizing: border-box;
    color: #fff;
    display: grid;
    font: 800 clamp(8px, 1.6cqw, 19px)/1 system-ui, sans-serif;
    padding-left: 12%;
    place-items: center;
    position: relative;
  }

  .bb-winter__lid {
    animation: bb-winter-lid 3s 1.15s ease-in-out both;
    background: linear-gradient(90deg, transparent 17%, #e8f9ff 17% 24%, transparent 24%),
      linear-gradient(#4298e2, #1667b3);
    border: 1px solid #c2eaffaa;
    border-radius: 4px 4px 2px 2px;
    height: 24%;
    inset: -13% -5% auto;
    position: absolute;
    transform-origin: 85% 60%;
  }

  .bb-winter__lid::before,
  .bb-winter__lid::after {
    border: clamp(1px, .3cqw, 4px) solid #dff8ff;
    bottom: 87%;
    content: "";
    height: 88%;
    position: absolute;
    width: 18%;
  }

  .bb-winter__lid::before { border-radius: 100% 80% 20% 100%; left: 6%; transform: rotate(24deg); }
  .bb-winter__lid::after { border-radius: 80% 100% 100% 20%; left: 21%; transform: rotate(-28deg); }

  .bb-winter__molds {
    animation: bb-winter-molds 3s 1.15s ease-in-out both;
    aspect-ratio: 840 / 460;
    background: url("../../../../image/catalog/banner_builder/winter-molds.png") center / contain no-repeat;
    bottom: 8%;
    left: 1%;
    position: absolute;
    transform-origin: center bottom;
    width: 104%;
  }

  .bb-winter__flash {
    animation: bb-winter-flash .62s var(--opening-flash) ease-out both;
    background: radial-gradient(ellipse at 52% 66%, #fff6ce, #ffda86a0 24%, #8ed8fc53 45%, transparent 70%);
    inset: -94% -24% 15%;
    position: absolute;
    transform-origin: 52% 66%;
  }

  .bb-winter__sparkle {
    animation: bb-winter-sparkle .85s var(--opening-flash) ease-out both;
    color: #fff3c1;
    font-size: clamp(10px, 2.5cqw, 28px);
    line-height: 1;
    position: absolute;
    right: -14%;
    text-shadow: 0 0 12px #ffdf8baa;
    top: -56%;
  }

  .bb-winter__discount {
    --fall-x: min(79%, calc(100% - 48px));
    --fall-time: 2.95s;
    --fall-delay: 1.8s;
    --drift: -.55rem;
  }

  .bb-winter__discount > span {
    background: #fff1ce;
    border-radius: 999px;
    color: #633725;
    font: 700 clamp(9px, 1.65cqw, 19px)/1 system-ui, sans-serif;
    padding: .35em .65em;
    white-space: nowrap;
  }

  @keyframes bb-winter-fall {
    0% { opacity: 0; transform: translate3d(0, -18%, 0); }
    18%, 80% { opacity: .8; }
    100% { opacity: 0; transform: translate3d(var(--drift), 106%, 0); }
  }

  @keyframes bb-winter-twinkle {
    0%, 100% { opacity: 0; transform: scale(.45); }
    45% { opacity: .88; transform: scale(1); }
  }

  @keyframes bb-winter-gift-fall {
    0% { opacity: 0; transform: translate(0, -30%); }
    21% { opacity: 1; transform: translate(0, 37%); }
    68% { opacity: 1; transform: translate(calc(var(--drift) / 2), 49%); }
    88% { opacity: 1; }
    100% { opacity: 0; transform: translate(var(--drift), 114%); }
  }

  @keyframes bb-winter-lid {
    0%, 16%, 100% { transform: none; }
    31%, 78% { transform: translate(-48%, -134%) rotate(-23deg); }
  }

  @keyframes bb-winter-molds {
    0%, 20%, 100% { opacity: 0; transform: translateY(12%) scale(.7); }
    36%, 77% { opacity: 1; transform: translateY(-54%) scale(1.14); }
  }

  @keyframes bb-winter-flash {
    0% { opacity: 0; transform: scale(.55); }
    27% { opacity: .9; }
    100% { opacity: 0; transform: scale(1.12); }
  }

  @keyframes bb-winter-sparkle {
    0% { opacity: 0; transform: scale(.4) rotate(-20deg); }
    35% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-110%) scale(1.15) rotate(24deg); }
  }

  @keyframes bb-motion-reveal {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  @keyframes bb-motion-lift {
    from { transform: translateY(0); }
    to { transform: translateY(-30%); }
  }

  @keyframes bb-motion-shine {
    0% { mask-position: 128% 0; opacity: 0; }
    20%, 80% { opacity: 1; }
    100% { mask-position: -28% 0; opacity: 0; }
  }
}
