/**
 * RezWeb Cookie Consent — стили баннера.
 * Классы сохранены с версии 1.2 для совместимости с пользовательскими правками CSS.
 *
 * Всё, что относится к внутренностям баннера, селектится через
 * `.rezweb-cookie-banner ...`: иначе тема сайта со своими правилами для
 * `button`, `p`, `a` перебивает оформление.
 */

.rezweb-cookie-banner {
	--rezweb-cc-accent: #0073aa;
	position: fixed;
	z-index: 99999;
	box-sizing: border-box;
	width: calc(100% - 40px);
	max-width: 500px;
	padding: 20px 24px;
	display: none;
	background: #fff;
	color: #333;
	border: 0;
	border-radius: 8px;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	font-size: 14px;
	line-height: 1.5;
	text-align: left;
}

.rezweb-cookie-banner.active {
	display: block;
}

/*
 * Контейнер получает фокус программно (для скринридеров), поэтому рамка
 * вокруг него не нужна: иначе обводка видна при каждом показе баннера.
 * Обводка кнопок при этом сохраняется (см. :focus-visible ниже).
 */
.rezweb-cookie-banner:focus,
.rezweb-cookie-banner:focus-visible {
	outline: none;
}

.rezweb-cookie-banner.active .rezweb-cookie-content {
	animation: rezweb-cc-in 0.28s ease both;
}

@keyframes rezweb-cc-in {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* Позиции. Центр использует transform, поэтому анимация живёт на контенте,
   иначе она бы перезаписала центрирование. */
.rezweb-cookie-center {
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	max-width: 480px;
}

.rezweb-cookie-fullwidth {
	right: 0;
	bottom: 0;
	left: 0;
	width: 100%;
	max-width: none;
	padding: 16px 24px;
	border-radius: 0;
}

.rezweb-cookie-left {
	bottom: 20px;
	left: 20px;
}

.rezweb-cookie-right {
	right: 20px;
	bottom: 20px;
}

.rezweb-cookie-banner .rezweb-cookie-content {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.rezweb-cookie-fullwidth .rezweb-cookie-content {
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
}

.rezweb-cookie-banner .rezweb-cookie-message {
	margin: 0;
	padding: 0;
	color: inherit;
}

.rezweb-cookie-banner .rezweb-cookie-message a {
	color: var(--rezweb-cc-accent);
	text-decoration: underline;
}

.rezweb-cookie-banner .rezweb-cookie-buttons {
	display: flex;
	flex-wrap: wrap;
	flex-shrink: 0;
	gap: 10px;
}

.rezweb-cookie-banner .rezweb-cookie-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 38px;
	margin: 0;
	padding: 8px 18px;
	font: inherit;
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	color: var(--rezweb-cc-accent);
	background: transparent;
	border: 1px solid var(--rezweb-cc-accent);
	border-radius: 6px;
	box-shadow: none;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.rezweb-cookie-banner .rezweb-cookie-btn.accept {
	color: #fff;
	background: var(--rezweb-cc-accent);
	border-color: var(--rezweb-cc-accent);
}

.rezweb-cookie-banner .rezweb-cookie-btn.accept:hover {
	opacity: 0.9;
}

.rezweb-cookie-banner .rezweb-cookie-btn:hover,
.rezweb-cookie-banner .rezweb-cookie-btn:active {
	color: #fff;
	background: var(--rezweb-cc-accent);
}

/* У accept при наведении остаётся заливка, цвет текста не должен «прыгать». */
.rezweb-cookie-banner .rezweb-cookie-btn.accept:hover,
.rezweb-cookie-banner .rezweb-cookie-btn.accept:active {
	color: #fff;
	background: var(--rezweb-cc-accent);
}

.rezweb-cookie-banner .rezweb-cookie-btn:focus-visible {
	outline: 2px solid #111;
	outline-offset: 2px;
}

.rezweb-cookie-banner .rezweb-cookie-options {
	margin-top: 2px;
	padding: 14px;
	background: #f7f7f7;
	border: 1px solid #ddd;
	border-radius: 6px;
}

.rezweb-cookie-banner .rezweb-cookie-options[hidden] {
	display: none;
}

.rezweb-cookie-banner .rezweb-cookie-categories {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0;
	padding: 0;
	border: 0;
}

.rezweb-cookie-banner .rezweb-cookie-categories label {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	font-weight: 400;
	color: inherit;
	cursor: pointer;
}

.rezweb-cookie-banner .rezweb-cookie-categories input[type="checkbox"] {
	margin: 0;
}

.rezweb-cookie-banner .rezweb-cookie-hint {
	color: #666;
	font-size: 12px;
}

.rezweb-cookie-banner .rezweb-cookie-options .save-customize {
	width: 100%;
	margin-top: 12px;
}

/* Скрытый заголовок группы: только для скринридеров. */
.rezweb-cookie-banner .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Режим предпросмотра в админке: тот же вид, но в потоке документа. */
.rezweb-cookie-banner.rezweb-cookie-preview {
	position: relative;
	top: auto;
	right: auto;
	bottom: auto;
	left: auto;
	z-index: auto;
	display: block;
	width: 100%;
	max-width: 480px;
	margin: 0 auto;
	transform: none;
	box-shadow: none;
	border: 1px solid #ddd;
}

.rezweb-cookie-preview .rezweb-cookie-content {
	animation: none;
}

@media (max-width: 600px) {

	.rezweb-cookie-banner {
		width: calc(100% - 24px);
		padding: 16px;
	}

	.rezweb-cookie-left,
	.rezweb-cookie-right {
		right: 12px;
		bottom: 12px;
		left: 12px;
		width: calc(100% - 24px);
	}

	.rezweb-cookie-fullwidth .rezweb-cookie-content {
		flex-direction: column;
		align-items: flex-start;
	}

	.rezweb-cookie-banner .rezweb-cookie-buttons {
		width: 100%;
	}

	.rezweb-cookie-banner .rezweb-cookie-btn {
		flex: 1 1 auto;
	}
}

@media (prefers-reduced-motion: reduce) {

	.rezweb-cookie-banner.active .rezweb-cookie-content {
		animation: none;
	}
}
