/**
 * Calmly Rooted Affiliate — disclosure typography
 * Button disclaimer: one size smaller than body, lighter gray.
 */

.cr-affiliate-disclaimer {
	display: block;
	margin: 0.5em 0 0;
	max-width: 36em;
	font-size: 0.875em;
	line-height: 1.45;
	font-weight: 400;
	color: #8a8a8a;
}

/*
 * Single product: theme cart forms often use flex row, which places the
 * commission note beside CHECK PRICE. Stack CTA + disclaimer vertically.
 */
.single-product form.cart,
.single-product .entry-summary form.cart,
.single-product .summary form.cart {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	flex-wrap: nowrap;
}

.single-product form.cart .single_add_to_cart_button,
.single-product form.cart a.single_add_to_cart_button,
.single-product form.cart a.cr-affiliate-external-cta,
.single-product form.cart button.single_add_to_cart_button {
	flex: 0 0 auto;
	width: auto;
	max-width: 100%;
	float: none;
}

.single-product form.cart .cr-affiliate-disclaimer {
	flex: 0 0 auto;
	width: 100%;
	max-width: 36em;
	margin-top: 0.65em;
	clear: both;
}

/* Fallback when the disclaimer is hooked after the form in product summary. */
.single-product .summary > .cr-affiliate-disclaimer,
.single-product .entry-summary > .cr-affiliate-disclaimer {
	display: block;
	width: 100%;
	max-width: 36em;
	clear: both;
	margin-top: 0.65em;
}

/* Shop / category cards: keep disclosure in the text area, never over the product image. */
.cr-affiliate-loop-note {
	position: static;
	display: block;
	clear: both;
	width: 100%;
	margin: 0;
	padding: 0;
	z-index: 1;
}

.woocommerce ul.products li.product .cr-affiliate-loop-note,
.woocommerce-page ul.products li.product .cr-affiliate-loop-note {
	flex: 0 0 100%;
	order: 10;
}

.woocommerce ul.products li.product .cr-affiliate-disclaimer--loop,
.woocommerce-page ul.products li.product .cr-affiliate-disclaimer--loop {
	position: static;
	display: block;
	width: 100%;
	max-width: none;
	margin: 0.35em 0 0.5em;
	padding: 0;
	font-size: 0.6875rem;
	line-height: 1.35;
	text-align: left;
	color: #8a8a8a;
	transform: none;
	inset: auto;
	pointer-events: auto;
}

/* Hide if a theme injects the note inside the image overlay (buttons area). */
.product-block .wrapper-img .cr-affiliate-loop-note,
.product-block .groups-button .cr-affiliate-loop-note,
.product-block .group-button .cr-affiliate-loop-note,
.product-block .overlay .cr-affiliate-loop-note {
	display: none;
}

.cr-page-affiliate-disclosure {
	font-size: 0.8125rem;
	line-height: 1.4;
	color: #6b6b6b;
	background: #f6f6f6;
	padding: 0.65em 1em;
	text-align: center;
	margin: 0;
}

.cr-page-affiliate-disclosure--inline {
	margin: 0 0 1.25em;
	text-align: left;
}

.cr-footer-affiliate-disclosure {
	font-size: 0.8125rem;
	line-height: 1.45;
	color: #8a8a8a;
	text-align: center;
	padding: 0.85em 1.25em 1.25em;
	margin: 0;
	background: transparent;
}

@media (max-width: 782px) {
	.cr-affiliate-disclaimer,
	.cr-page-affiliate-disclosure,
	.cr-footer-affiliate-disclosure {
		font-size: 0.75rem;
		padding-left: 0.85em;
		padding-right: 0.85em;
	}

	.cr-affiliate-disclaimer {
		padding-left: 0;
		padding-right: 0;
	}
}
