/* ALFA HoReCa Cookies: baner zgody w barwach marki (zielen, zloto, piasek, Outfit, ostre narozniki).
   Pasek (intro) na dole ekranu; ustawienia = karta z kategoriami. "Odrzuc" i "Akceptuj" maja ten sam styl. */

.alfa-cookies {
	--ac-bg: #16342A;
	--ac-deep: #0F241C;
	--ac-text: #E2DEDC;
	--ac-muted: #A7B1A9;
	--ac-gold: #B8A077;
	--ac-sand: #CDB99A;
	--ac-line: rgba(184, 160, 119, .28);
	--ac-line-soft: rgba(226, 222, 220, .12);
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 1000;
	display: flex;
	justify-content: center;
	pointer-events: none;
	font-family: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
	font-weight: 300;
	color: var(--ac-text);
	-webkit-font-smoothing: antialiased;
}

.alfa-cookies[hidden] {
	display: none;
}

.alfa-cookies *,
.alfa-cookies *::before,
.alfa-cookies *::after {
	box-sizing: border-box;
}

.ac-card {
	pointer-events: auto;
	width: 100%;
	background: var(--ac-deep);
	border-top: 1px solid var(--ac-line);
	box-shadow: 0 -18px 50px -24px rgba(0, 0, 0, .6);
	opacity: 0;
	transform: translateY(16px);
	transition: opacity .4s cubic-bezier(.2, .7, .2, 1), transform .4s cubic-bezier(.2, .7, .2, 1);
}

.alfa-cookies.is-visible .ac-card {
	opacity: 1;
	transform: none;
}

.ac-view[hidden] {
	display: none;
}

/* ---------- Pasek (intro) ---------- */
.ac-view--intro {
	max-width: 1240px;
	margin: 0 auto;
	padding: 22px 40px calc(22px + env(safe-area-inset-bottom, 0px));
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: 18px 48px;
}

.ac-title,
.ac-settings-title {
	margin: 0 0 6px;
	font-size: 11px;
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: .26em;
	text-transform: uppercase;
	color: var(--ac-gold);
}

.ac-desc,
.ac-settings-desc {
	margin: 0;
	max-width: 68ch;
	font-size: 14.5px;
	line-height: 1.6;
	color: var(--ac-text);
}

.ac-link {
	color: var(--ac-sand);
	text-decoration: underline;
	text-decoration-color: rgba(205, 185, 154, .45);
	text-underline-offset: 3px;
	transition: color .2s, text-decoration-color .2s;
}

.ac-link:hover {
	color: var(--ac-text);
	text-decoration-color: var(--ac-text);
}

/* ---------- Przyciski ---------- */
.ac-actions {
	display: flex;
	align-items: center;
	gap: 10px;
}

.ac-btn,
.ac-btn-text {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	margin: 0;
	font-family: inherit;
	font-size: 12px;
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: .16em;
	text-transform: uppercase;
	white-space: nowrap;
	border-radius: 0;
	cursor: pointer;
	transition: background-color .25s, color .25s, border-color .25s;
}

.ac-btn {
	min-width: 148px;
	padding: 0 26px;
	background: transparent;
	border: 1px solid var(--ac-gold);
	color: var(--ac-sand);
}

.ac-btn:hover {
	background: var(--ac-gold);
	color: var(--ac-deep);
}

.ac-btn-text {
	padding: 0 14px;
	background: none;
	border: 1px solid transparent;
	color: var(--ac-muted);
	text-decoration: underline;
	text-decoration-color: rgba(167, 177, 169, .4);
	text-underline-offset: 4px;
}

.ac-btn-text:hover {
	color: var(--ac-text);
	text-decoration-color: var(--ac-text);
}

.alfa-cookies :focus-visible {
	outline: 1px solid var(--ac-sand);
	outline-offset: 4px;
}

.ac-settings-title:focus,
.ac-settings-title:focus-visible {
	outline: none;
}

/* ---------- Ustawienia ---------- */
.alfa-cookies[data-mode="settings"] {
	padding: 0 16px 16px;
}

.alfa-cookies[data-mode="settings"] .ac-card {
	max-width: 680px;
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	overflow-y: auto;
	overscroll-behavior: contain;
	border: 1px solid var(--ac-line);
	box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .75);
}

.ac-view--settings {
	padding: 30px 34px 28px;
}

.ac-settings-title {
	margin-bottom: 10px;
}

.ac-cats {
	list-style: none;
	margin: 20px 0 24px;
	padding: 0;
	border-top: 1px solid var(--ac-line-soft);
}

.ac-cat {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 24px;
	padding: 16px 0;
	border-bottom: 1px solid var(--ac-line-soft);
}

.ac-cat-text {
	display: grid;
	gap: 4px;
	min-width: 0;
}

.ac-cat-name {
	font-size: 16px;
	font-weight: 400;
	color: var(--ac-text);
	cursor: default;
}

label.ac-cat-name {
	cursor: pointer;
}

.ac-cat-desc {
	font-size: 13.5px;
	line-height: 1.55;
	color: var(--ac-muted);
}

.ac-always {
	flex: none;
	padding-top: 3px;
	font-size: 11px;
	font-weight: 500;
	letter-spacing: .18em;
	text-transform: uppercase;
	color: var(--ac-gold);
	white-space: nowrap;
}

/* Przelacznik: kwadratowy, jak reszta marki. */
.ac-switch {
	position: relative;
	flex: none;
	width: 48px;
	height: 26px;
	margin-top: 1px;
}

.ac-switch input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
	z-index: 1;
}

.ac-switch-track {
	position: absolute;
	inset: 0;
	border: 1px solid rgba(184, 160, 119, .6);
	background: transparent;
	transition: background-color .25s, border-color .25s;
}

.ac-switch-track::after {
	content: "";
	position: absolute;
	top: 4px;
	left: 4px;
	width: 16px;
	height: 16px;
	background: var(--ac-muted);
	transition: transform .25s cubic-bezier(.2, .7, .2, 1), background-color .25s;
}

.ac-switch input:checked + .ac-switch-track {
	background: var(--ac-gold);
	border-color: var(--ac-gold);
}

.ac-switch input:checked + .ac-switch-track::after {
	transform: translateX(22px);
	background: var(--ac-deep);
}

.ac-switch input:focus-visible + .ac-switch-track {
	outline: 1px solid var(--ac-sand);
	outline-offset: 4px;
}

.ac-actions--settings {
	justify-content: flex-end;
	flex-wrap: wrap;
}

/* ---------- Tablet ---------- */
@media (max-width: 960px) {
	.ac-view--intro {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.ac-view--intro .ac-actions {
		justify-content: flex-start;
	}
}

/* ---------- Telefon ---------- */
@media (max-width: 640px) {
	.ac-view--intro {
		padding: 20px 22px calc(18px + env(safe-area-inset-bottom, 0px));
	}

	.ac-desc {
		font-size: 14px;
	}

	.ac-view--intro .ac-actions,
	.ac-actions--settings {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 10px;
	}

	.ac-btn {
		min-width: 0;
		width: 100%;
		padding: 0 12px;
	}

	/* Ustawienia pod para Odrzuc / Akceptuj, na cala szerokosc. */
	.ac-view--intro .ac-btn-text {
		grid-column: 1 / -1;
		order: 3;
		min-height: 40px;
	}

	.alfa-cookies[data-mode="settings"] {
		padding: 0;
	}

	.alfa-cookies[data-mode="settings"] .ac-card {
		max-height: 88vh;
		max-height: 88dvh;
		border-left: 0;
		border-right: 0;
		border-bottom: 0;
	}

	.ac-view--settings {
		padding: 24px 22px calc(22px + env(safe-area-inset-bottom, 0px));
	}

	.ac-actions--settings [data-ac-action="save"] {
		grid-column: 1 / -1;
		order: 3;
	}

	.ac-cat {
		gap: 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ac-card,
	.ac-switch-track,
	.ac-switch-track::after,
	.ac-btn,
	.ac-btn-text {
		transition: none;
	}

	.ac-card {
		transform: none;
	}
}
