/* TP Promo Network Sync - stile griglia promozioni */

.tp-promo-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 20px;
	margin: 20px 0;
}

.tp-promo-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.tp-promo-card:hover {
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
	transform: translateY(-2px);
}

.tp-promo-card__badge {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 2;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	padding: 3px 8px;
	border-radius: 999px;
	color: #fff;
	background: #555;
}

.tp-promo-card__badge--awin { background: #2e2ee0; }
.tp-promo-card__badge--tradedoubler { background: #e2001a; }
.tp-promo-card__badge--webgains { background: #ff5a00; }

.tp-promo-card__image {
	width: 100%;
	aspect-ratio: 1 / 1;
	background: #f7f7f7;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.tp-promo-card__image img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: 12px;
}

.tp-promo-card__body {
	padding: 14px 16px 18px;
	display: flex;
	flex-direction: column;
	flex: 1;
}

.tp-promo-card__merchant {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: #888;
	margin-bottom: 4px;
}

.tp-promo-card__title {
	font-size: 16px;
	line-height: 1.3;
	margin: 0 0 8px;
}

.tp-promo-card__discount {
	font-weight: 700;
	color: #1a8a3c;
	margin: 0 0 8px;
}

.tp-promo-card__desc {
	font-size: 13px;
	color: #555;
	margin: 0 0 10px;
}

.tp-promo-card__code {
	margin: 0 0 12px;
}

.tp-promo-card__code code {
	display: inline-block;
	border: 1px dashed #bbb;
	border-radius: 6px;
	padding: 4px 10px;
	font-size: 14px;
	background: #fafafa;
	letter-spacing: 0.04em;
}

.tp-promo-card__expiry {
	font-size: 12px;
	color: #999;
	margin: 0 0 12px;
}

.tp-promo-card__cta {
	margin-top: auto;
	display: inline-block;
	text-align: center;
	background: #ff7a00;
	color: #fff !important;
	font-weight: 700;
	text-decoration: none;
	padding: 10px 16px;
	border-radius: 6px;
}

.tp-promo-card__cta:hover {
	background: #e56d00;
}

.tp-promo-empty {
	padding: 30px;
	text-align: center;
	color: #777;
}

/* =Layout "list": righe orizzontali stile elenco risultati
-------------------------------------------------------------- */

.tp-promo-list {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin: 20px 0;
}

.tp-promo-row {
	display: flex;
	align-items: stretch;
	gap: 18px;
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 10px;
	padding: 16px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
	transition: box-shadow 0.15s ease;
}

.tp-promo-row:hover {
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.09);
}

.tp-promo-row__image {
	flex: 0 0 96px;
	width: 96px;
	height: 96px;
	border-radius: 8px;
	background: #f7f7f7;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.tp-promo-row__image img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: 8px;
}

.tp-promo-row__image-fallback {
	font-size: 34px;
	font-weight: 700;
	color: #bbb;
}

.tp-promo-row__body {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.tp-promo-row__top {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin-bottom: 8px;
}

.tp-promo-row__badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.4;
	padding: 3px 10px;
	border-radius: 999px;
	background: #f0f0f0;
	color: #444;
	white-space: nowrap;
}

.tp-promo-row__badge--store {
	background: #fff1e2;
	color: #b35900;
}

.tp-promo-row__badge--network {
	color: #fff;
}

.tp-promo-row__badge--awin { background: #2e2ee0; }
.tp-promo-row__badge--tradedoubler { background: #e2001a; }
.tp-promo-row__badge--webgains { background: #ff5a00; }

.tp-promo-row__badge--time {
	background: #ffe8e0;
	color: #c53d17;
}

.tp-promo-row__badge--updated {
	background: #e7f3ff;
	color: #1665b8;
}

.tp-promo-row__title {
	font-size: 16px;
	line-height: 1.35;
	margin: 0 0 4px;
	color: #1a1a1a;
}

.tp-promo-row__discount {
	font-size: 20px;
	font-weight: 800;
	color: #1a8a3c;
	margin: 0 0 6px;
}

.tp-promo-row__desc {
	font-size: 13px;
	color: #666;
	margin: 0 0 8px;
}

.tp-promo-row__code {
	margin: 0 0 4px;
}

.tp-promo-row__code code {
	display: inline-block;
	border: 1px dashed #bbb;
	border-radius: 6px;
	padding: 3px 10px;
	font-size: 13px;
	background: #fafafa;
	letter-spacing: 0.04em;
}

.tp-promo-row__action {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
}

.tp-promo-row__cta {
	position: relative;
	display: inline-block;
	white-space: nowrap;
	background: #ff7a00;
	color: #fff !important;
	font-weight: 700;
	font-size: 14px;
	text-decoration: none;
	padding: 12px 20px;
	border-radius: 6px;
	clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%);
	padding-right: 26px;
}

.tp-promo-row__cta:hover {
	background: #e56d00;
}

@media (max-width: 640px) {
	.tp-promo-row {
		flex-wrap: wrap;
	}

	.tp-promo-row__image {
		flex: 0 0 72px;
		width: 72px;
		height: 72px;
	}

	.tp-promo-row__action {
		flex-basis: 100%;
		justify-content: flex-start;
		margin-top: 10px;
	}

	.tp-promo-row__cta {
		width: 100%;
		text-align: center;
	}
}

/* Nome autore mai visibile nelle pagine legate alle promozioni (richiesto):
   questo file CSS viene caricato SOLO nelle pagine archivio store (/store/{slug}/)
   e negli articoli che contengono lo shortcode [tp_promozioni] (i "carrier post"
   creati automaticamente per ogni store) — vedi tp_promo_sync_maybe_enqueue_assets()
   in tp-promo-sync.php — quindi questa regola non tocca il resto del sito
   (articoli normali, homepage, ecc.), dove il nome dell'autore resta visibile. */
.admin_meta {
	display: none !important;
}
