/* Buttons: hover, pressed and keyboard-focus states, site-wide (0.9.8).
   The editor's own buttons (wp-block-button: About, home, school/corporate
   pages, rules) had no hover at all. WooCommerce buttons already darken to
   #46734d in layout.css section 5; the editor buttons now do the same.
   Explicit colours, not filter: brightness() - WooCommerce also puts the
   class wp-element-button on transparent controls (mini-cart close "x",
   notice dismiss, "Виж количката" link), which must not get a box or shadow.
   Hover does not exist on phones, so the pressed state (:active) gives touch
   feedback; :focus-visible shows a ring for keyboard users only.
   Contrast: white on #46734d = 5.5:1 (passes AA); #518459 alone is 4.4:1. */

.wp-block-button > .wp-block-button__link {
	cursor: pointer;
	transition: background-color .15s ease, border-color .15s ease,
		color .15s ease, box-shadow .15s ease, transform .1s ease;
}

/* Hover only where a real pointer hovers: on phones a tapped button would
   otherwise stay dark after the tap ("sticky hover"). */
@media (hover: hover) {
	/* Filled buttons in the site green: one step darker + soft shadow. */
	.wp-block-button:not(.is-style-outline) > .wp-block-button__link:not(.has-background):hover {
		background-color: #46734d;
		border-color: #46734d;
		color: #fff;
		box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
	}

	/* A filled button given its own colour in the editor keeps it, slightly darker. */
	.wp-block-button:not(.is-style-outline) > .wp-block-button__link.has-background:hover {
		filter: brightness(.9);
		box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
	}

	/* Outline buttons: fill with the hover green, white text. */
	.wp-block-button.is-style-outline > .wp-block-button__link:hover {
		background-color: #46734d;
		border-color: #46734d;
		color: #fff;
	}
}

/* Pressed = the touch feedback on phones: editor buttons turn the hover
   green while the finger is down ... */
.wp-block-button > .wp-block-button__link:not(.has-background):active {
	background-color: #46734d;
	border-color: #46734d;
	color: #fff;
}

/* ... and every button moves 1px down, no shadow. transform does not move
   the surrounding layout. */
.wp-block-button > .wp-block-button__link:active,
body .woocommerce a.button:active,
body .woocommerce button.button:active,
body .wc-block-components-product-button__button:active,
body .wc-block-mini-cart__footer-checkout:active {
	transform: translateY(1px);
	box-shadow: none;
}

/* Keyboard focus ring (not shown for mouse clicks or taps). */
.wp-element-button:focus-visible,
body .woocommerce a.button:focus-visible,
body .woocommerce button.button:focus-visible,
body .woocommerce input.button:focus-visible {
	outline: 3px solid #518459;
	outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
	.wp-block-button > .wp-block-button__link {
		transition: none;
	}

	.wp-block-button > .wp-block-button__link:active,
	body .woocommerce a.button:active,
	body .woocommerce button.button:active,
	body .wc-block-components-product-button__button:active,
	body .wc-block-mini-cart__footer-checkout:active {
		transform: none;
	}
}
