/* Final native Woo accessibility details. Does not replace the accessibility plugin. */
/* The base theme hides .coupon label with display:none; retain its accessible name. */
#app #woo-native-target label.screen-reader-text {
  display: block !important;
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
#app :is(input, select, textarea, button, a, [tabindex], h1, h2, h3) {
  scroll-margin-block: 7rem 5rem;
}
#app .native-product #woo-native-target .woocommerce-tabs > ul.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-inline: 0;
}
#app .native-product #woo-native-target .woocommerce-tabs > ul.tabs li {
  min-width: 0;
  max-width: 100%;
  margin: 0;
}
#app .native-product #woo-native-target .woocommerce-tabs > ul.tabs a {
  overflow-wrap: anywhere;
}
#app :is(.woocommerce-error, .woocommerce-info, .woocommerce-message) {
  overflow-wrap: anywhere;
}
#app .woocommerce-error a {
  text-decoration: underline;
  text-underline-offset: .2em;
}
#app :is(input, select, textarea)[aria-invalid='true'] {
  border-width: 2px !important;
  border-color: #9e251b !important;
}
/* Inherited margins or fixed widths must not force native panels beyond the page. */
#app .native-product #woo-native-target .woocommerce-Tabs-panel {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
@media (max-width: 600px) {
  /* Reuse the plugin's controls, outside the centre of the reading viewport. */
  body.my-pc-imagine > .a11y-toolbar {
    position: fixed !important;
    top: auto !important;
    bottom: calc(12px + env(safe-area-inset-bottom)) !important;
    left: auto !important;
    right: 12px !important;
    max-width: calc(100vw - 80px);
  }
  body.my-pc-imagine > .a11y-toolbar ul {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
  }
  body.my-pc-imagine > .a11y-toolbar ul li button {
    min-width: 44px;
    min-height: 44px;
  }
  body.my-pc-imagine > .a11y-toolbar button:is(:hover, :focus) .offscreen {
    bottom: calc(100% + 8px);
    top: auto;
    left: auto !important;
    right: 0 !important;
    max-width: min(16rem, calc(100vw - 32px));
    white-space: normal;
    line-height: 1.5;
  }
  #app .site-footer { padding-bottom: calc(5rem + env(safe-area-inset-bottom)); }
  #app .native-product #woo-native-target .woocommerce-tabs > ul.tabs li {
    flex: 1 1 8rem;
  }
  #app .native-product #woo-native-target .woocommerce-tabs > ul.tabs a {
    width: 100%;
    min-height: 44px;
    text-align: center;
  }
}
@media (forced-colors: active) {
  #app :is(input, select, textarea)[aria-invalid='true'] { border-color: Mark !important; }
}

/* A short viewport (including real 200–400% zoom) cannot spare a floating dock.
 * Keep the original controls reachable in document flow instead of over text. */
@media (max-height: 420px) {
  body.my-pc-imagine > .a11y-toolbar {
    position: static !important;
    inset: auto !important;
    transform: none !important;
    width: fit-content;
    max-width: calc(100% - 32px);
    margin: 16px auto;
  }
  body.my-pc-imagine > .a11y-toolbar ul {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }
  body.my-pc-imagine > .a11y-toolbar ul li button {
    min-width: 44px;
    min-height: 44px;
  }
  body.my-pc-imagine > .a11y-toolbar button:is(:hover, :focus) .offscreen {
    position: static !important;
    inset: auto !important;
    display: block;
    max-width: 100%;
    white-space: normal;
    line-height: 1.5;
  }
  #app .floating-tools {
    position: static !important;
    inset: auto !important;
    transform: none !important;
    flex-direction: row;
    flex-wrap: wrap;
    width: min(1390px, calc(100% - 32px));
    margin: 16px auto;
  }
  #app .floating-tools > :is(a, button) {
    width: auto;
    max-width: 100%;
    height: auto;
    min-height: 44px;
    padding: 10px 12px;
    line-height: 1.5;
  }
  #app .floating-tools .floating-label {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    clip-path: none;
    white-space: normal;
  }
  #app .floating-tools .access-panel {
    position: static;
    max-width: 100%;
    max-height: none;
  }
}
