.itwp-ba-container {
	position: relative;
	overflow: hidden;
	isolation: isolate;
	width: var(--itwp-ba-width, 100%);
	height: var(--itwp-ba-height, 400px);
	border-radius: 0;
	touch-action: none;
	-webkit-user-select: none;
	user-select: none;
	max-width: 100%;
	box-sizing: border-box;
}

.itwp-ba-container *,
.itwp-ba-container *::before,
.itwp-ba-container *::after { box-sizing: border-box; }

.itwp-ba-container img.itwp-ba-image {
	opacity: 1 !important;
	visibility: visible !important;
	transform: none !important;
	max-width: none !important;
	filter: none;
}

.itwp-ba-image-wrap { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.itwp-ba-before-wrap { z-index: 2; }
.itwp-ba-after-wrap  { z-index: 1; }

.itwp-ba-image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	pointer-events: none;
}

.itwp-ba-divider {
	position: absolute;
	z-index: 3;
	top: 0; bottom: 0; left: 50%;
	width: var(--itwp-ba-divider-width, 2px);
	background: var(--itwp-ba-divider-color, #fff);
	transform: translateX(-50%);
	cursor: ew-resize;
}

.itwp-ba-container[data-orientation="vertical"] .itwp-ba-divider {
	top: 50%; bottom: auto; left: 0; right: 0;
	width: 100%;
	height: var(--itwp-ba-divider-width, 2px);
	transform: translateY(-50%);
	cursor: ns-resize;
}

.itwp-ba-handle {
	position: absolute;
	top: 50%; left: 50%;
	transform: translate(-50%, -50%);
	width: var(--itwp-ba-handle-size, 40px);
	height: var(--itwp-ba-handle-size, 40px);
	background: var(--itwp-ba-handle-bg, #fff);
	border-radius: 50%;
	box-shadow: 0 2px 6px rgba(0,0,0,.3);
	display: flex; align-items: center; justify-content: center;
	color: #333;
	cursor: inherit;
	outline: none;
	z-index: 4;
	transition: transform .2s ease;
}

.itwp-ba-handle:hover,
.itwp-ba-handle:focus { transform: translate(-50%, -50%) scale(1.08); }

.itwp-ba-handle:focus-visible { outline: 2px solid #0073aa; outline-offset: 2px; }

.itwp-ba-handle-icon { pointer-events: none; display: block; }

.itwp-ba-container[data-orientation="vertical"] .itwp-ba-handle-icon { transform: rotate(90deg); }

/* ---------------- Лэйблы ---------------- */
.itwp-ba-label {
	position: absolute;
	top: 10px;
	z-index: 5;
	padding: 5px 12px;
	background: rgba(0,0,0,.5);
	color: #fff;
	font-size: 14px;
	line-height: 1.4;
	border-radius: 4px;
	pointer-events: none;
	opacity: 1 !important;
	visibility: visible !important;
}

.itwp-ba-label-before { left: 10px; }
.itwp-ba-label-after  { right: 10px; }

.itwp-ba-container[data-label-pos="bottom"] .itwp-ba-label { top: auto; bottom: 10px; }

.itwp-ba-container[data-orientation="vertical"] .itwp-ba-label { left: 50%; right: auto; transform: translateX(-50%); }
.itwp-ba-container[data-orientation="vertical"] .itwp-ba-label-before { top: 10px; bottom: auto; }
.itwp-ba-container[data-orientation="vertical"] .itwp-ba-label-after  { top: auto; bottom: 10px; }

/* ---------------- Кнопка Full Screen ---------------- */
.itwp-ba-fs-btn {
	position: absolute;
	bottom: 10px;
	right: 10px;
	z-index: 6;
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 7px 14px;
	border: none;
	border-radius: 999px;
	background: rgba(0,0,0,.55);
	color: #fff;
	font-size: 13px;
	line-height: 1;
	cursor: pointer;
	transition: filter .2s ease;
}

.itwp-ba-fs-btn:hover { filter: brightness(1.3); }

.itwp-ba-fs-icon-wrap { display: flex; align-items: center; }
.itwp-ba-fs-icon-wrap svg { width: 14px; height: 14px; display: block; }
.itwp-ba-fs-icon { width: 14px; height: 14px; display: block; }

.itwp-ba-container[data-label-pos="bottom"] .itwp-ba-fs-btn { bottom: auto; top: 10px; }

.itwp-ba-container[data-fs-h="left"] .itwp-ba-fs-btn { left: 10px; right: auto; }
.itwp-ba-container[data-fs-h="center"] .itwp-ba-fs-btn { left: 50%; right: auto; transform: translateX(-50%); }
.itwp-ba-container[data-fs-h="right"] .itwp-ba-fs-btn { right: 10px; left: auto; }

.itwp-ba-container[data-orientation="vertical"][data-fs-h="center"] .itwp-ba-fs-btn { left: auto; right: 10px; transform: none; }

/* ---------------- Полноэкранный оверлей ---------------- */
.itwp-ba-fs-overlay {
	position: fixed;
	top: 0; left: 0; right: 0; bottom: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.itwp-ba-fs-overlay .itwp-ba-container {
	box-shadow: 0 10px 40px rgba(0,0,0,.45);
	touch-action: none;
}

.itwp-ba-fs-close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 9;
	width: 44px;
	height: 44px;
	border: none;
	border-radius: 50%;
	background: rgba(255,255,255,.14);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .2s ease;
}

.itwp-ba-fs-close:hover { background: rgba(255,255,255,.32); }
.itwp-ba-fs-close svg { width: 20px; height: 20px; display: block; }

/* ---------------- Адаптив ---------------- */
@media (max-width: 1024px) {
	.itwp-ba-fs-overlay { padding: 12px; }
}

@media (max-width: 767px) {
	.itwp-ba-fs-btn { padding: 6px 10px; font-size: 12px; gap: 5px; }
	.itwp-ba-fs-icon-wrap svg, .itwp-ba-fs-icon { width: 12px; height: 12px; }
	.itwp-ba-fs-overlay { padding: 10px; }
	.itwp-ba-fs-close { width: 40px; height: 40px; top: 8px; right: 8px; }
}
