.ct-panel {
	&.ct-click-allowed {
		cursor: pointer;
		position: relative;

		&:before {
			position: absolute;
			content: '';
			top: -11px;
			inset-inline-start: -12px;
			width: calc(100% + 24px);
			height: 42px;
		}

		&:hover {
			&:before {
				background: rgba(255, 255, 255, 0.7);
			}
		}

		header > label {
			cursor: pointer;
		}

		.ct-customizer-panel-option {
			button {
				opacity: 0.7;
				pointer-events: auto;
				transform: translate3d(0, 0, 0);
				transition: opacity 0.2s ease 0.2s, transform 0.2s ease 0.2s;
			}
		}
	}

	&[data-panel='only-arrow'] {
		.ct-customizer-panel-option button {
			inset-inline-end: -10px;
		}
	}
}

// option
.ct-customizer-panel-option {
	position: relative;
	cursor: pointer;
	min-height: 20px;

	button {
		position: absolute;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 25px;
		height: 20px;
		top: calc(50% - 10px);
		inset-inline-end: -24px;
		padding: 0;
		cursor: pointer;
		border: none;
		opacity: 0;
		pointer-events: none;
		background: transparent;

		&:after {
			font-family: dashicons;
			content: '\f345';
			width: 12px;
			height: 12px;
			font-size: 12px;
			color: inherit;
			-webkit-font-smoothing: antialiased;
			-moz-osx-font-smoothing: grayscale;
		}

		&:focus {
			outline: none;
		}
	}

	.ct-option-switch + button {
		transform: translate3d(-7px, 0, 0);
		transition: opacity 0s ease 0s, transform 0s ease 0s;
	}
}

// panel
.ct-customizer-panel {
	position: absolute;
	overflow-x: hidden;
	overflow-y: auto;
	z-index: 99;
	background: #f0f0f1;
	inset: 0;
	border-top: 1px solid #ddd;
	border-bottom: 1px solid #ddd;

	> * {
		position: absolute;
		inset: 0;
	}

	> *:nth-child(2) {
		display: none;
	}

	&.ct-panel-second-level {
		width: 200%;

		> * {
			width: 50%;
		}

		> *:last-child {
			inset-inline-start: 50%;
			display: block;
		}
	}
}

.ct-panel-open {
	height: 100% !important;
	overflow-y: hidden !important;
	transform: translateX(-100%) !important;
}

// panel actions
.wp-core-ui {
	.customize-panel-back:focus,
	.customize-panel-back:hover,
	.customize-section-back:focus,
	.customize-section-back:hover {
		color: var(--ui-accent-color);
	}
}

.customize-panel-actions {
	display: flex;
	background: #fff;
	border-bottom: 1px solid #ddd;

	button {
		width: 48px;
		padding-inline-end: 24px;
		background: #fff;
		cursor: pointer;
		border: none;
		border-inline-end: 1px solid #ddd;
		border-inline-start: 4px solid #fff;

		&:before {
			font: normal 20px/48px dashicons;
			content: '\f341';
			position: relative;
			inset-inline-start: 9px;
		}

		&:focus {
			outline: none;
		}
	}

	h3 {
		font-size: 20px !important;
		font-weight: 200;
		line-height: 26px;
		display: block;
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
		color: #555d66;
		width: 100%;
		margin: 0;
		padding: 10px;
		padding-inline-start: 14px;

		span {
			font-size: 13px;
			display: block;
			font-weight: 400;
			overflow: hidden;
		}
	}
}

// panel content
.customizer-panel-content {
	margin: 0;
	padding: 0 12px 30px 12px;

	> li {
		&:first-child {
			margin-top: 30px;

			&.customize-control-ct-title {
				margin-top: 0;
				border-top: none !important;
			}
		}
	}

	> form {
		margin-inline: -12px;
	}
}

.ct-tmp-panel-actions {
	z-index: 999999;
	position: relative;
}

// temp notice for this case - https://themes.trac.wordpress.org/ticket/181031#comment:13
// to remove later maybe
.ct-customizer-panel-container {
	display: flex;
	align-items: center;

	.ct-option-notice {
		display: flex;
		justify-content: center;
		margin-inline-end: 10px;
		position: initial;
	}

	[data-tooltip-reveal='top:full'] {
		.ct-tooltip {
			text-align: initial;
			white-space: initial;
			padding: 8px 10px;
			top: 0;
			inset-inline: 0px;
			transform: translateY(calc(-100% - 8px));
		}

		.ct-tooltip-trigger {
			position: relative;
			display: flex;
			align-items: center;
			justify-content: center;

			&:after {
				opacity: 0;
				visibility: hidden;
				content: '';
				position: absolute;
				box-sizing: border-box;
				width: 10px;
				height: 5px;
				border-inline: 5px solid transparent;
				border-top: 5px solid rgba(54, 63, 66, 1);

				transform: translateY(calc(-100% - 11px));

				transition: opacity 0.2s cubic-bezier(0.455, 0.03, 0.515, 0.955),
					transform 0.2s cubic-bezier(0.455, 0.03, 0.515, 0.955),
					visibility 0.2s cubic-bezier(0.455, 0.03, 0.515, 0.955);
			}
		}

		&:hover {
			.ct-tooltip-trigger:after {
				opacity: 1;
				visibility: visible;
				transform: translateY(calc(-100% - 15px));
			}

			.ct-tooltip {
				transform: translateY(calc(-100% - 12px));
			}
		}
	}
}
