/* ============================================================
   CSS-ПЕРЕМЕННЫЕ
   ============================================================ */
:root {
	--artcly-cc-font-size: 14px;
	--artcly-cc-line-height: 1.5;
	--artcly-cc-font-family:
		-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue",
		sans-serif;

	--artcly-cc-banner-bg: #ffffff;
	--artcly-cc-banner-color: #1f2937;
	--artcly-cc-modal-bg: #ffffff;
	--artcly-cc-modal-color: #1f2937;
	--artcly-cc-backdrop: rgba(17, 24, 39, 0.55);

	--artcly-cc-container-width: 1200px;
	--artcly-cc-modal-width: 560px;
	--artcly-cc-modal-radius: 14px;
	--artcly-cc-btn-radius: 8px;

	/* Акцент 1 — Принять (синий) */
	--artcly-cc-accent: #2563eb;
	--artcly-cc-accent-hover: #1d4ed8;

	/* Акцент 2 — Отклонить (тёмно-серый, равнозначный по весу) */
	--artcly-cc-accent-secondary: var(--artcly-cc-accent);
	--artcly-cc-accent-secondary-hover: var(--artcly-cc-accent-hover);

	/* Нейтральный — Настроить / Сохранить */
	--artcly-cc-neutral-bg: #f3f4f6;
	--artcly-cc-neutral-border: #e5e7eb;
	--artcly-cc-neutral-hover: #e5e7eb;
	--artcly-cc-neutral-text: #374151;

	/* Тоггл */
	--artcly-cc-toggle-width: 44px;
	--artcly-cc-toggle-height: 24px;
	--artcly-cc-toggle-bg: #d1d5db;
	--artcly-cc-toggle-bg-active: var(--artcly-cc-accent);
	--artcly-cc-toggle-dot: #ffffff;
	--artcly-cc-toggle-disabled-bg: var(--artcly-cc-accent);

	/* Чекбокс */
	--artcly-cc-chk-size: 20px;
	--artcly-cc-chk-radius: 4px;
	--artcly-cc-chk-border: #9ca3af;
	--artcly-cc-chk-bg: #ffffff;
	--artcly-cc-chk-bg-active: var(--artcly-cc-accent);
	--artcly-cc-chk-disabled-bg: var(--artcly-cc-accent);

	--artcly-cc-border: #e5e7eb;
	--artcly-cc-muted: #6b7280;
}

/* ============================================================
   БАЗОВАЯ ТИПОГРАФИКА
   ============================================================ */
.cookie-banner,
.cookie-modal-dialog {
	font-family: var(--artcly-cc-font-family);
	font-size: var(--artcly-cc-font-size);
	line-height: var(--artcly-cc-line-height);
	color: var(--artcly-cc-modal-color);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   БАННЕР
   ============================================================ */
.cookie-banner {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 999999;
	background: var(--artcly-cc-banner-bg);
	color: var(--artcly-cc-banner-color);
	padding: 20px 24px;
	box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.08);

	opacity: 0;
	visibility: hidden;
	transform: translateY(100%);
	transition:
		opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
		transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
		visibility 0s linear 0.35s;
}

.cookie-banner.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	transition:
		opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
		transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
		visibility 0s linear 0s;
}

.cookie-banner-container {
	max-width: var(--artcly-cc-container-width);
	margin: 0 auto;
	display: flex;
	align-items: center;
	gap: 24px;
	flex-wrap: wrap;
}

.cookie-banner-content {
	flex: 1 1 400px;
	min-width: 0;
}

.cookie-banner-title {
	margin: 0 0 8px;
	font-size: 18px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--artcly-cc-banner-color);
}

.cookie-banner-description {
	margin: 0;
	color: var(--artcly-cc-muted);
}

.cookie-banner-description p {
	margin: 0 0 6px;
}

.cookie-banner-description p:last-child {
	margin-bottom: 0;
}

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

.cookie-banner-description a:hover {
	text-decoration: none;
}

/* ============================================================
   БЛОК КНОПОК
   ============================================================ */
.cookie-actions,
.cookie-modal-actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	flex-shrink: 0;
	flex-direction: column;
    flex: 0 1 20%;
}

/* ============================================================
   БАЗОВЫЙ СТИЛЬ КНОПКИ
   ============================================================ */
.cookie-btn {
	font-family: inherit;
	font-size: var(--artcly-cc-font-size);
	font-weight: 500;
	padding: 10px 20px;
	border-radius: var(--artcly-cc-btn-radius);
	border: 1px solid transparent;
	cursor: pointer;
	line-height: 1.2;
	white-space: nowrap;
	text-decoration: none;
	display: inline-block;
	text-align: center;
	transition:
		background-color 0.2s ease,
		color 0.2s ease,
		border-color 0.2s ease,
		transform 0.1s ease;
}

.cookie-btn:active {
	transform: scale(0.97);
}

/* ============================================================
   РАВНОЗНАЧНЫЕ КНОПКИ — ПРИНЯТЬ и ОТКЛОНИТЬ
   По закону (GDPR / 152-ФЗ) они должны быть визуально
   одинаково весомыми.
   ============================================================ */

/* Принять — синий акцент */
.cookie-btn-accept {
	background-color: var(--artcly-cc-accent);
	color: #ffffff;
	border-color: var(--artcly-cc-accent);
}

.cookie-btn-accept:hover {
	background-color: var(--artcly-cc-accent-hover);
	border-color: var(--artcly-cc-accent-hover);
}

/* Отклонить — тёмно-серый акцент (равнозначный по весу) */
.cookie-btn-decline {
	background-color: var(--artcly-cc-accent-secondary);
	color: #ffffff;
	border-color: var(--artcly-cc-accent-secondary);
}

.cookie-btn-decline:hover {
	background-color: var(--artcly-cc-accent-secondary-hover);
	border-color: var(--artcly-cc-accent-secondary-hover);
}

/* ============================================================
   НЕЙТРАЛЬНАЯ — НАСТРОИТЬ / СОХРАНИТЬ
   ============================================================ */
.cookie-btn-settings {
	background-color: var(--artcly-cc-neutral-bg);
	color: var(--artcly-cc-neutral-text);
	border-color: var(--artcly-cc-neutral-border);
}

.cookie-btn-settings:hover {
	background-color: var(--artcly-cc-neutral-hover);
}

/* ============================================================
   МОДАЛЬНОЕ ОКНО
   ============================================================ */
.cookie-modal {
	position: fixed;
	inset: 0;
	z-index: 9999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	box-sizing: border-box;

	background: var(--artcly-cc-backdrop);
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);

	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition:
		opacity 0.3s ease,
		visibility 0s linear 0.3s;
}

.cookie-modal.is-visible {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transition:
		opacity 0.3s ease,
		visibility 0s linear 0s;
}

.cookie-modal-backdrop {
	position: absolute;
	inset: 0;
}

.cookie-modal-dialog-container {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: var(--artcly-cc-modal-width);
	max-height: calc(100dvh - 40px);
	display: flex;
	align-items: center;
	justify-content: center;
}

.cookie-modal-dialog {
	position: relative;
	background: var(--artcly-cc-modal-bg);
	color: var(--artcly-cc-modal-color);
	padding: 28px;
	border-radius: var(--artcly-cc-modal-radius);
	width: 100%;
	max-height: calc(100dvh - 40px);
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);

	transform: scale(0.95) translateY(10px);
	opacity: 0;
	transition:
		transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
		opacity 0.3s ease;
}

.cookie-modal.is-visible .cookie-modal-dialog {
	transform: scale(1) translateY(0);
	opacity: 1;
}

.cookie-modal-close {
	position: absolute;
	top: 14px;
	right: 16px;
	width: 32px;
	height: 32px;
	background: transparent;
	border: none;
	font-size: 26px;
	line-height: 1;
	color: var(--artcly-cc-muted);
	cursor: pointer;
	border-radius: 6px;
	transition:
		background-color 0.2s ease,
		color 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}

.cookie-modal-close:hover {
	background-color: var(--artcly-cc-neutral-bg);
	color: var(--artcly-cc-modal-color);
}

.cookie-modal-title {
	margin: 0 0 12px;
	padding-right: 32px;
	font-size: 18px;
	font-weight: 600;
	line-height: 1.3;
}

.cookie-modal-top-text {
	margin-bottom: 20px;
	color: var(--artcly-cc-muted);
}

.cookie-modal-top-text p {
	margin: 0 0 8px;
}

.cookie-modal-top-text p:last-child {
	margin-bottom: 0;
}

/* ============================================================
   СПИСОК НАСТРОЕК
   ============================================================ */
.cookie-settings-list {
	margin-bottom: 24px;
}

.cookie-setting-row {
	padding: 14px 0;
	border-bottom: 1px solid var(--artcly-cc-border);
}

.cookie-setting-row:first-child {
	padding-top: 0;
}

.cookie-setting-row:last-child {
	border-bottom: none;
	padding-bottom: 0;
}

.cookie-setting-desc {
	display: block;
	margin: 0;
	color: var(--artcly-cc-muted);
	font-size: 13px;
	line-height: 1.5;
}

/* ============================================================
   РЕЖИМ ТОГГЛОВ (СЛАЙДЕРОВ)
   ============================================================ */
.cookie-setting-row--toggle {
	margin: 0;
	padding: 14px 0;
	border-bottom: 1px solid var(--artcly-cc-border);
}

.cookie-setting-row--toggle:first-child {
	padding-top: 0;
}

.cookie-setting-row--toggle:last-child {
	border-bottom: none;
	padding-bottom: 0;
}

.cookie-toggle-label {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	cursor: pointer;
	user-select: none;
}

.cookie-toggle-label input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	pointer-events: none;
	width: 0;
	height: 0;
}

.cookie-toggle-slider {
	position: relative;
	flex-shrink: 0;
	width: var(--artcly-cc-toggle-width);
	height: var(--artcly-cc-toggle-height);
	background-color: var(--artcly-cc-toggle-bg);
	border-radius: calc(var(--artcly-cc-toggle-height) / 2);
	transition: background-color 0.25s ease;
	margin-top: 2px;
}

.cookie-toggle-slider::after {
	content: "";
	position: absolute;
	top: 2px;
	left: 2px;
	width: calc(var(--artcly-cc-toggle-height) - 4px);
	height: calc(var(--artcly-cc-toggle-height) - 4px);
	background-color: var(--artcly-cc-toggle-dot);
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
	transition: transform 0.25s ease;
}

.cookie-toggle-label input:checked + .cookie-toggle-slider {
	background-color: var(--artcly-cc-toggle-bg-active);
}

.cookie-toggle-label input:checked + .cookie-toggle-slider::after {
	transform: translateX(calc(var(--artcly-cc-toggle-width) - var(--artcly-cc-toggle-height)));
}

.cookie-toggle-label input:disabled + .cookie-toggle-slider {
	background-color: var(--artcly-cc-toggle-disabled-bg);
	cursor: not-allowed;
	opacity: 0.5;
}

.cookie-toggle-label input:disabled ~ .cookie-toggle-text strong {
	cursor: not-allowed;
}

.cookie-toggle-label:has(input:disabled) {
	cursor: default;
}

.cookie-toggle-text {
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex: 1;
}

.cookie-toggle-text strong {
	font-size: 15px;
	font-weight: 600;
	color: var(--artcly-cc-modal-color);
}

.cookie-toggle-text .cookie-setting-desc {
	font-size: 13px;
	color: var(--artcly-cc-muted);
	line-height: 1.5;
}

/* ============================================================
   РЕЖИМ КЛАССИЧЕСКИХ ЧЕКБОКСОВ
   ============================================================ */
.cookie-setting-row--checkbox {
	margin: 0;
	padding: 14px 0;
	border-bottom: 1px solid var(--artcly-cc-border);
}

.cookie-setting-row--checkbox:first-child {
	padding-top: 0;
}

.cookie-setting-row--checkbox:last-child {
	border-bottom: none;
	padding-bottom: 0;
}

.cookie-setting-row--checkbox label {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	cursor: pointer;
	position: relative;
}

.cookie-setting-row--checkbox input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	pointer-events: none;
	width: 0;
	height: 0;
}

.cookie-checkbox-icon {
	flex-shrink: 0;
	width: var(--artcly-cc-chk-size);
	height: var(--artcly-cc-chk-size);
	border: 1.5px solid var(--artcly-cc-chk-border);
	border-radius: var(--artcly-cc-chk-radius);
	background: var(--artcly-cc-chk-bg);
	position: relative;
	transition:
		background 0.15s ease,
		border-color 0.15s ease;
	margin-top: 2px;
}

.cookie-checkbox-icon::after {
	content: "";
	position: absolute;
	left: 6px;
	top: 2px;
	width: 5px;
	height: 10px;
	border: solid #ffffff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg) scale(0);
	opacity: 0;
	transition:
		transform 0.15s ease,
		opacity 0.15s ease;
}

.cookie-setting-row--checkbox input:checked ~ .cookie-checkbox-icon {
	background: var(--artcly-cc-chk-bg-active);
	border-color: var(--artcly-cc-chk-bg-active);
}

.cookie-setting-row--checkbox input:checked ~ .cookie-checkbox-icon::after {
	opacity: 1;
	transform: rotate(45deg) scale(1);
}

.cookie-setting-row--checkbox input:disabled ~ .cookie-checkbox-icon {
	background: var(--artcly-cc-chk-disabled-bg);
	border-color: var(--artcly-cc-chk-border);
	cursor: not-allowed;
	opacity: 0.5;
}

.cookie-checkbox-text {
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex: 1;
}

.cookie-checkbox-text strong {
	font-size: 15px;
	font-weight: 600;
	color: var(--artcly-cc-modal-color);
}

.cookie-checkbox-text .cookie-setting-desc {
	font-size: 13px;
	color: var(--artcly-cc-muted);
	line-height: 1.5;
}

/* ============================================================
   ДЕЙСТВИЯ МОДАЛЬНОГО ОКНА
   ============================================================ */
.cookie-modal-actions {
	padding-top: 20px;
	border-top: 1px solid var(--artcly-cc-border);
}

/* ============================================================
   ПЛЕЙСХОЛДЕР IFRAME
   ============================================================ */
.artcly-iframe-placeholder {
	width: 100%;
	min-height: 220px;
	background-color: #f9fafb;
	border: 1px dashed var(--artcly-cc-border);
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 24px;
	margin-bottom: 15px;
}

.artcly-iframe-msg {
	font-family: var(--artcly-cc-font-family);
	font-size: var(--artcly-cc-font-size);
	color: var(--artcly-cc-muted);
	max-width: 360px;
}

.artcly-iframe-msg a.cookie-btn {
	display: inline-block;
	margin-top: 12px;
	text-decoration: none;
}

/* ============================================================
   АДАПТИВНОСТЬ — ПЛАНШЕТ
   ============================================================ */
@media (max-width: 768px) {
	.cookie-banner-container {
		flex-direction: column;
		align-items: stretch;
		gap: 16px;
		text-align: left;
	}
	
	.cookie-banner-content {
   		flex: auto;
	}
	
	.cookie-actions {
		width: 100%;
	}

	.cookie-btn {
		flex: 1 1 auto;
		text-align: center;
	}
}

/* ============================================================
   АДАПТИВНОСТЬ — МОБИЛЬНЫЕ
   ============================================================ */
@media (max-width: 600px) {
	.cookie-banner {
		padding: 16px;
	}

	.cookie-banner-title {
		font-size: 16px;
	}

	.cookie-modal {
		padding: 0;
		align-items: flex-end;
	}

	.cookie-modal-dialog-container {
		max-height: 92dvh;
		max-width: 100%;
	}

	.cookie-modal-dialog {
		padding: 22px 18px;
		border-radius: var(--artcly-cc-modal-radius) var(--artcly-cc-modal-radius) 0 0;
		max-height: 92dvh;
	}

	.cookie-modal-close {
		top: 10px;
		right: 10px;
	}

	.cookie-modal-title {
		font-size: 17px;
		padding-right: 28px;
	}

	.cookie-actions,
	.cookie-modal-actions {
		flex-direction: column;
		gap: 8px;
	}

	.cookie-btn {
		width: 100%;
		padding: 12px 16px;
	}

	.cookie-setting-desc {
		font-size: 12.5px;
	}
}

@media (max-height: 500px) and (max-width: 600px) {
	.cookie-modal {
		align-items: center;
	}

	.cookie-modal-dialog-container {
		max-height: 95dvh;
	}

	.cookie-modal-dialog {
		border-radius: var(--artcly-cc-modal-radius);
		max-height: 95dvh;
	}
}

/* Блокировка скролла body при открытой модалке */
body.cookie-modal-open {
	overflow: hidden;
}
