/* WC Smart Promotions — промо цена (цветове и стил: Smart Promotions → 🎨 Вид на промоцията).
   Стил „Елегантен“ (по подразбиране): новата цена удебелена в цвят, старата — малка и задраскана,
   „-5%“ в мек балон. Стил „Каре“: новата цена в плътно цветно каре.
   Работи върху стандартния HTML на WooCommerce (.price > del + ins): продукт, категории,
   модулите на Divi, свързани продукти и т.н. */
:root {
	--wcsp-sale: #d7262e;        /* презаписва се от настройките */
	--wcsp-sale-soft: #fbe9ea;   /* презаписва се от настройките */
	--wcsp-sale-text: #ffffff;   /* презаписва се от настройките */
	--wcsp-sale-old: #8a847d;
}

/* подредба: нова цена → стара цена → процент */
span.price:has(ins) {
	display: inline-flex !important;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.2em 0.55em;
}

/* цена в самостоятелен ред (продуктова страница) — блок, за да не „лепне“ към формата */
p.price:has(ins),
div.price:has(ins) {
	display: flex !important;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.2em 0.55em;
}

.price ins {
	order: -1;
	padding: 0 !important;
	background: none !important;
	color: var(--wcsp-sale) !important;
	font-weight: 800 !important;
	letter-spacing: -0.01em;
	text-decoration: none !important;
	white-space: nowrap;
}

.price ins *,
.price ins .woocommerce-Price-amount,
.price ins bdi {
	color: inherit !important;
	font-weight: inherit !important;
	background: none !important;
	text-decoration: none !important;
}

.price del {
	order: 0;
	color: var(--wcsp-sale-old) !important;
	font-size: 0.72em !important;
	font-weight: 400 !important;
	opacity: 1 !important;
	text-decoration: line-through !important;
	text-decoration-thickness: 1px !important;
	white-space: nowrap;
}

.price del * {
	color: inherit !important;
	font-weight: inherit !important;
	text-decoration: inherit !important;
}

.wcsp-save-pct {
	order: 1;
	align-self: center;
	display: inline-flex;
	align-items: center;
	padding: 0.22em 0.6em;
	border-radius: 999px;
	background: var(--wcsp-sale-soft);
	color: var(--wcsp-sale);
	font-size: max(0.6em, 11px);
	font-weight: 700;
	letter-spacing: 0.02em;
	line-height: 1.2;
	white-space: nowrap;
}

/* ── Стил „Каре“ ───────────────────────────────────────────── */
.wcsp-sale-box .price ins {
	padding: 0.08em 0.4em !important;
	border-radius: 6px;
	background: var(--wcsp-sale) !important;
	color: var(--wcsp-sale-text) !important;
}

.wcsp-sale-box .wcsp-save-pct {
	background: none;
	padding: 0;
	font-size: max(0.8em, 12px);
	font-weight: 800;
}

/* ── Количка / checkout ─────────────────────────────────── */
.wcsp-line-price {
	justify-content: flex-end;
	font-size: inherit;
}

.wcsp-line-price .wcsp-save-pct {
	font-size: 11px;
}

tr.wcsp-savings td {
	padding-top: 4px !important;
	border: 0 !important;
	text-align: center !important;
}

.wcsp-savings-pill {
	display: inline-flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.3em;
	padding: 0.45em 0.9em;
	border-radius: 999px;
	background: var(--wcsp-sale-soft);
	color: var(--wcsp-sale);
	font-size: 13px;
	font-weight: 600;
}

.wcsp-savings-amount,
.wcsp-savings-amount * {
	color: inherit !important;
	font-weight: 800 !important;
	white-space: nowrap;
}

/* ── Единният етикет върху снимката ─────────────────────────────
   Малка таблетка в ъгъла. Без клас .onsale — Divi/Woo го стилизират с !important. */
.wcsp-flash {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 5;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 10px 5px 9px;
	border-radius: 999px;
	background: var(--wcsp-bar, #191816);
	color: #fff;
	font-family: inherit;
	font-size: 11px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	white-space: nowrap;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
	overflow: hidden;
	pointer-events: none;
}
.wcsp-flash::before {
	content: "";
	flex: none;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--wcsp-sale, #d7262e);
}
/* едно леко проблясване при зареждане */
.wcsp-flash::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(100deg, transparent 35%, rgba(255, 255, 255, 0.35) 50%, transparent 65%);
	transform: translateX(-120%);
	animation: wcspShine 1.1s ease 0.8s 1 both;
}
@keyframes wcspShine { to { transform: translateX(120%); } }
@media (prefers-reduced-motion: reduce) { .wcsp-flash::after { animation: none; } }

/* ── Лента под хедъра ───────────────────────────────────────── */
.wcsp-bar {
	position: relative;
	z-index: 50;
	display: block;
	padding: 7px 14px;
	background: var(--wcsp-bar, #191816);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.02em;
	line-height: 1.3;
	text-align: center;
}
.wcsp-bar[hidden] { display: none; }
.wcsp-bar a { color: inherit; text-decoration: none; }
.wcsp-bar a:hover { text-decoration: underline; }
@media (max-width: 480px) { .wcsp-bar { font-size: 12px; padding: 7px 10px; } }
