/**
 * Cookie Banner Creator - front-end styles.
 * Layout / positioning only; the banner's look is designed in Elementor.
 */

/* Root is hidden until the engine decides to show something. */
#cbc-root[data-cbc-hidden] {
	display: none;
}

/* Applied to <html> by the engine when "disable scroll" is on and a panel
   is visible - keeps the visitor from scrolling the page behind the banner. */
html.cbc-no-scroll {
	overflow: hidden !important;
}

#cbc-root {
	position: fixed;
	inset: 0;
	pointer-events: none;
}

/* Backdrop */
.cbc-backdrop {
	position: fixed;
	inset: 0;
	pointer-events: auto;
	opacity: 0;
	transition: opacity 0.25s ease;
}

#cbc-root.cbc-show-banner .cbc-backdrop,
#cbc-root.cbc-show-preferences .cbc-backdrop {
	opacity: 1;
}

/* Banner container: a bare positioning shell only. Background, shadow,
   border-radius, etc. are intentionally NOT set here — the visible design
   (the "card" look) is built by the user's own Elementor Container/Section
   as the banner's root element, so it stays fully customizable. */
.cbc-banner {
	position: fixed;
	box-sizing: border-box;
	pointer-events: auto;
	display: none;
}

#cbc-root.cbc-show-banner .cbc-banner {
	display: block;
}

/* Positions ------------------------------------------------------------- */
.cbc-pos-bottom-center { bottom: 24px; left: 50%; transform: translateX( -50% ); }
.cbc-pos-bottom-left   { bottom: 24px; left: 24px; }
.cbc-pos-bottom-right  { bottom: 24px; right: 24px; }
.cbc-pos-top-center    { top: 24px; left: 50%; transform: translateX( -50% ); }
.cbc-pos-top-left      { top: 24px; left: 24px; }
.cbc-pos-top-right     { top: 24px; right: 24px; }
.cbc-pos-center        { top: 50%; left: 50%; transform: translate( -50%, -50% ); }

.cbc-pos-full-top,
.cbc-pos-full-bottom {
	left: 0;
	right: 0;
	width: 100%;
	max-width: none;
	border-radius: 0;
}
.cbc-pos-full-top    { top: 0; }
.cbc-pos-full-bottom { bottom: 0; }

/* Entrance animations --------------------------------------------------- */
#cbc-root.cbc-show-banner .cbc-anim-fade      { animation: cbc-fade 0.3s ease both; }
#cbc-root.cbc-show-banner .cbc-anim-slide-up  { animation: cbc-slide-up 0.35s ease both; }
#cbc-root.cbc-show-banner .cbc-anim-slide-down{ animation: cbc-slide-down 0.35s ease both; }
#cbc-root.cbc-show-banner .cbc-anim-zoom      { animation: cbc-zoom 0.3s ease both; }

/* Centered positions use transform: translateX(-50%) for centering (see
   above). Animating the "transform" property directly would replace that
   centering offset and produce a diagonal slide. The "translate"/"scale"
   properties are independent of "transform" and compose with it instead,
   so the entrance motion never fights the position's own transform. */
@keyframes cbc-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cbc-slide-up { from { opacity: 0; translate: 0 24px; } to { opacity: 1; translate: 0 0; } }
@keyframes cbc-slide-down { from { opacity: 0; translate: 0 -24px; } to { opacity: 1; translate: 0 0; } }
@keyframes cbc-zoom { from { opacity: 0; scale: 0.92; } to { opacity: 1; scale: 1; } }

/* Preferences modal ----------------------------------------------------- */
.cbc-preferences {
	position: fixed;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	pointer-events: auto;
	padding: 20px;
	overflow-y: auto;
}

#cbc-root.cbc-show-preferences .cbc-preferences {
	display: flex;
}

/* Sizing/scroll shell only - visible design (background, radius, shadow) is
   built by the user's own Elementor Container/Section, same as the banner. */
.cbc-preferences__inner {
	max-width: 640px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
}

/* When preferences are open, the small banner steps aside. */
#cbc-root.cbc-show-preferences .cbc-banner {
	display: none;
}

/* Action buttons -------------------------------------------------------- */
/* Flex column so the Alignment control's align-items can position the button
   (flex-start/center/flex-end) and, for "Full Width", stretch it edge-to-edge. */
.cbc-action-wrap {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

.cbc-action {
	display: inline-block;
	cursor: pointer;
	border: none;
	font: inherit;
	line-height: 1.4;
	text-align: center;
	transition: background-color 0.2s ease, color 0.2s ease;
}

/* Category toggles ------------------------------------------------------ */
.cbc-toggles {
	display: block;
}

.cbc-toggle {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 16px;
}

.cbc-toggle__text {
	flex: 1 1 auto;
}

.cbc-toggle__name {
	display: block;
	font-weight: 600;
}

.cbc-toggle__desc {
	display: block;
	font-size: 0.85em;
	opacity: 0.8;
	margin-top: 2px;
}

.cbc-toggle__control {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
	cursor: pointer;
}

.cbc-toggle__control input {
	position: absolute;
	opacity: 0;
	width: 44px;
	height: 24px;
	margin: 0;
	cursor: pointer;
}

.cbc-toggle__switch {
	position: relative;
	display: inline-block;
	width: 44px;
	height: 24px;
	border-radius: 999px;
	background: #cbd5e1;
	transition: background-color 0.2s ease;
	flex: 0 0 auto;
}

.cbc-toggle__switch::after {
	content: "";
	position: absolute;
	top: 2px;
	left: 2px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #fff;
	transition: transform 0.2s ease;
}

.cbc-toggle__control input:checked + .cbc-toggle__switch {
	background: #2563eb;
}

.cbc-toggle__control input:checked + .cbc-toggle__switch::after {
	transform: translateX( 20px );
}

.cbc-toggle__control input:disabled + .cbc-toggle__switch {
	opacity: 0.65;
}

.cbc-toggle__locked {
	font-size: 0.75em;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	opacity: 0.7;
}

/* Cookie declaration list ----------------------------------------------- */
.cbc-cookies__group {
	margin-bottom: 18px;
}

.cbc-cookies__heading {
	margin: 0 0 6px;
}

.cbc-cookies__list {
	margin: 0;
	padding-left: 18px;
}

.cbc-cookies__item {
	margin-bottom: 4px;
}

/* Responsive ------------------------------------------------------------ */
@media ( max-width: 600px ) {
	.cbc-banner:not( .cbc-pos-full-top ):not( .cbc-pos-full-bottom ) {
		left: 12px !important;
		right: 12px !important;
		width: auto !important;
		max-width: none !important;
		transform: none !important;
	}
	.cbc-pos-bottom-center,
	.cbc-pos-bottom-left,
	.cbc-pos-bottom-right { bottom: 12px; }
	.cbc-pos-top-center,
	.cbc-pos-top-left,
	.cbc-pos-top-right { top: 12px; }
}
