/*
 * Stilovi za elemente koje ispisuje plugin (gumbi, kartice, obrazac, traka za poziv).
 * Boje se preuzimaju iz teme preko CSS varijabli, uz sigurnosne zadane vrijednosti,
 * pa sve radi i ako se tema promijeni.
 */

:root {
	--tba-accent: var(--wp--preset--color--accent, #9e2b35);
	--tba-accent-dark: var(--wp--preset--color--accent-dark, #7e2129);
	--tba-accent-light: var(--wp--preset--color--accent-light, #e0858b);
	--tba-ink: var(--wp--preset--color--ink, #0b1626);
	--tba-surface: var(--wp--preset--color--surface, #12213a);
	--tba-line: var(--wp--preset--color--line, #25395a);
	--tba-text: var(--wp--preset--color--text, #e6eaf1);
	--tba-muted: var(--wp--preset--color--muted, #a1aec4);
	--tba-radius: 14px;
}

/* --- Gumbi ------------------------------------------------------------- */

.tba-btn {
	box-sizing: border-box; /* min-height uključuje padding i rub, inače gumbi ispadnu ~23px viši */
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .6rem;
	padding: 1rem 1.6rem;
	border-radius: var(--tba-radius);
	font-weight: 700;
	font-size: 1rem;
	letter-spacing: .02em;
	text-decoration: none;
	line-height: 1.1;
	border: 2px solid transparent;
	transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
	min-height: 52px;
}

.tba-btn:hover,
.tba-btn:focus-visible {
	transform: translateY(-1px);
	text-decoration: none;
}

.tba-btn--primary {
	background: var(--tba-accent);
	color: #ffffff;
}

.tba-btn--primary:hover,
.tba-btn--primary:focus-visible {
	background: var(--tba-accent-dark);
	color: #ffffff;
}

.tba-btn--ghost {
	border-color: currentColor;
	color: inherit;
	background: transparent;
}

.tba-btn--ghost:hover,
.tba-btn--ghost:focus-visible {
	background: rgba(255, 255, 255, .08);
}

.tba-btn--chat {
	background: rgba(255, 255, 255, .07);
	border-color: var(--tba-line);
	color: inherit;
	font-size: .95rem;
}

.tba-btn--wa:hover { border-color: #25d366; }
.tba-btn--viber:hover { border-color: #7360f2; }

.tba-cta {
	display: flex;
	flex-wrap: wrap;
	gap: .8rem;
	margin: 1.5rem 0;
}

.tba-cta--sredina { justify-content: center; }
.tba-cta--veliko .tba-btn--primary { font-size: 1.15rem; padding: 1.15rem 2rem; min-height: 60px; }

/* Mobitel: svi gumbi u jednom redu, manji; "Nazovi odmah" malo širi od ostalih. */
@media (max-width: 600px) {
	.tba-cta { flex-wrap: nowrap; gap: .5rem; }
	.tba-cta .tba-btn,
	.tba-cta--veliko .tba-btn--primary {
		flex: 1 1 0;
		min-width: 0;
		min-height: 52px;
		padding: .6rem .45rem;
		gap: .35rem;
		font-size: .8rem;
		letter-spacing: 0;
		line-height: 1.15;
		text-align: center;
		white-space: normal;
	}
	.tba-cta .tba-btn--primary { flex-grow: 1.35; }
	.tba-cta .tba-btn .tba-icon { width: 1.1em; height: 1.1em; }
}

.tba-icon {
	width: 1.25em;
	height: 1.25em;
	flex: none;
}

/* --- Telefon / kontakt podaci ------------------------------------------ */

.tba-tel {
	display: inline-flex;
	align-items: center;
	gap: .5rem;
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
}

.tba-nap {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 1rem;
}

.tba-nap li {
	display: grid;
	grid-template-columns: 2rem 1fr;
	grid-template-areas: "ico label" "ico value";
	column-gap: .9rem;
	align-items: start;
}

.tba-nap__ico { grid-area: ico; color: var(--tba-accent-light); display: flex; padding-top: .15rem; }
.tba-nap__ico .tba-icon { width: 1.5rem; height: 1.5rem; }
.tba-nap__label { grid-area: label; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--tba-muted); }
.tba-nap__value { grid-area: value; font-size: 1.1rem; font-weight: 600; }
.tba-nap__value a { text-decoration: none; }

.tba-hours { list-style: none; margin: .5rem 0; padding: 0; display: grid; gap: .35rem; }
.tba-hours__badge { display: flex; align-items: center; gap: .5rem; color: var(--tba-accent-light); margin: 1.6rem 0 .5rem; }
.tba-hours__note { color: var(--tba-muted); font-size: .95rem; }

/* --- Kartice / mreža --------------------------------------------------- */

.tba-grid {
	display: grid;
	gap: 1.25rem;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

@media (min-width: 900px) {
	.tba-grid--2 { grid-template-columns: repeat(2, 1fr); }
	.tba-grid--3 { grid-template-columns: repeat(3, 1fr); }
	.tba-grid--4 { grid-template-columns: repeat(4, 1fr); }
}

.tba-card {
	background: var(--tba-surface);
	border: 1px solid var(--tba-line);
	border-radius: var(--tba-radius);
	overflow: hidden;
	transition: border-color .2s ease, transform .2s ease;
}

.tba-card:hover { border-color: var(--tba-accent-light); transform: translateY(-2px); }

/* Kartica je stupac: "Saznaj više" je uvijek u donjem desnom kutu, bez obzira na duljinu teksta. */
.tba-card__link { display: flex; flex-direction: column; color: inherit; text-decoration: none; height: 100%; }
.tba-card__media { aspect-ratio: 16 / 10; overflow: hidden; }
.tba-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tba-card__body { padding: 1.6rem 1.6rem 1.4rem; display: flex; flex-direction: column; gap: .65rem; flex: 1; }
.tba-card__icon {
	color: var(--tba-accent-light);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 3.25rem;
	height: 3.25rem;
	border-radius: 12px;
	background: rgba(158, 43, 53, .18);
	border: 1px solid rgba(224, 133, 139, .25);
	margin-bottom: .4rem;
}
.tba-card__icon .tba-icon { width: 1.6rem; height: 1.6rem; }
.tba-card__title { margin: 0; font-size: 1.5rem; line-height: 1.15; }
.tba-card__text { margin: 0; color: var(--tba-muted); font-size: 1rem; line-height: 1.6; }
.tba-card__price { margin: 0; font-weight: 700; color: var(--tba-accent-light); }
.tba-card__more {
	margin-top: auto;
	align-self: flex-end;
	padding-top: .9rem;
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	font-weight: 600;
	font-size: .95rem;
	color: var(--tba-accent-light);
}
.tba-card__more::after { content: "→"; transition: transform .2s ease; }
.tba-card:hover .tba-card__more::after { transform: translateX(3px); }

.tba-usluge-popis { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }

/* --- Područja rada ----------------------------------------------------- */

.tba-podrucja {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: .6rem;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
}

.tba-podrucja a {
	display: flex;
	align-items: center;
	gap: .6rem;
	padding: .9rem 1rem;
	border: 1px solid var(--tba-line);
	border-radius: 10px;
	text-decoration: none;
	color: inherit;
	background: var(--tba-surface);
}

.tba-podrucja a:hover { border-color: var(--tba-accent-light); }
.tba-podrucja .tba-icon { color: var(--tba-accent-light); }
.tba-podrucja small { display: block; color: var(--tba-muted); }

/* --- Recenzije --------------------------------------------------------- */

.tba-review {
	margin: 0;
	padding: 1.5rem;
	background: var(--tba-surface);
	border: 1px solid var(--tba-line);
	border-radius: var(--tba-radius);
	display: grid;
	gap: .8rem;
	align-content: start;
}

.tba-reviews__empty {
	background: var(--tba-surface);
	border: 1px solid var(--tba-line);
	border-left: 3px solid var(--tba-accent);
	border-radius: var(--tba-radius);
	padding: 1.25rem 1.5rem;
	max-width: 60ch;
}
.tba-reviews__empty p { margin: 0; color: var(--tba-text); }
.tba-reviews__cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

.tba-review__stars { color: var(--tba-accent-light); display: flex; gap: .15rem; }
.tba-review__stars .tba-icon { width: 1.1rem; height: 1.1rem; fill: currentColor; }
.tba-review blockquote { margin: 0; font-size: 1.05rem; }
.tba-review blockquote p { margin: 0 0 .5rem; }
.tba-review figcaption { font-weight: 700; }
.tba-review figcaption small { display: block; font-weight: 400; color: var(--tba-muted); }

/* --- Karta ------------------------------------------------------------- */

.tba-map { display: grid; gap: 1rem; }
.tba-map iframe { width: 100%; border-radius: var(--tba-radius); display: block; }
.tba-map__btn { justify-self: start; }
.tba-map__empty {
	min-height: 200px;
	display: grid;
	place-items: center;
	border: 2px dashed var(--tba-line);
	border-radius: var(--tba-radius);
	padding: 2rem;
}

/* --- Obrazac ----------------------------------------------------------- */

/* Obrazac je kartica; raspored polja ovisi o širini same kartice (container query),
   pa se polja nikad ne preklapaju, bez obzira u kojem je stupcu obrazac. */
.tba-form-wrap {
	position: relative;
	container-type: inline-size;
	background: var(--tba-surface);
	border: 1px solid var(--tba-line);
	border-top: 3px solid var(--tba-accent);
	border-radius: var(--tba-radius);
	padding: clamp(1.25rem, 4vw, 2rem);
}

.tba-form { display: grid; gap: 1.15rem; }
.tba-form *,
.tba-form *::before,
.tba-form *::after { box-sizing: border-box; }

/* Zamka za robote: potpuno skrivena (i pri kopiranju teksta i za čitače ekrana). */
.tba-form__hp {
	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;
	user-select: none;
}

.tba-form__row { display: grid; gap: 1.15rem; grid-template-columns: minmax(0, 1fr); }

@container (min-width: 520px) {
	.tba-form__row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.tba-form__field { margin: 0; display: grid; gap: .45rem; min-width: 0; }
.tba-form__field label { font-weight: 600; font-size: .95rem; color: var(--tba-text); }
.tba-form__field label span { color: var(--tba-accent-light); }

.tba-form input,
.tba-form textarea {
	display: block;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	padding: .85rem 1rem;
	border-radius: 10px;
	border: 1px solid var(--tba-line);
	background: var(--tba-ink);
	color: var(--tba-text);
	font: inherit;
	font-size: 1rem;
	line-height: 1.4;
	min-height: 50px;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.tba-form textarea { min-height: 140px; resize: vertical; }

.tba-form input::placeholder,
.tba-form textarea::placeholder { color: var(--tba-muted); opacity: .7; }

.tba-form input:hover,
.tba-form textarea:hover { border-color: #33496d; }

.tba-form input:focus,
.tba-form textarea:focus {
	outline: none;
	border-color: var(--tba-accent-light);
	box-shadow: 0 0 0 3px rgba(224, 133, 139, .2);
}

.tba-form__consent { color: var(--tba-muted); font-size: .9rem; margin: 0; }
.tba-form__submit {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .75rem 1.25rem;
	margin: .35rem 0 0;
	padding-top: 1.15rem;
	border-top: 1px solid var(--tba-line);
}
.tba-form__submit .tba-btn { min-height: 50px; padding-inline: 1.75rem; font-family: inherit; font-size: 1rem; font-weight: 700; cursor: pointer; }
.tba-form__or { color: var(--tba-muted); }
.tba-form__or a { color: var(--tba-accent-light); font-weight: 600; text-decoration: none; white-space: nowrap; }
.tba-form__or a:hover { text-decoration: underline; }

.tba-alert { padding: 1rem 1.25rem; border-radius: 10px; margin: 0 0 1.5rem; border: 1px solid var(--tba-line); }
.tba-alert--ok { border-color: var(--tba-accent-light); }
.tba-alert--warn { border-color: #e5484d; }

/* --- Traka za poziv na mobitelu ---------------------------------------- */

.tba-callbar {
	position: fixed;
	inset: auto 0 0 0;
	z-index: 999;
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 1fr;
	background: rgba(11, 22, 38, .96);
	backdrop-filter: blur(8px);
	border-top: 1px solid var(--tba-line);
	padding-bottom: env(safe-area-inset-bottom);
}

/* Uz četiri stavke (Nazovi, WhatsApp, Viber, Lokacija) natpisi se na najužim
   ekranima moraju malo stisnuti da ne prelome u dva reda. */
@media (max-width: 400px) {
	.tba-callbar__item { font-size: .72rem; padding-left: .2rem; padding-right: .2rem; }
	.tba-callbar__item span { white-space: nowrap; }
}

.tba-callbar__item {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: .2rem;
	padding: .7rem .4rem;
	font-size: .8rem;
	font-weight: 700;
	text-decoration: none;
	color: var(--tba-text);
	min-height: 60px;
}

.tba-callbar__item--call { background: var(--tba-accent); color: #ffffff; }
.tba-callbar__item .tba-icon { width: 1.4rem; height: 1.4rem; }

.has-tba-callbar { padding-bottom: 64px; }

@media (min-width: 900px) {
	.tba-callbar { display: none; }
	.has-tba-callbar { padding-bottom: 0; }
}

/* --- Oznaka za nepopunjene podatke (vidi je samo prijavljeni urednik) --- */

.tba-placeholder {
	display: inline-block;
	padding: .35rem .7rem;
	border: 1px dashed #e5a00d;
	border-radius: 8px;
	background: rgba(229, 160, 13, .1);
	color: #e5a00d;
	font-size: .85rem;
	font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
	.tba-btn,
	.tba-card { transition: none; }
	.tba-btn:hover,
	.tba-card:hover { transform: none; }
}

/* --- Sekcija "Gdje se nalazimo" ---------------------------------------- */

.tba-section__head .tba-adresa {
	display: block;
	margin-top: .75rem;
	font-size: 1.15rem;
	color: var(--tba-muted);
}

/* --- Mobitel: kartice usluga dvije u redu, sažetije -------------------- */

@media (max-width: 600px) {
	.tba-usluge-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
	.tba-usluge-grid .tba-card__body { padding: 1rem .9rem .85rem; gap: .4rem; }
	.tba-usluge-grid .tba-card__icon { width: 2.4rem; height: 2.4rem; border-radius: 10px; margin-bottom: .15rem; }
	.tba-usluge-grid .tba-card__icon .tba-icon { width: 1.25rem; height: 1.25rem; }
	.tba-usluge-grid .tba-card__title { font-size: 1.15rem; }
	.tba-usluge-grid .tba-card__text {
		font-size: .82rem;
		line-height: 1.45;
		display: -webkit-box;
		-webkit-line-clamp: 3;
		-webkit-box-orient: vertical;
		overflow: hidden;
	}
	.tba-usluge-grid .tba-card__more { font-size: .8rem; padding-top: .5rem; }
}

/* --- Gumb "Pošalji moju lokaciju" -------------------------------------- */

.tba-locate { margin: -.6rem 0 1.5rem; max-width: 34rem; }

.tba-locate__btn {
	width: 100%;
	font-family: inherit;
	cursor: pointer;
	background: rgba(37, 211, 102, .1);
	border-color: rgba(37, 211, 102, .45);
	color: var(--tba-text);
}

.tba-locate__btn:hover,
.tba-locate__btn:focus-visible { background: rgba(37, 211, 102, .18); border-color: #25d366; }
.tba-locate__btn .tba-icon { color: #25d366; }
.tba-locate__btn[disabled] { opacity: .7; cursor: progress; }

.tba-locate__note { margin: .45rem 0 0; font-size: .82rem; color: var(--tba-muted); }
.tba-locate__msg { margin: .5rem 0 0; font-size: .9rem; color: var(--tba-text); }
.tba-locate__msg a { color: var(--tba-accent-light); font-weight: 600; }

/* Na računalu nema smisla (lokacija po IP-u je netočna, a tko je na cesti, ima mobitel). */
@media (min-width: 901px) {
	.tba-locate { display: none; }
}

/* --- Traka suradnika ---------------------------------------------------- */

.tba-partneri {
	--tba-partneri-brzina: 55s;
	--tba-partneri-visina: 46px;
	--tba-partneri-razmak: 15vw;
	width: 100%;
}

.tba-partneri__naslov {
	margin: 0 0 1.25rem;
	text-align: center;
	font-size: .78rem;
	font-weight: 700;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--tba-muted);
}

/* Rubovi se stapaju s podlogom, pa logotipi ne "iskaču" naglo. */
.tba-partneri__okvir {
	overflow: hidden;
	-webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
	mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}

.tba-partneri__traka {
	display: flex;
	width: max-content;
	animation: tba-partneri-klizi var(--tba-partneri-brzina) linear infinite;
}

.tba-partneri__okvir:hover .tba-partneri__traka,
.tba-partneri__okvir:focus-within .tba-partneri__traka {
	animation-play-state: paused;
}

.tba-partneri__niz {
	display: flex;
	align-items: center;
	/* Razmak iza zadnjeg logotipa mora biti JEDNAK razmaku između njih —
	   inače se na spoju dvaju nizova vidi trzaj i traka "završi". */
	gap: var(--tba-partneri-razmak);
	margin: 0;
	padding: 0 var(--tba-partneri-razmak) 0 0;
	list-style: none;
}

.tba-partneri__stavka {
	flex: none;
	display: flex;
	align-items: center;
}

.tba-partneri__stavka img {
	/* Logotipi imaju vrlo različite omjere (od 3:1 do skoro 10:1), pa se ograničavaju
	   i po visini i po širini — svaki se smanji koliko treba, bez izobličenja. */
	height: auto;
	width: auto;
	max-height: var(--tba-partneri-visina);
	max-width: 210px;
	display: block;
	/* Logotipi su različitih boja, a neki su tamni i na tamnoj podlozi bi nestali;
	   zato se svi prikazuju bijelo, kao jedinstven niz. */
	filter: brightness(0) invert(1);
	opacity: .7;
	transition: opacity .2s ease;
}

.tba-partneri__stavka a:hover img,
.tba-partneri__stavka a:focus-visible img {
	opacity: 1;
}

@keyframes tba-partneri-klizi {
	from { transform: translateX(0); }
	to   { transform: translateX(-50%); }
}

/* Bez animacije: logotipi se jednostavno prelome u redak. */
@media (prefers-reduced-motion: reduce) {
	.tba-partneri__okvir { -webkit-mask-image: none; mask-image: none; }
	.tba-partneri__traka { animation: none; width: 100%; }
	.tba-partneri__traka .tba-partneri__niz:last-child { display: none; }
	.tba-partneri__niz { flex-wrap: wrap; justify-content: center; padding: 0; }
}

/* --- Suradnici: statična mreža (bez pomicanja) --------------------------- */

.tba-partneri-mreza {
	--tba-partneri-visina: 46px;
	width: 100%;
}

.tba-partneri-mreza__niz {
	display: grid;
	/* 150px minimuma znači da četiri logotipa stanu u jedan red i u užem stupcu teksta. */
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
	gap: 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tba-partneri-mreza__stavka {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 104px;
	padding: 1.25rem 1.5rem;
	background: var(--tba-surface);
	border: 1px solid var(--tba-line);
	border-radius: var(--tba-radius);
	transition: border-color .2s ease;
}

.tba-partneri-mreza__stavka:hover {
	border-color: var(--tba-accent);
}

.tba-partneri-mreza__stavka a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
}

.tba-partneri-mreza__stavka img {
	height: auto;
	width: auto;
	max-height: var(--tba-partneri-visina);
	max-width: 100%;
	display: block;
	/* Logotipi su različitih boja i neki su tamni; bijeli prikaz ih ujednačuje
	   i drži čitljivima na tamnoj podlozi — isto kao u traci na naslovnici. */
	filter: brightness(0) invert(1);
	opacity: .78;
	transition: opacity .2s ease;
}

.tba-partneri-mreza__stavka:hover img {
	opacity: 1;
}

/* Na mobitelu dva logotipa u redu — ostaju čitljivi, a ne zauzimaju pola ekrana. */
@media (max-width: 600px) {
	.tba-partneri-mreza__niz { grid-template-columns: repeat(2, 1fr); gap: .75rem; }
	.tba-partneri-mreza__stavka { min-height: 84px; padding: .9rem 1rem; }
	.tba-partneri-mreza { --tba-partneri-visina: 36px; }
}

/* --- Kompaktni popis usluga (dno stranice pojedine usluge) --------------- */

.tba-usluge-kompakt {
	/* Odmak od naslova iznad — bez njega pločice "sjedaju" na tekst. */
	margin-top: 1.5rem;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
	gap: .6rem;
	margin-right: 0;
	margin-bottom: 0;
	margin-left: 0;
	padding: 0;
	list-style: none;
}

.tba-usluge-kompakt a {
	display: flex;
	align-items: center;
	gap: .7rem;
	padding: .85rem 1rem;
	border: 1px solid var(--tba-line);
	border-radius: 10px;
	background: var(--tba-surface);
	color: inherit;
	text-decoration: none;
	font-weight: 600;
	line-height: 1.3;
	transition: border-color .2s ease;
}

.tba-usluge-kompakt a:hover,
.tba-usluge-kompakt a:focus-visible {
	border-color: var(--tba-accent);
}

.tba-usluge-kompakt__ico {
	display: flex;
	flex: none;
	color: var(--tba-accent);
}

.tba-usluge-kompakt__ico .tba-icon { width: 1.4rem; height: 1.4rem; }

@media (max-width: 600px) {
	.tba-usluge-kompakt { grid-template-columns: 1fr; }
}
