/* Amazon Product Ads – front end */
.aai-slot { margin: 24px auto; clear: both; }
.aai-slot:empty { display: none; }
.aai-loc-header, .aai-loc-footer { max-width: 1200px; padding: 0 16px; box-sizing: border-box; }

.aai-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.aai-grid.aai-n1 { grid-template-columns: minmax(0, 380px); justify-content: center; }
.aai-loc-widget .aai-grid { grid-template-columns: 1fr; }

.aai-card {
	position: relative; display: flex; flex-direction: column; align-items: center;
	padding: 20px 18px 22px; background: #fff;
	border: 1px solid #ececec; border-radius: 14px;
	box-shadow: 0 2px 10px rgba(0,0,0,.05);
	text-decoration: none !important; color: #222 !important; text-align: center;
	transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
	box-sizing: border-box; overflow: hidden;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
.aai-card::before {
	content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
	background: linear-gradient(90deg, #f0ad4e, #ec971f);
}
.aai-card:hover { box-shadow: 0 12px 28px rgba(0,0,0,.12); transform: translateY(-3px); border-color: #f5d199; }

.aai-img {
	display: flex; align-items: center; justify-content: center;
	width: 100%; height: 190px; margin-bottom: 16px; overflow: hidden;
}
.aai-img img { max-width: 100%; max-height: 100%; object-fit: contain; border: 0; box-shadow: none; transition: transform .3s ease; }
.aai-card:hover .aai-img img { transform: scale(1.05); }
.aai-img.aai-noimg { height: 90px; background: #f6f6f6; border-radius: 10px; }
.aai-img.aai-noimg::after { content: "amazon"; font: 700 22px/1 Arial, sans-serif; color: #b5b5b5; letter-spacing: .5px; }

.aai-body { display: flex; flex-direction: column; align-items: center; width: 100%; flex: 1; }
.aai-label {
	font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
	color: #d9534f; margin-bottom: 6px;
}
.aai-title {
	font-size: 16px; font-weight: 700; line-height: 1.35; color: #222; margin-bottom: 16px;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.aai-btn {
	margin-top: auto; display: inline-block;
	background: #f0ad4e; color: #fff; border-radius: 6px;
	padding: 10px 22px; font-size: 14px; font-weight: 700; line-height: 1.2;
	box-shadow: 0 3px 8px rgba(240,173,78,.35);
	transition: background .2s, box-shadow .2s;
}
.aai-card:hover .aai-btn { background: #ec971f; box-shadow: 0 5px 14px rgba(236,151,31,.45); }

.aai-note { margin: 8px 0 0; font-size: 12px; color: #6b7280; text-align: center; }
.aai-disclosure {
	font-size: 13px; line-height: 1.5; color: #4b5563;
	background: #f9fafb; border-left: 3px solid #f59e0b;
	padding: 10px 14px; margin: 0 0 20px; border-radius: 4px;
}

/* Popup */
.aai-pop {
	position: fixed; inset: 0; z-index: 999999;
	background: rgba(17,24,39,.55);
	display: flex; align-items: center; justify-content: center; padding: 16px;
	opacity: 0; transition: opacity .25s;
}
.aai-pop.aai-open { opacity: 1; }
.aai-pop-box {
	position: relative; background: #fff; border-radius: 14px;
	width: 100%; max-width: 640px; max-height: 90vh; overflow: auto;
	padding: 28px 20px 20px; box-sizing: border-box;
	transform: translateY(12px); transition: transform .25s;
}
.aai-pop.aai-open .aai-pop-box { transform: none; }
.aai-pop-title { font: 700 18px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; margin: 0 0 12px; text-align: center; color: #111827; }
.aai-pop-x {
	position: absolute; top: 8px; right: 10px;
	width: 34px; height: 34px; border: 0; border-radius: 50%;
	background: #f3f4f6; color: #111827; font-size: 22px; line-height: 1; cursor: pointer;
}
.aai-pop-x:hover { background: #e5e7eb; }
.aai-loc-popup { margin: 0; }
.aai-loc-popup .aai-img { height: 160px; }

@media (max-width: 480px) {
	/* Mobile: one product per row, image left + text right */
	.aai-grid, .aai-grid.aai-n1 { grid-template-columns: 1fr; gap: 12px; }
	.aai-card { flex-direction: row; align-items: center; gap: 14px; padding: 14px; }
	.aai-img { flex: 0 0 96px; width: 96px; height: 96px; margin: 0; }
	.aai-img.aai-noimg { height: 96px; }
	.aai-img.aai-noimg::after { font-size: 15px; }
	.aai-body { flex: 1; min-width: 0; }
	.aai-title { font-size: 15px; margin-bottom: 10px; }
	.aai-btn { font-size: 13px; padding: 8px 14px; white-space: nowrap; }
}
}

/* Compact popup (one product, image left) */
.aai-pop-compact .aai-pop-box { max-width: 360px; padding: 0; overflow: hidden; border: 1px solid #ddd; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.aai-pop-compact .aai-pop-box { transform: scale(.85); }
.aai-pop-compact.aai-open .aai-pop-box { transform: scale(1); }
.aai-pop-compact .aai-pop-x { background: transparent; color: #aaa; width: 30px; height: 30px; top: 6px; right: 6px; z-index: 2; }
.aai-pop-compact .aai-pop-x:hover { color: #555; background: #f3f4f6; }
.aai-pc { display: flex; align-items: center; gap: 15px; padding: 22px 20px; text-decoration: none !important; color: #333 !important; font-family: Arial, sans-serif; }
.aai-pc-img { flex: 0 0 90px; height: 90px; display: flex; align-items: center; justify-content: center; }
.aai-pc-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.aai-pc-img.aai-noimg { background: #f3f4f6; border-radius: 8px; }
.aai-pc-img.aai-noimg::after { content: "amazon"; font: 700 15px/1 Arial, sans-serif; color: #9ca3af; }
.aai-pc-info { flex: 1; display: flex; flex-direction: column; align-items: flex-start; padding-right: 14px; }
.aai-pc-label { font-size: 11px; font-weight: 700; color: #d9534f; text-transform: uppercase; margin-bottom: 5px; }
.aai-pc-title { font-size: 16px; font-weight: 700; line-height: 1.3; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.aai-pc-btn { background: #f0ad4e; color: #fff; padding: 8px 15px; border-radius: 5px; font-size: 13px; font-weight: 700; transition: background .2s; }
.aai-pc:hover .aai-pc-btn { background: #ec971f; }
@media (max-width: 480px) { .aai-pop-compact .aai-pop-box { max-width: 85vw; } }
a.aai-pop-x { display: flex; align-items: center; justify-content: center; text-decoration: none !important; }
