/* Cookie Consent Banner — front-end styles
   Colors, font-size and radius are injected as CSS variables from PHP
   so everything is controllable from the WordPress admin panel. */

#ccb-banner,
#ccb-banner * {
	box-sizing: border-box;
}

.ccb-banner {
	position: fixed;
	left: 0;
	right: 0;
	z-index: 999999;
	background: var(--ccb-bg, #1c1c1e);
	color: var(--ccb-text, #f5f5f7);
	font-size: var(--ccb-font-size, 14px);
	line-height: 1.5;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.25);
	animation: ccb-fade-in 0.3s ease;
}

@keyframes ccb-fade-in {
	from { opacity: 0; transform: translateY(12px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* Bottom bar (default) */
.ccb-position-bottom-bar {
	bottom: 0;
}

/* Top bar */
.ccb-position-top-bar {
	top: 0;
	box-shadow: 0 2px 16px rgba(0, 0, 0, 0.25);
}

/* Centered popup */
.ccb-position-popup-center {
	left: 50%;
	bottom: 24px;
	right: auto;
	transform: translateX(-50%);
	max-width: 640px;
	width: calc(100% - 32px);
	border-radius: var(--ccb-radius, 8px);
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.ccb-banner-inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 18px 24px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.ccb-banner-message {
	flex: 1 1 320px;
}

.ccb-banner-links a {
	color: var(--ccb-accent, #4f8cff);
	text-decoration: underline;
	margin-left: 4px;
}

.ccb-banner-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	flex-shrink: 0;
}

.ccb-btn {
	appearance: none;
	border: 1px solid transparent;
	border-radius: var(--ccb-radius, 8px);
	padding: 10px 18px;
	font-size: var(--ccb-font-size, 14px);
	font-family: inherit;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
	transition: opacity 0.15s ease, transform 0.1s ease;
}

.ccb-btn:hover {
	opacity: 0.88;
}

.ccb-btn:active {
	transform: scale(0.98);
}

.ccb-btn-accept {
	background: var(--ccb-accept-bg, #4f8cff);
	color: var(--ccb-accept-text, #fff);
}

.ccb-btn-reject {
	background: var(--ccb-reject-bg, transparent);
	color: var(--ccb-reject-text, #f5f5f7);
	border-color: currentColor;
}

.ccb-btn-manage {
	background: var(--ccb-manage-bg, transparent);
	color: var(--ccb-manage-text, #f5f5f7);
	text-decoration: underline;
	border-color: transparent;
	padding-left: 6px;
	padding-right: 6px;
}

/* ---------- Preferences modal ---------- */

.ccb-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: 1000000;
}

.ccb-modal {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 1000001;
	width: calc(100% - 32px);
	max-width: 520px;
	max-height: 85vh;
	overflow-y: auto;
	background: var(--ccb-bg, #1c1c1e);
	color: var(--ccb-text, #f5f5f7);
	border-radius: var(--ccb-radius, 8px);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: var(--ccb-font-size, 14px);
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.ccb-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 24px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.ccb-modal-header h2 {
	margin: 0;
	font-size: 1.15em;
}

.ccb-modal-close {
	background: none;
	border: none;
	color: inherit;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 4px 8px;
}

.ccb-modal-body {
	padding: 8px 24px;
}

.ccb-category {
	padding: 14px 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ccb-category:last-child {
	border-bottom: none;
}

.ccb-category-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.ccb-category-title {
	font-weight: 600;
}

.ccb-category-desc {
	margin: 6px 0 0;
	opacity: 0.75;
	font-size: 0.92em;
}

/* Toggle switch */
.ccb-switch {
	position: relative;
	display: inline-block;
	width: 42px;
	height: 24px;
	flex-shrink: 0;
}

.ccb-switch input {
	opacity: 0;
	width: 0;
	height: 0;
}

.ccb-slider {
	position: absolute;
	cursor: pointer;
	inset: 0;
	background-color: rgba(255, 255, 255, 0.25);
	border-radius: 24px;
	transition: 0.2s;
}

.ccb-slider::before {
	content: "";
	position: absolute;
	height: 18px;
	width: 18px;
	left: 3px;
	bottom: 3px;
	background-color: #fff;
	border-radius: 50%;
	transition: 0.2s;
}

.ccb-switch input:checked + .ccb-slider {
	background-color: var(--ccb-accent, #4f8cff);
}

.ccb-switch input:checked + .ccb-slider::before {
	transform: translateX(18px);
}

.ccb-switch-disabled .ccb-slider {
	cursor: not-allowed;
	opacity: 0.6;
}

.ccb-modal-footer {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	padding: 18px 24px;
	border-top: 1px solid rgba(255, 255, 255, 0.12);
}

/* ---------- Responsive ---------- */

@media (max-width: 600px) {
	.ccb-banner-inner {
		flex-direction: column;
		align-items: stretch;
		padding: 16px;
	}

	.ccb-banner-actions {
		flex-direction: column;
	}

	.ccb-banner-actions .ccb-btn {
		width: 100%;
		text-align: center;
	}

	.ccb-position-popup-center {
		bottom: 12px;
	}

	.ccb-modal-footer {
		flex-direction: column-reverse;
	}

	.ccb-modal-footer .ccb-btn {
		width: 100%;
		text-align: center;
	}
}
