/* Columbus – Plan Animacji 1.1.7
   Odświeżony styl inspirowany widgetem ofert zimowych.
   Zachowuje istniejącą strukturę i działanie wtyczki. */

.cpa-widget {
	--cpa-radius: 16px;
	--cpa-navy: #202b4f;
	--cpa-cream: #fef9f1;
	--cpa-gold: #e9ab3d;
	position: fixed;
	left: 0;
	top: var(--cpa-top);
	transform: translateY(-50%);
	z-index: 99990;
	color: var(--cpa-text);
	font-family: inherit;
	filter: drop-shadow(0 10px 24px rgba(15, 28, 55, .16));
}

.cpa-tab {
	display: block;
	box-sizing: border-box;
	width: 300px;
	min-height: 82px;
	height: auto;
	border: 1px solid rgba(255,255,255,.24);
	margin: 0;
	padding: 17px 44px 16px 19px;
	border-radius: 0 var(--cpa-radius) 0 0;
	background: var(--cpa-navy);
	color: #fff;
	cursor: pointer;
	text-align: left;
	box-shadow: none;
}

.cpa-tab__desktop {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.cpa-tab__desktop strong {
	color: #fff;
	font-size: 18px;
	font-weight: 750;
	line-height: 1.2;
	letter-spacing: -.02em;
}

.cpa-tab__desktop span {
	color: rgba(255,255,255,.94);
	font-size: 13px;
	line-height: 1.4;
}

.cpa-tab__mobile { display: none; }

.cpa-panel {
	box-sizing: border-box;
	width: 300px;
	background: #fff;
	border: 1px solid #e4e8ef;
	border-top: 0;
	border-radius: 0 0 var(--cpa-radius) 0;
	overflow: hidden;
}

.cpa-panel[hidden] { display: none !important; }
.cpa-panel__header { display: none; }
.cpa-close { display: none; }

.cpa-actions {
	display: grid;
	gap: 9px;
	padding: 13px 14px 15px;
}

.cpa-action {
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 100%;
	min-height: 44px;
	padding: 11px 14px;
	border: 1px solid var(--cpa-navy);
	border-radius: 9px;
	background: var(--cpa-navy);
	color: #fff;
	text-decoration: none;
	font-weight: 700;
	font-size: 14px;
	line-height: 1.25;
	text-align: center;
	transition: background-color .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.cpa-action:hover,
.cpa-action:focus-visible {
	background: #2d3d6a;
	border-color: #2d3d6a;
	color: #fff;
	transform: translateY(-1px);
	box-shadow: 0 5px 12px rgba(32,43,79,.16);
}

.cpa-tab:focus-visible,
.cpa-close:focus-visible,
.cpa-action:focus-visible {
	outline: 3px solid var(--cpa-gold);
	outline-offset: 3px;
}

/* Desktop: panel rozwija się pod granatowym nagłówkiem. */
@media (min-width: 768px) {
	.cpa-widget { width: 300px; }
	.cpa-tab { position: relative; z-index: 2; transition: border-radius .25s ease; }
	.cpa-panel {
		max-height: 0;
		opacity: 0;
		overflow: hidden;
		border-radius: 0 0 var(--cpa-radius) var(--cpa-radius);
		transition: max-height .28s ease, opacity .18s ease;
	}
	.cpa-widget.is-open .cpa-tab { border-radius: 0 var(--cpa-radius) 0 0; }
	.cpa-widget.is-open .cpa-panel { max-height: 150px; opacity: 1; display: block; }
	.cpa-panel[hidden] { display: block !important; }
	.cpa-widget { transform: translateY(-50%); }
	.cpa-widget.is-closing .cpa-panel { max-height: 150px; opacity: 1; }
	.cpa-widget.is-closing .cpa-tab { border-radius: 0 var(--cpa-radius) 0 0; }
}

/* Mobile: zachowany dotychczasowy wysuwany panel i pionowa zakładka. */
@media (max-width: 767px) {
	.cpa-widget {
		top: 50%;
		left: 0;
		width: 292px;
		height: 148px;
		transform: translateX(-234px) translateY(-50%);
		transition: transform .34s cubic-bezier(.22,.61,.36,1);
		pointer-events: none;
		filter: drop-shadow(0 8px 20px rgba(15, 28, 55, .18));
	}
	.cpa-widget.is-open { transform: translateX(0) translateY(-50%); }
	.cpa-tab {
		position: absolute;
		right: 0;
		top: 0;
		width: 58px;
		height: 148px;
		min-height: 0;
		padding: 10px 4px;
		border: 1px solid rgba(255,255,255,.22);
		border-radius: 0 14px 14px 0;
		background: var(--cpa-navy);
		pointer-events: auto;
		display: flex;
		align-items: center;
		justify-content: center;
		z-index: 3;
	}
	.cpa-tab__desktop { display: none; }
	.cpa-tab__mobile {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 100%;
		height: 100%;
		color: #fff;
		font-size: 12px;
		font-weight: 800;
		line-height: 1;
		letter-spacing: .035em;
		white-space: nowrap;
		writing-mode: vertical-rl;
		text-orientation: mixed;
		transform: rotate(180deg);
		text-align: center;
	}
	.cpa-tab__mobile-letter { animation: cpaRainbow 2.8s linear infinite; }
	@keyframes cpaRainbow {
		0% { color: #ef4444; }
		16% { color: #f59e0b; }
		33% { color: #22c55e; }
		50% { color: #06b6d4; }
		66% { color: #3b82f6; }
		83% { color: #8b5cf6; }
		100% { color: #ef4444; }
	}
	.cpa-panel {
		position: absolute;
		left: 0;
		top: 0;
		width: 234px;
		height: 148px;
		padding: 0;
		border: 1px solid #e4e8ef;
		border-radius: 14px 0 0 14px;
		background: #fff;
		overflow: hidden;
		pointer-events: none;
		z-index: 2;
		opacity: 1;
		visibility: visible;
		transform: none;
		transition: none;
	}
	.cpa-panel[hidden] { display: block !important; }
	.cpa-panel__header, .cpa-close { display: none !important; }
	.cpa-actions {
		position: absolute;
		left: 14px;
		right: 14px;
		top: 50%;
		transform: translateY(-50%);
		display: grid;
		gap: 9px;
		padding: 0;
	}
	.cpa-action { min-height: 43px; padding: 10px; border-radius: 9px; font-size: 13px; }
	.cpa-widget:not(.is-open) .cpa-panel { visibility: visible; pointer-events: none; }
	.cpa-widget.is-open .cpa-panel { visibility: visible; pointer-events: auto; }
	.cpa-widget.is-open .cpa-tab { border-radius: 0 14px 14px 0; }
}

@media (prefers-reduced-motion: reduce) {
	.cpa-widget, .cpa-action, .cpa-tab__mobile-letter { animation: none !important; transition: none !important; }
}

@media print { .cpa-widget { display: none !important; } }
