/* UI-only enhancement. Load after site.css, home-v2.css and pages-v3.css. */
html :is(.home-v2, .inner-v3) :is(a, button, input, select, textarea, summary, [role="button"]) {
  transition:
    color 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    text-decoration-color 180ms ease,
    opacity 180ms ease;
}

html :is(.home-v2, .inner-v3) :is(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid #191715;
  outline-offset: 3px;
  box-shadow: 0 0 0 3px #fffdf8;
}

/* Display/hidden remain owned by the existing controllers and SSR markup. */
.home-v2 .v2-account-menu:not([hidden]),
.inner-v3 :is(.p3-account-panel, .p3-search-panel):not([hidden]) {
  animation: polish-v4-panel-in 180ms ease-out;
}

@keyframes polish-v4-panel-in {
  from { opacity: .4; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 900px) {
  .home-v2 .v2-nav.is-open,
  .inner-v3 .p3-nav.is-open,
  .inner-v3.p3-filters-open .p3-filter-drawer {
    animation: polish-v4-panel-in 180ms ease-out;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  /* Scope resets to moving UI; static skip-link/brand transforms stay intact. */
  html :is(.home-v2, .inner-v3) :is(a, button, input, select, textarea, summary, [role="button"],
    .v2-nav, .v2-account-menu, .p3-nav, .p3-account-panel, .p3-search-panel, .p3-filter-drawer, .product-image img),
  html :is(.home-v2, .inner-v3) :is(a, button) span[aria-hidden="true"] {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto;
  }

  :is(.home-v2, .inner-v3) .product-card-link:hover .product-image img,
  .home-v2 :is(.v2-nav, .v2-account-menu),
  .inner-v3 :is(.p3-nav, .p3-account-panel, .p3-search-panel, .p3-filter-drawer) {
    transform: none !important;
  }
}
