/* Amazon Produkte SBV - Frontend-Stile
   Akzentfarbe ueber CSS-Variablen, in der Plugin-Hauptdatei gesetzt. */

.amzsbv-box,
.amzsbv-card,
.amzsbv-table-wrap {
	--amzsbv-border: #e3e3e3;
	--amzsbv-text: #1a1a1a;
	--amzsbv-muted: #666;
	font-family: inherit;
	box-sizing: border-box;
}

.amzsbv-box *,
.amzsbv-grid *,
.amzsbv-table-wrap * {
	box-sizing: border-box;
}

/* ---------- Einzelne Produktbox ---------- */
.amzsbv-box {
	display: flex;
	gap: 20px;
	border: 1px solid var(--amzsbv-border);
	border-radius: 10px;
	padding: 20px;
	background: #fff;
	max-width: 640px;
	margin: 24px 0;
}

.amzsbv-box-media {
	flex: 0 0 180px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.amzsbv-box-media img {
	max-width: 100%;
	max-height: 200px;
	height: auto;
	object-fit: contain;
}

.amzsbv-box-body {
	flex: 1;
	display: flex;
	flex-direction: column;
}

/* ---------- Grid ---------- */
.amzsbv-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 20px;
	margin: 24px 0;
}

.amzsbv-card {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--amzsbv-border);
	border-radius: 10px;
	padding: 16px;
	background: #fff;
}

.amzsbv-card-media {
	height: 180px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 12px;
}

.amzsbv-card-media img {
	max-width: 100%;
	max-height: 180px;
	height: auto;
	object-fit: contain;
}

/* ---------- Gemeinsame Elemente ---------- */
.amzsbv-title {
	font-size: 15px;
	line-height: 1.4;
	font-weight: 600;
	color: var(--amzsbv-text);
	margin: 0 0 8px;
}

/* Titel in Grid und Tabelle auf maximal zwei Zeilen begrenzen.
   Der vollstaendige Titel bleibt im alt-Text des Bildes erhalten. */
.amzsbv-card .amzsbv-title,
.amzsbv-table .amzsbv-title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
}

.amzsbv-prime {
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.3px;
	color: #fff;
	background: #232f3e;
	padding: 2px 8px;
	border-radius: 4px;
	margin-bottom: 8px;
}

.amzsbv-specs {
	list-style: disc;
	padding-left: 18px;
	margin: 8px 0;
	font-size: 13px;
	color: var(--amzsbv-muted);
}

.amzsbv-specs li {
	margin-bottom: 3px;
}

/* Specs in Grid und Tabelle kompakt halten: hoechstens zwei kurze
   Eintraege, jeder einzeilig, Gesamthoehe gedeckelt. */
.amzsbv-card .amzsbv-specs,
.amzsbv-table .amzsbv-specs {
	max-height: 300px;
}

.amzsbv-card .amzsbv-specs li,
.amzsbv-table .amzsbv-specs li {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Ab dem dritten Spec-Eintrag in Grid und Tabelle ausblenden. */
.amzsbv-card .amzsbv-specs li:nth-child(n+3),
.amzsbv-table .amzsbv-specs li:nth-child(n+3) {
	display: none;
}

.amzsbv-price {
	font-size: 20px;
	font-weight: 700;
	color: var(--amzsbv-text);
	margin: 10px 0;
}

.amzsbv-btn {
	display: inline-block;
	background: var(--amzsbv-accent);
	color: #fff !important;
	text-decoration: none !important;
	font-size: 14px;
	font-weight: 600;
	padding: 10px 18px;
	border-radius: 6px;
	text-align: center;
	transition: background 0.15s ease;
	margin-top: auto;
}

.amzsbv-btn:hover,
.amzsbv-btn:focus {
	background: var(--amzsbv-accent-hover);
	color: #fff !important;
}

/* ---------- Tabelle ---------- */
.amzsbv-table-wrap {
	margin: 24px 0;
	overflow-x: auto;
}

.amzsbv-table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
}

.amzsbv-table th,
.amzsbv-table td {
	border-bottom: 1px solid var(--amzsbv-border);
	padding: 14px 12px;
	vertical-align: middle;
	text-align: left;
}

.amzsbv-table thead th {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	color: var(--amzsbv-muted);
}

.amzsbv-col-rank {
	width: 44px;
	text-align: center;
}

.amzsbv-rank {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--amzsbv-accent);
	color: #fff;
	font-weight: 700;
	font-size: 13px;
}

.amzsbv-col-img {
	width: 90px;
}

.amzsbv-col-img img {
	max-width: 72px;
	max-height: 72px;
	height: auto;
	object-fit: contain;
}

.amzsbv-col-price {
	width: 110px;
	font-weight: 700;
	white-space: nowrap;
}

.amzsbv-col-cta {
	width: 1%;
	white-space: nowrap;
	text-align: right;
}

.amzsbv-table .amzsbv-btn {
	margin-top: 0;
}

.amzsbv-table .amzsbv-title {
	margin-bottom: 4px;
}

.amzsbv-table .amzsbv-specs {
	margin: 4px 0 0;
}

/* ---------- Hinweis und Fehler ---------- */
.amzsbv-disclaimer {
	font-size: 12px;
	color: var(--amzsbv-muted);
	margin: 8px 0 24px;
}

.amzsbv-error {
	border: 1px solid #d63638;
	background: #fcf0f1;
	color: #d63638;
	padding: 10px 14px;
	border-radius: 6px;
	font-size: 13px;
	margin: 16px 0;
}

/* ---------- Mobil ---------- */
@media (max-width: 600px) {
	.amzsbv-box {
		flex-direction: column;
	}
	.amzsbv-box-media {
		flex: 0 0 auto;
	}
	.amzsbv-col-cta {
		white-space: normal;
	}
	.amzsbv-table th,
	.amzsbv-table td {
		padding: 10px 8px;
	}
}
