/* Affiliate Autopilot — front end. Inherits the theme's fonts; accent colour comes from Settings. */
:root {
	--afap-accent: #ff9900;
	--afap-border: rgba(0, 0, 0, .1);
	--afap-soft: rgba(0, 0, 0, .03);
	--afap-text-soft: rgba(0, 0, 0, .62);
	--afap-good: #1a7f37;
	--afap-bad: #b42318;
	--afap-radius: 10px;
}

/* Disclosure & freshness */
.afap-disclosure {
	font-size: .85em;
	color: var(--afap-text-soft);
	border-left: 3px solid var(--afap-accent);
	padding: .5em .9em;
	margin: 0 0 1.5em;
	background: var(--afap-soft);
}
.afap-updated {
	font-size: .85em;
	color: var(--afap-text-soft);
	margin: 0 0 1em;
}

/* Featured snippet answer, takeaways, TOC */
.afap-snippet {
	font-size: 1.05em;
	padding: 1em 1.2em;
	border-radius: var(--afap-radius);
	background: var(--afap-soft);
	border: 1px solid var(--afap-border);
}
.afap-takeaways,
.afap-toc {
	border: 1px solid var(--afap-border);
	border-radius: var(--afap-radius);
	padding: 1em 1.4em;
	margin: 1.5em 0;
}
.afap-takeaways-title,
.afap-toc-title,
.afap-proscons-title {
	font-weight: 700;
	margin: 0 0 .5em !important;
}
.afap-takeaways ul,
.afap-toc ol {
	margin: 0;
	padding-left: 1.2em;
}
.afap-toc li {
	margin: .25em 0;
}
.afap-toc a {
	text-decoration: none;
}
.afap-toc a:hover {
	text-decoration: underline;
}
h2[id] {
	scroll-margin-top: 90px;
}

/* Buttons */
.afap-btn,
.afap-btn:visited {
	display: inline-block;
	background: var(--afap-accent);
	color: #111 !important;
	font-weight: 700;
	text-decoration: none !important;
	padding: .7em 1.4em;
	border-radius: 999px;
	line-height: 1.2;
	text-align: center;
	transition: filter .15s ease, transform .15s ease;
	box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
}
.afap-btn:hover,
.afap-btn:focus {
	filter: brightness(1.06);
	transform: translateY(-1px);
}
.afap-btn--large {
	font-size: 1.1em;
	padding: .9em 2em;
}
.afap-btn--small {
	font-size: .85em;
	padding: .5em 1em;
	white-space: nowrap;
}
.afap-btn-wrap {
	text-align: center;
	margin: 1.2em 0 2em;
}

/* Product box */
.afap-box {
	position: relative;
	display: grid;
	grid-template-columns: minmax(140px, 220px) 1fr;
	gap: 1.4em;
	align-items: center;
	border: 1px solid var(--afap-border);
	border-radius: var(--afap-radius);
	padding: 1.4em;
	margin: 1.2em 0 1.6em;
	background: #fff;
	color: #1d1d1f;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
}
.afap-box--unavailable {
	opacity: .75;
}
.afap-box--noimg {
	grid-template-columns: 1fr;
}
.afap-box-media {
	text-align: center;
}
.afap-box-media img,
.afap-img {
	max-width: 100%;
	max-height: 240px;
	width: auto;
	height: auto;
	object-fit: contain;
	margin: 0 auto;
	box-shadow: none !important;
	border: 0 !important;
}
.afap-box-title {
	font-weight: 700;
	font-size: 1.05em;
	line-height: 1.35;
	margin: 0 0 .25em !important;
}
.afap-box-title a {
	color: inherit !important;
	text-decoration: none !important;
}
.afap-box-brand {
	font-size: .85em;
	color: var(--afap-text-soft);
	margin: 0 0 .6em !important;
}
.afap-box-features {
	margin: 0 0 .9em !important;
	padding-left: 1.1em !important;
	font-size: .92em;
}
.afap-box-features li {
	margin: .2em 0;
}
.afap-box-buy {
	display: flex;
	flex-wrap: wrap;
	gap: .8em;
	align-items: center;
	justify-content: space-between;
}
.afap-badge {
	position: absolute;
	top: -.75em;
	left: 1em;
	background: #1d1d1f;
	color: #fff;
	font-size: .75em;
	font-weight: 700;
	letter-spacing: .02em;
	text-transform: uppercase;
	padding: .3em .8em;
	border-radius: 999px;
}
.afap-badge--inline {
	position: static;
	display: inline-block;
	margin-bottom: .3em;
}
.afap-deal {
	display: inline-block;
	background: var(--afap-bad);
	color: #fff;
	font-size: .75em;
	font-weight: 700;
	padding: .2em .6em;
	border-radius: 4px;
	margin-bottom: .6em;
}

/* Prices */
.afap-price {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: .4em;
}
.afap-price-now {
	font-size: 1.25em;
	font-weight: 800;
}
.afap-price-was {
	color: var(--afap-text-soft);
	font-size: .9em;
}
.afap-save {
	color: var(--afap-good);
	font-weight: 700;
	font-size: .9em;
}
.afap-price--na {
	color: var(--afap-text-soft);
	font-size: .9em;
}
.afap-price-date {
	display: block;
	width: 100%;
	font-size: .72em;
	color: var(--afap-text-soft);
	cursor: help;
}
.afap-price-date abbr {
	text-decoration: none;
}

/* Comparison table */
.afap-table {
	border: 1px solid var(--afap-border);
	border-radius: var(--afap-radius);
	overflow: hidden;
	margin: 1em 0 2em;
	background: #fff;
	color: #1d1d1f;
}
.afap-row {
	display: grid;
	grid-template-columns: 90px 1fr auto;
	gap: 1em;
	align-items: center;
	padding: .9em 1.1em;
	border-top: 1px solid var(--afap-border);
}
.afap-row:first-child {
	border-top: 0;
}
.afap-row:nth-child(even) {
	background: var(--afap-soft);
}
.afap-thumb {
	max-width: 80px !important;
	max-height: 80px;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
	margin: 0 auto;
}
.afap-row-title {
	display: block;
	font-weight: 600;
	color: inherit !important;
	line-height: 1.35;
}
.afap-cell-buy {
	text-align: right;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: .4em;
}
.afap-cell-buy .afap-price-date {
	display: none;
}

/* Pros & cons */
.afap-proscons {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1em;
	margin: 1em 0 1.4em;
}
.afap-pros,
.afap-cons {
	border-radius: var(--afap-radius);
	padding: 1em 1.2em;
	border: 1px solid var(--afap-border);
}
.afap-pros {
	border-top: 4px solid var(--afap-good);
}
.afap-cons {
	border-top: 4px solid var(--afap-bad);
}
.afap-pros ul,
.afap-cons ul {
	margin: 0 !important;
	padding-left: 0 !important;
	list-style: none !important;
}
.afap-pros li,
.afap-cons li {
	position: relative;
	padding-left: 1.5em;
	margin: .35em 0;
}
.afap-pros li::before {
	content: "✓";
	position: absolute;
	left: 0;
	color: var(--afap-good);
	font-weight: 700;
}
.afap-cons li::before {
	content: "✕";
	position: absolute;
	left: 0;
	color: var(--afap-bad);
	font-weight: 700;
}
.afap-bestfor {
	background: var(--afap-soft);
	border-radius: var(--afap-radius);
	padding: .7em 1em;
}

/* Related articles */
.afap-related {
	border-top: 1px solid var(--afap-border);
	margin: 2.5em 0 1em;
	padding-top: 1em;
}
.afap-related-title {
	font-weight: 700;
	margin: 0 0 .5em !important;
}
.afap-related ul {
	margin: 0;
	padding-left: 1.2em;
}
.afap-related li {
	margin: .35em 0;
}

/* FAQ */
.afap-faq h3 {
	margin-top: 1.2em;
}

@media (max-width: 640px) {
	.afap-box {
		grid-template-columns: 1fr;
		text-align: left;
		padding: 1.4em 1em 1em;
	}
	.afap-box-buy .afap-btn {
		width: 100%;
	}
	.afap-row {
		grid-template-columns: 64px 1fr;
	}
	.afap-cell-buy {
		grid-column: 1 / -1;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
	}
	.afap-proscons {
		grid-template-columns: 1fr;
	}
}

/* Quick-buy card after the intro */
.afap-top {
	display: flex;
	align-items: center;
	gap: 14px;
	box-sizing: border-box;
	max-width: 100%;
	margin: 1.4em 0 1.8em;
	padding: 12px 16px;
	border: 2px solid var(--afap-accent);
	border-radius: var(--afap-radius);
	background: #fff;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
}
.afap-top *, .afap-bar * { box-sizing: border-box; }
.afap-top-media { flex: 0 0 auto; }
.afap-top-img { display: block; width: 84px; height: 84px; object-fit: contain; }
.afap-top-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.afap-top-label { font-size: .75em; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--afap-text-soft); }
.afap-top-name { font-weight: 700; line-height: 1.3; color: inherit !important; text-decoration: none !important; overflow-wrap: anywhere; }
.afap-top-name:hover { text-decoration: underline !important; }
.afap-top .afap-price { font-size: .95em; }
.afap-top .afap-price-date { display: none; }
.afap-top .afap-btn { flex: 0 0 auto; max-width: 100%; white-space: normal; }
@media (max-width: 600px) {
	.afap-top { flex-wrap: wrap; padding: 12px; gap: 10px 12px; }
	.afap-top-img { width: 72px; height: 72px; }
	.afap-top-body { flex: 1 1 0; }
	.afap-top .afap-btn { flex: 1 1 100%; width: 100%; padding: .75em 1em; }
}
.afap-cta-mid { margin: 1.6em 0; }

/* Buy bar fixed to the bottom of the screen */
.afap-bar {
	position: fixed;
	left: 50%;
	bottom: 14px;
	transform: translateX(-50%);
	z-index: 9990;
	display: flex;
	align-items: center;
	gap: 14px;
	width: min(920px, calc(100% - 24px));
	box-sizing: border-box;
	padding: 12px 14px 12px 16px;
	background: #fff;
	color: #111;
	border: 1px solid var(--afap-border);
	border-top: 3px solid var(--afap-accent);
	border-radius: 16px;
	box-shadow: 0 8px 30px rgba(0, 0, 0, .22);
	font-size: 17px;
}
.afap-bar[hidden] { display: none; }
.afap-bar-media { flex: 0 0 auto; }
.afap-bar-img { display: block; width: 60px; height: 60px; object-fit: contain; }
.afap-bar-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; line-height: 1.25; }
.afap-bar-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.afap-bar-price { font-size: .95em; font-weight: 600; color: var(--afap-text-soft); }
.afap-bar .afap-btn { flex: 0 0 auto; font-size: 1em; padding: .8em 1.6em; white-space: nowrap; }
.afap-bar-short { display: none; }
.afap-bar-close {
	flex: 0 0 auto;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--afap-soft);
	color: #555;
	font-size: 20px;
	line-height: 32px;
	cursor: pointer;
}
@media (max-width: 600px) {
	.afap-bar { bottom: 8px; width: calc(100% - 16px); gap: 10px; padding: 10px 10px 10px 12px; font-size: 16px; }
	.afap-bar-img { width: 52px; height: 52px; }
	.afap-bar .afap-btn { padding: .8em 1.1em; }
	.afap-bar-long { display: none; }
	.afap-bar-short { display: inline; }
}
/* The theme's "back to top" button moves up while the buy bar is showing. */
body.afap-bar-on .generate-back-to-top,
body.afap-bar-on #back-to-top,
body.afap-bar-on .back-to-top,
body.afap-bar-on .scroll-to-top {
	bottom: calc(var(--afap-bar-h, 90px) + 26px) !important;
	transition: bottom .2s ease;
}
@media print { .afap-bar, .afap-top .afap-btn, .afap-cta-mid { display: none !important; } }
