/**
 * TourManager - baner zgody. Wygląd wprost z palety wtyczki (te same wartości
 * co w public.css), zamknięty w przestrzeni .tourmgr-consent / .tmc-. Bez
 * stylowania zmiennymi z panelu: kolory, krój i zaokrąglenia są firmowe.
 *
 * Tokeny zdefiniowane lokalnie na kontenerach, żeby baner działał też na stronach,
 * na których nie ma innych assetów wtyczki. Literał + color-mix jak w public.css:
 * starsza przeglądarka bierze literał, nowsza liczy z palety.
 */

.tourmgr-consent,
.tmc-prefs,
.tourmgr-consent-fab {
	/* Paleta źródłowa. */
	--tourmgr-wapno: #faf6f0;
	--tourmgr-piasek: #e7dac5;
	--tourmgr-grafit: #2e3439;
	--tourmgr-azulejo: #2f5d8a;
	--tourmgr-niebo: #b7d0e3;
	--tourmgr-oliwka: #6d7b54;
	--tourmgr-terakota: #a8512f;

	/* Role. */
	--tmc-surface: var(--tourmgr-wapno);
	--tmc-text: var(--tourmgr-grafit);

	--tmc-muted: #666663;
	--tmc-muted: color-mix(in srgb, var(--tourmgr-grafit) 70%, var(--tourmgr-piasek));

	--tmc-border: #ede2d2;
	--tmc-border: color-mix(in srgb, var(--tourmgr-piasek) 70%, var(--tourmgr-wapno));

	--tmc-link: var(--tourmgr-azulejo);
	--tmc-focus: var(--tourmgr-azulejo);

	/* Akcept/zapis = firmowe CTA (terakota). Terakota jest jedynym kolorem, który
	   cokolwiek uruchamia - przełącznik "włączony" i główny przycisk to właśnie
	   akcja, więc dostają ją zgodnie z systemem. */
	--tmc-accept-bg: var(--tourmgr-terakota);
	--tmc-accept-bg-hover: #924c31;
	--tmc-accept-bg-hover: color-mix(in srgb, var(--tourmgr-terakota) 82%, var(--tourmgr-grafit));
	--tmc-accept-text: var(--tourmgr-wapno);

	/* Odrzuć = neutralny grafit: równorzędny wagą, ale bez firmowego akcentu. */
	--tmc-reject-bg: var(--tourmgr-grafit);
	--tmc-reject-text: var(--tourmgr-wapno);

	/* Ustawienia = trzeciorzędny: powierzchnia + obramowanie. */
	--tmc-settings-bg: var(--tourmgr-wapno);
	--tmc-settings-text: var(--tourmgr-grafit);

	--tmc-toggle-on: var(--tourmgr-terakota);
	--tmc-fab-bg: var(--tourmgr-terakota);
	--tmc-fab-icon: var(--tourmgr-wapno);

	--tmc-radius: 16px;
	--tmc-radius-sm: 8px;
	--tmc-shadow: 0 12px 44px rgba(46, 52, 57, .18);
	--tmc-shadow-strong: 0 24px 70px rgba(46, 52, 57, .35);
	--tmc-scrim: rgba(46, 52, 57, .55);

	--tmc-font-heading: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--tmc-font-body: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', sans-serif;

	box-sizing: border-box;
}

.tourmgr-consent *,
.tmc-prefs * { box-sizing: border-box; }

html.tmc-lock { overflow: hidden; }

/* ----------------------------------------------------------------------
 *  PIERWSZA WARSTWA – baner
 * ------------------------------------------------------------------- */
.tourmgr-consent[hidden] { display: none !important; }

.tmc-banner {
	font-family: var(--tmc-font-body);
	background: var(--tmc-surface);
	color: var(--tmc-text);
	border: 1px solid var(--tmc-border);
	border-radius: var(--tmc-radius);
	box-shadow: var(--tmc-shadow);
	padding: 22px 24px;
	display: flex;
	gap: 18px 28px;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
}

.tmc-banner-text { flex: 1 1 320px; min-width: 0; }

.tmc-title {
	margin: 0 0 6px;
	font-family: var(--tmc-font-heading);
	font-size: 20px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--tmc-text);
}

.tmc-text {
	margin: 0;
	font-size: 16px;
	line-height: 1.55;
	color: var(--tmc-muted);
}

.tmc-text .tmc-policy-link,
.tmc-policy-link {
	color: var(--tmc-link);
	text-decoration: underline;
}

.tmc-actions {
	display: flex;
	gap: 10px;
	align-items: center;
	flex-wrap: wrap;
	flex: 0 0 auto;
}

/* Przyciski – Akceptuj i Odrzuć MUSZĄ być równorzędne (ta sama wielkość/waga).
 * Style są scope'owane i oznaczone !important, żeby motyw (Hello Elementor /
 * globalne style przycisków Elementora) nie nadpisywał kolorów z palety. */
.tourmgr-consent .tmc-btn,
.tmc-prefs .tmc-btn {
	font-family: var(--tmc-font-body) !important;
	cursor: pointer !important;
	border: 2px solid transparent !important;
	border-radius: var(--tmc-radius-sm) !important;
	padding: 11px 20px !important;
	margin: 0 !important;
	font-size: 15px !important;
	font-weight: 600 !important;
	line-height: 1 !important;
	min-height: 44px !important;
	width: auto !important;
	min-width: 0 !important;
	max-width: none !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	text-decoration: none !important;
	text-shadow: none !important;
	box-shadow: none !important;
	background-image: none !important;
	transition: filter .15s ease, opacity .15s ease !important;
	white-space: nowrap !important;
	-webkit-appearance: none !important;
	appearance: none !important;
}
.tourmgr-consent .tmc-btn:hover,
.tmc-prefs .tmc-btn:hover { filter: brightness(.94) !important; }
.tourmgr-consent .tmc-btn:focus-visible,
.tmc-prefs .tmc-btn:focus-visible { outline: 3px solid var(--tmc-focus) !important; outline-offset: 2px !important; }

.tourmgr-consent .tmc-btn-accept,
.tmc-prefs .tmc-btn-accept,
.tourmgr-consent .tmc-btn-save,
.tmc-prefs .tmc-btn-save {
	background: var(--tmc-accept-bg) !important;
	background-color: var(--tmc-accept-bg) !important;
	color: var(--tmc-accept-text) !important;
	border-color: transparent !important;
}
.tourmgr-consent .tmc-btn-accept:hover,
.tmc-prefs .tmc-btn-accept:hover,
.tourmgr-consent .tmc-btn-save:hover,
.tmc-prefs .tmc-btn-save:hover {
	filter: none !important;
	background: var(--tmc-accept-bg-hover) !important;
	background-color: var(--tmc-accept-bg-hover) !important;
}
.tourmgr-consent .tmc-btn-reject,
.tmc-prefs .tmc-btn-reject {
	background: var(--tmc-reject-bg) !important;
	background-color: var(--tmc-reject-bg) !important;
	color: var(--tmc-reject-text) !important;
	border-color: transparent !important;
}

/* "Ustawienia" – trzeciorzędny, mniej wyróżniony, ale w pełni widoczny. */
.tourmgr-consent .tmc-btn-settings,
.tmc-prefs .tmc-btn-settings {
	background: var(--tmc-settings-bg) !important;
	background-color: var(--tmc-settings-bg) !important;
	color: var(--tmc-settings-text) !important;
	border-color: var(--tmc-border) !important;
}

/* ---- Układy ---- */
.tourmgr-consent.tmc-layout-bar {
	position: fixed;
	left: 0; right: 0; bottom: 0;
	z-index: 2147483600;
	padding: 16px;
}
.tourmgr-consent.tmc-layout-bar .tmc-banner {
	max-width: 1180px;
	margin: 0 auto;
}

.tourmgr-consent.tmc-layout-box {
	position: fixed;
	bottom: 18px;
	z-index: 2147483600;
	padding: 0 16px;
	width: 100%;
	max-width: 460px;
}
.tourmgr-consent.tmc-layout-box.tmc-pos-left  { left: 0; }
.tourmgr-consent.tmc-layout-box.tmc-pos-right { right: 0; left: auto; }
.tourmgr-consent.tmc-layout-box .tmc-banner {
	flex-direction: column;
	align-items: stretch;
	justify-content: flex-start;
	max-width: 420px;
}
.tourmgr-consent.tmc-layout-box .tmc-banner-text { flex: 0 0 auto; }
.tourmgr-consent.tmc-layout-box.tmc-pos-right .tmc-banner { margin-left: auto; }
.tourmgr-consent.tmc-layout-box .tmc-actions { width: 100%; }
.tourmgr-consent.tmc-layout-box .tmc-btn { flex: 1 1 auto; text-align: center; }

.tourmgr-consent.tmc-layout-modal {
	position: fixed;
	inset: 0;
	z-index: 2147483600;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: var(--tmc-scrim);
}
.tourmgr-consent.tmc-layout-modal .tmc-banner {
	flex-direction: column;
	align-items: stretch;
	justify-content: flex-start;
	max-width: 560px;
	width: 100%;
}
.tourmgr-consent.tmc-layout-modal .tmc-banner-text { flex: 0 0 auto; }
.tourmgr-consent.tmc-layout-modal .tmc-actions { justify-content: flex-end; }

/* ----------------------------------------------------------------------
 *  PANEL USTAWIEŃ (modal z przełącznikami)
 * ------------------------------------------------------------------- */
.tmc-prefs[hidden] { display: none !important; }

.tmc-prefs {
	position: fixed;
	inset: 0;
	z-index: 2147483601;
	font-family: var(--tmc-font-body);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.tmc-prefs-backdrop {
	position: absolute;
	inset: 0;
	background: var(--tmc-scrim);
}
.tmc-prefs-dialog {
	position: relative;
	background: var(--tmc-surface);
	color: var(--tmc-text);
	border-radius: var(--tmc-radius);
	box-shadow: var(--tmc-shadow-strong);
	width: 100%;
	max-width: 600px;
	max-height: 86vh;
	overflow-y: auto;
	padding: 26px 28px;
}
.tmc-prefs .tmc-prefs-close {
	position: absolute;
	top: 12px; right: 14px;
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	border: none !important;
	box-shadow: none !important;
	text-shadow: none !important;
	font-size: 28px !important;
	line-height: 1 !important;
	min-height: 0 !important;
	width: auto !important;
	min-width: 0 !important;
	cursor: pointer !important;
	color: var(--tmc-muted) !important;
	padding: 4px 8px !important;
	margin: 0 !important;
	-webkit-appearance: none !important;
	appearance: none !important;
}
.tmc-prefs .tmc-prefs-close:hover { color: var(--tmc-text) !important; background: transparent !important; }

.tmc-prefs-title { margin: 0 0 6px; font-family: var(--tmc-font-heading); font-size: 22px; font-weight: 700; }
.tmc-prefs-intro { margin: 0 0 18px; font-size: 15px; line-height: 1.55; color: var(--tmc-muted); }

.tmc-cat {
	border: 1px solid var(--tmc-border);
	border-radius: var(--tmc-radius-sm);
	padding: 14px 16px;
	margin-bottom: 12px;
}
.tmc-cat-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}
.tmc-cat-label { font-family: var(--tmc-font-heading); font-weight: 700; font-size: 16px; }
.tmc-cat-always { font-size: 13px; color: var(--tmc-muted); font-weight: 600; }
.tmc-cat-desc { margin: 8px 0 0; font-size: 14px; line-height: 1.5; color: var(--tmc-muted); }

/* Przełącznik */
.tmc-switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: 0 0 auto; }
.tmc-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.tmc-slider {
	position: absolute;
	inset: 0;
	background: var(--tourmgr-piasek);
	border-radius: 999px;
	transition: background .18s ease;
	cursor: pointer;
}
.tmc-slider::before {
	content: "";
	position: absolute;
	height: 20px; width: 20px;
	left: 3px; top: 3px;
	background: #fff;
	border-radius: 50%;
	transition: transform .18s ease;
	box-shadow: 0 1px 3px rgba(46, 52, 57, .3);
}
.tmc-switch input:checked + .tmc-slider { background: var(--tmc-toggle-on); }
.tmc-switch input:checked + .tmc-slider::before { transform: translateX(20px); }
.tmc-switch input:focus-visible + .tmc-slider { outline: 3px solid var(--tmc-focus); outline-offset: 2px; }

.tmc-cookie-details { margin-top: 10px; }
.tmc-cookie-details summary {
	cursor: pointer;
	font-size: 14px;
	color: var(--tmc-link);
	font-weight: 600;
}
.tmc-cookie-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 10px;
	font-size: 13px;
}
.tmc-cookie-table th,
.tmc-cookie-table td {
	text-align: left;
	padding: 6px 8px;
	border-bottom: 1px solid var(--tmc-border);
	vertical-align: top;
	color: var(--tmc-muted);
}
.tmc-cookie-table th { color: var(--tmc-text); font-weight: 700; }
.tmc-cookie-table code { font-size: 12.5px; }

.tmc-prefs-actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	margin-top: 18px;
}
.tmc-prefs-actions .tmc-btn { flex: 1 1 auto; text-align: center; }

/* ----------------------------------------------------------------------
 *  PŁYWAJĄCY PRZYCISK (wycofanie/zmiana zgody)
 * ------------------------------------------------------------------- */
.tourmgr-consent-fab[hidden] { display: none !important; }
.tourmgr-consent-fab {
	position: fixed;
	bottom: 18px;
	z-index: 2147483599;
	width: 50px !important; height: 50px !important;
	min-height: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
	border-radius: 50% !important;
	border: none !important;
	cursor: pointer !important;
	background: var(--tmc-fab-bg) !important;
	background-color: var(--tmc-fab-bg) !important;
	background-image: none !important;
	color: var(--tmc-fab-icon) !important;
	box-shadow: 0 6px 18px rgba(46, 52, 57, .25) !important;
	font-size: 22px !important;
	line-height: 1 !important;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform .15s ease;
	-webkit-appearance: none !important;
	appearance: none !important;
}
.tourmgr-consent-fab:hover { transform: scale(1.06); }
.tourmgr-consent-fab:focus-visible { outline: 3px solid var(--tmc-focus); outline-offset: 3px; }
.tourmgr-consent-fab.tmc-fab-left  { left: 18px; }
.tourmgr-consent-fab.tmc-fab-right { right: 18px; }

/* ----------------------------------------------------------------------
 *  RESPONSYWNOŚĆ
 * ------------------------------------------------------------------- */
@media (max-width: 600px) {
	.tmc-banner { flex-direction: column; align-items: stretch; justify-content: flex-start; padding: 18px; }
	.tmc-banner-text { flex: 0 0 auto; }
	.tmc-actions { width: 100%; }
	.tmc-actions .tmc-btn { flex: 1 1 100%; text-align: center; }
	.tmc-prefs-dialog { padding: 22px 18px; }
}

@media (prefers-reduced-motion: reduce) {
	.tmc-btn, .tmc-slider, .tmc-slider::before, .tourmgr-consent-fab { transition: none; }
}
