/* Shared feedback, not page choreography. Payment-provider widgets retain ownership. */
:root {
  --aoc-ui-fast: 140ms;
  --aoc-ui-normal: 220ms;
  --aoc-ui-enter: 280ms;
  --aoc-ui-ease: cubic-bezier(.2,.8,.2,1);
  --aoc-ui-focus: #744737;
}

/* Individual scale does not replace positioned controls' existing transforms. */
body :is(
  .aoc-button, .aoc-v37-primary, .aoc-v37-secondary, .aoc-icon-btn, .aoc-mobile-search-close,
  .aoc-master-save, .aoc-wishlist-remove, .aoc-wishlist-retry,
  .aoc-welcome-popup-action, .aoc-welcome-popup-close,
  .aoc-contact-page__message > summary, .aoc-contact-form button[type="submit"],
  .aoc-newsletter button, .aoc-quantity-step, [data-aoc-quantity],
  [data-aoc-gallery-nav], [data-aoc-gallery-zoom], [data-aoc-gallery-close],
  .aoc-drawer-header button, .sq-carousel-arrow, .sq-collection-controls button,
  .woocommerce a.button, .woocommerce button.button, [data-aoc-sticky-cart],
  .aoc-auth-social-button, .aoc-resend-content button, .aoc-account-email-change button
) {
  transition: scale var(--aoc-ui-fast) var(--aoc-ui-ease),
    background-color var(--aoc-ui-normal) ease, color var(--aoc-ui-normal) ease,
    border-color var(--aoc-ui-normal) ease, box-shadow var(--aoc-ui-normal) ease,
    opacity var(--aoc-ui-fast) ease;
}

@media (hover:hover) and (pointer:fine) {
  body :is(
    .aoc-button, .aoc-v37-primary, .aoc-v37-secondary, .aoc-icon-btn, .aoc-mobile-search-close,
    .aoc-master-save, .aoc-wishlist-remove, .aoc-wishlist-retry,
    .aoc-welcome-popup-action, .aoc-welcome-popup-close,
    .aoc-contact-page__message > summary, .aoc-contact-form button[type="submit"],
    .aoc-newsletter button, .aoc-quantity-step, [data-aoc-quantity],
    [data-aoc-gallery-nav], [data-aoc-gallery-zoom], [data-aoc-gallery-close],
    .aoc-drawer-header button, .sq-carousel-arrow, .sq-collection-controls button,
    .woocommerce a.button, .woocommerce button.button, [data-aoc-sticky-cart],
    .aoc-auth-social-button, .aoc-resend-content button, .aoc-account-email-change button
  ):not(:disabled, .disabled, .loading, .is-loading, [aria-disabled="true"], [aria-busy="true"]):hover {
    scale: 1.015;
  }
}

body :is(
  .aoc-button, .aoc-v37-primary, .aoc-v37-secondary, .aoc-icon-btn, .aoc-mobile-search-close,
  .aoc-master-save, .aoc-wishlist-remove, .aoc-wishlist-retry,
  .aoc-welcome-popup-action, .aoc-welcome-popup-close,
  .aoc-contact-page__message > summary, .aoc-contact-form button[type="submit"],
  .aoc-newsletter button, .aoc-quantity-step, [data-aoc-quantity],
  [data-aoc-gallery-nav], [data-aoc-gallery-zoom], [data-aoc-gallery-close],
  .aoc-drawer-header button, .sq-carousel-arrow, .sq-collection-controls button,
  .woocommerce a.button, .woocommerce button.button, [data-aoc-sticky-cart],
  .aoc-auth-social-button, .aoc-resend-content button, .aoc-account-email-change button
):not(:disabled, .disabled, .loading, .is-loading, [aria-disabled="true"], [aria-busy="true"]):active {
  scale: .975;
  transition-duration: 90ms;
}

/* Keep keyboard focus visible even on snapshot pages with reset styles. */
body :is(main, #root, .aoc-header, .aoc-footer, .aoc-drawer, .aoc-welcome-popup)
  :is(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--aoc-ui-focus);
  outline-offset: 3px;
}
body :is(.sq-carousel-track > a, .aoc-auto-carousel-item):focus-visible {
  outline-offset: -3px;
}
body :is(.aoc-search, .aoc-contact-form, .aoc-newsletter, .woocommerce, .aoc-account-v2)
  :is(input:not([type="checkbox"], [type="radio"], [type="hidden"]), select, textarea) {
  transition: border-color var(--aoc-ui-fast) ease, box-shadow var(--aoc-ui-fast) ease,
    background-color var(--aoc-ui-fast) ease;
  caret-color: var(--aoc-ui-focus);
}
body :is(.aoc-search, .aoc-contact-form, .aoc-newsletter, .woocommerce, .aoc-account-v2)
  :is(input, select, textarea):focus-visible {
  border-color: var(--aoc-ui-focus);
}
body :is(.aoc-contact-form, .aoc-newsletter, .woocommerce)
  :is(input, select, textarea)[aria-invalid="true"] {
  border-color: #a63c35;
}
body :is(.aoc-contact-form, .aoc-newsletter, .woocommerce)
  :is(input[type="checkbox"], input[type="radio"]) {
  accent-color: var(--aoc-ui-focus);
}
.aoc-mobile-search-panel form:focus-within {
  outline: 2px solid var(--aoc-ui-focus);
  outline-offset: 2px;
}

body :is(.aoc-nav a, .aoc-nav button, .aoc-footer-group a, .aoc-footer-contact a,
  .aoc-nav-mega a, .aoc-mega-menu a, .aoc-drawer-panel nav a,
  .sq-category-tabs button, .aoc-master-tabs button, [data-aoc-choice],
  [data-aoc-gallery-image], .aoc-faq-item > button, .aoc-product-module-toggle,
  .aoc-profile-guide-toggle, .aoc-product-faq-item > summary,
  [aria-labelledby="faq-heading"] button) {
  transition: color var(--aoc-ui-fast) ease, background-color var(--aoc-ui-fast) ease,
    border-color var(--aoc-ui-fast) ease, box-shadow var(--aoc-ui-fast) ease;
}
body :is(.aoc-footer-group, .aoc-footer-contact) a {
  text-decoration-color: transparent;
  text-underline-offset: 4px;
}
body :is(.aoc-footer-group, .aoc-footer-contact) a:is(:hover, :focus-visible) {
  color: var(--aoc-ui-focus);
  text-decoration: underline;
  text-decoration-thickness: 1px;
}
body :is(.sq-collection-link, .aoc-nav-jewellery-all) .bi-arrow-right {
  transition: translate var(--aoc-ui-normal) var(--aoc-ui-ease);
}
@media (hover:hover) and (pointer:fine) {
  body :is(.sq-collection-link, .aoc-nav-jewellery-all):hover .bi-arrow-right {
    translate: 3px 0;
  }
  body :is(.aoc-nav-mega, .aoc-mega-menu, .aoc-drawer-panel nav) a:hover {
    color: var(--aoc-ui-focus);
  }
  body :is([data-aoc-choice], [data-aoc-gallery-image]):not(:disabled):hover {
    border-color: var(--aoc-ui-focus);
  }
}

/* No dimensions change on press, selection or asynchronous updates. */
body :is(.sq-collection-controls button,
  .sq-carousel-arrow, [data-aoc-gallery-nav], .aoc-drawer-header button) {
  min-width: 44px;
  min-height: 44px;
}
body :is(.aoc-quantity-step, [data-aoc-quantity], .sq-collection-controls button,
  .sq-carousel-arrow, .aoc-newsletter button, .woocommerce .button):disabled {
  cursor: not-allowed;
  scale: 1;
}
body :is(.is-loading, .loading, [aria-busy="true"]) {
  cursor: progress;
}
.aoc-newsletter form[aria-busy="true"] button,
.woocommerce .button:is(.loading, .is-loading),
button[aria-busy="true"] {
  cursor: progress;
  scale: 1;
}

/* The cart owns its open/close transitions; other surfaces share entry feedback. */
.aoc-drawer:not([data-drawer="cart"]).is-open .aoc-drawer-panel {
  animation: aoc-ui-drawer-in var(--aoc-ui-enter) var(--aoc-ui-ease);
}
.aoc-drawer[data-drawer="menu"] { --aoc-ui-drawer-offset: -24px; }
.aoc-drawer:not([data-drawer="cart"]).is-open .aoc-drawer-backdrop,
:is(.aoc-welcome-popup, [data-aoc-gallery-dialog])[open]::backdrop {
  animation: aoc-ui-fade-in var(--aoc-ui-normal) ease-out;
}
:is(.aoc-welcome-popup, [data-aoc-gallery-dialog])[open] {
  animation: aoc-ui-dialog-in var(--aoc-ui-enter) var(--aoc-ui-ease);
}
.aoc-nav-mega:not([hidden]), .aoc-mega-menu,
.sq-category-panel:not([hidden]), .aoc-master-panel:not([hidden]),
.aoc-product-module-panel:not([hidden]), .aoc-profile-guide-panel:not([hidden]),
.aoc-faq-item.is-open .aoc-faq-answer,
.aoc-product-faq-item[open] > :not(summary),
.aoc-contact-page__message[open] > :not(summary),
.aoc-subscription-feedback:not([hidden]) {
  animation: aoc-ui-fade-in var(--aoc-ui-normal) ease-out;
}
@keyframes aoc-ui-fade-in {
  from { opacity: .35; }
  to { opacity: 1; }
}
@keyframes aoc-ui-drawer-in {
  from { opacity: .4; translate: var(--aoc-ui-drawer-offset,24px) 0; }
  to { opacity: 1; translate: 0 0; }
}
@keyframes aoc-ui-dialog-in {
  from { opacity: .4; scale: .985; }
  to { opacity: 1; scale: 1; }
}
@media (prefers-reduced-motion:reduce) {
  .aoc-drawer, .aoc-drawer .aoc-drawer-panel { transition: none !important; }
  /* Restrict overrides to our feedback surfaces, not third-party payment UI. */
  body :is(
    .aoc-button, .aoc-v37-primary, .aoc-v37-secondary, .aoc-icon-btn, .aoc-mobile-search-close,
    .aoc-master-save, .aoc-wishlist-remove, .aoc-wishlist-retry,
    .aoc-welcome-popup-action, .aoc-welcome-popup-close,
    .aoc-contact-page__message > summary, .aoc-contact-form button[type="submit"],
    .aoc-newsletter button, .aoc-quantity-step, [data-aoc-quantity],
    [data-aoc-gallery-nav], [data-aoc-gallery-zoom], [data-aoc-gallery-close],
    .aoc-drawer-header button, .sq-carousel-arrow, .sq-collection-controls button,
    .woocommerce a.button, .woocommerce button.button, [data-aoc-sticky-cart],
    .aoc-auth-social-button, .aoc-resend-content button, .aoc-account-email-change button
  ) {
    scale: 1 !important;
    transition-duration: 0s;
  }
  body :is(.sq-collection-link, .aoc-nav-jewellery-all) .bi-arrow-right { translate: none; }
  .aoc-drawer.is-open :is(.aoc-drawer-panel, .aoc-drawer-backdrop),
  :is(.aoc-welcome-popup, [data-aoc-gallery-dialog])[open],
  :is(.aoc-welcome-popup, [data-aoc-gallery-dialog])[open]::backdrop,
  .aoc-nav-mega:not([hidden]), .aoc-mega-menu,
  .sq-category-panel:not([hidden]), .aoc-master-panel:not([hidden]),
  .aoc-product-module-panel:not([hidden]), .aoc-profile-guide-panel:not([hidden]),
  .aoc-faq-item.is-open .aoc-faq-answer,
  .aoc-product-faq-item[open] > :not(summary),
  .aoc-contact-page__message[open] > :not(summary),
  .aoc-subscription-feedback:not([hidden]) { animation: none; }
}
