/* Best Days Rx Storefront - MCP Button Appearance (v0.9.0)
 * ====================================================================
 * Storefront is the VISUAL controller for MCP's action buttons while they sit
 * inside a Storefront product card; MCP stays the functional controller
 * (labels, states, URLs, eligibility, sessions, checkout are never touched).
 *
 * HOW IT IS GATED
 *   This file is enqueued only when Settings > MCP Buttons is enabled AND at
 *   least one device uses the "Editor" source, and its <link media="..."> is
 *   the union of exactly those devices' breakpoints (Desktop >=1025px, Tablet
 *   768-1024px, Mobile <=767px). A device set to "My custom CSS" therefore
 *   receives none of these rules - your pasted card / layout CSS owns it.
 *
 * HOW IT IS SCOPED
 *   The root gets
 *   .bdrx-storefront--mcp-buttons AND Integration\McpButtons wraps the finished
 *   MCP markup in <div class="bdrx-mcp-actions"> - but only while Storefront is
 *   rendering its own cards. Every selector below starts with both, so an MCP
 *   button on a product page, in a shortcode or anywhere else is never affected.
 *
 * STABLE HOOKS RELIED ON (MCP docs/STYLING-CONTRACT.md)
 *   .mcp-shop-actions (group)  .mcp-product-action (primary, any state)
 *   .mcp-product-learn-more (secondary)  .is-disabled / aria-disabled (terminal)
 *
 * TOKENS (blank = inherit): --bdrx-mcp-primary-bg / -primary-text /
 *   -primary-hover-bg / -secondary-text / -secondary-bg / -height / -font-size /
 *   -font-weight / -radius / -gap. They fall back to the Appearance tab
 *   (--bdrx-btn-bg ...) and the Responsive Design tab (--bdrx-card-button-*)
 *   so those systems keep working underneath. Layout + secondary style are
 *   generated per device by Integration\McpButtons::build_css().
 *
 * !important is used for the same reason as the legacy button rules above:
 * MCP's / WooCommerce's / the theme's .button rules must not win. Nothing here
 * hides or truncates a label: wrapping is normal, overflow is visible.
 */
.bdrx-storefront--mcp-buttons .bdrx-mcp-actions {
	display: block;
	width: 100%;
	max-width: 100%;
	margin-top: auto;
	box-sizing: border-box;
	container-name: bdrx-mcp;
	container-type: inline-size;
}
.bdrx-storefront.bdrx-storefront--mcp-buttons .bdrx-mcp-actions .mcp-shop-actions {
	display: flex !important;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--bdrx-mcp-gap, var(--bdrx-card-button-gap, 8px));
	width: 100%;
	max-width: 100%;
	margin: 0 !important;
	box-sizing: border-box;
}
.bdrx-storefront.bdrx-storefront--mcp-buttons .bdrx-mcp-actions .mcp-shop-actions > .mcp-product-action,
.bdrx-storefront.bdrx-storefront--mcp-buttons .bdrx-mcp-actions .mcp-shop-actions > .mcp-product-learn-more {
	box-sizing: border-box;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	min-width: 0;
	max-width: 100%;
	margin: 0 !important;
	padding: 8px 18px !important;
	min-height: var(--bdrx-mcp-height, var(--bdrx-card-button-height, 40px)) !important;
	border-radius: var(--bdrx-mcp-radius, var(--bdrx-card-button-radius, 8px)) !important;
	font-size: var(--bdrx-mcp-font-size, 14px) !important;
	font-weight: var(--bdrx-mcp-font-weight, 600) !important;
	line-height: 1.25 !important;
	text-align: center;
	text-decoration: none !important;
	white-space: normal !important;
	overflow: visible !important;
	text-overflow: clip !important;
	overflow-wrap: break-word;
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease;
}
/* Primary (every MCP primary state: Get Started, Resume Intake, Review & Purchase, ...). */
.bdrx-storefront.bdrx-storefront--mcp-buttons .bdrx-mcp-actions .mcp-shop-actions > .mcp-product-action {
	background: var(--bdrx-mcp-primary-bg, var(--bdrx-btn-bg, var(--bdrx-navy))) !important;
	color: var(--bdrx-mcp-primary-text, var(--bdrx-btn-text, var(--bdrx-button-text))) !important;
	border: 1.4px solid transparent !important; /* transparent (not none): keeps heights equal with the outlined secondary and stays visible in forced-colors mode */
}
.bdrx-storefront.bdrx-storefront--mcp-buttons .bdrx-mcp-actions .mcp-shop-actions > .mcp-product-action:hover:not(.is-disabled),
.bdrx-storefront.bdrx-storefront--mcp-buttons .bdrx-mcp-actions .mcp-shop-actions > .mcp-product-action:focus-visible:not(.is-disabled) {
	background: var(--bdrx-mcp-primary-hover-bg, var(--bdrx-btn-hover-bg, var(--bdrx-navy-hover))) !important;
	color: var(--bdrx-mcp-primary-text, var(--bdrx-btn-text, var(--bdrx-button-text))) !important;
}
/* Terminal / unavailable: still a visible, fully-labelled button - just inert. */
.bdrx-storefront.bdrx-storefront--mcp-buttons .bdrx-mcp-actions .mcp-shop-actions > .mcp-product-action.is-disabled,
.bdrx-storefront.bdrx-storefront--mcp-buttons .bdrx-mcp-actions .mcp-shop-actions > .mcp-product-action[aria-disabled="true"] {
	opacity: .65;
	cursor: not-allowed;
}
.bdrx-storefront.bdrx-storefront--mcp-buttons .bdrx-mcp-actions .mcp-product-action__label {
	display: inline;
	white-space: normal;
	overflow: visible;
}
/* Keyboard focus: always visible, on every state and every secondary style. */
.bdrx-storefront.bdrx-storefront--mcp-buttons .bdrx-mcp-actions .mcp-shop-actions > .mcp-product-action:focus-visible,
.bdrx-storefront.bdrx-storefront--mcp-buttons .bdrx-mcp-actions .mcp-shop-actions > .mcp-product-learn-more:focus-visible {
	outline: 2px solid var(--bdrx-mcp-focus, var(--bdrx-text, #1c1c1a)) !important;
	outline-offset: 2px !important;
}
@media (prefers-reduced-motion: reduce) {
	.bdrx-storefront.bdrx-storefront--mcp-buttons .bdrx-mcp-actions .mcp-shop-actions > a { transition: none; }
}
