/* TBT Highlight-Badge — Stil 1:1 vom Hero-Badge des FLEX-Set-Konfigurators
   (Referenz: #tbtk .c .hero in tbt-flexpack.js).
   Kachel-Badge oben RECHTS; bestehende Sale-Elemente bleiben unangetastet:
   - .tbt-aktion-rund (tb-tools-compat): roter Kreis 54px, oben LINKS
   - .tbt-loop-savings (tb-tools-compat): «Spare X%», oben RECHTS -> Hero rückt darunter
   - .wc-block-components-product-sale-badge (Woo-Block «ANGEBOT»): oben RECHTS -> dito */

/* Anker: Kachel-Container positioniert (Block-Theme li ist bereits relative —
   hier abgesichert; klassischer Loop fürs Zubehör-/Upsell-Grid). */
li.wc-block-product,
ul.products li.product {
	position: relative !important;
}

.tbt-hero-badge {
	box-sizing: border-box !important; /* max-width inkl. Padding, sonst Kollision auf schmalen Kacheln */
	position: absolute !important;
	top: 8px !important;
	right: 8px !important;
	left: auto !important;
	display: inline-block !important;
	background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
	color: #fff !important;
	font-weight: 900 !important;
	font-size: 13px !important;
	line-height: 1.12 !important;
	padding: 5px 9px !important;
	border-radius: 5px !important;
	box-shadow: 0 3px 8px rgba(220, 38, 38, 0.35) !important;
	z-index: 4 !important;
	max-width: 76% !important;
	text-align: center !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	white-space: normal !important; /* darf umbrechen — wie im Konfigurator */
	pointer-events: none !important; /* Klick geht durch auf den Produktlink */
}

/* Kollisionsregeln: sitzt oben rechts bereits ein Sale-Element, rückt das
   Hero-Badge darunter (Sale-Elemente selbst bleiben unangetastet). */
li.wc-block-product:has(.tbt-loop-savings) .tbt-hero-badge,
li.wc-block-product:has(.wc-block-components-product-sale-badge) .tbt-hero-badge,
ul.products li.product:has(.tbt-loop-savings) .tbt-hero-badge,
ul.products li.product:has(.wc-block-components-product-sale-badge) .tbt-hero-badge {
	top: 44px !important;
}

/* Hauptbild der Produktseite: grosses Badge oben rechts auf der Galerie. */
.woocommerce-product-gallery {
	position: relative !important;
}

.tbt-hero-badge-main {
	box-sizing: border-box !important;
	position: absolute !important;
	top: 12px !important;
	right: 12px !important;
	display: inline-block !important;
	background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
	color: #fff !important;
	font-weight: 900 !important;
	font-size: 16px !important;
	line-height: 1.12 !important;
	padding: 7px 12px !important;
	border-radius: 5px !important;
	box-shadow: 0 3px 8px rgba(220, 38, 38, 0.35) !important;
	z-index: 5 !important;
	max-width: 60% !important;
	text-align: center !important;
	white-space: normal !important;
	pointer-events: none !important;
}

/* 1.2.0: Klickbare Variante (nur wenn Badge-Link-URL gesetzt).
   Ueberschreibt gezielt pointer-events; Unterzeile macht die
   Klickbarkeit sichtbar (Touch kennt kein Hover). */
a.tbt-hero-badge-main.tbt-hero-badge-link {
	pointer-events: auto !important;
	cursor: pointer !important;
	text-decoration: none !important;
	transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}

a.tbt-hero-badge-main.tbt-hero-badge-link:hover,
a.tbt-hero-badge-main.tbt-hero-badge-link:focus-visible {
	color: #fff !important;
	transform: translateY(-1px) !important;
	box-shadow: 0 5px 12px rgba(220, 38, 38, 0.5) !important;
}

a.tbt-hero-badge-main.tbt-hero-badge-link:focus-visible {
	outline: 2px solid #fff !important;
	outline-offset: 2px !important;
}

.tbt-hero-badge-link .tbt-hlb-sub {
	display: block !important;
	font-size: 11px !important;
	font-weight: 600 !important;
	letter-spacing: 0.2px !important;
	margin-top: 3px !important;
	text-decoration: underline !important;
	text-underline-offset: 2px !important;
	color: #fff !important;
	white-space: nowrap !important;
}

/* Mobile (2-Spalten-Grid): kleiner, aber lesbar; Platz fürs runde
   Aktions-Badge (links, 8+54=62px) freihalten. */
@media (max-width: 600px) {
	.tbt-hero-badge {
		font-size: 11px !important;
		padding: 4px 7px !important;
		top: 6px !important;
		right: 6px !important;
		max-width: 58% !important;
	}

	li.wc-block-product:has(.tbt-loop-savings) .tbt-hero-badge,
	li.wc-block-product:has(.wc-block-components-product-sale-badge) .tbt-hero-badge,
	ul.products li.product:has(.tbt-loop-savings) .tbt-hero-badge,
	ul.products li.product:has(.wc-block-components-product-sale-badge) .tbt-hero-badge {
		top: 40px !important;
		max-width: calc(100% - 74px) !important;
	}

	.tbt-hero-badge-main {
		font-size: 14px !important;
		padding: 6px 10px !important;
		top: 10px !important;
		right: 10px !important;
	}

	.tbt-hero-badge-link .tbt-hlb-sub {
		font-size: 10px !important;
	}
}
