/**
 * A9 — Accessibility (WCAG 2.2 AA) automatic fixes.
 * Invisible for mouse users except: focus rings (keyboard only, :focus-visible) and tiny grey shifts
 * that lift text to 4.5:1. PHP: inc/areas/fix-a9-a11y.php. JS: assets/js/areas/fix-a9-a11y.js.
 */

/* 1. Skip link (2.4.1): hidden until focused. */
.yb-a9-skip {
	position: absolute;
	top: -200px;
	left: 16px;
	z-index: 1000001;
	padding: 12px 20px;
	background: #000;
	color: #fff !important;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none !important;
}
.yb-a9-skip:focus,
.yb-a9-skip:focus-visible {
	top: 8px;
	outline: 2px solid #fff !important;
	outline-offset: -4px !important;
}
#yb-a9-main:focus { outline: none; }

/* Visually hidden helper (live regions, keyboard-only controls). */
.yb-a9-sr {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0 0 0 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* 2. Focus visible (2.4.7 / 2.4.11) on controls that had no ring. */
.yb button:focus-visible,
.yb select:focus-visible,
.yb summary:focus-visible,
.yb [role="button"]:focus-visible,
.yb [role="tab"]:focus-visible,
.yb .yb-promo__arrow:focus-visible,
.yb .yb-gf-toggle:focus-visible,
.yb .yb-reviews__box:focus-visible,
.yb .yb-reviews__write-btn:focus-visible,
.yb .yb-co-sum:focus-visible,
.yb .wd-swatch:focus-visible,
.yb .wd-accordion-title:focus-visible,
.yb .owl-prev:focus-visible,
.yb .owl-next:focus-visible,
.yb .owl-dot:focus-visible,
.yb .quantity input[type="button"]:focus-visible {
	outline: 2px solid #000 !important;
	outline-offset: 2px !important;
}
.yb .select2-container--focus .select2-selection,
.yb .select2-selection:focus-visible {
	outline: 2px solid #000 !important;
	outline-offset: 2px !important;
}
.yb .yb-promo__pause:focus-visible { outline-offset: 0 !important; }

/* 3. Text contrast (1.4.3): same greys, a few shades darker. */
.yb.search a.yb-search-tabs__tab:not(.is-active) { color: #6B6B6B; }
.yb table.cart td.product-price .amount { color: #6F6F6F; }
.yb .yb-gf-form__input::placeholder { color: #6E7174; opacity: 1; }

/* 4. Promo bar arrows: 24px-high hit area without changing the drawn size (2.5.8). */
.yb .yb-promo__arrow::after {
	content: "";
	position: absolute;
	top: -6px;
	right: 0;
	bottom: -6px;
	left: 0;
}

/* Promo pause control: keyboard/screen-reader only (mouse users pause by hovering). */
.yb .yb-promo__pause {
	position: absolute;
	top: 50%;
	right: 8px;
	width: 1px;
	height: 1px;
	margin: 0;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	border: 0;
	background: #fff;
	color: #000;
	font-size: 12px;
	line-height: 1;
	white-space: nowrap;
	cursor: pointer;
	transform: translateY(-50%);
}
.yb .yb-promo__pause:focus,
.yb .yb-promo__pause:focus-visible {
	width: auto;
	height: 24px !important;
	min-height: 0 !important;
	padding: 0 8px !important;
	line-height: 24px !important;
	overflow: visible;
	clip: auto;
}

/* 5. Desktop mega menu opened from the keyboard (2.1.1). Mirrors WoodMart's :hover state. */
@media (min-width: 1025px) {
	.yb .whb-header .wd-nav-main > li.yb-a9-open > .wd-dropdown,
	.yb .whb-header .wd-nav-main > li.yb-a9-open > .wd-dropdown-menu {
		visibility: visible;
		opacity: 1;
		pointer-events: visible;
		transform: none;
		transition: opacity .2s ease, visibility 0s !important; /* links are tabbable at once */
	}
}

/* 6. Reduced motion (2.3.3): no slide/fade animation, no smooth scrolling. */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto !important; }
	.yb *,
	.yb *::before,
	.yb *::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
		transition-delay: 0s !important;
		scroll-behavior: auto !important;
	}
}
