/* Water Advisor Affiliates - Product Styles */

/* Preconnect hint for Amazon images */
@import url() layer();

/* ===================== */
/* Product Box            */
/* ===================== */

.wa-product {
	background: var(--wa-bg-main, #FFFFFF);
	border: 1px solid var(--wa-border, #E0E0E0);
	border-radius: 8px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	padding: 20px;
	margin: 24px 0;
	display: flex;
	gap: 20px;
	align-items: flex-start;
}

.wa-product:hover {
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.wa-product-image {
	flex-shrink: 0;
	width: 180px;
}

.wa-product-image {
	aspect-ratio: 1 / 1;
	background: var(--wa-bg-alt, #F8F9FA);
	overflow: hidden;
}

.wa-product-image img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	border-radius: 4px;
}

.wa-product-info {
	flex: 1;
	min-width: 0;
}

.wa-product-title {
	font-size: 18px;
	line-height: 1.3;
	margin: 0 0 8px;
}

.wa-product-title a {
	color: var(--wa-primary, #1A5276);
	text-decoration: none;
}

.wa-product-title a:hover {
	color: var(--wa-secondary, #148a9e);
	text-decoration: underline;
}

.wa-product-brand {
	font-size: 14px;
	color: var(--wa-text-secondary, #555F63);
	margin: 0 0 8px;
}

/* Star Rating (CSS-only) */
.wa-product-rating {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 8px;
}

.wa-stars {
	--wa-star-size: 16px;
	--wa-star-color: #FF9900;
	--wa-star-empty: #D0D0D0;
	display: inline-block;
	width: calc(var(--wa-star-size) * 5);
	height: var(--wa-star-size);
	background: linear-gradient(
		90deg,
		var(--wa-star-color) calc(var(--wa-rating) / 5 * 100%),
		var(--wa-star-empty) calc(var(--wa-rating) / 5 * 100%)
	);
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 16'%3E%3Cpath d='M8 0l2.5 5H16l-4 3.5 1.5 5.5L8 11 2.5 14 4 8.5 0 5h5.5zm16 0l2.5 5H32l-4 3.5 1.5 5.5L24 11l-5.5 3 1.5-5.5L16 5h5.5zm16 0l2.5 5H48l-4 3.5 1.5 5.5L40 11l-5.5 3 1.5-5.5L32 5h5.5zm16 0l2.5 5H64l-4 3.5 1.5 5.5L56 11l-5.5 3 1.5-5.5L48 5h5.5zm16 0l2.5 5H80l-4 3.5 1.5 5.5L72 11l-5.5 3 1.5-5.5L64 5h5.5z' fill='black'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 16'%3E%3Cpath d='M8 0l2.5 5H16l-4 3.5 1.5 5.5L8 11 2.5 14 4 8.5 0 5h5.5zm16 0l2.5 5H32l-4 3.5 1.5 5.5L24 11l-5.5 3 1.5-5.5L16 5h5.5zm16 0l2.5 5H48l-4 3.5 1.5 5.5L40 11l-5.5 3 1.5-5.5L32 5h5.5zm16 0l2.5 5H64l-4 3.5 1.5 5.5L56 11l-5.5 3 1.5-5.5L48 5h5.5zm16 0l2.5 5H80l-4 3.5 1.5 5.5L72 11l-5.5 3 1.5-5.5L64 5h5.5z' fill='black'/%3E%3C/svg%3E");
	-webkit-mask-size: contain;
	mask-size: contain;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
}

.wa-review-count {
	font-size: 13px;
	color: var(--wa-text-secondary, #555F63);
}

/* Price */
.wa-product-price {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 12px;
}

.wa-price-amount {
	font-size: 20px;
	font-weight: 700;
	color: var(--wa-text-primary, #2D3436);
}

.wa-price-unavailable {
	font-size: 14px;
	color: var(--wa-text-secondary, #555F63);
}

/* Prime Badge */
.wa-prime-badge {
	display: inline-block;
	background: #00A8E1;
	color: #FFFFFF;
	font-size: 11px;
	font-weight: 700;
	padding: 2px 6px;
	border-radius: 3px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* Features */
.wa-product-features {
	list-style: none;
	padding: 0;
	margin: 0 0 16px;
}

.wa-product-features li {
	font-size: 14px;
	color: var(--wa-text-secondary, #555F63);
	padding: 3px 0 3px 18px;
	position: relative;
}

.wa-product-features li::before {
	content: '\2713';
	color: var(--wa-success, #27AE60);
	position: absolute;
	left: 0;
	font-weight: 700;
}

/* CTA Button */
.wa-product-cta {
	display: inline-block;
	background-color: var(--wa-cta, #FF9900);
	color: #FFFFFF !important;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
	font-size: 16px;
	font-weight: 700;
	border: none;
	border-radius: 6px;
	padding: 12px 24px;
	text-decoration: none;
	min-height: 48px;
	min-width: 48px;
	cursor: pointer;
	transition: background-color 0.2s;
}

.wa-product-cta:hover {
	background-color: var(--wa-cta-hover, #E68A00);
	color: #FFFFFF !important;
}

.wa-product-cta:focus-visible {
	outline: 2px solid var(--wa-primary, #1A5276);
	outline-offset: 2px;
}

/* Focus styles for links */
.wa-product-title a:focus-visible,
.wa-bestseller-title a:focus-visible,
.wa-comparison-product-title:focus-visible {
	outline: 2px solid var(--wa-secondary, #148a9e);
	outline-offset: 2px;
}

/* Disclaimer */
.wa-product-disclaimer {
	font-size: 12px;
	color: var(--wa-text-secondary, #555F63);
	margin: 8px 0 0;
}

/* Quiz result transparency */
.wa-result-card__basis {
	font-size: 13px;
	color: var(--wa-text-secondary, #555F63);
	line-height: 1.5;
	margin: 0 0 12px;
}

.wa-result-card__guide {
	font-size: 14px;
	margin: 0 0 14px;
}

.wa-result-card__guide a,
.wa-quiz-results__method a {
	color: var(--wa-secondary, #148a9e);
	font-weight: 600;
}

.wa-result-card__guide a:hover,
.wa-quiz-results__method a:hover {
	color: var(--wa-primary, #1A5276);
}

.wa-quiz-results__method {
	margin: 24px 0 0;
	padding: 18px;
	background: var(--wa-bg-alt, #F8F9FA);
	border: 1px solid var(--wa-border, #E0E0E0);
	border-radius: 8px;
}

.wa-quiz-results__method h3 {
	font-size: 18px;
	margin: 0 0 6px;
}

.wa-quiz-results__method p {
	font-size: 14px;
	color: var(--wa-text-secondary, #555F63);
	line-height: 1.6;
	margin: 0;
}

/* Fallback */
.wa-product-fallback {
	display: block;
	text-align: center;
	padding: 24px;
	background: var(--wa-bg-alt, #F8F9FA);
}

.wa-product-fallback p {
	margin: 0;
	font-size: 15px;
}

/* Compact Style */
.wa-product-compact {
	padding: 12px;
	gap: 12px;
}

.wa-product-compact .wa-product-image {
	width: 100px;
}

.wa-product-compact .wa-product-title {
	font-size: 15px;
}

.wa-product-compact .wa-product-features {
	display: none;
}

.wa-product-compact .wa-product-cta {
	font-size: 14px;
	padding: 8px 16px;
}

/* Horizontal Style */
.wa-product-horizontal {
	flex-direction: row;
	align-items: center;
}

.wa-product-horizontal .wa-product-image {
	width: 120px;
}

/* ===================== */
/* Comparison Table       */
/* ===================== */

.wa-comparison {
	margin: 24px 0;
}

.wa-comparison-title {
	margin-bottom: 16px;
}

.wa-comparison-scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border: 1px solid var(--wa-border, #E0E0E0);
	border-radius: 8px;
}

.wa-comparison-table {
	width: 100%;
	border-collapse: collapse;
	min-width: 500px;
}

.wa-comparison-table th,
.wa-comparison-table td {
	padding: 12px 16px;
	text-align: center;
	border-bottom: 1px solid var(--wa-border, #E0E0E0);
}

.wa-comparison-table thead th {
	background-color: var(--wa-bg-alt, #F8F9FA);
	border-bottom: 2px solid var(--wa-border, #E0E0E0);
	vertical-align: bottom;
	padding: 16px 12px;
}

.wa-comparison-table tbody tr:nth-child(odd) {
	background-color: var(--wa-bg-main, #FFFFFF);
}

.wa-comparison-table tbody tr:nth-child(even) {
	background-color: var(--wa-bg-alt, #F8F9FA);
}

.wa-comparison-table tbody tr:hover {
	background-color: #f0f4f7;
}

.wa-comparison-table tbody tr:last-child td {
	border-bottom: none;
	padding-top: 16px;
	padding-bottom: 16px;
}

.wa-comparison-label-cell,
.wa-comparison-label {
	text-align: left;
	font-weight: 600;
	white-space: nowrap;
}

.wa-comparison-image {
	max-width: 120px;
	max-height: 120px;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
	margin: 0 auto 10px;
}

.wa-comparison-product-title {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--wa-primary, #1A5276);
	text-decoration: none;
	max-width: 200px;
	margin: 0 auto;
}

.wa-comparison-product-title:hover {
	text-decoration: underline;
	color: var(--wa-secondary, #148a9e);
}

.wa-comparison-cta {
	display: inline-block;
	font-size: 15px;
	font-weight: 700;
	padding: 12px 20px;
	white-space: nowrap;
	border-radius: 6px;
}

.wa-check {
	color: var(--wa-success, #27AE60);
	font-weight: 700;
}

.wa-cross {
	color: var(--wa-warning, #E74C3C);
	font-weight: 700;
}

/* ===================== */
/* Bestseller List        */
/* ===================== */

.wa-bestsellers {
	margin: 24px 0;
}

.wa-bestsellers-title {
	margin-bottom: 16px;
}

.wa-bestsellers-list {
	list-style: none;
	padding: 0;
	margin: 0;
	counter-reset: bestseller;
}

.wa-bestseller-item {
	display: flex;
	gap: 16px;
	align-items: flex-start;
	padding: 16px;
	border: 1px solid var(--wa-border, #E0E0E0);
	border-radius: 8px;
	margin-bottom: 12px;
	background: var(--wa-bg-main, #FFFFFF);
	counter-increment: bestseller;
	position: relative;
	padding-left: 48px;
}

.wa-bestseller-item::before {
	content: counter(bestseller);
	position: absolute;
	left: 16px;
	top: 16px;
	font-size: 20px;
	font-weight: 700;
	color: var(--wa-primary, #1A5276);
}

.wa-bestseller-image {
	flex-shrink: 0;
	width: 80px;
}

.wa-bestseller-image img {
	width: 100%;
	height: auto;
	border-radius: 4px;
}

.wa-bestseller-info {
	flex: 1;
	min-width: 0;
}

.wa-bestseller-title {
	font-size: 16px;
	margin: 0 0 6px;
	line-height: 1.3;
}

.wa-bestseller-title a {
	color: var(--wa-primary, #1A5276);
	text-decoration: none;
}

.wa-bestseller-title a:hover {
	color: var(--wa-secondary, #148a9e);
	text-decoration: underline;
}

.wa-bestseller-meta {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
	flex-wrap: wrap;
}

.wa-bestseller-cta {
	font-size: 14px;
	padding: 8px 16px;
}

/* ===================== */
/* Affiliate Disclosure   */
/* ===================== */

.wa-affiliate-disclosure {
	background: var(--wa-bg-alt, #F8F9FA);
	border-left: 3px solid var(--wa-cta, #FF9900);
	padding: 12px 16px;
	margin-bottom: 24px;
	font-size: 13px;
	color: var(--wa-text-secondary, #555F63);
	border-radius: 0 4px 4px 0;
}

.wa-affiliate-disclosure p {
	margin: 0;
}

/* ===================== */
/* Accessibility          */
/* ===================== */

@media (prefers-reduced-motion: reduce) {
	.wa-product,
	.wa-product-cta {
		transition: none;
	}
}

@media (forced-colors: active) {
	.wa-product-cta {
		border: 2px solid ButtonText;
	}

	.wa-stars {
		forced-color-adjust: none;
	}
}

/* ===================== */
/* Print                  */
/* ===================== */

@media print {
	.wa-product-cta,
	.wa-affiliate-disclosure {
		display: none !important;
	}

	.wa-product {
		box-shadow: none;
		border: 1px solid #ccc;
		break-inside: avoid;
	}

	.wa-product-title a::after {
		content: " (" attr(href) ")";
		font-size: 11px;
		font-weight: 400;
	}
}

/* ===================== */
/* Mobile Responsive      */
/* ===================== */

@media (max-width: 768px) {
	.wa-product {
		flex-direction: column;
		padding: 16px;
	}

	.wa-product-image {
		width: 100%;
		max-width: 200px;
		margin: 0 auto;
	}

	.wa-product-cta {
		width: 100%;
		text-align: center;
		display: block;
	}

	/* Pin first column in comparison table */
	.wa-comparison-table .wa-comparison-label-cell,
	.wa-comparison-table .wa-comparison-label {
		position: sticky;
		left: 0;
		background-color: inherit;
		z-index: 5;
	}

	.wa-bestseller-item {
		flex-direction: column;
		padding-left: 48px;
	}

	.wa-bestseller-image {
		width: 60px;
	}
}
