/* Progresfera Checkout – panel po dodaniu do koszyka.
 * Mobile: dolny panel (wysokość wg treści, max 85% ekranu). Desktop (≥768px): karta w prawym górnym rogu, max 440px, wysokość wg treści.
 * Kolory z globalnych kolorów Elementora: Accent (#F2B100) jak przyciski „Zapisz się na kurs”, hover #E9A316. */

.pgc-atc[hidden] { display: none; }

.pgc-atc {
	--pgc-accent: var(--e-global-color-accent, #F2B100);
	--pgc-accent-hover: var(--e-global-color-4378429, #E9A316);
	--pgc-focus: #333333;
	--pgc-text: #1f2328;
	--pgc-muted: #57606a;
	--pgc-border: #e1e4e8;
	--pgc-bg-soft: #f7f7f8;
	position: fixed;
	inset: 0;
	z-index: 100000;
	font-family: inherit;
	color: var(--pgc-text);
}

.pgc-atc__overlay {
	position: absolute;
	inset: 0;
	background: rgba(17, 24, 39, 0.45);
	opacity: 0;
	transition: opacity 0.2s ease;
}

.pgc-atc__dialog {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: 16px;
	max-height: 85vh;
	overflow-y: auto;
	padding: 28px 20px calc(20px + env(safe-area-inset-bottom, 0px));
	background: #fff;
	border-radius: 16px 16px 0 0;
	box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.18);
	transform: translateY(100%);
	transition: transform 0.25s ease;
	outline: none;
}

.pgc-atc.is-open .pgc-atc__overlay { opacity: 1; }
.pgc-atc.is-open .pgc-atc__dialog { transform: none; }

/* Selektor z #pgc-atc i !important: motyw (Hello Elementor) nadaje przyciskom ramkę i kolor. */
#pgc-atc .pgc-atc__close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 44px;
	height: 44px;
	min-height: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: transparent !important;
	box-shadow: none !important;
	color: var(--pgc-text) !important;
	font-size: 30px;
	font-weight: 400;
	line-height: 1;
	text-transform: none;
	cursor: pointer;
}

#pgc-atc .pgc-atc__close span { color: inherit; font-size: inherit; line-height: 1; }

#pgc-atc .pgc-atc__close:hover { background: #f1f3f5 !important; }

.pgc-atc__title {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding-right: 44px;
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 1.3;
}

.pgc-atc__badge {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: #dafbe1;
	color: #1a7f37;
}

/* Karta kursu – ten sam styl co w koszyku i podsumowaniu zamówienia. */
.pgc-atc__product {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding: 14px;
	border: 1px solid var(--pgc-border);
	border-radius: 12px;
	background: #fff;
}

.pgc-atc__thumb[hidden] { display: none; }

.pgc-atc__thumb {
	flex: 0 0 72px;
	width: 72px;
	height: 72px;
	overflow: hidden;
	border-radius: 8px;
	background: var(--pgc-bg-soft);
}

#pgc-atc .pgc-atc__thumb img {
	display: block;
	width: 72px !important;
	height: 72px !important;
	max-width: none;
	margin: 0 !important;
	object-fit: cover;
}

.pgc-atc__info { flex: 1 1 auto; min-width: 0; }

.pgc-atc__name {
	margin: 0;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.4;
	overflow-wrap: anywhere;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.pgc-atc__label {
	margin: 4px 0 0;
	color: var(--pgc-muted);
	font-size: 0.875rem;
}

.pgc-atc__price {
	margin: 6px 0 0;
	font-size: 1rem;
	font-weight: 700;
}

.pgc-atc__price del { opacity: 0.6; font-weight: 400; }
.pgc-atc__price ins { text-decoration: none; }

.pgc-atc__label[hidden],
.pgc-atc__cart[hidden] { display: none; }

.pgc-atc__cart {
	margin: 0;
	padding: 10px 14px;
	border-radius: 8px;
	background: var(--pgc-bg-soft);
	color: var(--pgc-muted);
	font-size: 0.875rem;
}

.pgc-atc__actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 4px;
}

#pgc-atc .pgc-atc__primary,
#pgc-atc .pgc-atc__checkout {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 12px 20px;
	border-radius: 8px;
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	text-align: center;
	text-decoration: none !important;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

#pgc-atc .pgc-atc__primary {
	border: 2px solid var(--pgc-accent);
	background: var(--pgc-accent);
	color: #1f2328 !important; /* kontrast 8,3:1 na złotym, biały miał 1,9:1 (WCAG AA wymaga 4,5:1) */
}

#pgc-atc .pgc-atc__primary:hover { border-color: var(--pgc-accent-hover); background: var(--pgc-accent-hover); }

/* Druga akcja: obrys, żeby nie konkurowała z koszykiem, ale była wyraźnie przyciskiem. */
#pgc-atc .pgc-atc__checkout {
	border: 2px solid #1f2328;
	background: #fff;
	color: #1f2328 !important;
}

#pgc-atc .pgc-atc__checkout:hover { background: #f1f3f5; }

#pgc-atc .pgc-atc__secondary {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	color: var(--pgc-text) !important;
	font-weight: 600;
	text-align: center;
	text-decoration: underline !important;
	text-underline-offset: 3px;
	cursor: pointer;
}

.pgc-atc__close:focus-visible,
.pgc-atc__primary:focus-visible,
.pgc-atc__checkout:focus-visible,
.pgc-atc__secondary:focus-visible {
	outline: 3px solid var(--pgc-focus);
	outline-offset: 2px;
}

html.pgc-atc-lock,
html.pgc-atc-lock body { overflow: hidden; }

/* Stan ładowania przycisku „Zapisz się na kurs”. */
.add_to_cart_button.loading,
a[href*="add-to-cart="][aria-busy="true"] {
	opacity: 0.6;
	pointer-events: none;
}

/* Desktop (uwaga Michała 28.11): karta w prawym górnym rogu o wysokości treści zamiast panelu na całą wysokość,
 * który przy jednym kursie był w większości pusty. */
@media (min-width: 768px) {
	.pgc-atc__dialog {
		top: 16px;
		left: auto;
		right: 16px;
		bottom: auto;
		width: min(440px, calc(100% - 32px));
		min-height: 0;
		max-height: calc(100vh - 32px);
		padding: 36px 28px 28px;
		border-radius: 16px;
		box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
		transform: translateX(calc(100% + 32px));
	}
	/* Pasek administratora WordPressa (tylko zalogowani w panelu). */
	.admin-bar .pgc-atc__dialog { top: 48px; max-height: calc(100vh - 64px); }

	.pgc-atc__actions { margin-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
	.pgc-atc__overlay,
	.pgc-atc__dialog { transition: none; }
}
