/* ==========================================================================
   Cart drawer (Figma "1b Desktop - mini-cart")
   Markup: #cart-modal in inc/frontend/footer.php + woocommerce/cart/mini-cart.php,
   JS: js/mini-cart.js. Opened/closed by the theme's sober.openModal()/closeModal().
   ========================================================================== */

.oc-cart-drawer {
	--oc-brand: #e85d0c;
	--oc-brand-tint: #fef6f1;
	--oc-brand-tint-2: #f3dccc;
	--oc-ink: #141414;
	--oc-ink-3: #5c5c5c;
	--oc-line: #eceae7;
	--oc-border-input: #dcd8d4;
	--oc-surface: #fff;
	--oc-surface-3: #f6f4f2;
	--oc-placeholder: #9a9a9a;
	--oc-success: #1a7f4b;
	--oc-error: #c62828;
}

/* The modal itself becomes a transparent full-screen layer: backdrop + panel. */
.sober-modal.oc-cart-drawer {
	overflow: hidden;
	background: transparent;
	font-family: "Poppins", sans-serif;
	color: var(--oc-ink);
}

.sober-modal.oc-cart-drawer.open {
	/* Above the fixed NFZ banner (z-index 9999, inc/reimbursement). */
	z-index: 10000;
}

.oc-cart-drawer .sober-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(20, 20, 20, .35);
	cursor: pointer;
}

.oc-drawer {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	width: 436px;
	max-width: 100%;
	background: var(--oc-surface);
	box-shadow: -8px 0 40px rgba(20, 20, 20, .12);
}

/* sober.openModal() shows the modal (display:block) and adds .open in the same tick,
   so a transition wouldn't run - a keyframe animation does. */
.oc-cart-drawer.open .oc-drawer {
	animation: oc-drawer-in .3s cubic-bezier(.2, .8, .2, 1);
}

@keyframes oc-drawer-in {
	from {
		transform: translateX(100%);
	}
}

@media (prefers-reduced-motion: reduce) {
	.oc-cart-drawer.open .oc-drawer {
		animation: none;
	}
}

.admin-bar .oc-drawer {
	top: 32px;
}

/* Header */
.oc-drawer__head {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: space-between;
	padding: 22px 24px;
	border-bottom: 1px solid var(--oc-line);
}

.oc-drawer__title {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 18px;
	font-weight: 800;
	line-height: 1;
}

.oc-drawer__title .cart-counter {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 22px;
	height: 22px;
	padding: 0 7px;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	color: var(--oc-surface);
	background: var(--oc-brand);
	border-radius: 999px;
}

.oc-cart-drawer .oc-drawer__close {
	position: static;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	margin: -6px -6px -6px 0;
	font-size: 15px;
	font-weight: 700;
	line-height: 1;
	color: var(--oc-ink-3);
	text-decoration: none;
	transform: none;
	border-radius: 8px;
}

.oc-cart-drawer .oc-drawer__close:hover {
	color: var(--oc-ink);
	background: var(--oc-surface-3);
}

/* Fragment wrapper fills the rest of the panel. */
.oc-cart-drawer .widget_shopping_cart_content {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-height: 0;
}

.oc-mc {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-height: 0;
}

/* Free shipping progress */
.oc-mc__shipping {
	display: flex;
	flex: 0 0 auto;
	flex-direction: column;
	gap: 8px;
	padding: 14px 24px;
	background: var(--oc-brand-tint);
}

.oc-mc__shipping-text {
	margin: 0;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.4;
	color: var(--oc-ink);
}

.oc-mc__shipping-text .amount {
	font-weight: inherit;
	color: inherit;
}

.oc-mc__progress {
	height: 6px;
	overflow: hidden;
	background: var(--oc-brand-tint-2);
	border-radius: 999px;
}

.oc-mc__progress span {
	display: block;
	height: 100%;
	background: var(--oc-brand);
	border-radius: 999px;
	transition: width .3s;
}

.oc-mc__shipping.is-free .oc-mc__shipping-text {
	color: var(--oc-success);
}

.oc-mc__shipping.is-free .oc-mc__progress span {
	background: var(--oc-success);
}

/* Items */
.oc-mc__body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding: 8px 24px;
	overscroll-behavior: contain;
}

.oc-cart-drawer ul.oc-mc__items {
	margin: 0;
	padding: 0;
	list-style: none;
	border: 0;
}

.oc-cart-drawer ul.oc-mc__items li.oc-mc-item {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 14px;
	margin: 0;
	padding: 18px 0;
	border: 0;
	border-bottom: 1px solid var(--oc-line);
	transition: opacity .2s;
}

.oc-mc-item.is-busy {
	opacity: .55;
	pointer-events: none;
}

.oc-mc-item__thumb {
	display: block;
	flex: 0 0 64px;
	width: 64px;
	height: 78px;
	overflow: hidden;
	background: var(--oc-surface-3);
	border-radius: 8px;
}

.oc-cart-drawer .oc-mc-item__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: contain;
}

.oc-mc-item__body {
	display: flex;
	flex: 1 1 0;
	flex-direction: column;
	gap: 10px;
	min-width: 0;
}

.oc-cart-drawer .oc-mc-item__name {
	font-size: 14px;
	font-weight: 700;
	line-height: 1.4;
	color: var(--oc-ink);
	text-decoration: none;
}

.oc-cart-drawer .oc-mc-item__name:hover {
	color: var(--oc-brand);
}

.oc-cart-drawer .oc-mc-item__body dl.variation {
	margin: -6px 0 0;
	font-size: 12px;
	color: var(--oc-ink-3);
}

.oc-cart-drawer .oc-mc-item__body dl.variation dt,
.oc-cart-drawer .oc-mc-item__body dl.variation dd,
.oc-cart-drawer .oc-mc-item__body dl.variation p {
	display: inline;
	margin: 0;
	font-weight: 400;
}

.oc-mc-item__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.oc-cart-drawer .oc-mc-item__price {
	font-size: 15px;
	font-weight: 800;
	white-space: nowrap;
	color: var(--oc-ink);
}

.oc-cart-drawer .oc-mc-item__price .amount {
	font-weight: inherit;
	color: inherit;
}

.oc-mc-item__qty-fixed {
	font-size: 12px;
	color: var(--oc-ink-3);
}

.oc-cart-drawer a.oc-mc-item__remove.remove {
	position: static;
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	margin: -2px -4px 0 0;
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
	/* WooCommerce colours a.remove red with !important. */
	color: var(--oc-placeholder) !important;
	text-decoration: none;
	background: none;
	border-radius: 6px;
}

.oc-cart-drawer a.oc-mc-item__remove.remove:hover {
	color: var(--oc-ink) !important;
	background: var(--oc-surface-3);
}

.oc-mc-item__error {
	margin: 0;
	font-size: 12px;
	line-height: 1.4;
	color: var(--oc-error);
}

/* Quantity stepper */
.oc-stepper {
	display: inline-flex;
	align-items: center;
	height: 34px;
	overflow: hidden;
	background: var(--oc-surface);
	border: 1px solid var(--oc-border-input);
	border-radius: 8px;
}

.oc-cart-drawer .oc-stepper__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	margin: 0;
	padding: 0;
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	line-height: 1;
	color: var(--oc-ink-3);
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	cursor: pointer;
}

.oc-cart-drawer .oc-stepper__btn:hover:not(:disabled) {
	color: var(--oc-ink);
	background: var(--oc-surface-3);
}

.oc-cart-drawer .oc-stepper__btn:disabled {
	color: var(--oc-border-input);
	cursor: default;
}

.oc-stepper__value {
	min-width: 30px;
	font-size: 14px;
	font-weight: 800;
	text-align: center;
}

/* Cross-sells */
.oc-mc__cross {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 18px 0;
}

.oc-mc__cross-title {
	margin: 0;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.4;
}

.oc-mc-cross {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border: 1px solid var(--oc-line);
	border-radius: 10px;
}

.oc-mc-cross__thumb {
	display: block;
	flex: 0 0 40px;
	width: 40px;
	height: 40px;
	overflow: hidden;
	background: var(--oc-surface-3);
	border-radius: 8px;
}

.oc-cart-drawer .oc-mc-cross__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: contain;
}

.oc-cart-drawer .oc-mc-cross__name {
	flex: 1 1 0;
	min-width: 0;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.4;
	color: var(--oc-ink);
	text-decoration: none;
}

.oc-mc-cross__price {
	font-size: 13px;
	font-weight: 700;
	white-space: nowrap;
}

.oc-mc-cross__price .amount {
	font-weight: inherit;
	color: inherit;
}

.oc-cart-drawer .oc-mc-cross__add {
	flex: 0 0 auto;
	padding: 7px 10px;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	color: var(--oc-brand);
	text-decoration: none;
	background: var(--oc-surface);
	border: 1px solid var(--oc-brand);
	border-radius: 8px;
}

.oc-cart-drawer .oc-mc-cross__add:hover {
	color: var(--oc-surface);
	background: var(--oc-brand);
}

.oc-cart-drawer .oc-mc-cross__add.loading {
	opacity: .6;
	pointer-events: none;
}

/* WooCommerce appends a "Zobacz koszyk" link after an AJAX add - the drawer re-renders anyway. */
.oc-cart-drawer .added_to_cart {
	display: none;
}

/* Footer */
.oc-mc__foot {
	display: flex;
	flex: 0 0 auto;
	flex-direction: column;
	gap: 12px;
	padding: 20px 24px;
	background: var(--oc-surface);
	border-top: 1px solid var(--oc-line);
}

.oc-mc__row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.4;
}

.oc-mc__row > span:first-child {
	color: var(--oc-ink-3);
}

.oc-mc__row .amount,
.oc-mc__total .amount {
	font-weight: inherit;
	color: inherit;
}

.oc-mc__total {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	font-weight: 800;
	line-height: 1;
}

.oc-mc__total > span:first-child {
	font-size: 15px;
}

.oc-mc__total > span:last-child {
	font-size: 24px;
}

.oc-cart-drawer .oc-mc__cta {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 54px;
	margin: 0;
	padding: 0 20px;
	font-family: inherit;
	font-size: 16px;
	font-weight: 800;
	line-height: 1;
	letter-spacing: 0;
	text-transform: none;
	text-decoration: none;
	color: var(--oc-surface);
	background: var(--oc-brand);
	border: 0;
	border-radius: 12px;
	box-shadow: none;
	cursor: pointer;
	transition: filter .15s;
}

.oc-cart-drawer .oc-mc__cta:hover {
	color: var(--oc-surface);
	filter: brightness(.94);
}

.oc-cart-drawer .oc-mc__continue {
	position: static;
	align-self: center;
	margin: 0;
	padding: 2px 6px;
	font-family: inherit;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.4;
	text-transform: none;
	letter-spacing: 0;
	color: var(--oc-ink-3);
	background: none;
	border: 0;
	box-shadow: none;
	transform: none;
	cursor: pointer;
}

.oc-cart-drawer .oc-mc__continue:hover {
	color: var(--oc-ink);
	text-decoration: underline;
}

/* Empty cart */
.oc-mc__empty {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 18px;
	padding: 32px 24px;
	text-align: center;
}

.oc-cart-drawer .oc-mc__empty .woocommerce-mini-cart__empty-message {
	margin: 0;
	padding: 0;
	font-size: 15px;
	font-weight: 700;
	color: var(--oc-ink-3);
}

.oc-mc__empty .oc-mc__cta {
	max-width: 280px;
}

.oc-cart-drawer .oc-drawer :focus-visible {
	outline: 2px solid var(--oc-brand);
	outline-offset: 2px;
}

/* The theme's blockUI overlay while an item is being removed. */
.oc-cart-drawer .blockUI.blockOverlay {
	background: rgba(255, 255, 255, .6) !important;
}

@media (max-width: 782px) {
	.admin-bar .oc-drawer {
		top: 46px;
	}
}

@media (max-width: 480px) {
	.oc-drawer__head,
	.oc-mc__shipping,
	.oc-mc__foot {
		padding-left: 16px;
		padding-right: 16px;
	}

	.oc-mc__body {
		padding-left: 16px;
		padding-right: 16px;
	}
}

/* Mobile (Figma 1c): bottom sheet with a grab handle instead of a side panel. */
@media (max-width: 767px) {
	.oc-drawer,
	.admin-bar .oc-drawer {
		top: auto;
		right: 0;
		bottom: 0;
		left: 0;
		width: 100%;
		max-height: 88vh;
		max-height: 88dvh;
		border-radius: 18px 18px 0 0;
		box-shadow: 0 -8px 40px rgba(20, 20, 20, .14);
	}

	.oc-drawer:before {
		content: "";
		display: block;
		flex: 0 0 auto;
		width: 40px;
		height: 4px;
		margin: 10px auto 0;
		background: #dcd8d4;
		border-radius: 999px;
	}

	.oc-cart-drawer.open .oc-drawer {
		animation-name: oc-sheet-in;
	}

	.oc-drawer__head {
		padding: 12px 20px 16px;
		border-bottom: 0;
	}

	.oc-mc__foot {
		padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
	}

	/* Products line repeats "Razem" in the sheet - the design shows the total only. */
	.oc-mc__foot .oc-mc__row:first-child {
		display: none;
	}
}

@keyframes oc-sheet-in {
	from {
		transform: translateY(100%);
	}
}
