/* Box sizing rules */
*:where(:not(iframe, canvas, img, svg, video):not(svg *)),
*:where(:not(iframe, canvas, img, svg, video):not(svg *))::before,
*:where(:not(iframe, canvas, img, svg, video):not(svg *))::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html:where(:not(.no-reset)) {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  min-height: 100%;
}

body:where(:not(.no-reset)) {
  min-height: 100dvh;
  line-height: 1.5;
  text-rendering: optimizeSpeed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

/* Remove list styles with higher specificity */
ul:where(:not(.no-reset)),
ol:where(:not(.no-reset)) {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Typography reset with increased specificity */
:where(body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd):not(
    .no-reset
  ) {
  margin: 0;
  padding: 0;
}

/* Media elements with better specificity */
:where(img, picture, video, canvas, svg):not(.no-reset) {
  display: block;
  max-width: 100%;
  height: auto;
  object-fit: cover;
}

/* Form elements with improved specificity */
:where(input, button, textarea, select):not(.no-reset) {
  font: inherit;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
}

/* Text handling with better specificity */
:where(p, h1, h2, h3, h4, h5, h6):not(.no-reset) {
  overflow-wrap: break-word;
  word-break: auto-phrase;
  hyphens: auto;
}

:where(h1, h2, h3, h4, h5, h6):not(.no-reset) {
  text-wrap: balance;
  line-height: 1.2;
}

:where(p):not(.no-reset) {
  text-wrap: balance;
  text-wrap: pretty;
}

/* Root stacking context with higher specificity */
:where(#root, #__next):not(.no-reset) {
  isolation: isolate;
}

/* Reduced motion with increased specificity */
@media (prefers-reduced-motion: reduce) {
  :where(*):not(.no-reset),
  :where(*):not(.no-reset)::before,
  :where(*):not(.no-reset)::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Links with better specificity */
:where(a):not(.no-reset) {
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

/* Textarea improvements with higher specificity */
:where(textarea:not([rows])):not(.no-reset) {
  min-height: 10em;
  resize: vertical;
}

/* Media elements with increased specificity */
:where(iframe, video, audio):not(.no-reset) {
  max-width: 100%;
  display: block;
  border: 0;
}

/* Button reset with better specificity */
:where(button):not(.no-reset) {
  all: unset;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* Focus styles for accessibility */
:where(a, button, input, textarea, select):focus-visible:not(.no-reset) {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.woocommerce img,
.woocommerce-page img {
  width: inherit !important;
  height: inherit !important;
}
