/* ============================================================
   Kody rabatowe przy produkcie — ramka „ciemny bilet" nad „Dodaj do koszyka".
   Kolory i fonty z tokenów motywu (Molten).
   ============================================================ */

.ws-kody {
	position: relative;
	overflow: hidden;
	margin: 0;
	padding: 14px 16px 6px;
	border-radius: 14px;
	color: #fff;
	background: linear-gradient(150deg, var(--ink-800, #2a2420), var(--ink-900, #1a1614));
}

.ws-kody::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image: repeating-linear-gradient(180deg, transparent 0 14px, rgba(255, 255, 255, 0.05) 14px 16px);
	pointer-events: none;
}

.ws-kody__head {
	position: relative;
	margin: 0 0 6px;
	font-family: var(--font-mono, monospace);
	font-size: 11px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.64);
}

.ws-kody__list {
	position: relative;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ws-kody__row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 9px 0;
	border-top: 1px dashed rgba(255, 255, 255, 0.16);
}

.ws-kody__amount {
	min-width: 76px;
	font-family: var(--font-display, sans-serif);
	font-weight: 700;
	font-size: 20px;
	line-height: 1;
	letter-spacing: -0.02em;
	color: var(--molten-300, #ff9f70);
	white-space: nowrap;
}

.ws-kody__condition {
	flex: 1 1 auto;
	font-size: 13px;
	line-height: 1.35;
	color: rgba(255, 255, 255, 0.86);
}

.ws-kody__code {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 40px;
	margin-left: auto;
	padding: 0 6px 0 10px;
	border: 1.5px dashed rgba(255, 159, 112, 0.7);
	border-radius: 8px;
	background: transparent;
	color: #fff;
	font: inherit;
	cursor: pointer;
	transition: background var(--dur-base, 200ms), border-color var(--dur-base, 200ms);
}

.ws-kody__code:hover {
	background: rgba(255, 255, 255, 0.06);
	border-color: var(--molten-300, #ff9f70);
}

.ws-kody__code:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.ws-kody__code-value {
	font-family: var(--font-mono, monospace);
	font-weight: 600;
	font-size: 14px;
	letter-spacing: 0.03em;
	white-space: nowrap;
}

.ws-kody__copy {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-width: 28px;
	height: 28px;
	padding: 0 6px;
	border-radius: 6px;
	background: rgba(255, 255, 255, 0.12);
	font-size: 12px;
	font-weight: 600;
	transition: background var(--dur-base, 200ms);
}

.ws-kody__copy-label {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.ws-kody__code.is-copied {
	border-color: var(--green-500, #1e8a5b);
}

.ws-kody__code.is-copied .ws-kody__copy {
	background: var(--green-500, #1e8a5b);
}

@media (max-width: 600px) {
	.ws-kody__row {
		flex-wrap: wrap;
		align-items: baseline;
		gap: 6px 10px;
	}

	.ws-kody__amount {
		min-width: 0;
	}

	.ws-kody__code {
		flex-basis: 100%;
		justify-content: space-between;
		min-height: 48px;
		margin-left: 0;
	}

	.ws-kody__copy {
		height: 36px;
		padding: 0 12px;
	}

	.ws-kody__copy-label {
		position: static;
		width: auto;
		height: auto;
		clip: auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ws-kody__code,
	.ws-kody__copy {
		transition: none;
	}
}

.ws-kody__icon,
.ws-kody__hint {
	display: none;
}

/* ============================================================
   Nowa karta produktu (.ws-pp): jasny kupon z wycięciami po bokach.
   ============================================================ */

.ws-pp .ws-kody {
	overflow: visible;
	padding: 12px 16px 4px;
	color: var(--ink-700, #3d362f);
	background: #fff8f3;
	border: 1px solid var(--molten-100, #ffe3d2);
}

.ws-pp .ws-kody::before,
.ws-pp .ws-kody::after {
	content: "";
	position: absolute;
	top: 50%;
	width: 16px;
	height: 16px;
	margin-top: -8px;
	border-radius: 50%;
	background: var(--paper, #fbfaf7);
	border: 1px solid var(--molten-100, #ffe3d2);
	background-image: none;
	inset: auto;
	pointer-events: none;
}

.ws-pp .ws-kody::before {
	left: -9px;
	top: 50%;
}

.ws-pp .ws-kody::after {
	right: -9px;
	top: 50%;
}

.ws-pp .ws-kody__head {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 8px;
	font-family: var(--font-sans, sans-serif);
	font-size: 13px;
	letter-spacing: 0;
	text-transform: none;
	color: var(--ink-900, #1a1614);
}

.ws-pp .ws-kody__icon {
	display: block;
	flex-shrink: 0;
	color: var(--molten-600, #d8410f);
}

.ws-pp .ws-kody__title {
	font-weight: 600;
}

.ws-pp .ws-kody__sub {
	color: var(--text-muted, #6b625a);
}

.ws-pp .ws-kody__row {
	padding: 10px 0;
	border-top: 1px dashed var(--molten-200, #ffc4a3);
}

.ws-pp .ws-kody__amount {
	min-width: 68px;
	font-size: 19px;
	color: var(--molten-600, #d8410f);
}

.ws-pp .ws-kody__condition {
	font-size: 13.5px;
	color: var(--ink-700, #3d362f);
}

.ws-pp .ws-kody__hint {
	display: block;
	font-size: 12px;
	color: var(--text-muted, #6b625a);
}

.ws-pp .ws-kody__hint.is-ok {
	color: var(--green-700, #146043);
}

.ws-pp .ws-kody__code {
	min-height: 38px;
	padding: 0 5px 0 11px;
	border-color: var(--molten-300, #ff9f70);
	background: var(--white, #fff);
	color: var(--ink-900, #1a1614);
}

.ws-pp .ws-kody__code:hover {
	background: var(--molten-50, #fff3ec);
	border-color: var(--molten-500, #f2541b);
}

.ws-pp .ws-kody__code:focus-visible {
	outline: 2px solid var(--molten-500, #f2541b);
}

.ws-pp .ws-kody__copy {
	background: var(--molten-50, #fff3ec);
	color: var(--molten-600, #d8410f);
}

.ws-pp .ws-kody__code.is-copied {
	border-color: var(--green-500, #1e8a5b);
}

.ws-pp .ws-kody__code.is-copied .ws-kody__copy {
	background: var(--green-100, #dbf0e3);
	color: var(--green-700, #146043);
}

@media (max-width: 600px) {
	.ws-pp .ws-kody__code {
		min-height: 44px;
	}

	.ws-pp .ws-kody__copy {
		height: 32px;
	}
}

.ws-kody__progress {
	display: none;
}

.ws-pp .ws-kody:has(.ws-kody__progress) .ws-kody__hint {
	display: none;
}

.ws-pp .ws-kody__progress {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 2px -16px -4px;
	padding: 12px 16px 14px;
	border-top: 1px dashed var(--molten-200, #ffc4a3);
	border-radius: 0 0 13px 13px;
	background: var(--molten-50, #fff3ec);
}

.ws-pp .ws-kody__progress-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 2px 12px;
}

.ws-pp .ws-kody__progress-label {
	font-size: 14px;
	font-weight: 600;
	color: var(--molten-700, #b0340c);
}

.ws-pp .ws-kody__progress-num {
	font-family: var(--font-mono, monospace);
	font-size: 12.5px;
	color: var(--ink-700, #3d362f);
	font-feature-settings: 'tnum' 1;
}

.ws-pp .ws-kody__bar {
	display: block;
	height: 8px;
	border-radius: 4px;
	background: var(--molten-100, #ffe3d2);
	overflow: hidden;
}

.ws-pp .ws-kody__bar-fill {
	display: block;
	height: 100%;
	border-radius: 4px;
	background: repeating-linear-gradient(90deg, var(--molten-500, #f2541b) 0 18px, var(--molten-400, #ff7a45) 18px 24px);
	transition: width var(--dur-slow, 320ms) var(--ease-out, ease-out);
}

.ws-pp .ws-kody__progress.is-ok .ws-kody__progress-label {
	color: var(--green-700, #146043);
}

.ws-pp .ws-kody__progress.is-ok .ws-kody__bar {
	background: var(--green-100, #dbf0e3);
}

.ws-pp .ws-kody__progress.is-ok .ws-kody__bar-fill {
	background: repeating-linear-gradient(90deg, var(--green-500, #1e8a5b) 0 18px, #3fae7a 18px 24px);
}

.ws-pp .ws-kody__progress-link {
	display: inline-flex;
	align-self: flex-start;
	align-items: center;
	gap: 6px;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--molten-600, #d8410f);
	text-decoration: underline;
	text-decoration-color: var(--molten-200, #ffc4a3);
	text-underline-offset: 3px;
}

.ws-pp .ws-kody__progress-link[hidden] {
	display: none;
}

.ws-pp .ws-kody__progress-link:hover {
	color: var(--molten-700, #b0340c);
	text-decoration-color: currentColor;
}

@media (prefers-reduced-motion: reduce) {
	.ws-pp .ws-kody__bar-fill {
		transition: none;
	}
}

/* ---- Stany kodów w nowej karcie: złapany rabat świeci, niezłapane pokazują brakującą kwotę ---- */
.ws-kody__status {
	display: none;
}

.ws-pp .ws-kody__condition-text {
	display: block;
}

.ws-pp .ws-kody__status {
	display: block;
	margin-top: 2px;
	font-size: 12px;
	color: var(--text-muted, #6b625a);
}

.ws-pp .ws-kody__status:empty {
	display: none;
}

.ws-pp .ws-kody__row {
	transition: background var(--dur-base, 200ms), box-shadow var(--dur-base, 200ms), opacity var(--dur-base, 200ms);
}

.ws-pp .ws-kody__row.is-active {
	position: relative;
	margin: 4px -9px;
	padding: 12px 8px;
	border: 1.5px solid var(--molten-400, #ff7a45);
	border-radius: 12px;
	background: var(--white, #fff);
	box-shadow: 0 0 0 4px rgba(242, 84, 27, 0.1), 0 8px 22px rgba(242, 84, 27, 0.22);
	animation: ws-kody-glow 2.6s ease-in-out infinite;
}

.ws-pp .ws-kody__row.is-active + .ws-kody__row {
	border-top-color: transparent;
}

.ws-pp .ws-kody__row.is-active .ws-kody__amount {
	font-size: 22px;
	color: var(--molten-600, #d8410f);
}

.ws-pp .ws-kody__row.is-active .ws-kody__condition-text {
	color: var(--ink-900, #1a1614);
}

.ws-pp .ws-kody__row.is-active .ws-kody__status {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	margin-top: 5px;
	padding: 3px 9px 3px 7px;
	border-radius: 999px;
	background: var(--green-100, #dbf0e3);
	color: var(--green-700, #146043);
	font-weight: 600;
}

.ws-pp .ws-kody__row.is-active .ws-kody__status::before {
	content: "";
	width: 12px;
	height: 12px;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}

.ws-pp .ws-kody__row.is-active .ws-kody__code {
	border-style: solid;
	border-color: var(--molten-500, #f2541b);
	background: var(--molten-50, #fff3ec);
}

.ws-pp .ws-kody__row.is-lower {
	opacity: 0.5;
}

.ws-pp .ws-kody__row.is-locked .ws-kody__amount {
	color: var(--molten-300, #ff9f70);
}

.ws-pp .ws-kody__row.is-locked .ws-kody__condition-text {
	color: var(--ink-500, #6b625a);
}

.ws-pp .ws-kody__row.is-locked .ws-kody__status::before {
	content: "";
	display: inline-block;
	width: 11px;
	height: 11px;
	margin: 0 5px -1px 0;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E") center / contain no-repeat;
}

.ws-pp .ws-kody__progress[hidden] {
	display: none;
}

@keyframes ws-kody-glow {
	0%, 100% {
		box-shadow: 0 0 0 4px rgba(242, 84, 27, 0.1), 0 8px 22px rgba(242, 84, 27, 0.2);
	}
	50% {
		box-shadow: 0 0 0 6px rgba(242, 84, 27, 0.16), 0 10px 30px rgba(242, 84, 27, 0.34);
	}
}

@media (max-width: 600px) {
	.ws-pp .ws-kody__row.is-active {
		margin: 4px -8px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ws-pp .ws-kody__row,
	.ws-pp .ws-kody__row.is-active {
		transition: none;
		animation: none;
	}
}
