/**
 * CookieYes MVP - front-end banner styles.
 */

#cyx-root {
	--cyx-accent: #1a73e8;
	--cyx-bg: #ffffff;
	--cyx-fg: #1f2933;
	--cyx-muted: #52606d;
	--cyx-border: #e4e7eb;
	--cyx-radius: 10px;
	--cyx-shadow: 0 8px 30px rgba( 0, 0, 0, 0.18 );
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	color: var( --cyx-fg );
}

#cyx-root[hidden],
#cyx-root [hidden] {
	display: none !important;
}

/* ---------- Banner ---------- */
.cyx-banner {
	position: fixed;
	left: 0;
	right: 0;
	z-index: 999990;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 18px 22px;
	background: var( --cyx-bg );
	box-shadow: var( --cyx-shadow );
	border-top: 3px solid var( --cyx-accent );
}

.cyx-banner.cyx-pos-bottom {
	bottom: 0;
}

.cyx-banner.cyx-pos-top {
	top: 0;
	border-top: 0;
	border-bottom: 3px solid var( --cyx-accent );
}

.cyx-banner.cyx-pos-box {
	left: auto;
	right: 24px;
	bottom: 24px;
	max-width: 380px;
	flex-direction: column;
	align-items: stretch;
	border-radius: var( --cyx-radius );
	border-top: 3px solid var( --cyx-accent );
}

.cyx-banner__body {
	flex: 1 1 380px;
	min-width: 0;
}

.cyx-banner__title {
	margin: 0 0 6px;
	font-size: 17px;
	font-weight: 600;
}

.cyx-banner__message {
	margin: 0;
	color: var( --cyx-muted );
	font-size: 14px;
}

.cyx-banner__message p {
	margin: 0 0 6px;
}

.cyx-banner__policy {
	color: var( --cyx-accent );
	text-decoration: underline;
}

.cyx-banner__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	flex: 0 0 auto;
}

/* ---------- Buttons ---------- */
.cyx-btn {
	cursor: pointer;
	border: 1px solid transparent;
	border-radius: 8px;
	padding: 10px 18px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	transition: opacity 0.15s ease, background 0.15s ease;
}

.cyx-btn:focus-visible {
	outline: 2px solid var( --cyx-accent );
	outline-offset: 2px;
}

.cyx-btn--primary {
	background: var( --cyx-accent );
	color: #fff;
}

.cyx-btn--primary:hover {
	opacity: 0.9;
}

.cyx-btn--ghost {
	background: transparent;
	color: var( --cyx-fg );
	border-color: var( --cyx-border );
}

.cyx-btn--ghost:hover {
	background: rgba( 0, 0, 0, 0.04 );
}

/* ---------- Modal ---------- */
.cyx-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.cyx-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba( 0, 0, 0, 0.5 );
}

.cyx-modal__dialog {
	position: relative;
	width: 100%;
	max-width: 560px;
	max-height: 85vh;
	overflow: auto;
	background: var( --cyx-bg );
	border-radius: var( --cyx-radius );
	box-shadow: var( --cyx-shadow );
}

.cyx-modal__header,
.cyx-modal__footer {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 18px 22px;
}

.cyx-modal__header {
	justify-content: space-between;
	border-bottom: 1px solid var( --cyx-border );
}

.cyx-modal__footer {
	justify-content: flex-end;
	flex-wrap: wrap;
	border-top: 1px solid var( --cyx-border );
}

.cyx-modal__title {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
}

.cyx-modal__close {
	background: none;
	border: 0;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	color: var( --cyx-muted );
}

.cyx-modal__body {
	padding: 8px 22px 4px;
}

/* ---------- Category rows ---------- */
.cyx-category {
	padding: 16px 0;
	border-bottom: 1px solid var( --cyx-border );
}

.cyx-category:last-child {
	border-bottom: 0;
}

.cyx-category__head {
	display: flex;
	align-items: center;
	gap: 12px;
}

.cyx-category__label {
	font-weight: 600;
}

.cyx-category__always {
	margin-left: 8px;
	font-size: 12px;
	font-weight: 500;
	font-style: normal;
	color: var( --cyx-accent );
}

.cyx-category__desc {
	margin: 8px 0 0 54px;
	font-size: 13px;
	color: var( --cyx-muted );
}

/* ---------- Switch ---------- */
.cyx-switch {
	position: relative;
	display: inline-block;
	width: 42px;
	height: 24px;
	flex: 0 0 auto;
}

.cyx-switch input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.cyx-switch__slider {
	position: absolute;
	inset: 0;
	background: #cbd2d9;
	border-radius: 999px;
	transition: background 0.15s ease;
}

.cyx-switch__slider::before {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	background: #fff;
	border-radius: 50%;
	transition: transform 0.15s ease;
}

.cyx-switch input:checked + .cyx-switch__slider {
	background: var( --cyx-accent );
}

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

.cyx-switch input:disabled + .cyx-switch__slider {
	opacity: 0.6;
}

.cyx-switch input:focus-visible + .cyx-switch__slider {
	outline: 2px solid var( --cyx-accent );
	outline-offset: 2px;
}

/* ---------- Revisit button ---------- */
.cyx-revisit {
	position: fixed;
	left: 20px;
	bottom: 20px;
	z-index: 999980;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: 1px solid var( --cyx-border );
	background: var( --cyx-bg );
	box-shadow: var( --cyx-shadow );
	cursor: pointer;
	font-size: 22px;
	line-height: 1;
}

.cyx-revisit:hover {
	transform: scale( 1.05 );
}

/* ---------- Responsive ---------- */
@media ( max-width: 640px ) {
	.cyx-banner {
		flex-direction: column;
		align-items: stretch;
	}
	.cyx-banner__actions .cyx-btn {
		flex: 1 1 auto;
	}
}
