/**
 * Focus ring only for keyboard users (Tiago, 2026-10, formerly in Flatsome footer scripts).
 * js/focus-mode.js marks <html> with gf-bb-input-pointer or gf-bb-input-keyboard; the DOM focus never changes.
 */

/* An important cascade layer outranks the theme's unlayered important focus rings.
   Only a confirmed pointer interaction activates this exception. Native keyboard
   focus-visible rules remain the source of each component's colour and spacing. */
@layer gf-bb-focus-interaction {
  html.gf-bb-input-pointer body.wp-child-theme-buyback :focus:not(:where(
    input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]),
    textarea,select,[contenteditable]:not([contenteditable="false"]),
    [contenteditable]:not([contenteditable="false"]) *,
    [role="textbox"],[role="searchbox"],[role="combobox"],[role="spinbutton"],
    [role="slider"],[role="checkbox"],[role="radio"],[role="switch"],[role="listbox"]
  )) {
    outline: none !important;
  }
  html.gf-bb-input-pointer body.wp-child-theme-buyback .bb-home-guide__link:focus::after {
    outline: none !important;
  }
}

/* Superfly also paints a pseudo-element for :focus. Keep the current category
   state, but remove a returned pointer focus from an otherwise idle category. */
html.gf-bb-input-pointer body.wp-child-theme-buyback #sfm-sidebar .sfm-menu
li:not(.sfm-submenu-visible):not(.sfm-active-item):not(.sfm-active-smooth):not(:hover)>a:focus::before {
  width: 0 !important;
}
@media (hover: none) {
  html.gf-bb-input-pointer body.wp-child-theme-buyback #sfm-sidebar .sfm-menu
  li:not(.sfm-submenu-visible):not(.sfm-active-item):not(.sfm-active-smooth)>a:focus::before {
    width: 0 !important;
  }
}
/* A minimum keyboard indicator for controls such as the native DIV close button.
   More specific existing component rules keep their established presentation. */
html.gf-bb-input-keyboard body.wp-child-theme-buyback :is(a[href],button,summary,[tabindex],[role="button"]):focus {
  outline: 2px solid var(--bb-color-focus-ring,#028543);
  outline-offset: 2px;
}
