/**
 * CoCookie Banner CSS
 *
 * All selectors prefixed with .cocookie- to prevent theme conflicts.
 * BEM naming convention. CSS custom properties for theming.
 */

/* === Banner === */
.cocookie-banner {
	--cocookie-bg: #ffffff;
	--cocookie-text: #333333;
	--cocookie-accent: #29A166;
	--cocookie-accent-text: #ffffff;
	--cocookie-reject-bg: #f0f0f0;
	--cocookie-reject-text: #333333;

	position: fixed;
	left: 0;
	right: 0;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
	font-size: 14px;
	line-height: 1.5;
	color: var(--cocookie-text);
}

.cocookie-banner--bottom { bottom: 0; }
.cocookie-banner--top { top: 0; }

.cocookie-banner--center {
	top: 50%;
	left: 50%;
	right: auto;
	transform: translate(-50%, -50%);
	max-width: 540px;
	width: 92%;
	max-height: 88vh;
	border-radius: 16px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

/* Overlay for center modal */
.cocookie-banner__overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.45);
	z-index: -1;
	backdrop-filter: blur(2px);
}

/* Inner container */
.cocookie-banner__inner {
	background: var(--cocookie-bg);
	padding: 28px 32px;
	box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
	overflow-y: auto;
}

.cocookie-banner--top .cocookie-banner__inner {
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.cocookie-banner--center .cocookie-banner__inner {
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
	border-radius: 16px;
}

/* Logo */
.cocookie-banner__logo {
	display: block;
	max-height: 36px;
	width: auto;
	margin-bottom: 16px;
}

/* Title */
.cocookie-banner__title {
	margin: 0 0 8px;
	font-size: 20px;
	font-weight: 700;
	color: var(--cocookie-text);
	letter-spacing: -0.3px;
}

/* Text */
.cocookie-banner__text {
	margin: 0 0 20px;
	font-size: 14px;
	color: #666;
	line-height: 1.6;
}

.cocookie-banner__policy-link {
	color: var(--cocookie-accent);
	text-decoration: none;
}

.cocookie-banner__policy-link:hover {
	text-decoration: underline;
}

/* Consent info */
.cocookie-banner__consent-info {
	margin: 4px 0 16px;
	padding: 12px 16px;
	background: #f8f9fa;
	border-radius: 8px;
	font-size: 12px;
	color: #666;
	line-height: 1.7;
	border: 1px solid #eee;
}

.cocookie-banner__consent-info p { margin: 2px 0; }
.cocookie-banner__consent-info strong { color: #444; font-weight: 600; }

/* DNT notice */
.cocookie-banner__dnt {
	margin: 0 0 16px;
	padding: 10px 14px;
	background: #fffbeb;
	color: #92730c;
	border-radius: 8px;
	font-size: 13px;
	border: 1px solid #fde68a;
}

/* === Tabs === */
.cocookie-banner__tabs {
	display: flex;
	gap: 0;
	border-bottom: 2px solid #eee;
	margin-bottom: 16px;
}

.cocookie-banner__tab {
	padding: 10px 18px;
	border: none;
	border-bottom: 2px solid transparent;
	border-radius: 0;
	background: none !important;
	font-size: 13px;
	font-weight: 600;
	color: #888;
	cursor: pointer;
	margin-bottom: -2px;
	transition: color 0.2s, border-color 0.2s;
	white-space: nowrap;
	box-shadow: none;
	outline: none;
	text-decoration: none;
	line-height: 1.4;
}

.cocookie-banner__tab:hover,
.cocookie-banner__tab:focus {
	color: #555;
	background: none !important;
	box-shadow: none;
	border-color: transparent;
	border-bottom-color: #ccc;
}

.cocookie-banner__tab--active,
.cocookie-banner__tab--active:hover,
.cocookie-banner__tab--active:focus {
	color: var(--cocookie-accent, #29A166);
	background: none !important;
	border-bottom-color: var(--cocookie-accent, #29A166);
	box-shadow: none;
}

/* Panels */
.cocookie-banner__panel {
	min-height: 60px;
}

/* === About cookies === */
.cocookie-banner__about {
	font-size: 13px;
	line-height: 1.7;
	color: #555;
	max-height: 320px;
	overflow-y: auto;
}

.cocookie-banner__about p {
	margin: 0 0 12px;
}

.cocookie-banner__about-title {
	font-size: 14px;
	font-weight: 700;
	color: #222;
	margin: 16px 0 6px;
}

.cocookie-banner__about-title:first-child {
	margin-top: 0;
}

.cocookie-banner__about-types {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 12px;
}

.cocookie-banner__about-type {
	background: #f8f9fa;
	border: 1px solid #eee;
	border-radius: 8px;
	padding: 12px 14px;
}

.cocookie-banner__about-type strong {
	display: block;
	font-size: 13px;
	color: #333;
	margin-bottom: 4px;
}

.cocookie-banner__about-type p {
	margin: 0;
	font-size: 12px;
	color: #666;
	line-height: 1.6;
}

/* === Buttons === */
.cocookie-banner__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 20px;
}

.cocookie-btn {
	padding: 12px 24px;
	border: none !important;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
	letter-spacing: 0.1px;
	line-height: 1;
	text-transform: none;
	text-decoration: none;
	outline: none;
}

.cocookie-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.cocookie-btn:active {
	transform: translateY(0);
	box-shadow: none;
}

.cocookie-btn--accept,
.cocookie-btn--accept:hover,
.cocookie-btn--accept:focus,
.cocookie-btn--save,
.cocookie-btn--save:hover,
.cocookie-btn--save:focus {
	background: var(--cocookie-accent) !important;
	color: var(--cocookie-accent-text) !important;
}

.cocookie-btn--reject,
.cocookie-btn--reject:focus {
	background: var(--cocookie-reject-bg) !important;
	color: var(--cocookie-reject-text) !important;
	border: 1px solid #e0e0e0 !important;
}

.cocookie-btn--reject:hover {
	background: #ebebeb !important;
	color: var(--cocookie-reject-text) !important;
}

.cocookie-btn--settings,
.cocookie-btn--settings:focus {
	background: transparent !important;
	color: #888 !important;
	text-decoration: underline;
	text-underline-offset: 3px;
	padding: 12px 14px;
	font-weight: 500;
	box-shadow: none !important;
}

.cocookie-btn--settings:hover {
	box-shadow: none !important;
	transform: none;
	background: transparent !important;
	color: #555 !important;
}

/* === Details / Categories === */
.cocookie-banner__details {
	margin-top: 20px;
	border-top: 1px solid #f0f0f0;
	padding-top: 16px;
	max-height: 320px;
	overflow-y: auto;
}

.cocookie-category {
	border: 1px solid #eaeaea;
	border-radius: 10px;
	margin-bottom: 8px;
	background: #fafbfc;
	overflow: hidden;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.cocookie-category:last-child { margin-bottom: 0; }
.cocookie-category:hover { border-color: #ddd; }

.cocookie-category__header {
	display: flex;
	align-items: center;
	padding: 14px 16px;
	gap: 10px;
}

.cocookie-category__label {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 600;
	font-size: 14px;
	cursor: default;
	flex: 1;
	min-width: 0;
	color: #222;
}

/* Custom toggle switch */
.cocookie-toggle {
	position: relative;
	display: inline-block;
	width: 40px;
	height: 22px;
	flex-shrink: 0;
}

.cocookie-toggle__input {
	opacity: 0;
	width: 0;
	height: 0;
	position: absolute;
}

.cocookie-toggle__slider {
	position: absolute;
	cursor: pointer;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: #ccc;
	border-radius: 22px;
	transition: background 0.25s;
}

.cocookie-toggle__slider::before {
	content: '';
	position: absolute;
	height: 16px;
	width: 16px;
	left: 3px;
	bottom: 3px;
	background: white;
	border-radius: 50%;
	transition: transform 0.25s;
	box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.cocookie-toggle__input:checked + .cocookie-toggle__slider {
	background: var(--cocookie-accent);
}

.cocookie-toggle__input:checked + .cocookie-toggle__slider::before {
	transform: translateX(18px);
}

.cocookie-toggle__input:disabled + .cocookie-toggle__slider {
	opacity: 0.5;
	cursor: default;
}

.cocookie-toggle__input:focus-visible + .cocookie-toggle__slider {
	outline: 2px solid var(--cocookie-accent);
	outline-offset: 2px;
}

.cocookie-category__name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cocookie-category__required {
	font-size: 11px;
	color: #999;
	font-weight: 400;
}

.cocookie-category__expand {
	display: flex;
	align-items: center;
	gap: 6px;
	background: none;
	border: none;
	cursor: pointer;
	padding: 4px;
	color: #999;
	font-size: 12px;
}

.cocookie-category__expand:hover {
	color: #666;
}

.cocookie-category__arrow {
	font-size: 10px;
	transition: transform 0.2s;
}

.cocookie-category__count {
	white-space: nowrap;
	font-weight: 400;
}

.cocookie-category__body {
	padding: 0 16px 14px;
	border-top: 1px solid #f0f0f0;
}

.cocookie-category__desc {
	margin: 12px 0 10px;
	font-size: 13px;
	color: #777;
	line-height: 1.5;
}

/* Cookie detail table */
.cocookie-category__table {
	width: 100%;
	border-collapse: collapse;
	font-size: 12px;
	border-radius: 6px;
	overflow: hidden;
}

.cocookie-category__table th,
.cocookie-category__table td {
	text-align: left;
	padding: 6px 10px;
	border-bottom: 1px solid #f0f0f0;
	color: #666;
}

.cocookie-category__table th {
	font-weight: 600;
	color: #444;
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	background: #f3f4f6;
	padding: 8px 10px;
}

.cocookie-category__table tr:last-child td { border-bottom: none; }

.cocookie-category__table td:first-child {
	font-family: "SFMono-Regular", "Menlo", monospace;
	font-size: 11px;
	color: #222;
}

.cocookie-category__table code {
	background: none;
	padding: 0;
	font-size: inherit;
}

/* === Floating button === */
.cocookie-float {
	position: fixed;
	bottom: 20px;
	left: 20px;
	z-index: 999997;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: none;
	background: #fff;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
	font-size: 22px;
	line-height: 48px;
	text-align: center;
	cursor: pointer;
	padding: 0;
	transition: transform 0.2s, box-shadow 0.2s;
}

.cocookie-float:hover {
	transform: scale(1.1);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
}

.cocookie-float img {
	width: 24px;
	height: 24px;
	vertical-align: middle;
}

/* === Iframe placeholder === */
.cocookie-iframe-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f0f1f3;
	border: 1px solid #ddd;
	border-radius: 8px;
	min-height: 200px;
	position: relative;
	overflow: hidden;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 14px;
	color: #555;
	box-sizing: border-box;
}

.cocookie-iframe-placeholder__inner {
	text-align: center;
	padding: 24px 20px;
	max-width: 360px;
}

.cocookie-iframe-placeholder__inner p { margin: 0 0 12px; line-height: 1.5; }
.cocookie-iframe-placeholder__icon { display: block; font-size: 40px; margin-bottom: 12px; opacity: 0.5; }

.cocookie-iframe-placeholder__btn {
	display: inline-block;
	padding: 10px 22px;
	border: none;
	border-radius: 6px;
	background: var(--cocookie-accent, #29A166);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s, transform 0.15s;
	margin-top: 4px;
}

.cocookie-iframe-placeholder__btn:hover {
	filter: brightness(0.9);
	transform: translateY(-1px);
}

/* === Responsive === */
@media (max-width: 480px) {
	.cocookie-banner__inner {
		padding: 20px 18px;
	}

	.cocookie-banner__title {
		font-size: 18px;
	}

	.cocookie-banner__buttons {
		flex-direction: column;
		gap: 8px;
	}

	.cocookie-btn {
		width: 100%;
		text-align: center;
	}

	.cocookie-btn--settings {
		width: auto;
		text-align: center;
	}

	.cocookie-category__header {
		padding: 12px 14px;
	}

	.cocookie-category__table {
		font-size: 10px;
	}
}

/* === Shortcode cookie declaration === */
.cocookie-declaration h3 {
	margin-top: 24px;
	margin-bottom: 4px;
}

.cocookie-declaration h3 small {
	font-weight: normal;
	font-size: 12px;
	color: #888;
}

.cocookie-declaration-table {
	width: 100%;
	border-collapse: collapse;
	margin: 8px 0 24px;
	font-size: 14px;
}

.cocookie-declaration-table th,
.cocookie-declaration-table td {
	text-align: left;
	padding: 8px 12px;
	border: 1px solid #ddd;
}

.cocookie-declaration-table th {
	background: #f5f5f5;
	font-weight: 600;
	font-size: 13px;
}

.cocookie-declaration-table code {
	background: #eee;
	padding: 1px 5px;
	border-radius: 3px;
	font-size: 13px;
}
