/* Unified focus treatment --------------------------------------------------
   Batya controls already have borders, backgrounds and semantic active states.
   Do not add a second external ring on top of them. Keep keyboard focus visible
   through the component's own border/background treatment instead. */

:root {
  --batya-focus-border: #b8aea3;
  --batya-focus-surface: rgba(27, 24, 21, .035);
}

/* Kill UA/component outline rings consistently. This file loads last, and the
   !important is intentional because Woo/third-party component CSS can re-add
   outlines later in specificity. */
:where(
  a[href],
  button,
  input,
  select,
  textarea,
  summary,
  [role="button"],
  [role="link"],
  [tabindex]:not([tabindex="-1"])
):focus,
:where(
  a[href],
  button,
  input,
  select,
  textarea,
  summary,
  [role="button"],
  [role="link"],
  [tabindex]:not([tabindex="-1"])
):focus-visible {
  outline: 0 !important;
  outline-offset: 0 !important;
}

/* Form controls: use their existing border as the only focus indicator. */
.site-header__search-input:focus,
.site-header__search-input:focus-visible,
.batya-reviews-toolbar__select:focus,
.batya-reviews-toolbar__select:focus-visible,
.batya-review-form__form input:focus,
.batya-review-form__form input:focus-visible,
.batya-review-form__form textarea:focus,
.batya-review-form__form textarea:focus-visible,
.batya-review-form__form select:focus,
.batya-review-form__form select:focus-visible {
  border-color: var(--batya-focus-border);
  box-shadow: none;
}

/* Desktop catalog: no external rings. Accordion rows/chips get a subtle local
   surface change; select/checkbox use their own border. */
@media (min-width: 1200px) {
  .catalog-sidebar .batya-filter > summary:focus-visible,
  .catalog-sidebar .batya-filter__desktop-more:focus-visible,
  .batya-catalog-active-filters__chip:focus-visible {
    background-color: var(--batya-focus-surface);
  }

  .catalog-main-toolbar .woocommerce-ordering select:focus,
  .catalog-main-toolbar .woocommerce-ordering select:focus-visible,
  .catalog-sidebar .batya-filter__check input[type="checkbox"]:focus,
  .catalog-sidebar .batya-filter__check input[type="checkbox"]:focus-visible {
    border-color: var(--batya-focus-border);
    box-shadow: none;
  }
}

/* Product/review media already have visible tiles; keep focus local. */
.batya-review-photo-rail__item:focus-visible,
.batya-review-media__item:focus-visible {
  border-color: var(--batya-border-strong);
}

.single-product-card__rating:focus-visible {
  color: var(--batya-text);
}

/* Quantity and gallery use their existing borders instead of a halo. */
.single-product-card__cta form.cart.has-batya-mobile-stepper > .quantity.batya-quantity-stepper:focus-within {
  border-color: var(--batya-focus-border);
  box-shadow: none;
}

.single-product-hero__gallery .flex-control-thumbs img:focus-visible {
  border-color: var(--batya-focus-border);
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  :where(
    a[href],
    button,
    input,
    select,
    textarea,
    summary,
    [role="button"],
    [role="link"],
    [tabindex]:not([tabindex="-1"])
  ):focus-visible {
    transition: none !important;
  }
}
