/**
 * Flavors Cookie Consent - base structural styles.
 *
 * Layout, fixed positioning per layout variant, the consent panel, the category
 * toggles and the show/hide behavior only. Every themeable value (colors,
 * backgrounds, typography, padding, radius, max-width, accent) is injected by
 * Elementor through the widget control `selectors`, so this file carries NO
 * per-instance styling. Custom properties supply sensible fallbacks for the bits
 * the controls drive (--flavor-cc-accent / -offset / -max-width / -overlay).
 *
 * The panel is hidden until the JS confirms it should appear (.flavor-cc-hidden),
 * so a returning visitor who already consented never sees a flash. The editor
 * (.flavor-cc-edit) always shows the panel so it can be styled.
 */

.flavor-cc-root {
	--flavor-cc-accent: #2271b1;
	--flavor-cc-toggle-off: #c3c4c7;
	--flavor-cc-offset: 20px;
	--flavor-cc-max-width: 460px;
	--flavor-cc-overlay: rgba( 0, 0, 0, 0.55 );
	box-sizing: border-box;
}

.flavor-cc-root *,
.flavor-cc-root *::before,
.flavor-cc-root *::after {
	box-sizing: border-box;
}

/* --------------------------------------------------------------------- panel */

.flavor-cc-panel {
	position: relative;
	z-index: 100000;
	width: 100%;
	background: #fff;
	color: #50575e;
}

.flavor-cc-heading {
	margin: 0 0 8px;
	font-size: 1.15em;
	line-height: 1.3;
	color: #1d2327;
}

.flavor-cc-message {
	margin: 0;
	line-height: 1.55;
}

.flavor-cc-message p {
	margin: 0 0 0.6em;
}

.flavor-cc-message p:last-child {
	margin-bottom: 0;
}

.flavor-cc-message a,
.flavor-cc-policy {
	color: var( --flavor-cc-accent );
	text-decoration: underline;
}

.flavor-cc-policy-wrap {
	margin: 8px 0 0;
}

/* ----------------------------------------------------------------- toggles */

.flavor-cc-prefs {
	margin-top: 16px;
	border-top: 1px solid rgba( 0, 0, 0, 0.08 );
	padding-top: 12px;
	max-height: 40vh;
	overflow-y: auto;
}

.flavor-cc-cat {
	padding: 10px 0;
	border-bottom: 1px solid rgba( 0, 0, 0, 0.06 );
}

.flavor-cc-cat:last-child {
	border-bottom: 0;
}

.flavor-cc-cat-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.flavor-cc-cat-label {
	font-weight: 600;
	color: #1d2327;
	cursor: pointer;
}

.flavor-cc-cat-desc {
	margin: 4px 0 0;
	font-size: 0.85em;
	line-height: 1.45;
	color: #646970;
}

/* Accessible switch built on a real checkbox. */
.flavor-cc-toggle {
	position: relative;
	display: inline-flex;
	flex: 0 0 auto;
	width: 42px;
	height: 24px;
}

.flavor-cc-toggle-input {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
	z-index: 1;
}

.flavor-cc-toggle-track {
	position: absolute;
	inset: 0;
	border-radius: 24px;
	background: var( --flavor-cc-toggle-off );
	transition: background-color 0.2s ease;
	pointer-events: none;
}

.flavor-cc-toggle-track::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	transition: transform 0.2s ease;
	box-shadow: 0 1px 2px rgba( 0, 0, 0, 0.25 );
}

.flavor-cc-toggle-input:checked + .flavor-cc-toggle-track {
	background: var( --flavor-cc-accent );
}

.flavor-cc-toggle-input:checked + .flavor-cc-toggle-track::after {
	transform: translateX( 18px );
}

.flavor-cc-toggle-input:focus-visible + .flavor-cc-toggle-track {
	outline: 2px solid var( --flavor-cc-accent );
	outline-offset: 2px;
}

/* Locked (required) toggles are visually on but not interactive. */
.flavor-cc-toggle-locked .flavor-cc-toggle-input {
	cursor: not-allowed;
}

.flavor-cc-toggle-locked .flavor-cc-toggle-track {
	opacity: 0.65;
}

/* ----------------------------------------------------------------- actions */

.flavor-cc-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-top: 16px;
}

.flavor-cc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 10px 18px;
	font: inherit;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	border: 1px solid transparent;
	border-radius: 6px;
	background: transparent;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.flavor-cc-btn-accept {
	color: #fff;
	background: var( --flavor-cc-accent );
	border-color: var( --flavor-cc-accent );
	/* Push the primary action to the end of the row. */
	margin-left: auto;
}

.flavor-cc-btn-secondary {
	color: #1d2327;
	border-color: #c3c4c7;
}

.flavor-cc-btn:hover,
.flavor-cc-btn:focus {
	transform: translateY( -1px );
}

.flavor-cc-btn:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* --------------------------------------------------------- layout: fixed bar */

/*
 * Bar layouts span the viewport edge to edge; box layouts are constrained to
 * --flavor-cc-max-width and pinned to a corner; the modal centers with a
 * backdrop. All fixed variants are pinned to the viewport via .flavor-cc-root.
 */
.flavor-cc-layout-bar-bottom .flavor-cc-root,
.flavor-cc-layout-bar-top .flavor-cc-root,
.flavor-cc-layout-box-bottom-left .flavor-cc-root,
.flavor-cc-layout-box-bottom-right .flavor-cc-root,
.flavor-cc-layout-center-modal .flavor-cc-root {
	position: fixed;
	z-index: 100000;
}

.flavor-cc-layout-bar-bottom .flavor-cc-root {
	left: 0;
	right: 0;
	bottom: 0;
}

.flavor-cc-layout-bar-top .flavor-cc-root {
	left: 0;
	right: 0;
	top: 0;
}

.flavor-cc-layout-bar-bottom .flavor-cc-panel,
.flavor-cc-layout-bar-top .flavor-cc-panel {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px 24px;
}

/* In bar mode the message takes the remaining space and actions sit beside it. */
.flavor-cc-layout-bar-bottom .flavor-cc-message,
.flavor-cc-layout-bar-top .flavor-cc-message {
	flex: 1 1 320px;
}

.flavor-cc-layout-bar-bottom .flavor-cc-actions,
.flavor-cc-layout-bar-top .flavor-cc-actions {
	margin-top: 0;
	flex: 0 0 auto;
}

.flavor-cc-layout-bar-bottom .flavor-cc-prefs,
.flavor-cc-layout-bar-top .flavor-cc-prefs {
	flex: 1 1 100%;
	margin-top: 4px;
}

/* --------------------------------------------------------- layout: corner box */

.flavor-cc-layout-box-bottom-left .flavor-cc-root {
	left: var( --flavor-cc-offset );
	bottom: var( --flavor-cc-offset );
	width: min( 100% - ( var( --flavor-cc-offset ) * 2 ), var( --flavor-cc-max-width ) );
}

.flavor-cc-layout-box-bottom-right .flavor-cc-root {
	right: var( --flavor-cc-offset );
	bottom: var( --flavor-cc-offset );
	width: min( 100% - ( var( --flavor-cc-offset ) * 2 ), var( --flavor-cc-max-width ) );
}

.flavor-cc-layout-box-bottom-left .flavor-cc-panel,
.flavor-cc-layout-box-bottom-right .flavor-cc-panel {
	max-width: var( --flavor-cc-max-width );
}

/* ----------------------------------------------------------- layout: modal */

.flavor-cc-layout-center-modal .flavor-cc-root {
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var( --flavor-cc-offset );
}

.flavor-cc-layout-center-modal .flavor-cc-overlay {
	position: fixed;
	inset: 0;
	background: var( --flavor-cc-overlay );
	z-index: 99999;
}

.flavor-cc-layout-center-modal .flavor-cc-panel {
	max-width: var( --flavor-cc-max-width );
	max-height: calc( 100vh - ( var( --flavor-cc-offset ) * 2 ) );
	overflow-y: auto;
}

/* The overlay only exists for the modal layout. */
.flavor-cc-overlay {
	display: none;
}

.flavor-cc-layout-center-modal .flavor-cc-overlay {
	display: block;
}

/* When the panel is hidden, the modal overlay must go too. */
.flavor-cc-root.flavor-cc-resolved-hidden .flavor-cc-overlay {
	display: none;
}

/* --------------------------------------------------------- re-open button */

.flavor-cc-reopen {
	position: fixed;
	left: var( --flavor-cc-offset );
	bottom: var( --flavor-cc-offset );
	z-index: 99998;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 10px 14px;
	font: inherit;
	line-height: 1;
	color: #fff;
	cursor: pointer;
	background: var( --flavor-cc-accent );
	border: 0;
	border-radius: 40px;
	box-shadow: 0 2px 10px rgba( 0, 0, 0, 0.25 );
	transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.flavor-cc-reopen:hover,
.flavor-cc-reopen:focus {
	transform: translateY( -1px );
	box-shadow: 0 4px 14px rgba( 0, 0, 0, 0.3 );
}

.flavor-cc-reopen:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.flavor-cc-reopen-icon {
	width: 18px;
	height: 18px;
	display: block;
	flex: 0 0 auto;
}

/* For box-bottom-left the re-open button would collide; nudge it to the right. */
.flavor-cc-layout-box-bottom-left .flavor-cc-reopen {
	left: auto;
	right: var( --flavor-cc-offset );
}

/* --------------------------------------------------------- show / hide */

/*
 * Hidden until the JS resolves whether to show the banner. The editor keeps it
 * visible (.flavor-cc-edit) so it can be styled.
 */
.flavor-cc-hidden {
	display: none !important;
}

.flavor-cc-edit .flavor-cc-panel.flavor-cc-hidden {
	display: block !important;
}

.flavor-cc-edit.flavor-cc-layout-bar-bottom .flavor-cc-panel.flavor-cc-hidden,
.flavor-cc-edit.flavor-cc-layout-bar-top .flavor-cc-panel.flavor-cc-hidden {
	display: flex !important;
}

/* Inside the editor the banner is rendered inline, not fixed, so it can be seen. */
.flavor-cc-edit .flavor-cc-root {
	position: relative;
	inset: auto;
	left: auto;
	right: auto;
	top: auto;
	bottom: auto;
	width: auto;
	padding: 0;
}

.flavor-cc-edit .flavor-cc-overlay {
	display: none !important;
}

.flavor-cc-edit .flavor-cc-reopen {
	display: none !important;
}

/* Soft entrance once the JS shows the panel (respects reduced motion below). */
.flavor-cc-panel:not( .flavor-cc-hidden ) {
	animation: flavor-cc-in 0.28s ease both;
}

@keyframes flavor-cc-in {
	from {
		opacity: 0;
		transform: translateY( 8px );
	}

	to {
		opacity: 1;
		transform: translateY( 0 );
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.flavor-cc-btn,
	.flavor-cc-reopen,
	.flavor-cc-toggle-track,
	.flavor-cc-toggle-track::after {
		transition: none !important;
	}

	.flavor-cc-panel:not( .flavor-cc-hidden ) {
		animation: none;
	}
}

/* --------------------------------------------------------------- mobile */

@media ( max-width: 600px ) {
	.flavor-cc-layout-box-bottom-left .flavor-cc-root,
	.flavor-cc-layout-box-bottom-right .flavor-cc-root {
		left: var( --flavor-cc-offset );
		right: var( --flavor-cc-offset );
		width: auto;
	}

	.flavor-cc-actions {
		width: 100%;
	}

	.flavor-cc-btn {
		flex: 1 1 auto;
	}

	.flavor-cc-btn-accept {
		margin-left: 0;
	}

	.flavor-cc-reopen-label {
		display: none;
	}
}
