/* VM DIAMOND — site-wide interaction feedback (pairs with js/ui-fx.js) */

/* click: a facet opens at the pointer with a short flare */
.ui-spark { position: fixed; z-index: 400; width: 0; height: 0; pointer-events: none; }
.ui-spark b { position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; rotate: 45deg; border: 1px solid var(--gold-hi); animation: ui-facet .55s cubic-bezier(.2, .7, .1, 1) forwards; }
.ui-spark u { position: absolute; left: -22px; top: -.5px; width: 44px; height: 1px; background: linear-gradient(90deg, transparent, #FFF4DC, transparent); animation: ui-flare .45s cubic-bezier(.2, .7, .1, 1) forwards; }
@keyframes ui-facet { from { scale: .2; opacity: 1; } to { scale: 4.2; opacity: 0; } }
@keyframes ui-flare { from { scale: .1 1; opacity: 1; } to { scale: 1.5 1; opacity: 0; } }

/* press: every control gives a little under the finger */
.btn, .tab, .chip, .link, .ic, .x, .save, .bag-btn, .lang button, .menu-btn, .playbtn, .card, .s-piece, .ftr a, .opt, .qty button, .seg button, .sel, .pdp-th button, .st-views button, .st-film-btn, .st-zoom button, .c4-dots button {
  transition-property: scale, translate, color, background-color, box-shadow, opacity, border-color; transition-duration: .28s; transition-timing-function: cubic-bezier(.22, 1, .36, 1); }
.btn:active, .tab:active, .chip:active, .ic:active, .x:active, .bag-btn:active, .lang button:active, .menu-btn:active, .opt:active, .qty button:active, .st-views button:active, .st-film-btn:active, .st-zoom button:active, .c4-dots button:active { scale: .96; transition-duration: .08s; }
.card:active, .s-piece:active { scale: .985; transition-duration: .08s; }
.link:active, .ftr a:active, .c4-ways a:active { translate: 0 1px; }

/* primary buttons lean toward the pointer */
.btn { translate: var(--bx, 0px) var(--by, 0px); }
.btn > * { pointer-events: none; }

/* add to bag: the label gives way to a drawn tick, then returns */
.btn.ui-done { color: transparent !important; }
.btn.ui-done::before { content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 9px; margin: -8px 0 0 -9px; border-left: 1.5px solid #0A080B; border-bottom: 1.5px solid #0A080B; rotate: -45deg; z-index: 4;
  clip-path: inset(0 100% 0 0); animation: ui-tick .5s cubic-bezier(.2, .7, .1, 1) .1s forwards; }
@keyframes ui-tick { to { clip-path: inset(0); } }

/* the bag count bumps when it changes; a saved heart pops */
.ui-bump .n, .ui-bump#bagN { animation: ui-bump .6s cubic-bezier(.2, .7, .1, 1); }
@keyframes ui-bump { 0% { scale: 1; } 30% { scale: 1.5; background: var(--gold); color: #0A080B; } 100% { scale: 1; } }
.save.ui-pop svg { animation: ui-pop .55s cubic-bezier(.2, .7, .1, 1); }
@keyframes ui-pop { 0% { scale: 1; } 35% { scale: 1.5; } 60% { scale: .88; } 100% { scale: 1; } }
.save:hover { color: var(--gold-hi); }

/* filter tabs: one underline that slides */
.shop-bar .tabs { position: relative; }
.shop-bar .tab[aria-pressed="true"] { box-shadow: none; }
.ui-ink { position: absolute; left: 0; top: 0; width: 1px; height: 1px; background: var(--gold-hi); transform-origin: left; pointer-events: none;
  transform: translate(var(--x, 0px), var(--y, 0px)) scaleX(var(--w, 0)); transition: transform .6s cubic-bezier(.22, 1, .36, 1); }

/* product grid: cards deal in, tilt under the pointer, and the picture answers */
#grid .card { transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transform-style: preserve-3d; transition: transform .6s cubic-bezier(.22, 1, .36, 1), scale .28s; }
#grid .card.ui-hover { transition-duration: .12s, .28s; }
#grid .card .media::before { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 244, 220, .2), transparent 65%); }
#grid .card.ui-hover .media::before { opacity: 1; }
#grid .card .meta { transition: translate .5s cubic-bezier(.22, 1, .36, 1); }
#grid .card.ui-hover .meta { translate: 0 -4px; }
#grid .card.ui-hover .pr { color: #FFF4DC; }
#grid .card.ui-deal { animation: ui-deal .8s cubic-bezier(.22, 1, .36, 1) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes ui-deal { from { opacity: 0; translate: 0 34px; clip-path: inset(0 0 22% 0); } to { opacity: 1; translate: 0 0; clip-path: inset(0); } }
.sel { transition: box-shadow .3s; } .sel:hover, .sel:focus { box-shadow: inset 0 0 0 1px var(--gold-hi); }

/* product sheet: the picture opens first, then the words come up in order */
.modal .pdp-g { clip-path: inset(0 100% 0 0); transition: clip-path .9s cubic-bezier(.7, 0, .2, 1) .1s; }
.modal.on .pdp-g { clip-path: inset(0); }
.modal .slot img { scale: 1.12; transition: scale 1.6s cubic-bezier(.22, 1, .36, 1) .1s, opacity .5s; }
.modal.on .slot img { scale: 1; }
.modal .body > * { opacity: 0; translate: 0 18px; transition: opacity .6s cubic-bezier(.22, 1, .36, 1), translate .8s cubic-bezier(.22, 1, .36, 1); }
.modal.on .body > * { opacity: 1; translate: 0 0; }
.modal.on .body > :nth-child(1) { transition-delay: .25s; } .modal.on .body > :nth-child(2) { transition-delay: .31s; } .modal.on .body > :nth-child(3) { transition-delay: .37s; }
.modal.on .body > :nth-child(4) { transition-delay: .43s; } .modal.on .body > :nth-child(5) { transition-delay: .49s; } .modal.on .body > :nth-child(6) { transition-delay: .55s; }
.modal.on .body > :nth-child(7) { transition-delay: .61s; } .modal.on .body > :nth-child(8) { transition-delay: .67s; } .modal.on .body > :nth-child(9) { transition-delay: .73s; }
.pdp-th button { transition-property: scale, box-shadow, opacity; } .pdp-th button:hover { scale: 1.06; }

/* data-rise */
.ui-rise-on [data-rise] { opacity: 0; translate: 0 26px; transition: opacity .9s cubic-bezier(.22, 1, .36, 1), translate 1.1s cubic-bezier(.22, 1, .36, 1); transition-delay: calc(var(--ri, 0) * 90ms); }
.ui-rise-on [data-rise].is-in { opacity: 1; translate: 0 0; }

@media (prefers-reduced-motion: reduce) {
  .ui-spark { display: none; }
  .btn { translate: none; }
  #grid .card, #grid .card.ui-deal { transform: none; animation: none; }
  .modal .pdp-g, .modal .slot img, .modal .body > * { clip-path: none; scale: 1; opacity: 1; translate: none; transition: none; }
  .ui-rise-on [data-rise] { opacity: 1; translate: none; transition: none; }
  .ui-ink { transition: none; }
}
