/* Reversible motion layer: existing desktop layout and mobile styles stay intact. */
@media (min-width: 981px) {
  #customization3dStudio {
    --customization-motion-press: 110ms;
    --customization-motion-feedback: 160ms;
    --customization-motion-panel: 200ms;
    --customization-motion-ease: cubic-bezier(0.22, 1, 0.36, 1);
  }

  #customization3dStudio :is(button, a, input, textarea, select, .customization-design-upload, .customization-file-picker) {
    transition: border-color var(--customization-motion-feedback) ease-out,
      background-color var(--customization-motion-feedback) ease-out,
      color var(--customization-motion-feedback) ease-out;
    will-change: auto;
  }

  #customization3dStudio :is(button, a, input, textarea, select):focus-visible,
  #customization3dStudio :is(.customization-design-upload, .customization-file-picker):focus-within {
    outline: 2px solid var(--studio-cream);
    outline-offset: 3px;
  }

  /* Only the visual press layer contracts; the button and hit target never move. */
  #customization3dStudio :is(.customization-step-next, .customization-step-back, .customization-generate-preview, .customization-explore-viewer, #submitCustomization) {
    position: relative;
    transform: none;
  }

  #customization3dStudio :is(.customization-step-next, .customization-step-back, .customization-generate-preview, .customization-explore-viewer, #submitCustomization)::before {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid transparent;
    border-radius: inherit;
    background: transparent;
    opacity: 1;
    pointer-events: none;
    transform: scale(1);
    transition: transform var(--customization-motion-press) var(--customization-motion-ease),
      border-color var(--customization-motion-press) ease-out,
      background-color var(--customization-motion-press) ease-out;
  }

  #customization3dStudio :is(.customization-step-next, .customization-step-back, .customization-generate-preview, .customization-explore-viewer, #submitCustomization):not(:disabled):not([aria-disabled="true"]):active::before {
    border-color: currentColor;
    background-color: rgba(255, 255, 255, 0.045);
    transform: scale(0.985);
  }

  /* Keep genuine loading labels, but suppress the storefront's sweeping shine. */
  #customization3dStudio .button[aria-busy="true"]::after { content: none; }

  #customization3dStudio :is(.customization-selected-garment, .customization-garment-category-card, .customization-garment-product-card) {
    transform: none;
    transition: transform var(--customization-motion-feedback) var(--customization-motion-ease),
      border-color var(--customization-motion-feedback) ease-out,
      background-color var(--customization-motion-feedback) ease-out;
  }

  /* Preserve the resting image treatment; never zoom or animate image filters. */
  #customization3dStudio .customization-garment-category-image img {
    filter: saturate(0.72) contrast(1.04);
    transform: none;
    transition: none;
  }

  #customization3dStudio .customization-garment-product-media img {
    filter: saturate(0.78);
    transform: none;
    transition: none;
  }

  #customization3dStudio .customization-color-swatches button {
    /* Real swatch and garment colors change immediately, not through a tween. */
    transition: border-color var(--customization-motion-feedback) ease-out;
  }

  #customization3dStudio :is(.customization-color-swatches button, .customization-stepper button)::after {
    transition: border-color var(--customization-motion-feedback) ease-out,
      background-color var(--customization-motion-feedback) ease-out;
  }

  #customization3dStudio .customization-step-panel:not([hidden]) {
    animation: customization-desktop-panel-in var(--customization-motion-panel) var(--customization-motion-ease) both;
  }

  #customization3dStudio .customization-garment-picker[open] {
    animation: customization-desktop-panel-in var(--customization-motion-panel) var(--customization-motion-ease) both;
  }

  #customization3dStudio .customization-status.is-success:not(:empty) {
    animation: customization-desktop-confirm-in var(--customization-motion-feedback) ease-out both;
  }

  #customization3dStudio button:is(:disabled, [aria-disabled="true"]) {
    transform: none;
    transition: none;
    animation: none;
    cursor: not-allowed;
  }

  #customization3dStudio button:is(:disabled, [aria-disabled="true"])::before {
    content: none;
  }

  #customization3dStudio .customization-step-next:disabled {
    border-color: rgba(226, 210, 174, 0.48);
    background: linear-gradient(135deg, rgba(212, 191, 145, 0.18), rgba(212, 191, 145, 0.08));
  }
  #customization3dStudio #submitCustomization:disabled { background: var(--white); color: var(--black); border-color: var(--white); }
  #customization3dStudio .customization-viewer-toolbar button:disabled { background: transparent; color: rgba(247, 247, 242, 0.62); }

  /* Neutral resting states also neutralize inherited/sticky hover on touch PCs. */
  #customization3dStudio .customization-size-options button:not(.is-active) {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.025);
    color: rgba(247, 247, 242, 0.64);
  }

  #customization3dStudio .customization-viewer-toolbar button:not(.is-active) {
    background: transparent;
    color: rgba(247, 247, 242, 0.62);
  }

  #customization3dStudio .customization-color-swatches button:not(.is-active)::after { border-color: transparent; }
}

@media (min-width: 981px) and (hover: hover) and (pointer: fine) {
  #customization3dStudio :is(.customization-selected-garment, .customization-garment-category-card, .customization-garment-product-card):not(:disabled):not([aria-disabled="true"]):hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.28);
  }

  #customization3dStudio .customization-selected-garment:not(:disabled):hover { border-color: rgba(226, 210, 174, 0.82); }
  #customization3dStudio .customization-garment-product-card.is-active:not(:disabled):hover { border-color: rgba(212, 191, 145, 0.74); }
  #customization3dStudio .customization-garment-category-card.is-current-category:not(:disabled):hover { border-color: rgba(212, 191, 145, 0.58); }

  #customization3dStudio .customization-size-options button:not(.is-active):not(:disabled):hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.055);
    color: var(--studio-cream);
  }

  #customization3dStudio .customization-color-swatches button:not(.is-active):not(:disabled):hover::after { border-color: rgba(255, 255, 255, 0.5); }
  #customization3dStudio .customization-viewer-toolbar button:not(.is-active):not(:disabled):hover {
    background: rgba(212, 191, 145, 0.08);
    color: var(--studio-cream);
  }
}

@media (min-width: 981px) and (hover: none), (min-width: 981px) and (pointer: coarse) {
  #customization3dStudio :is(.customization-garment-category-card, .customization-garment-product-card):not(.is-active):not(.is-current-category):hover {
    border-color: rgba(255, 255, 255, 0.105);
    background: #111;
  }
  #customization3dStudio .customization-garment-category-card.is-current-category:hover { border-color: rgba(212, 191, 145, 0.58); background: #111; }
  #customization3dStudio .customization-garment-product-card.is-active:hover { border-color: rgba(212, 191, 145, 0.74); background: #111; }
  #customization3dStudio .customization-selected-garment:hover {
    border-color: rgba(212, 191, 145, 0.28);
    background-color: rgba(255, 255, 255, 0.025);
  }
  #customization3dStudio .customization-stepper button:not(.is-active):not(.is-complete):hover { color: rgba(247, 247, 242, 0.42); }
  #customization3dStudio .customization-step-next:hover {
    border-color: rgba(226, 210, 174, 0.48);
    background: linear-gradient(135deg, rgba(212, 191, 145, 0.18), rgba(212, 191, 145, 0.08));
  }
  #customization3dStudio #submitCustomization:hover { background: var(--white); color: var(--black); border-color: var(--white); }
  #customization3dStudio .customization-step-back:hover { border-color: rgba(255, 255, 255, 0.11); color: rgba(247, 247, 242, 0.56); }
  #customization3dStudio .customization-garment-picker-close:hover { border-color: rgba(255, 255, 255, 0.13); color: rgba(247, 247, 242, 0.7); }
  #customization3dStudio .customization-design-upload:hover { border-color: rgba(212, 191, 145, 0.38); background: rgba(212, 191, 145, 0.045); }
  #customization3dStudio .customization-garment-picker-back:hover { color: rgba(247, 247, 242, 0.68); }
  #customization3dStudio .customization-garment-picker-footer > button:hover { border-color: rgba(255, 255, 255, 0.15); color: rgba(247, 247, 242, 0.72); }
  #customization3dStudio .customization-design-layer:not(.is-active):hover { border-color: rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.022); color: rgba(247, 247, 242, 0.7); }
  #customization3dStudio .customization-design-layer-remove:hover { border-color: rgba(255, 255, 255, 0.1); color: rgba(247, 247, 242, 0.62); }
  #customization3dStudio .customization-transform-actions button:hover { border-color: rgba(212, 191, 145, 0.3); background: rgba(212, 191, 145, 0.08); }
  #customization3dStudio :is(.customization-final-preview-controls button, .customization-explore-viewer):not(.is-active):hover {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.25);
    color: rgba(247, 247, 242, 0.62);
  }
}

/* No exit animation, stagger, or page/viewer entrance. Hidden panels stay hidden. */
@keyframes customization-desktop-panel-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes customization-desktop-confirm-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (min-width: 981px) and (prefers-reduced-motion: reduce) {
  #customization3dStudio :is(.customization-step-panel, .customization-garment-picker, .customization-status, .customization-viewer-spinner) { animation: none; }
  #customization3dStudio :is(button, a, input, textarea, select, .customization-design-upload, .customization-file-picker),
  #customization3dStudio button::before,
  #customization3dStudio button::after { transition: none; }
  #customization3dStudio :is(.customization-selected-garment, .customization-garment-category-card, .customization-garment-product-card):hover,
  #customization3dStudio button:active::before { transform: none !important; }
}
