/**
 * Ceneo Cube Rotator v2.0 - karuzela 2D
 */

.ccr-carousel {
	position: relative;
	width: var(--ccr-size, 300px);
	height: var(--ccr-size, 300px);
	margin: 2em auto;
	background: #fff;
	overflow: hidden;
}

.ccr-carousel,
.ccr-carousel * {
	box-sizing: border-box;
}

.ccr-slides {
	position: relative;
	width: 100%;
	height: 100%;
}

/* Slajdy - wszystkie nałożone na siebie, tylko aktywny widoczny */
.ccr-slide {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.5s ease-in-out;
}

.ccr-slide.ccr-slide-active {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	z-index: 2;
}

/* Iframe wypełnia slajd, linki są natywnie klikalne */
.ccr-slide-iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
	outline: none;
	background: #fff;
	margin: 0;
	padding: 0;
}

.ccr-slide-iframe:focus,
.ccr-slide-iframe:focus-visible,
.ccr-slide-iframe:active {
	outline: none;
	border: 0;
	box-shadow: none;
}

.ccr-slide-placeholder {
	color: #999;
	font-size: 14px;
	text-align: center;
	padding: 1em;
	background: #f5f5f5;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Strzałki nawigacji */
.ccr-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 32px;
	height: 32px;
	background: rgba(0, 0, 0, 0.5);
	color: #fff;
	border: 0;
	border-radius: 50%;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	z-index: 5;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.3s, background 0.2s;
}

.ccr-carousel:hover .ccr-arrow {
	opacity: 1;
}

.ccr-arrow:hover {
	background: rgba(0, 0, 0, 0.75);
}

.ccr-arrow:focus {
	outline: none;
	opacity: 1;
}

.ccr-arrow-prev {
	left: 8px;
}

.ccr-arrow-next {
	right: 8px;
}

/* Kropki wskaźników na dole */
.ccr-indicators {
	position: absolute;
	bottom: 8px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	gap: 6px;
	z-index: 5;
	padding: 4px 8px;
	background: rgba(0, 0, 0, 0.3);
	border-radius: 10px;
}

.ccr-indicator {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.5);
	border: 0;
	cursor: pointer;
	padding: 0;
	transition: background 0.2s;
}

.ccr-indicator:hover {
	background: rgba(255, 255, 255, 0.8);
}

.ccr-indicator-active {
	background: #fff;
}

.ccr-indicator:focus {
	outline: none;
	box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

/* Tryb pływający */
.ccr-mode-floating {
	position: fixed;
	z-index: 999;
	margin: 0;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.ccr-mode-floating.ccr-position-bottom-right {
	bottom: var(--ccr-offset, 20px);
	right: var(--ccr-offset, 20px);
}

.ccr-mode-floating.ccr-position-bottom-left {
	bottom: var(--ccr-offset, 20px);
	left: var(--ccr-offset, 20px);
}

.ccr-mode-floating.ccr-position-top-right {
	top: var(--ccr-offset, 20px);
	right: var(--ccr-offset, 20px);
}

.ccr-mode-floating.ccr-position-top-left {
	top: var(--ccr-offset, 20px);
	left: var(--ccr-offset, 20px);
}

/* Przycisk zamknięcia */
.ccr-close {
	position: absolute;
	top: -10px;
	right: -10px;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: #d63638;
	color: #fff;
	border: 2px solid #fff;
	font-size: 18px;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	z-index: 10;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ccr-close:hover {
	background: #a10e11;
}

/* Responsive */
@media (max-width: 767px) {
	.ccr-carousel.ccr-hide-mobile {
		display: none !important;
	}

	.ccr-mode-floating:not(.ccr-hide-mobile) {
		transform: scale(0.75);
		transform-origin: bottom right;
	}

	.ccr-mode-floating.ccr-position-bottom-left:not(.ccr-hide-mobile),
	.ccr-mode-floating.ccr-position-top-left:not(.ccr-hide-mobile) {
		transform-origin: bottom left;
	}

	/* Strzałki zawsze widoczne na mobile - nie ma hover */
	.ccr-arrow {
		opacity: 1;
	}
}

/* Dostępność - wyłącz auto-rotację przy reduced-motion */
@media (prefers-reduced-motion: reduce) {
	.ccr-slide {
		transition: none;
	}
}
