/*
 * Farmacia Serrano — accessibility reinforcement layer.
 * Intended to complement Hummingbird's native accessibility styles.
 */

:root {
  --fs-focus-color: #005fcc;
  --fs-focus-shadow: #fff;
}

html {
  scroll-behavior: smooth;
}

/* A visible, high-contrast keyboard focus indicator across the storefront. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--fs-focus-color) !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 5px var(--fs-focus-shadow) !important;
}

/* The skip link must remain above sticky headers and cookie banners. */
.skip-link:focus-visible {
  position: fixed !important;
  inset-block-start: 0.75rem;
  inset-inline-start: 0.75rem;
  z-index: 10000;
  width: auto;
  height: auto;
  padding: 0.75rem 1rem;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* Avoid hiding the focused main landmark behind the sticky header. */
#main-content {
  scroll-margin-top: 8rem;
}

#main-content:focus {
  outline: 0;
  box-shadow: none;
}

/* Keep controls comfortably operable on touch screens. */
@media (pointer: coarse) {
  :where(button, .btn, input[type="button"], input[type="submit"], input[type="reset"], .header-block__action-btn, .page-link) {
    min-width: 44px;
    min-height: 44px;
  }
}

/* Links embedded in text must not rely on colour alone. */
:where(.page-content, .product-description, .cms-page, .footer__main) p a {
  text-decoration: underline;
  text-decoration-thickness: 0.1em;
  text-underline-offset: 0.15em;
}

/* Preserve readable placeholders without using them as the only label. */
::placeholder {
  color: #595959;
  opacity: 1;
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline-color: Highlight !important;
    box-shadow: none !important;
  }
}
