/* KraftBox WEB-05 E3 – panel po dodaniu: ≥ 768 px boczny 448 px, < 768 px bottom sheet (forma B, styl A). Wszystko pod #kb-pd. */

.kb-pd {
	--kb-yel: #F6D813; --kb-ink: #14141A; --kb-ink2: #3A3D4A; --kb-mut: #5A5D6B; --kb-bg: #F4F5FB; --kb-line: #E3E5EC;
	--kb-blue: #4652D0; --kb-blue-d: #3440B8; --kb-ok: #0E7A2C;
	--kb-sora: "KB Sora", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	--kb-inter: "KB Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	position: fixed; inset: 0; z-index: 2147483000;
	font-family: var(--kb-inter); font-size: 15px; line-height: 1.45; color: var(--kb-ink); text-align: left; font-variant-numeric: tabular-nums;
}
.kb-pd[hidden] { display: none !important; }
.kb-pd * { box-sizing: border-box; transition: none; }
.kb-pd :is(a, button):focus-visible, .kb-pd .kb-pd-title:focus-visible { outline: 3px solid var(--kb-blue); outline-offset: 2px; box-shadow: none; }
.kb-pd .kb-pd-title:focus:not(:focus-visible) { outline: none; }
.kb-pd :is(p, h2, h3, ul) { margin: 0; padding: 0; }

/* blokada przewijania strony pod panelem (także iOS) – pozycja zachowana w JS */
html.kb-pd-lock, html.kb-pd-lock body { overflow: hidden !important; }
html.kb-pd-lock body { position: fixed; left: 0; right: 0; width: 100%; }
/* zastąpienie szuflady Astry przy otwartym panelu */
html.kb-pd-lock #astra-mobile-cart-drawer, html.kb-pd-lock .astra-mobile-cart-overlay { display: none !important; }

.kb-pd-tlo { position: absolute; inset: 0; background: rgba(20, 20, 26, .5); opacity: 0; transition: opacity .24s ease; }
.kb-pd-open .kb-pd-tlo { opacity: 1; }

.kb-pd-panel {
	position: absolute; top: 0; right: 0; bottom: 0; width: 448px; max-width: 100%;
	display: flex; flex-direction: column; background: #fff; box-shadow: -16px 0 40px rgba(20, 20, 26, .22);
	transform: translateX(100%); transition: transform .24s cubic-bezier(.2, .8, .2, 1); overscroll-behavior: contain;
}
.kb-pd-open .kb-pd-panel { transform: translateX(0); }
.kb-pd-ochrona .kb-pd-panel :is(a, button) { pointer-events: none; }

.kb-pd .kb-pd-tresc { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; padding: 28px 28px 0; }
.kb-pd-uchwyt { display: none; }

.kb-pd-head { display: flex; align-items: center; gap: 12px; margin: 0 0 20px; }
.kb-pd-ok { display: flex; flex: 0 0 26px; }
.kb-pd .kb-pd-title { flex: 1 1 auto; font-family: var(--kb-sora); font-weight: 700; font-size: 21px; line-height: 1.25; letter-spacing: -.02em; color: var(--kb-ink); }
.kb-pd .kb-pd-x {
	display: flex; align-items: center; justify-content: center; flex: 0 0 44px; width: 44px; height: 44px; margin: -6px -6px -6px 0; padding: 0;
	border: 0; border-radius: 50%; background: var(--kb-bg); color: var(--kb-ink); cursor: pointer; box-shadow: none;
}
.kb-pd .kb-pd-x:hover { background: #E8EAF4; color: var(--kb-ink); }

.kb-pd-added { display: flex; align-items: center; gap: 16px; padding: 16px; border-radius: 14px; background: var(--kb-bg); }
.kb-pd .kb-pd-added img { display: block; flex: 0 0 72px; width: 72px; height: 72px; max-width: none; margin: 0; border-radius: 10px; object-fit: cover; background: #fff; }
.kb-pd-added-info { min-width: 0; }
.kb-pd .kb-pd-added-name { font-weight: 600; font-size: 16px; line-height: 1.35; color: var(--kb-ink); }
.kb-pd .kb-pd-added-qty { margin-top: 4px; font-size: 14px; color: var(--kb-mut); }
.kb-pd-added-qty .woocommerce-Price-amount, .kb-pd-qty .woocommerce-Price-amount { color: inherit; font-weight: 400; }

.kb-pd-listhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 24px 0 6px; }
.kb-pd .kb-pd-h3 { font-family: var(--kb-sora); font-weight: 700; font-size: 17px; line-height: 1.3; color: var(--kb-ink); }
.kb-pd-count { font-size: 14px; color: var(--kb-mut); white-space: nowrap; }

.kb-pd .kb-pd-list { list-style: none; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0 -4px 0 0; padding: 0 4px 8px 0; }
.kb-pd .kb-pd-item { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; column-gap: 14px; align-items: center; margin: 0; padding: 12px 0; border-top: 1px solid var(--kb-line); }
.kb-pd .kb-pd-item:first-child { border-top: 0; }
.kb-pd .kb-pd-item img { display: block; width: 56px; height: 56px; max-width: none; margin: 0; border-radius: 8px; object-fit: cover; background: var(--kb-bg); }
.kb-pd-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kb-pd .kb-pd-name {
	display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
	font-weight: 600; font-size: 15px; line-height: 1.35; color: var(--kb-ink); text-decoration: none;
}
.kb-pd a.kb-pd-name:hover { text-decoration: underline; color: var(--kb-ink); }
.kb-pd-qty { font-size: 13.5px; color: var(--kb-mut); }
.kb-pd-sum { font-family: var(--kb-sora); font-weight: 700; font-size: 15px; color: var(--kb-ink); white-space: nowrap; text-align: right; }
.kb-pd-sum .woocommerce-Price-amount, .kb-pd-total .woocommerce-Price-amount { color: inherit; }
.kb-pd-empty { margin: 16px 0 28px !important; color: var(--kb-ink2); }

.kb-pd-foot {
	flex: 0 0 auto; margin: 0 -28px; padding: 18px 28px 28px; background: #fff;
	box-shadow: 0 -10px 24px rgba(20, 20, 26, .06);
}
.kb-pd-total { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 16px; font-size: 16px; }
.kb-pd-total strong { font-family: var(--kb-sora); font-weight: 700; font-size: 17px; color: var(--kb-ink); }

.kb-pd .kb-pd-btn {
	display: flex; align-items: center; justify-content: center; width: 100%; margin: 0; padding: 0 20px; border: 0; border-radius: 999px;
	text-align: center; text-decoration: none; box-shadow: none; cursor: pointer; transition: background-color .15s ease, color .15s ease;
}
.kb-pd .kb-pd-btn--yel { min-height: 52px; background: var(--kb-yel); color: #000; font-family: var(--kb-sora); font-weight: 800; font-size: 16.5px; }
.kb-pd .kb-pd-btn--yel:hover { background: #E9CB0B; color: #000; }
.kb-pd-sec { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.kb-pd .kb-pd-btn--alt { min-height: 48px; background: var(--kb-bg); color: var(--kb-ink); font-weight: 600; font-size: 15px; }
.kb-pd .kb-pd-btn--alt:hover { background: #E8EAF4; color: var(--kb-ink); }
.kb-pd .kb-pd-continue { min-height: 44px; background: none; color: var(--kb-blue-d); font-family: var(--kb-inter); font-weight: 600; font-size: 15px; letter-spacing: 0; text-transform: none; }
.kb-pd .kb-pd-continue:hover { background: none; color: var(--kb-blue-d); text-decoration: underline; }

/* pasek FSL (wtyczka) – wygląd jak w E1/E2 */
.kb-pd .kb-pd-fsl { margin: 0 0 14px; }
.kb-pd .kb-pd-fsl:not(:has(.devnet_fsl-free-shipping, strong)), .kb-pd .kb-pd-fsl:has(> .fsl-wrapper:empty) { display: none; }
.kb-pd .kb-pd-fsl .fsl-wrapper { margin: 0; padding: 0; }
.kb-pd .kb-pd-fsl .devnet_fsl-free-shipping, .kb-pd .kb-pd-fsl > .fsl-wrapper > .fsl-wrapper {
	display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; text-align: left;
}
.kb-pd .kb-pd-fsl .fsl-description { order: 1; display: block; margin: 0; font-size: 15px; line-height: 1.4; color: var(--kb-ink); text-align: left; }
.kb-pd .kb-pd-fsl .fsl-description .amount { font-weight: 700; }
.kb-pd .kb-pd-fsl .fsl-progress-bar { order: 2; height: 6px !important; margin: 0; padding: 0; border: 0 !important; border-radius: 999px; background: var(--kb-line) !important; overflow: hidden; }
.kb-pd .kb-pd-fsl .fsl-progress-bar::before, .kb-pd .kb-pd-fsl .fsl-progress-bar::after, .kb-pd .kb-pd-fsl .fsl-progress-amount::before, .kb-pd .kb-pd-fsl .fsl-progress-amount::after { display: none !important; }
.kb-pd .kb-pd-fsl .fsl-progress-amount { display: block; height: 6px !important; border-radius: 999px; background: var(--kb-blue) !important; background-image: none !important; animation: none !important; }
.kb-pd .kb-pd-fsl .fsl-title { order: 3; margin: 0; padding: 0; font-family: var(--kb-inter); font-weight: 400; font-size: 13px; line-height: 1.45; letter-spacing: 0; text-transform: none; color: var(--kb-mut); text-align: left; }
.kb-pd .kb-pd-fsl .fsl-threshold-reached .fsl-title, .kb-pd .kb-pd-fsl > .fsl-wrapper > .fsl-wrapper strong { font-size: 15px; font-weight: 600; color: var(--kb-ok); }
.kb-pd .kb-pd-fsl :is(.devnet_fsl-free-shipping, .fsl-title, .fsl-description) { text-align: left !important; }
.kb-pd .kb-pd-fsl > .fsl-wrapper > .fsl-wrapper > div { text-align: left !important; }

/* ---------- telefon: bottom sheet */
@media (max-width: 767px) {
	.kb-pd-panel {
		top: auto; left: 0; right: 0; bottom: 0; width: 100%;
		max-height: calc(100vh - 56px); max-height: calc(100dvh - 56px);
		border-radius: 20px 20px 0 0; box-shadow: 0 -16px 40px rgba(20, 20, 26, .22);
		transform: translateY(100%);
	}
	.kb-pd-open .kb-pd-panel { transform: translateY(0); }
	.kb-pd .kb-pd-tresc { padding: 8px 20px 0; }
	.kb-pd-uchwyt { display: block; width: 40px; height: 5px; margin: 0 auto 12px; border-radius: 3px; background: #D5D8DC; }
	.kb-pd-head { margin-bottom: 14px; touch-action: none; }
	.kb-pd .kb-pd-title { font-size: 19px; }
	.kb-pd-added { gap: 14px; padding: 12px; }
	.kb-pd .kb-pd-added img { flex-basis: 64px; width: 64px; height: 64px; }
	.kb-pd .kb-pd-added-name { font-size: 15px; }
	.kb-pd .kb-pd-added-qty { font-size: 13.5px; }
	.kb-pd-listhead { margin-top: 18px; }
	.kb-pd .kb-pd-item { grid-template-columns: 48px minmax(0, 1fr) auto; column-gap: 12px; padding: 10px 0; }
	.kb-pd .kb-pd-item img { width: 48px; height: 48px; }
	.kb-pd .kb-pd-name { font-size: 14px; }
	.kb-pd-qty { font-size: 12.5px; }
	.kb-pd-sum { font-size: 14px; }
	.kb-pd-foot { margin: 0 -20px; padding: 14px 20px calc(16px + env(safe-area-inset-bottom)); }
	.kb-pd-total { margin-bottom: 12px; font-size: 15.5px; }
	.kb-pd .kb-pd-btn--yel { min-height: 54px; font-size: 16.5px; }
	.kb-pd-sec { flex-direction: row; gap: 10px; }
	.kb-pd-sec .kb-pd-btn { flex: 1 1 0; min-height: 48px; padding: 0 12px; }
	.kb-pd .kb-pd-continue { background: var(--kb-bg); color: var(--kb-ink); }
	.kb-pd .kb-pd-continue:hover { background: #E8EAF4; color: var(--kb-ink); text-decoration: none; }
}
@media (max-width: 360px) {
	.kb-pd-sec { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
	.kb-pd-panel, .kb-pd-open .kb-pd-panel { transform: none; transition: opacity .12s linear; opacity: 0; }
	.kb-pd-open .kb-pd-panel { opacity: 1; }
	.kb-pd-tlo { transition: opacity .12s linear; }
}
