/**
 * PMG – Produkty (slider) widget styles.
 *
 * @package Solatic
 */

.pmg-ps {
	--pmg-ps-gap: 24px;
	--pmg-ps-per-view: 4;
	--pmg-ps-per-view-t: 2;
	--pmg-ps-per-view-m: 1;
	--pmg-ps-cur: var(--pmg-ps-per-view);
	width: 100%;
	box-sizing: border-box;
}

.pmg-ps *,
.pmg-ps *::before,
.pmg-ps *::after {
	box-sizing: border-box;
}

.pmg-ps__heading {
	text-align: center;
	margin: 0 0 28px;
	font-weight: 700;
}

/* ---- Viewport + arrows row ---- */
.pmg-ps__viewport-wrap {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
}

.pmg-ps__viewport {
	overflow: hidden;
	flex: 1 1 auto;
	min-width: 0;
}

.pmg-ps__track {
	display: flex;
	gap: var(--pmg-ps-gap);
	transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
	will-change: transform;
}

.pmg-ps__track.is-dragging {
	transition: none;
	cursor: grabbing;
}

/* Each slide width = (100% - gaps) / per-view */
.pmg-ps__slide {
	flex: 0 0 calc((100% - (var(--pmg-ps-cur) - 1) * var(--pmg-ps-gap)) / var(--pmg-ps-cur));
	max-width: calc((100% - (var(--pmg-ps-cur) - 1) * var(--pmg-ps-gap)) / var(--pmg-ps-cur));
	display: flex;
}

/* ---- Card ---- */
.pmg-ps__card {
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
	background: #fff;
	border: 1px solid #e9eef0;
	border-radius: 14px;
	padding: 18px;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.pmg-ps__card:hover {
	box-shadow: 0 12px 30px rgba(15, 27, 45, 0.08);
}

.pmg-ps__media {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 170px;
	margin-bottom: 18px;
}

.pmg-ps__media img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
}

/* Body grows so footers align across cards of unequal title length */
.pmg-ps__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
}

.pmg-ps__title {
	display: block;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
	color: #5b6470;
	text-decoration: none;
	margin-bottom: 14px;
}

.pmg-ps__title:hover {
	text-decoration: underline;
}

/* Footer pinned to bottom -> equal baseline regardless of title height */
.pmg-ps__footer {
	margin-top: auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.pmg-ps__price {
	font-size: 18px;
	font-weight: 700;
	color: #0f1b2d;
}

.pmg-ps__price del {
	font-size: 0.75em;
	font-weight: 500;
	opacity: 0.6;
	margin-right: 4px;
}

/* ---- Add to cart button ---- */
.pmg-ps__cart {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	flex: 0 0 auto;
	border-radius: 10px;
	background: #16a34a;
	color: #fff;
	text-decoration: none;
	transition: filter 0.2s ease;
}

.pmg-ps__cart:hover {
	filter: brightness(0.92);
	color: #fff;
}

.pmg-ps__cart.loading {
	opacity: 0.6;
	pointer-events: none;
}

.pmg-ps__cart.added::after {
	content: none !important;
}

/* ---- Login (price hidden) ---- */
.pmg-ps__login {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 11px 14px;
	border-radius: 10px;
	background: #16a34a;
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	transition: filter 0.2s ease;
}

.pmg-ps__login:hover {
	filter: brightness(0.92);
	color: #fff;
}

/* ---- Arrows ---- */
.pmg-ps__arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	flex: 0 0 auto;
	border-radius: 50%;
	border: 1px solid #d9e0e3;
	background: #fff;
	color: #16a34a;
	cursor: pointer;
	transition: border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.pmg-ps__arrow:disabled {
	opacity: 0.35;
	cursor: default;
}

.pmg-ps__arrow i {
	font-size: 20px;
	line-height: 1;
}

.pmg-ps__arrow svg {
	width: 20px;
	height: 20px;
	fill: currentColor;
}

/* ---- Dots ---- */
.pmg-ps__dots {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 22px;
}

.pmg-ps__dot {
	width: 9px;
	height: 9px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #d2dadd;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease;
}

.pmg-ps__dot.is-active {
	background: #16a34a;
	transform: scale(1.2);
}

/* ---- Responsive per-view ---- */
@media (max-width: 1024px) {
	.pmg-ps {
		--pmg-ps-cur: var(--pmg-ps-per-view-t);
	}
}

@media (max-width: 767px) {
	.pmg-ps {
		--pmg-ps-cur: var(--pmg-ps-per-view-m);
	}

	.pmg-ps__arrow {
		width: 38px;
		height: 38px;
	}
}
