/* Affiliate Product Boxes – front end. Colors come from CSS variables set in Settings. */

.apb-box,
.apb-compare-wrap {
	--apb-accent: #f5468a;
	--apb-btn1: #f5468a;
	--apb-btn1-text: #fff;
	--apb-btn2: #42a5f5;
	--apb-btn2-text: #fff;
	--apb-title: #2e9fe6;
	--apb-text: #333;
	--apb-bg: #fff;
	box-sizing: border-box;
	color: var(--apb-text);
	line-height: 1.6;
}

.apb-box *,
.apb-compare-wrap * {
	box-sizing: border-box;
}

/* ---------- Check-mark bullets ---------- */

.apb-features {
	list-style: none !important;
	margin: 0 0 18px !important;
	padding: 0 !important;
	text-align: left;
}

.apb-features li {
	position: relative;
	margin: 0 0 8px !important;
	padding: 0 0 0 28px !important;
	font-size: 16px;
	list-style: none !important;
}

.apb-features li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.32em;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--apb-accent);
}

.apb-features li::after {
	content: "";
	position: absolute;
	left: 5.5px;
	top: calc(0.32em + 3.5px);
	width: 4px;
	height: 7px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

/* ---------- Buttons ---------- */

.apb-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
}

.apb-buttons--stacked {
	flex-direction: column;
	align-items: center;
}

.apb-btn,
.apb-btn:visited {
	display: inline-block;
	min-width: 138px;
	padding: 8px 18px;
	border-radius: 3px;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.4;
	text-align: center;
	text-decoration: none !important;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18);
	transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.apb-btn:hover,
.apb-btn:focus {
	transform: translateY(-1px);
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
	filter: brightness(1.05);
}

.apb-btn--amazon,
.apb-btn--amazon:visited,
.apb-btn--amazon:hover {
	background: var(--apb-btn1);
	color: var(--apb-btn1-text) !important;
}

.apb-btn--second,
.apb-btn--second:visited,
.apb-btn--second:hover {
	background: var(--apb-btn2);
	color: var(--apb-btn2-text) !important;
}

.apb-price {
	margin: -6px 0 14px;
	font-weight: 700;
	text-align: center;
}

.apb-price small {
	font-weight: 400;
	font-size: 12px;
	opacity: 0.7;
	cursor: help;
}

.apb-admin-note {
	margin: 0 0 10px;
	padding: 6px 10px;
	border-left: 3px solid #d63638;
	background: #fcf0f1;
	color: #8a2424;
	font-size: 13px;
	line-height: 1.4;
	text-align: left;
}

/* ---------- Product box ---------- */

.apb-box {
	position: relative;
	margin: 46px 0 40px;
	padding: 34px 28px 30px;
	border: 5px solid var(--apb-accent);
	background: var(--apb-bg);
}

/* Speech-bubble pointer at the bottom left. */
.apb-box::before,
.apb-box::after {
	content: "";
	position: absolute;
	left: 40px;
	width: 0;
	height: 0;
	border-style: solid;
}

.apb-box::before {
	bottom: -21px;
	border-width: 16px 16px 0 16px;
	border-color: var(--apb-accent) transparent transparent transparent;
}

.apb-box::after {
	bottom: -12px;
	left: 46px;
	border-width: 10px 10px 0 10px;
	border-color: var(--apb-bg) transparent transparent transparent;
}

.apb-box__badge {
	position: absolute;
	top: -26px;
	left: -14px;
	padding: 4px 16px 5px;
	border-radius: 8px 8px 0 0;
	background: var(--apb-accent);
	color: #fff;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.4;
}

/* Small folded corner under the badge. */
.apb-box__badge::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: -9px;
	border-style: solid;
	border-width: 0 9px 9px 0;
	border-color: transparent #2b2b3a transparent transparent;
}

.apb-box__inner {
	display: flex;
	align-items: center;
	gap: 28px;
}

.apb-box__img {
	flex: 0 0 34%;
	text-align: center;
}

.apb-box__img img {
	display: inline-block;
	max-width: 100%;
	max-height: 210px;
	width: auto;
	height: auto;
	object-fit: contain;
	box-shadow: none !important;
}

.apb-box__body {
	flex: 1 1 auto;
	min-width: 0;
}

.apb-box__title {
	margin: 0 0 10px;
	color: var(--apb-title);
	font-size: 18px;
	font-weight: 700;
	line-height: 1.35;
}

/* ---------- Comparison ---------- */

.apb-compare-wrap {
	margin: 24px 0 32px;
}

.apb-disclosure {
	margin: 0 0 14px !important;
	font-size: 13px;
	font-style: italic;
	font-weight: 600;
	text-align: center;
}

.apb-compare {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	border: 1px solid #e3e3e3;
	background: var(--apb-bg);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
}

.apb-compare--2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.apb-compare--1 {
	grid-template-columns: minmax(0, 1fr);
	max-width: 380px;
	margin: 0 auto;
}

.apb-col {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 0 18px 28px;
	border-left: 1px solid #e3e3e3;
	text-align: center;
}

.apb-col:first-child {
	border-left: 0;
}

/* Ribbon with forked tails. */
.apb-ribbon {
	position: relative;
	width: 170px;
	max-width: 100%;
	height: 42px;
	margin: 0 auto 22px;
	padding-top: 3px;
	background: var(--apb-accent);
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.25;
	clip-path: polygon(0 0, 100% 0, 100% 100%, 88% 78%, 12% 78%, 0 100%);
}

.apb-ribbon span {
	display: block;
	padding: 4px 18px 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.apb-ribbon--empty {
	visibility: hidden;
}

.apb-col__img {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 130px;
	margin-bottom: 18px;
}

.apb-col__img img {
	max-height: 130px;
	max-width: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	box-shadow: none !important;
}

.apb-col__divider {
	display: block;
	width: 40px;
	height: 2px;
	margin: 0 auto 12px;
	background: var(--apb-accent);
}

.apb-col__title {
	margin: 0 0 16px;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.5;
}

.apb-col__title,
.apb-col__title a,
.apb-col__title a:visited {
	color: var(--apb-title) !important;
	text-decoration: none !important;
}

.apb-col__title a:hover {
	text-decoration: underline !important;
}

.apb-col .apb-features {
	width: 100%;
}

.apb-col .apb-buttons {
	margin-top: auto;
}

/* ---------- Mobile ---------- */

@media (max-width: 680px) {
	.apb-box {
		padding: 30px 18px 24px;
	}

	.apb-box__inner {
		flex-direction: column;
		gap: 16px;
	}

	.apb-box__img {
		flex-basis: auto;
	}

	.apb-box__img img {
		max-height: 180px;
	}

	.apb-compare,
	.apb-compare--2 {
		grid-template-columns: minmax(0, 1fr);
	}

	.apb-col {
		border-left: 0;
		border-top: 1px solid #e3e3e3;
	}

	.apb-col:first-child {
		border-top: 0;
	}
}

/* Fallback (no product data): just the button. */
.apb-box--fallback {
	margin: 20px 0;
	padding: 0;
	border: 0;
	background: transparent;
}

.apb-box--fallback::before,
.apb-box--fallback::after {
	display: none;
}
