/*
 * ANDPRO semantic attention system G3.
 * Activation is opt-in: load last and add `ap-attention-v1` to <html>.
 * One conversion primary per task; violet is reserved for context/selection.
 * Existing family CSS stays untouched and remains the rollback preimage.
 */

html.ap-attention-v1 {
	--ap-attention-primary-bg: #f6c15f;
	--ap-attention-primary-hover: #e7a92f;
	--ap-attention-primary-active: #cc8d13;
	--ap-attention-primary-fg: #222466;
	--ap-attention-secondary-bg: #ffffff;
	--ap-attention-secondary-hover: #eef0fb;
	--ap-attention-secondary-fg: #343a92;
	--ap-attention-secondary-border: #727bb5;
	--ap-attention-focus: #0b70e0;
	--ap-attention-selection-bg: #eef0fb;
	--ap-attention-selection-border: #575fcf;
	--ap-attention-selection-fg: #222466;
	--ap-attention-success-bg: #eaf8f1;
	--ap-attention-success-border: #23845a;
	--ap-attention-success-fg: #136b43;
	--ap-attention-warning-bg: #fff4d6;
	--ap-attention-warning-border: #a66d00;
	--ap-attention-warning-fg: #704900;
	--ap-attention-error-bg: #fff0f1;
	--ap-attention-error-border: #b4232f;
	--ap-attention-error-fg: #98202a;
	--ap-attention-info-bg: #edf6ff;
	--ap-attention-info-border: #0f5f9a;
	--ap-attention-info-fg: #0b507f;
	--ap-attention-disabled-bg: #e9edf2;
	--ap-attention-disabled-border: #c0c6cf;
	--ap-attention-disabled-fg: #515a67;
}

/* One visible, accessible focus language across every family. */
html.ap-attention-v1 :where(a, button, input, select, textarea, summary, [role="button"], [role="link"], [tabindex]):focus-visible {
	outline: 3px solid var(--ap-attention-focus) !important;
	outline-offset: 3px !important;
}

/* ANDPRO-G38-WAVE-B-REPEATED-COMMERCE-EXCLUSION-V1: keep the global amber role outside Wave B; Wave B owns repeated card actions. */
/* Conversion primary: purchase, quote, order, payment recovery or service request. */
html.ap-attention-v1:not(.ap-wave-b-v1) .catalog-card .card-btn.--buy,
html.ap-attention-v1 :where(
	.ap-attention-primary,
	.itempage-content__buyblock .card-btn.--buy,
	.itempage-stickybar__buy,
	.cf-total-box__btn,
	.cfgsrv-cta,
	.nwheader-cart .cf-button.toorder,
	.order-page .--create-order,
	.content-block__order .--create-order,
	.andpro-payment-return__button,
	.ap-action--primary,
	.ap-services-action--primary,
	.contacts-action--primary,
	.abh-btn--yellow,
	.cf-button.--primary
) {
	display: inline-flex;
	min-height: 45px;
	align-items: center;
	justify-content: center;
	padding: 10px 16px;
	border: 1px solid var(--ap-attention-primary-bg) !important;
	border-radius: 8px;
	background: var(--ap-attention-primary-bg) !important;
	color: var(--ap-attention-primary-fg) !important;
	font-weight: 800;
	box-shadow: none;
	opacity: 1;
	text-decoration: none;
}

html.ap-attention-v1:not(.ap-wave-b-v1) .catalog-card .card-btn.--buy:hover,
html.ap-attention-v1 :where(
	.ap-attention-primary,
	.itempage-content__buyblock .card-btn.--buy,
	.itempage-stickybar__buy,
	.cf-total-box__btn,
	.cfgsrv-cta,
	.nwheader-cart .cf-button.toorder,
	.order-page .--create-order,
	.content-block__order .--create-order,
	.andpro-payment-return__button,
	.ap-action--primary,
	.ap-services-action--primary,
	.contacts-action--primary,
	.abh-btn--yellow,
	.cf-button.--primary
):hover {
	border-color: var(--ap-attention-primary-hover) !important;
	background: var(--ap-attention-primary-hover) !important;
	color: var(--ap-attention-primary-fg) !important;
	transform: none;
}

html.ap-attention-v1:not(.ap-wave-b-v1) .catalog-card .card-btn.--buy:active,
html.ap-attention-v1 :where(
	.ap-attention-primary,
	.itempage-content__buyblock .card-btn.--buy,
	.itempage-stickybar__buy,
	.cf-total-box__btn,
	.cfgsrv-cta,
	.nwheader-cart .cf-button.toorder,
	.order-page .--create-order,
	.content-block__order .--create-order,
	.andpro-payment-return__button,
	.ap-action--primary,
	.ap-services-action--primary,
	.contacts-action--primary,
	.abh-btn--yellow,
	.cf-button.--primary
):active {
	border-color: var(--ap-attention-primary-active) !important;
	background: var(--ap-attention-primary-active) !important;
}

/* Secondary/contextual actions are first-class, but never compete with conversion. */
html.ap-attention-v1 :where(
	.ap-attention-secondary,
	.cf-button.--default,
	.cf-button.--white-outline,
	.andpro-cart-kp,
	.ap-invoice-btn,
	.abh-btn--primary,
	.article-side__button,
	.ap-action--light,
	.ap-services-action--light,
	.contacts-action:not(.contacts-action--primary):not(.contacts-action--accent)
) {
	display: inline-flex;
	min-height: 45px;
	align-items: center;
	justify-content: center;
	padding: 10px 16px;
	border: 1px solid var(--ap-attention-secondary-border) !important;
	border-radius: 8px;
	background: var(--ap-attention-secondary-bg) !important;
	color: var(--ap-attention-secondary-fg) !important;
	font-weight: 800;
	box-shadow: none;
	opacity: 1;
	text-decoration: none;
}

html.ap-attention-v1 :where(
	.ap-attention-secondary,
	.cf-button.--default,
	.cf-button.--white-outline,
	.andpro-cart-kp,
	.ap-invoice-btn,
	.abh-btn--primary,
	.article-side__button,
	.ap-action--light,
	.ap-services-action--light,
	.contacts-action:not(.contacts-action--primary):not(.contacts-action--accent)
):hover {
	border-color: var(--ap-attention-secondary-border) !important;
	background: var(--ap-attention-secondary-hover) !important;
	color: var(--ap-attention-secondary-fg) !important;
	transform: none;
}

/* Selection/current state: violet has a single job and always has a non-color cue. */
html.ap-attention-v1 :where(
	.catalog-head__filters li.--active a,
	.catalog-controls__btn.--active,
	.itempage-info__tab-link.--active,
	.itempage-specchips__chip[aria-selected="true"],
	.cfgsrv-chip[aria-pressed="true"],
	.cfgsrv-slot[data-active="1"],
	.cfgsrv-prod[data-selected="1"],
	.abh-chip--active,
	.blog-category a.--active,
	.page-side__link.selected,
	[aria-current="page"],
	.order-page__select-btn input:checked + .order-select
) {
	border-color: var(--ap-attention-selection-border) !important;
	background: var(--ap-attention-selection-bg) !important;
	color: var(--ap-attention-selection-fg) !important;
}

html.ap-attention-v1 :where(
	.catalog-head__filters li.--active a,
	.abh-chip--active,
	.blog-category a.--active
)::before {
	content: "✓";
	margin-right: 6px;
	font-weight: 900;
}

html.ap-attention-v1 :where(.abh-chip, .catalog-head__filters a, .blog-category a) {
	text-decoration: none;
}

html.ap-attention-v1 .cfgsrv-prod[data-selected="1"] .cfgsrv-prod__pick::before {
	content: "✓ ";
	font-weight: 900;
}

/* Editorial/navigation CTAs remain calm unless explicitly promoted. */
html.ap-attention-v1 :where(.abh-btn, .ap-action, .ap-services-action, .contacts-action) {
	text-decoration: none;
}

html.ap-attention-v1 .andpro-payment-return__link {
	min-height: 45px;
	color: var(--ap-attention-secondary-fg) !important;
	font-weight: 800;
}

html.ap-attention-v1 :where(
	.abh-btn:not(.abh-btn--yellow):not(.abh-btn--primary),
	.ap-action:not(.ap-action--primary):not(.ap-action--yellow):not(.ap-action--light),
	.ap-services-action:not(.ap-services-action--primary):not(.ap-services-action--yellow):not(.ap-services-action--light)
) {
	border-color: var(--ap-attention-secondary-border);
	background: var(--ap-attention-secondary-bg);
	color: var(--ap-attention-secondary-fg) !important;
}

/* Status colors are semantic, never decorative, and include symbols/text. */
html.ap-attention-v1 :where(
	.ap-attention-success,
	.card-stock,
	.cfgsrv-stockbadge,
	.cfgpcb-stockbadge,
	.cfgnet-stock,
	.cfgups-stock,
	.cfgmem-stock,
	.cfgdsk-stock,
	.nwheader-cart-item__bonus.--instock,
	.andpro-payment-return[data-state="paid"] .andpro-payment-return__eyebrow
) {
	border-color: var(--ap-attention-success-border) !important;
	background: var(--ap-attention-success-bg) !important;
	color: var(--ap-attention-success-fg) !important;
}

html.ap-attention-v1 :where(
	.ap-attention-success,
	.cfgsrv-stockbadge,
	.cfgpcb-stockbadge,
	.cfgnet-stock,
	.cfgups-stock,
	.cfgmem-stock,
	.cfgdsk-stock,
	.andpro-payment-return[data-state="paid"] .andpro-payment-return__eyebrow
)::before {
	content: "✓ ";
	font-weight: 900;
}

html.ap-attention-v1 :where(
	.ap-attention-warning,
	.cfgsrv-orderbadge,
	.cfgpcb-orderbadge,
	.cfgpcb-prod__warn,
	.cfgnet-order,
	.cfgups-order,
	.cfgmem-order,
	.cfgdsk-order,
	.cfgsrv-slot__warn,
	.andpro-payment-return[data-state="pending"] .andpro-payment-return__eyebrow,
	.andpro-payment-return[data-state="incomplete"] .andpro-payment-return__eyebrow
) {
	border-color: var(--ap-attention-warning-border) !important;
	background: var(--ap-attention-warning-bg) !important;
	color: var(--ap-attention-warning-fg) !important;
}

html.ap-attention-v1 :where(
	.ap-attention-warning,
	.cfgsrv-orderbadge,
	.cfgpcb-orderbadge,
	.cfgpcb-prod__warn,
	.cfgnet-order,
	.cfgups-order,
	.cfgmem-order,
	.cfgdsk-order,
	.andpro-payment-return[data-state="pending"] .andpro-payment-return__eyebrow,
	.andpro-payment-return[data-state="incomplete"] .andpro-payment-return__eyebrow
)::before {
	content: "! ";
	font-weight: 900;
}

html.ap-attention-v1 :where(
	.ap-attention-error,
	.form-error-text,
	.order-contact__error,
	.order-total__error,
	.error_add_coupon,
	.andpro-payment-return[data-state="cancelled"] .andpro-payment-return__eyebrow,
	.andpro-payment-return[data-state="failed"] .andpro-payment-return__eyebrow
) {
	border-color: var(--ap-attention-error-border) !important;
	background: var(--ap-attention-error-bg) !important;
	color: var(--ap-attention-error-fg) !important;
}

html.ap-attention-v1 :where(
	.ap-attention-error,
	.andpro-payment-return[data-state="cancelled"] .andpro-payment-return__eyebrow,
	.andpro-payment-return[data-state="failed"] .andpro-payment-return__eyebrow
)::before {
	content: "× ";
	font-weight: 900;
}

html.ap-attention-v1 .ap-attention-info {
	border-color: var(--ap-attention-info-border);
	background: var(--ap-attention-info-bg);
	color: var(--ap-attention-info-fg);
}

html.ap-attention-v1 .ap-attention-info::before {
	content: "i ";
	font-weight: 900;
}

/* Invalid fields retain the same strong focus geometry, in error semantics. */
html.ap-attention-v1 :where(input, select, textarea)[aria-invalid="true"] {
	border-color: var(--ap-attention-error-border) !important;
	box-shadow: 0 0 0 3px rgba(180, 35, 47, 0.14) !important;
}

/* Disabled is visually stable, readable and never faked through opacity alone. */
html.ap-attention-v1 :where(
	button:disabled,
	input:disabled,
	select:disabled,
	.cf-button[aria-disabled="true"],
	.form-radio-label.--disabled,
	.catalog-head__filters li.disabled a
) {
	border-color: var(--ap-attention-disabled-border) !important;
	background: var(--ap-attention-disabled-bg) !important;
	color: var(--ap-attention-disabled-fg) !important;
	cursor: not-allowed !important;
	opacity: 1 !important;
}

/* Commerce/touch controls use a render-safe 45px floor. */
html.ap-attention-v1 :where(
	.card-quant__btn,
	.nwheader-cart-item__btn,
	.cfgsrv-qty button,
	.cfgsrv-prod__pick,
	.cfgsrv-chip,
	.filter-btn,
	.order-page__select-btn,
	.cf-button,
	.ap-action,
	.ap-services-action,
	.contacts-action,
	.abh-btn
) {
	min-height: 45px;
}

html.ap-attention-v1 :where(.card-quant__btn, .nwheader-cart-item__btn, .cfgsrv-qty button) {
	min-width: 45px;
}

@media (max-width: 640px) {
	html.ap-attention-v1 :where(
		.ap-attention-primary,
		.catalog-card .card-btn.--buy,
		.itempage-content__buyblock .card-btn.--buy,
		.itempage-stickybar__buy,
		.cfgsrv-cta,
		.nwheader-cart .cf-button.toorder,
		.order-page .--create-order,
		.andpro-payment-return__button,
		.ap-services-action--primary,
		.cf-button.--primary
	) {
		width: 100%;
	}

	/* Keep room for price and stock beside the non-shrinking sticky buy button. */
	html.ap-attention-v1 .itempage-stickybar__buy {
		width: auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	html.ap-attention-v1 :where(a, button, input, select, textarea) {
		transition: none !important;
	}
}

/* ANDPRO-BLOG-VISUAL-INCIDENT-G1-20260830: stable fallback for unwrapped article heroes. */
.ap-article-hero:not(:has(> .ap-article-hero__content)) {
	display: block;
	padding: 28px;
	border: 1px solid rgba(87, 98, 200, .22);
	border-radius: 18px;
	background: #fff;
	box-shadow: 0 14px 34px rgba(47, 50, 134, .08);
}

.ap-article-hero:not(:has(> .ap-article-hero__content)) .apa-meta {
	margin: 0 0 12px;
}

.ap-article-hero:not(:has(> .ap-article-hero__content)) .ap-article-badge {
	margin: 0 0 18px;
}

.ap-article-hero:not(:has(> .ap-article-hero__content)) h1 {
	margin: 0 0 16px;
}

.ap-article-hero:not(:has(> .ap-article-hero__content)) .ap-article-preview {
	max-width: 920px;
	margin: 0 0 16px;
}

.ap-article-hero:not(:has(> .ap-article-hero__content)) .ap-article-actions {
	margin-top: 24px;
}

.ap-article-hero .ap-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	padding: 11px 18px;
	border: 1px solid rgba(47, 50, 134, .48);
	border-radius: 12px;
	font-size: 15px;
	font-weight: 800;
	line-height: 1.25;
	text-align: center;
	text-decoration: none !important;
}

.ap-article-hero .ap-btn-primary,
.ap-article-hero .ap-btn-primary:visited {
	border-color: #2f3286;
	background: #2f3286;
	color: #fff !important;
}

.ap-article-hero .ap-btn-secondary,
.ap-article-hero .ap-btn-secondary:visited {
	background: #fff;
	color: #2f3286 !important;
}

.ap-article-hero .ap-btn-primary:hover,
.ap-article-hero .ap-btn-primary:active {
	background: #222466;
	color: #fff !important;
}

.ap-article-hero .ap-btn-secondary:hover,
.ap-article-hero .ap-btn-secondary:active {
	border-color: #2f3286;
	background: #f6f7ff;
	color: #222466 !important;
}

.ap-article-button--primary:visited {
	color: #fff !important;
}

.ap-article-button--accent:visited {
	color: #222466 !important;
}

.ap-article-hero .ap-btn:focus-visible,
.ap-article-button:focus-visible {
	outline: 3px solid var(--ap-attention-focus) !important;
	outline-offset: 3px !important;
}

.ap-article-hero .ap-btn[aria-disabled="true"],
.ap-article-button[aria-disabled="true"],
.ap-article-hero .ap-btn:disabled,
.ap-article-button:disabled {
	opacity: .62;
	pointer-events: none;
}

@media (max-width: 760px) {
	.ap-article-hero:not(:has(> .ap-article-hero__content)) {
		padding: 18px;
		border-radius: 16px;
	}

	.ap-article-hero:not(:has(> .ap-article-hero__content)) .ap-article-actions {
		margin-top: 20px;
	}

	.ap-article-hero .ap-btn {
		width: 100%;
	}
}


/* ANDPRO-HOMEPAGE-ACCENT-HIERARCHY-G2:start — scoped role correction only. */
html.ap-attention-v1 .header__cat-btn {
  background: #fff;
  border-color: #dfe3f1;
  color: #2c3a47;
  box-shadow: none;
}

html.ap-attention-v1 .header__cat-btn:hover {
  background: #eef0fb;
  border-color: #575fcf;
  color: #343a92;
}

html.ap-attention-v1 .ap-tophero__btn.--primary,
html.ap-attention-v1 .ap-track__cta.--primary,
html.ap-attention-v1 .cfghub-card[href="/configurator-server/"] .cfghub-card__cta {
  min-height: 45px;
  background: #f6c15f;
  border-color: #f6c15f;
  color: #222466;
  box-shadow: none;
}

html.ap-attention-v1 .ap-tophero__btn.--primary:hover,
html.ap-attention-v1 .ap-track__cta.--primary:hover,
html.ap-attention-v1 .cfghub-card[href="/configurator-server/"]:hover .cfghub-card__cta {
  background: #e7a92f;
  border-color: #e7a92f;
  color: #222466;
}

html.ap-attention-v1 .ap-tophero__btn.--ghost,
html.ap-attention-v1 .ap-track__cta.--soft,
html.ap-attention-v1 .cfghub-card:not([href="/configurator-server/"]) .cfghub-card__cta {
  min-height: 45px;
  background: #fff;
  border-color: #dfe3f1;
  color: #2c3a47;
  box-shadow: none;
}

html.ap-attention-v1 .ap-tophero__btn.--ghost:hover,
html.ap-attention-v1 .ap-track__cta.--soft:hover,
html.ap-attention-v1 .cfghub-card:not([href="/configurator-server/"]):hover .cfghub-card__cta {
  background: #eef0fb;
  border-color: #575fcf;
  color: #343a92;
}

html.ap-attention-v1 .andpro-contact-launcher__trigger {
  background: #fff;
  border: 1px solid #575fcf;
  color: #343a92;
  box-shadow: none;
}

html.ap-attention-v1 .andpro-contact-launcher__trigger:hover {
  background: #eef0fb;
  color: #343a92;
}

html:has(#andpro-consent:not([hidden])) .andpro-contact-launcher {
  visibility: hidden;
  pointer-events: none;
}

#andpro-consent .andpro-consent__button--primary {
  background: #edf6ff;
  border-color: #005b9f;
  color: #005b9f;
}

#andpro-consent .andpro-consent__button--secondary {
  background: #fff;
  border-color: #dfe3f1;
  color: #2c3a47;
}

#andpro-consent .andpro-consent__button:focus-visible,
#andpro-consent .andpro-consent-settings:focus-visible {
  outline: 3px solid var(--ap-attention-focus) !important;
  outline-offset: 3px !important;
}
/* ANDPRO-HOMEPAGE-ACCENT-HIERARCHY-G2:end */

/* Purchase20Oct: keep support in document flow on checkout/payment pages. */
body:has(.content-block__order) .andpro-contact-launcher,
body:has(.andpro-payment-return) .andpro-contact-launcher,
body:has(.ap-payment-link) .andpro-contact-launcher {
  position: static;
  inset: auto;
  z-index: auto;
  width: auto;
  max-width: calc(100% - 32px);
  margin: 24px 16px;
  align-items: flex-start;
}
