/**
 * Amazon Creators — Frontend-Styles für Produktbox und Vergleichstabelle.
 *
 * Gilt für die Ausgabe der Shortcodes [amz_box] und [amz_table]
 * (siehe includes/render.php). Kein externer Font, kein @import,
 * keine externen Assets — nur system-fonts + reine CSS-Farben.
 *
 * Farbwelt: an teichhelden.de angelehnt (Wasserblau/Grün):
 *   --amzc-teal  #0e7490  (Akzent, Badges, CTA, Tabellenkopf)
 *   --amzc-green #15803d  (Ersparnis/positive Signale)
 *
 * CTA-Entscheidung: bewusst SITE-NEUTRAL statt Amazon-Orange (#ff9900),
 * damit der Button zur Site passt statt wie ein Fremdkörper zu wirken.
 * Kontrast geprüft: #0e7490 auf #ffffff-Text ≈ 5,4:1 — besteht WCAG AA
 * für Fließtext (min. 4,5:1) und erst recht für den größer gesetzten
 * Button-Text.
 *
 * CLS-Hinweis: <img> bekommt width/height als HTML-Attribute aus der
 * API-Response (amzc_render_image() in render.php). Dieses CSS überschreibt
 * das NICHT mit festen Pixelmaßen, sondern skaliert nur responsiv
 * (max-width:100%; height:auto) — der Browser reserviert den Platz
 * weiterhin anhand der width/height-Attribute.
 */

:root {
	--amzc-teal: #0e7490;
	--amzc-teal-dark: #0b5b73;
	--amzc-green: #15803d;
	--amzc-border: #e2e8f0;
	--amzc-bg: #ffffff;
	--amzc-bg-muted: #f8fafc;
	--amzc-text: #1e293b;
	--amzc-text-muted: #64748b;
	--amzc-radius: 10px;
	--amzc-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* --- Produktbox [amz_box] ------------------------------------------- */

.amzc-box {
	display: flex;
	align-items: flex-start;
	gap: 1.25rem;
	max-width: 640px;
	margin: 1.5rem 0;
	padding: 1rem;
	background: var(--amzc-bg);
	border: 1px solid var(--amzc-border);
	border-radius: var(--amzc-radius);
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
	font-family: var(--amzc-font);
	color: var(--amzc-text);
}

/* Fallback (kein Preis/keine Verfügbarkeit): darf nicht kaputt wirken —
 * kein Rot, kein Warndreieck, nur ein dezent gedämpfter Rahmen. */
.amzc-box--nodata {
	border-style: dashed;
	border-color: #cbd5e1;
	background: var(--amzc-bg-muted);
}

.amzc-box__media {
	flex: 0 0 auto;
	width: 140px;
	display: flex;
	align-items: flex-start;
	justify-content: center;
}

.amzc-box__media a {
	display: block;
	line-height: 0;
}

/* Bild: reserviert per width/height-Attribut (HTML), skaliert nur responsiv. */
.amzc-img {
	max-width: 100%;
	height: auto;
	border-radius: 6px;
}

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

/* Badge/Label — geteilt zwischen Produktbox und Tabellenzeile. */
.amzc-box__label,
.amzc-table__label {
	display: inline-block;
	margin-bottom: 0.4rem;
	padding: 0.15rem 0.55rem;
	background: var(--amzc-teal);
	color: #ffffff;
	font-size: 0.72rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	border-radius: 999px;
}

/* Titel — Produktbox groß, Tabellenzeile kompakter. */
.amzc-box__title,
.amzc-table__title {
	font-weight: 600;
	line-height: 1.3;
}

.amzc-box__title {
	margin: 0 0 0.5rem;
	font-size: 1.05rem;
}

/* --- Preis, Verfügbarkeit, Stand-Zeile (Box + Tabelle) ---------------- */

.amzc-price {
	margin: 0.35rem 0;
}

/* Preis: bewusst groß/prominent — der wichtigste Wert in der Box. */
.amzc-price__now {
	font-size: 1.4rem;
	font-weight: 700;
	color: var(--amzc-text);
}

.amzc-table__price .amzc-price__now {
	font-size: 1.1rem;
}

.amzc-price__basis {
	margin-left: 0.5rem;
	font-size: 0.85rem;
	color: var(--amzc-text-muted);
}

.amzc-price__basis s {
	text-decoration-color: var(--amzc-text-muted);
}

.amzc-price__savings {
	margin-left: 0.4rem;
	padding: 0.1rem 0.4rem;
	background: #dcfce7;
	color: var(--amzc-green);
	font-size: 0.8rem;
	font-weight: 700;
	border-radius: 4px;
	white-space: nowrap;
}

.amzc-avail {
	margin: 0.2rem 0 0.4rem;
	font-size: 0.9rem;
	color: var(--amzc-text-muted);
}

/* Zeitstempel + Disclaimer: bewusst klein und gedämpft (~0.8em) —
 * Pflichtangabe, aber kein optisches Gewicht wie Preis/CTA. */
.amzc-stand,
.amzc-legal {
	font-size: 0.8em;
	color: var(--amzc-text-muted);
}

.amzc-stand {
	margin: 0.3rem 0 0.6rem;
}

.amzc-stand__summary {
	cursor: pointer;
	list-style: none;
}

.amzc-stand__summary::-webkit-details-marker {
	display: none;
}

.amzc-stand__more {
	text-decoration: underline;
	text-underline-offset: 2px;
}

.amzc-stand__text {
	margin: 0.35rem 0 0;
	font-size: 0.95em;
}

/* --- CTA-Button — geteilt zwischen Box und Tabelle -------------------- */

.amzc-cta {
	display: inline-block;
	margin-top: 0.4rem;
	padding: 0.55rem 1.1rem;
	background: var(--amzc-teal);
	color: #ffffff;
	font-size: 0.9rem;
	font-weight: 600;
	text-decoration: none;
	border-radius: 6px;
	transition: background-color 0.15s ease;
}

.amzc-cta:hover,
.amzc-cta:focus-visible {
	background: var(--amzc-teal-dark);
	color: #ffffff;
}

/* --- Hinweise für Redakteure + Pflicht-Disclaimer --------------------- */

/* Nur eingeloggt sichtbar, siehe amzc_editor_notice(). */
.amzc-editor-notice {
	margin: 0.5rem 0 0;
	padding: 0.5rem 0.75rem;
	background: #fffbeb;
	border: 1px dashed #f59e0b;
	border-radius: 6px;
	font-size: 0.85rem;
	color: #92400e;
}

/* Text-Disclaimer + Partner-Hinweis, einmal pro Seitenaufruf. */
.amzc-legal {
	max-width: 640px;
	margin: 0.75rem 0 1.5rem;
}

/* --- Vergleichstabelle [amz_table] ------------------------------------ */

.amzc-table-wrap {
	margin: 1.5rem 0;
	overflow-x: auto; /* mobil horizontal scrollbar statt umgebrochen */
	-webkit-overflow-scrolling: touch;
	border: 1px solid var(--amzc-border);
	border-radius: var(--amzc-radius);
}

.amzc-table {
	width: 100%;
	min-width: 560px; /* erzwingt den Scroll-Container statt Quetsch-Layout */
	border-collapse: collapse;
	font-family: var(--amzc-font);
	color: var(--amzc-text);
}

.amzc-table thead th {
	background: var(--amzc-teal);
	color: #ffffff;
	font-size: 0.85rem;
	font-weight: 600;
	text-align: left;
	padding: 0.65rem 0.85rem;
	white-space: nowrap;
}

.amzc-table tbody td {
	padding: 0.75rem 0.85rem;
	border-top: 1px solid var(--amzc-border);
	vertical-align: top;
}

.amzc-table tbody tr:nth-child(even) {
	background: var(--amzc-bg-muted);
}

.amzc-table__product {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	min-width: 220px;
}

.amzc-table__media {
	flex: 0 0 auto;
	width: 56px;
}

.amzc-table__text {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
}

.amzc-table__cta {
	white-space: nowrap;
}

/* --- Mobil: Box stapelt Bild über Text, Tabelle bleibt scrollbar ------ */

@media (max-width: 600px) {
	.amzc-box {
		flex-direction: column;
		align-items: stretch;
		max-width: 100%;
	}

	.amzc-box__media {
		width: 100%;
		max-width: 220px;
		margin: 0 auto;
	}

	.amzc-table__product {
		min-width: 180px;
	}
}

/* --------------------------------------------------------------------------
 * Nachtrag: zwei Klassen, die render.php nutzt und oben fehlten
 * ----------------------------------------------------------------------- */

/* <details>-Wrapper der Pflichtangabe „Preis Stand: …" — unauffällig,
   damit die rechtlich nötige Angabe den Lesefluss nicht bricht. */
.amzc-stand__details {
	margin-top: .5rem;
	font-size: .8em;
	color: #57606a;
}

.amzc-stand__details > summary {
	cursor: pointer;
	list-style: none;
}

.amzc-stand__details > summary::-webkit-details-marker {
	display: none;
}

/* Verfügbarkeitszelle in der Vergleichstabelle (Pendant zu .amzc-avail). */
.amzc-table__avail {
	font-size: .85em;
	color: #1a7f37;
	white-space: nowrap;
}
