/* Tempo Black Friday – amblem (maskota sa štitom) sa procentom popusta
 * Amblem: 1102 × 1319 px (odnos se nikad ne mijenja). Natpisi BLACK FRIDAY i POPUSTA su dio amblema.
 * Slobodno polje za procenat: između BLACK FRIDAY (kraj ≈ 50,5 %) i POPUSTA (početak ≈ 83 % visine). */

:root {
	--tbf-red: #E2231A;
	--tbf-card-w: 26%;
	--tbf-card-min: 64px;
	--tbf-card-top: 6px;
	/* Širina na kartici: 26 % fotografije, najmanje 64 px, nikad viša od fotografije (4:3) */
	--tbf-badge-w: min(max(var(--tbf-card-min), var(--tbf-card-w)), calc((75% - 2 * var(--tbf-card-top)) * .835));
	--tbf-single-w: 16%;
	--tbf-single-max: 130px;
	--tbf-edge: 6px;
	/* Zajedničko podešavanje procenta (jedno mjesto za sve veličine) */
	--tbf-box-top: 53.5%;
	--tbf-box-h: 27%;
	--tbf-box-x: 10.5%;
	--tbf-num-size: 28cqw;   /* −30% – najuočljiviji element, crveno */
	--tbf-gap: 2.2cqw;
}

.tempo-bf-badge {
	position: absolute;
	z-index: 2;
	display: block;
	aspect-ratio: 1102 / 1319;
	height: auto;
	container-type: inline-size;
	container-name: tbf;
	pointer-events: none;       /* klik, swipe i zum prolaze do fotografije */
	user-select: none;
	line-height: 1;
	margin: 0 !important;
	padding: 0 !important;
	background: none !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .22));
}

.tempo-bf-emblem {
	position: absolute;
	inset: 0;
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	object-fit: contain;
	margin: 0 !important;
	border: 0 !important;
	background: none !important;
	aspect-ratio: auto !important;
}

.tempo-bf-text {
	position: absolute;
	top: var(--tbf-box-top);
	height: var(--tbf-box-h);
	left: var(--tbf-box-x);
	right: var(--tbf-box-x);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: var(--tbf-gap);
	text-align: center;
	font-family: "Barlow Condensed", "Roboto Condensed", "Arial Narrow", sans-serif;
	font-stretch: condensed;
	font-weight: 700;
	white-space: nowrap;
	overflow: visible;
}

.tempo-bf-pct {
	display: flex;
	align-items: baseline;
	justify-content: center;
	color: var(--tbf-red);
	font-family: "Barlow Condensed", "Roboto Condensed", "Arial Narrow", sans-serif;
	font-stretch: condensed;
	font-weight: 900;
	font-size: var(--tbf-num-size);
	line-height: .8;
	letter-spacing: -.01em;
	font-variant-numeric: lining-nums tabular-nums;
}
.tempo-bf-minus { margin-right: .02em; }

.tempo-bf-upto {
	font-size: .3em;
	letter-spacing: .02em;
	align-self: center;
	margin-right: .2em;
	line-height: 1;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: #fff;
}

.tempo-bf-sr {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0; overflow: hidden;
	clip: rect(0 0 0 0); clip-path: inset(50%);
	white-space: nowrap; border: 0;
}

/* ---------- Položaj: kartice proizvoda (WoodMart) ---------- */

/* Amblem stoji kao zaseban element na fotografiji (izvan WoodMart kontejnera oznaka),
 * tako da brend i ostale oznake ostaju netaknute, uredno gore lijevo. */
.tempo-bf-tail { display: none !important; }

.tempo-bf--card { width: var(--tbf-badge-w); }
.tempo-bf--card.tempo-bf--top-right    { top: var(--tbf-card-top); right: var(--tbf-card-top); }
.tempo-bf--card.tempo-bf--top-left     { top: var(--tbf-card-top); left: var(--tbf-card-top); }
.tempo-bf--card.tempo-bf--bottom-right { bottom: var(--tbf-card-top); right: var(--tbf-card-top); }
.tempo-bf--card.tempo-bf--bottom-left  { bottom: var(--tbf-card-top); left: var(--tbf-card-top); }

/* Bez preklapanja: dugme za omiljene ide lijevo od oznake */
html body.tempo-bf-on .product-element-top:has(> .tempo-bf--card.tempo-bf--top-right) > .wd-buttons {
	right: calc(var(--tbf-badge-w) + var(--tbf-card-top)) !important;
}
/* Oznake teme (brend, NOVO…) ne ulaze ispod amblema: kontejner oznaka ostavlja mu prostor */
html body.tempo-bf-on .wd-product .product-element-top:has(> .tempo-bf--card.tempo-bf--top-right) > .product-labels {
	padding-right: calc(var(--tbf-badge-w) + var(--tbf-card-top) + 4px) !important;
}
html body.tempo-bf-on .wd-product .product-element-top:has(> .tempo-bf--card.tempo-bf--top-left) > .product-labels {
	padding-left: calc(var(--tbf-badge-w) + var(--tbf-card-top) + 4px) !important;
}
/* Telefon: manja ikonica, uvučena u sam gornji desni ugao fotografije
 * (html:root ima prednost nad veličinom iz podešavanja, koja važi za desktop) */
@media (max-width: 600px) {
	html:root { --tbf-card-w: 0%; --tbf-card-min: 46px; --tbf-card-top: 2px; }
}

/* Standardna "-X%" oznaka se ne prikazuje dok traje akcija (nema dupliranja) */
body.tempo-bf-on .tempo-bf-product .onsale,
body.tempo-bf-on .product-element-top:has(> .tempo-bf-badge) .onsale { display: none !important; }

/* ---------- Položaj: glavna fotografija na stranici proizvoda ---------- */

.tempo-bf--single { --tbf-single-bw: max(70px, min(var(--tbf-single-w), var(--tbf-single-max))); width: var(--tbf-single-bw); }
.tempo-bf--single.tempo-bf--top-right    { top: 14px; right: 14px; }
.tempo-bf--single.tempo-bf--top-left     { top: 14px; left: 14px; }
.tempo-bf--single.tempo-bf--bottom-right { bottom: 14px; right: 14px; }
.tempo-bf--single.tempo-bf--bottom-left  { bottom: 14px; left: 14px; }

.tempo-bf-host { position: relative; }

/* Na stranici proizvoda dugme za omiljene je u opisu, pa je gornji ugao slobodan.
 * Ako tema ima kontrolu zuma gore desno, oznaka se spušta ispod nje. */
.woocommerce-product-gallery:has(.woodmart-show-product-gallery-wrap.wd-gallery-btn-top-right, .wd-show-product-gallery-wrap) .tempo-bf--single.tempo-bf--top-right { top: 62px; }

@media (max-width: 600px) {
	.tempo-bf--single { --tbf-single-bw: max(60px, 17%); }
}

@media (prefers-reduced-motion: no-preference) {
	.tempo-bf-badge.is-updated { animation: tbf-pop .28s ease-out; }
	@keyframes tbf-pop { from { transform: scale(.94); } to { transform: none; } }
}

/* Black Friday slajd (WoodMart slider) – tekst popunjava zid lijevo, ne prelazi na bicikl ni na mačka.
 * Mjere su u % širine slajda (cqw), pa tekst prati fotografiju na svakoj širini ekrana.
 * Desktop (1920×700): zid je slobodan do ≈31 % širine cijelom visinom (zadnji točak počinje na ≈31 %).
 * Telefon (1000×500): zid je slobodan do ≈40 % širine. */
.wd-slide:has(.tempo-bf-slide) { position: relative; container-type: inline-size; container-name: bfslide; }
.wd-slide:has(.tempo-bf-slide) .wd-slide-container,
.wd-slide:has(.tempo-bf-slide) .wd-slide-inner { position: static !important; }
.tempo-bf-slide {
	position: absolute; z-index: 1; left: 3.4cqw; top: 50%; transform: translateY(-50%);
	width: 26.5cqw; display: flex; flex-direction: column; align-items: flex-start;
	color: #fff; font-family: "Barlow Condensed", "Roboto Condensed", "Arial Narrow", sans-serif; font-stretch: condensed;
	text-transform: uppercase; pointer-events: none;
}
.tempo-bf-slide .tbs-title { margin: 0; font-size: 7cqw; line-height: .85; font-weight: 700; letter-spacing: .005em; color: #fff; text-shadow: 0 .2cqw 1.4cqw rgba(0,0,0,.45); }
.tempo-bf-slide .tbs-title span { display: block; }
body .tempo-bf-slide h2.tbs-title { text-transform: uppercase !important; color: #fff !important; }
.tempo-bf-slide .tbs-offer { margin: .8cqw 0 0; font-size: 3.3cqw; line-height: 1.05; font-weight: 700; letter-spacing: .02em; color: #fff; white-space: nowrap; text-shadow: 0 .15cqw .9cqw rgba(0,0,0,.45); }
.tempo-bf-slide .tbs-offer b { color: #E2231A; font-weight: 900; }
.tempo-bf-slide .tbs-offer span { display: block; white-space: nowrap; }
.tempo-bf-slide .tbs-date { margin: 1.1cqw 0 0; padding-left: .7cqw; border-left: .22cqw solid #E2231A; font-size: 1.2cqw; line-height: 1.2; font-weight: 600; letter-spacing: .09em; color: #E3E6EB; white-space: nowrap; }
.tempo-bf-slide .tbs-cta { display: inline-flex; align-items: center; gap: .5em; margin-top: .9cqw; padding: .75em 1.4em; border-radius: 999px; background: #E2231A; color: #fff; font-family: Inter, system-ui, sans-serif; font-size: max(12px, 1.05cqw); font-weight: 700; letter-spacing: .02em; text-transform: none; box-shadow: 0 .4cqw 1.2cqw rgba(226,35,26,.35); }
.tempo-bf-slide .tbs-cta::after { content: "→"; }
/* zid malo tamniji radi čitljivosti, bicikl i mačak ostaju netaknuti */
.wd-slide:has(.tempo-bf-slide) .wd-slide-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,12,16,.5) 0%, rgba(10,12,16,.25) 24%, rgba(10,12,16,0) 32%); pointer-events: none; }
@media (max-width: 767.98px) {
	.tempo-bf-slide { left: 1.5cqw; width: 35cqw; }
	.tempo-bf-slide { top: 46%; }
	.tempo-bf-slide .tbs-title { font-size: 10cqw; }
	.tempo-bf-slide .tbs-offer { margin-top: 1cqw; font-size: 4.6cqw; line-height: 1.05; white-space: normal; }
	.tempo-bf-slide .tbs-offer span { display: block; }
	.tempo-bf-slide .tbs-date { margin-top: 1.6cqw; padding-left: 1.4cqw; border-left-width: .5cqw; font-size: 2.9cqw; }
	.tempo-bf-slide .tbs-cta { display: none; }
	.wd-slide:has(.tempo-bf-slide) .wd-slide-bg::after { background: linear-gradient(90deg, rgba(10,12,16,.55) 0%, rgba(10,12,16,.3) 30%, rgba(10,12,16,0) 41%); }
}

/* Odbrojavanje na slajdu (do početka akcije, zatim do kraja) */
.tempo-bf-slide .tbs-timer { display: flex; flex-wrap: wrap; align-items: stretch; gap: .5cqw; margin: .9cqw 0 0; text-transform: uppercase; }
.tempo-bf-slide .tbs-timer[hidden] { display: none; }
.tempo-bf-slide:has(.tbs-timer:not([hidden])) .tbs-date { display: none; }
.tempo-bf-slide .tbs-tl { flex: 0 0 100%; margin-bottom: .35cqw; padding-left: .7cqw; border-left: .22cqw solid #E2231A; font-size: 1.15cqw; line-height: 1.2; font-weight: 600; letter-spacing: .09em; color: #E3E6EB; white-space: nowrap; }
.tempo-bf-slide .tbs-tu { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 4.7cqw; padding: .45cqw .4cqw .35cqw; background: rgba(10,12,16,.6); border: 1px solid rgba(226,35,26,.8); border-radius: .45cqw; }
.tempo-bf-slide .tbs-tu b { font-size: 2.4cqw; line-height: 1; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.tempo-bf-slide .tbs-tu i { margin-top: .2cqw; font-style: normal; font-size: max(9px, .75cqw); line-height: 1; letter-spacing: .1em; font-weight: 600; color: #C9CDD3; }
.tempo-bf-slide .tbs-timer.is-live .tbs-tu { border-color: #E2231A; background: rgba(226,35,26,.22); }
@media (max-width: 767.98px) {
	.tempo-bf-slide .tbs-timer { gap: .9cqw; margin-top: 1.4cqw; }
	.tempo-bf-slide .tbs-tld { display: none; }
	.tempo-bf-slide .tbs-tl { margin-bottom: .6cqw; padding-left: 1.4cqw; border-left-width: .5cqw; font-size: 2.3cqw; }
	.tempo-bf-slide .tbs-tu { min-width: 6.6cqw; padding: .6cqw .5cqw .5cqw; border-radius: 1cqw; }
	.tempo-bf-slide .tbs-tu b { font-size: 3.8cqw; }
	.tempo-bf-slide .tbs-tu i { margin-top: .4cqw; font-size: max(7px, 1.8cqw); }
}
