/**
 * Serena Beach Cookie Consent — стили баннера, модального окна настроек,
 * placeholder заблокированных сервисов (Google Maps) и footer-ссылок.
 *
 * Палитра темы: #001F4B / #F8F7F3 / #F1E4D1; шрифты Montserrat + Syne.
 */

/* ---------- Блокировка прокрутки при открытом модальном окне ---------- */
html.sb-cc-lock {
	overflow: hidden;
}

/*
 * КРИТИЧНО: авторские display-правила ниже перекрывают браузерное
 * [hidden]{display:none}. Явные правила возвращают hidden-элементам
 * невидимость — без них модальное окно с оверлеем постоянно закрывало
 * весь сайт (именно из-за этого система «не работала»).
 */
.serena-cookie-banner[hidden],
.sb-cc__modal[hidden] {
	display: none;
}

/* ---------- Баннер: небольшая карточка слева внизу ---------- */
.serena-cookie-banner {
	position: fixed;
	left: 24px;
	bottom: 24px;
	width: min(400px, calc(100vw - 48px));
	max-height: calc(100dvh - 48px);
	overflow-y: auto;
	overscroll-behavior: contain;
	z-index: 99999;
	background: #F8F7F3;
	color: #001F4B;
	border: 1px solid rgba(0, 31, 75, 0.12);
	border-radius: 14px;
	box-shadow: 0 16px 50px rgba(0, 31, 75, 0.14);
	padding: 22px;
	font-family: 'Montserrat', sans-serif;
	box-sizing: border-box;
}

.sb-cc__title {
	margin: 0 0 8px;
	font-family: 'Syne', sans-serif;
	font-weight: 600;
	font-size: 18px;
	line-height: 1.25;
	color: #001F4B;
}

.sb-cc__desc {
	margin: 0;
	font-size: 13px;
	line-height: 1.55;
	color: rgba(0, 31, 75, 0.8);
}

.sb-cc__links {
	margin: 10px 0 0;
	font-size: 13px;
	line-height: 1.4;
	color: rgba(0, 31, 75, 0.55);
}

.sb-cc__links a {
	color: #001F4B;
	text-decoration: underline;
	text-underline-offset: 3px;
	transition: color 0.2s ease;
}

.sb-cc__links a:hover {
	color: rgba(0, 31, 75, 0.65);
}

.sb-cc__gpc-note {
	margin: 10px 0 0;
	font-size: 12px;
	line-height: 1.45;
	color: rgba(0, 31, 75, 0.6);
}

/* ---------- Кнопки ---------- */
.sb-cc__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

/* В компактном баннере кнопки в столбик на всю ширину карточки */
.serena-cookie-banner .sb-cc__actions {
	margin-top: 16px;
	flex-direction: column;
	align-items: stretch;
	gap: 8px;
}

.serena-cookie-banner .sb-cc__btn {
	width: 100%;
	min-height: 40px;
	padding: 8px 18px;
	font-size: 13px;
}

.sb-cc__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 10px 22px;
	border-radius: 999px;
	border: 1px solid #001F4B;
	font-family: 'Montserrat', sans-serif;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.sb-cc__btn--primary {
	background: #001F4B;
	color: #fff;
}

.sb-cc__btn--primary:hover {
	background: rgba(0, 31, 75, 0.88);
}

.sb-cc__btn--secondary {
	background: transparent;
	color: #001F4B;
}

.sb-cc__btn--secondary:hover {
	background: #F1E4D1;
}

.sb-cc__btn--ghost {
	background: transparent;
	color: #001F4B;
	border-color: rgba(0, 31, 75, 0.35);
}

.sb-cc__btn--ghost:hover {
	border-color: #001F4B;
}

.sb-cc__btn:focus-visible,
.sb-cc__close:focus-visible,
.sb-cc__links a:focus-visible,
.sb-cc__switch input:focus-visible ~ .sb-cc__switch-track,
.serena-footer__legal-link:focus-visible,
.sb-cc-blocked__btn:focus-visible {
	outline: 2px solid #001F4B;
	outline-offset: 2px;
}

/* ---------- Модальное окно ---------- */
.sb-cc__modal {
	position: fixed;
	inset: 0;
	z-index: 100010;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	font-family: 'Montserrat', sans-serif;
}

.sb-cc__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 15, 40, 0.55);
}

.sb-cc__dialog {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 640px;
	max-height: min(86vh, 86dvh);
	overflow-y: auto;
	overscroll-behavior: contain;
	background: #F8F7F3;
	color: #001F4B;
	border-radius: 12px;
	padding: 28px 24px 24px;
	box-shadow: 0 30px 80px rgba(0, 15, 40, 0.35);
}

.sb-cc__close {
	position: absolute;
	top: 14px;
	right: 14px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: rgba(0, 31, 75, 0.6);
	cursor: pointer;
	transition: color 0.2s ease, background-color 0.2s ease;
}

.sb-cc__close:hover {
	color: #001F4B;
	background: #F1E4D1;
}

.sb-cc__modal-title {
	margin: 0 32px 10px 0;
	font-family: 'Syne', sans-serif;
	font-weight: 600;
	font-size: 24px;
	line-height: 1.2;
}

.sb-cc__modal-desc {
	margin: 0 0 20px;
	font-size: 14px;
	line-height: 1.55;
	color: rgba(0, 31, 75, 0.8);
}

/* ---------- Категории ---------- */
.sb-cc__categories {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.sb-cc__category {
	background: #fff;
	border: 1px solid rgba(0, 31, 75, 0.1);
	border-radius: 10px;
	padding: 14px 16px;
}

.sb-cc__category-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.sb-cc__category-title {
	font-family: 'Syne', sans-serif;
	font-weight: 600;
	font-size: 15px;
	line-height: 1.3;
}

.sb-cc__category-desc {
	margin: 8px 0 0;
	font-size: 13px;
	line-height: 1.5;
	color: rgba(0, 31, 75, 0.65);
}

/* ---------- Переключатель ---------- */
.sb-cc__switch {
	position: relative;
	display: inline-flex;
	flex-shrink: 0;
	cursor: pointer;
}

.sb-cc__switch input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.sb-cc__switch-track {
	display: inline-block;
	width: 46px;
	height: 26px;
	border-radius: 999px;
	background: rgba(0, 31, 75, 0.22);
	position: relative;
	transition: background-color 0.25s ease;
}

.sb-cc__switch-track::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	border-radius: 999px;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 15, 40, 0.35);
	transition: transform 0.25s ease;
}

.sb-cc__switch input:checked ~ .sb-cc__switch-track {
	background: #001F4B;
}

.sb-cc__switch input:checked ~ .sb-cc__switch-track::after {
	transform: translateX(20px);
}

.sb-cc__switch input:disabled ~ .sb-cc__switch-track {
	background: rgba(0, 31, 75, 0.55);
	cursor: not-allowed;
}

.sb-cc__links--modal {
	margin-top: 18px;
}

.sb-cc__actions--modal {
	margin-top: 16px;
}

/* ---------- Placeholder заблокированных сервисов (Google Maps) ---------- */
.sb-cc-blocked {
	position: relative;
	width: 100%;
	height: 100%;
	min-height: inherit;
	background: #F1E4D1;
}

.sb-cc-blocked iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

.sb-cc-blocked__overlay {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	text-align: center;
	padding: 24px;
	background: #F1E4D1;
	color: #001F4B;
	font-family: 'Montserrat', sans-serif;
}

.sb-cc-blocked.is-allowed .sb-cc-blocked__overlay {
	display: none;
}

.sb-cc-blocked__title {
	margin: 0;
	font-family: 'Syne', sans-serif;
	font-weight: 600;
	font-size: 20px;
	line-height: 1.25;
}

.sb-cc-blocked__text {
	margin: 0;
	max-width: 420px;
	font-size: 14px;
	line-height: 1.55;
	color: rgba(0, 31, 75, 0.75);
}

.sb-cc-blocked__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-top: 6px;
	min-height: 46px;
	padding: 12px 28px;
	border-radius: 999px;
	border: 1px solid #001F4B;
	background: #001F4B;
	color: #fff;
	font-family: 'Montserrat', sans-serif;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: background-color 0.25s ease, color 0.25s ease;
}

.sb-cc-blocked__btn:hover {
	background: transparent;
	color: #001F4B;
}

/* ---------- Footer: настройки cookies + Do Not Sell ---------- */
.serena-footer__legal {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 20px;
}

.serena-footer__legal-link {
	background: none;
	border: 0;
	padding: 0;
	font-family: 'Mulish', sans-serif;
	font-weight: 600;
	font-size: 13px;
	line-height: 1.3;
	color: rgba(254, 247, 229, 0.75);
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
	transition: color 0.2s ease;
}

.serena-footer__legal-link:hover {
	color: #FEF7E5;
}

@media (max-width: 479.98px) {
	.serena-footer__legal {
		justify-content: center;
	}
}

/* ---------- Адаптив ---------- */
@media (max-width: 767.98px) {
	.sb-cc__actions--modal {
		flex-direction: column;
		align-items: stretch;
	}

	.sb-cc__actions--modal .sb-cc__btn {
		width: 100%;
	}

	.sb-cc__dialog {
		padding: 24px 16px 16px;
	}
}

/* Телефоны: отступы от обоих краёв, чуть плотнее */
@media (max-width: 575px) {
	.serena-cookie-banner {
		left: 12px;
		right: 12px;
		bottom: 12px;
		width: auto;
		max-height: calc(100dvh - 24px);
		padding: 18px;
	}
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
	.sb-cc__btn,
	.sb-cc__close,
	.sb-cc__links a,
	.sb-cc__switch-track,
	.sb-cc__switch-track::after,
	.sb-cc-blocked__btn,
	.serena-footer__legal-link {
		transition: none;
	}
}
