/* Shared motion for client pages, authentication, standalone layouts and cart.
   Animate opacity for page containers so fixed modals keep their viewport anchor. */
@keyframes pa-page-enter {
    from { opacity:0; }
    to { opacity:1; }
}
@keyframes pa-card-enter {
    from { opacity:0; transform:translateY(8px); }
    to { opacity:1; transform:translateY(0); }
}
@media (prefers-reduced-motion:no-preference) {
    .pa-theme .pa-page,
    .pa-theme.pa-standalone .invoice-container,
    .pa-theme.pa-standalone #content,
    .pa-theme #order-standard_cart .cart-body { animation:pa-page-enter .3s ease-out; }
    .pa-theme .pa-dashboard-stats .tile { animation:pa-card-enter .35s ease-out backwards; }
    .pa-theme .pa-dashboard-stats .tile:nth-child(2) { animation-delay:40ms; }
    .pa-theme .pa-dashboard-stats .tile:nth-child(3) { animation-delay:80ms; }
    .pa-theme .pa-dashboard-stats .tile:nth-child(4) { animation-delay:120ms; }
    .pa-theme .btn,
    .pa-theme #primary-nav a,
    .pa-theme #primary-nav a>i,
    .pa-theme .pa-cart-link img,
    .pa-theme .pa-signout,
    .pa-theme .dropdown-menu>li>a,
    .pa-theme a.list-group-item,
    .pa-theme .nav-tabs>li>a,
    .pa-theme .pagination>li>a,
    .pa-theme .table>tbody>tr>td,
    .pa-theme .pa-dashboard-stats .tile,
    .pa-theme .pa-department-card,
    .pa-theme #order-standard_cart .product,
    .pa-theme .form-control,
    .pa-theme .field { transition:background-color .18s ease,border-color .18s ease,color .18s ease,box-shadow .18s ease,transform .18s ease; }
}
/* Hover effects belong on pointer devices; keyboard users get the same emphasis. */
.pa-theme #primary-nav a:focus-visible,
.pa-theme .dropdown-menu>li>a:focus-visible,
.pa-theme a.list-group-item:focus-visible { background:#edf5ff; color:var(--pa-link); }
.pa-theme .pa-dashboard-stats .tile:focus-within,
.pa-theme .pa-department-card:focus-within,
.pa-theme #order-standard_cart .product:focus-within { border-color:#9bbfe2; box-shadow:0 6px 18px #183b5610; }
@media (hover:hover) and (pointer:fine) {
    .pa-theme .btn:not(:disabled):not([disabled]):not(.disabled):hover { box-shadow:0 4px 10px #183b561a; }
    .pa-theme #primary-nav a:hover>i { color:var(--pa-link); }
    .pa-theme a.list-group-item:hover { background:#edf5ff; color:var(--pa-primary); }
    .pa-theme .pagination>li:not(.disabled):not(.active)>a:hover { background:#edf5ff; border-color:#9bbfe2; }
    .pa-theme .pa-dashboard-stats .tile:hover,
    .pa-theme .pa-department-card:hover,
    .pa-theme #order-standard_cart .product:hover { border-color:#9bbfe2; box-shadow:0 6px 18px #183b5610; }
    .pa-theme .table>tbody>tr:hover>td { background-color:#f3f8ff; }
    .pa-theme .pa-signout:hover { color:#c32a52; background:#fff3f6; border-radius:6px; }
}
@media (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference) {
    .pa-theme .btn:not(:disabled):not([disabled]):not(.disabled):hover { transform:translateY(-1px); }
    .pa-theme .btn:not(:disabled):not([disabled]):not(.disabled):active { transform:translateY(0); }
    .pa-theme #primary-nav a:hover>i { transform:translateY(-1px); }
    .pa-theme .pa-cart-link:hover img { transform:translateY(-2px); }
    .pa-theme .pa-dashboard-stats .tile:hover,
    .pa-theme #order-standard_cart .product:hover { transform:translateY(-3px); }
}
/* Also neutralize older component transitions when reduced motion is requested. */
@media (prefers-reduced-motion:reduce) {
    .pa-theme .btn,.pa-theme .pa-sidebar,.pa-theme .pa-dashboard-stats .tile,
    .pa-theme #primary-nav a,.pa-theme #primary-nav a>i,
    .pa-theme .pa-cart-link img,.pa-theme .pa-signout,
    .pa-theme .dropdown-menu>li>a,.pa-theme a.list-group-item,
    .pa-theme .nav-tabs>li>a,.pa-theme .pagination>li>a,
    .pa-theme .table>tbody>tr>td,.pa-theme .pa-department-card,
    .pa-theme #order-standard_cart .product,.pa-theme .form-control,.pa-theme .field { transition:none; }
}
@media print {
    .pa-theme .pa-page,.pa-theme.pa-standalone .invoice-container,
    .pa-theme.pa-standalone #content,.pa-theme #order-standard_cart .cart-body,
    .pa-theme .pa-dashboard-stats .tile { animation:none; transform:none; }
}
