/* Hide WooCommerce default "added to cart" message */
.woocommerce-message,
.woocommerce-notices-wrapper .woocommerce-message {
	display: none !important;
}

/* InPost Pay widget - zawsze na wierzchu */
.inpost-pay-widget,
.inpost-izi-widget,
[class*='inpost-pay'],
[class*='inpost-izi'],
inpost-izi-button,
#inpost-pay-modal,
#inpost-izi-modal,
div[id*='inpost'] {
	z-index: 999999 !important;
}

/* Gdy widget InPost jest widoczny, body NIE powinno być blokowane */
body:has(inpost-izi-widget),
body:has(.inpost-pay-widget),
body:has([class*='inpost-izi']) {
	overflow: auto !important;
}

/* Slide-in Cart Styles */
.slide-in-cart-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	z-index: 9998;
	opacity: 0;
	visibility: hidden;
	transition:
		opacity 0.3s ease,
		visibility 0.3s ease;
}

.slide-in-cart-overlay.active {
	opacity: 1;
	visibility: visible;
}

.slide-in-cart {
	position: fixed;
	top: 0;
	right: 0;
	width: 100%;
	max-width: 450px;
	height: 100%;
	background: #fff;
	z-index: 9999;
	transform: translateX(100%);
	transition: transform 0.3s ease;
	display: flex;
	flex-direction: column;
	box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
}

.slide-in-cart.active {
	transform: translateX(0);
}

.slide-in-cart.active.collapsed {
	transform: translateX(100%);
	box-shadow: none;
}

.slide-in-cart-floating-toggle {
	position: fixed;
	top: 32px;
	right: 16px;
	z-index: 10001;
	width: 48px;
	height: 48px;
	border-radius: 999px;
	border: 1px solid #d1d5db;
	background: #fff;
	color: #111827;
	font-size: 20px;
	font-weight: 700;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
	opacity: 0;
	pointer-events: none;
	transform: translateY(-6px);
	transition:
		opacity 0.2s ease,
		transform 0.2s ease,
		border-color 0.2s ease,
		background 0.2s ease;
}

.slide-in-cart-floating-toggle svg {
	width: 22px;
	height: 22px;
	flex-shrink: 0;
}

.slide-in-cart-floating-toggle .cart-count {
	position: absolute;
	top: -4px;
	right: -4px;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	background: rgb(106 38 58);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	border-radius: 999px;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.slide-in-cart-floating-toggle:hover {
	background: #f9fafb;
	border-color: #9ca3af;
}

body.slide-in-cart-has-items:not(.slide-in-cart-is-open) .slide-in-cart-floating-toggle {
	opacity: 1;
	pointer-events: auto;
	transform: translateY(0);
}

.slide-in-cart-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 1.5rem 3.5rem 1.5rem 1.5rem;
	border-bottom: 1px solid #e5e7eb;
	position: relative;
}

.slide-in-cart-title {
	margin: 0;
	font-size: 20px;
	font-weight: 700;
	color: #111827;
}

.slide-in-cart-toggle {
	background: none;
	border: 1px solid #d1d5db;
	border-radius: 999px;
	cursor: pointer;
	padding: 0;
	width: 34px;
	height: 34px;
	color: #6b7280;
	transition:
		color 0.2s,
		border-color 0.2s,
		background 0.2s;
	position: absolute;
	right: 12px;
	left: auto;
	top: 50%;
	transform: translateY(-50%);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	font-weight: 700;
}

.slide-in-cart-toggle-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.slide-in-cart-toggle-icon .slide-in-cart-close-icon {
	width: 16px;
	height: 16px;
	display: block;
}

.slide-in-cart-toggle:hover {
	color: #111827;
	border-color: #9ca3af;
	background: #f9fafb;
}

.slide-in-cart-content {
	flex: 1;
	overflow-y: auto;
	padding: 1rem;
}

.slide-in-cart-empty {
	text-align: center;
	padding: 3rem 1rem;
	color: #6b7280;
}

.slide-in-cart-items {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	margin-bottom: 1.5rem;
}

.slide-in-cart-item {
	display: grid;
	grid-template-columns: 80px 1fr auto 30px;
	gap: 1rem;
	padding-bottom: 1rem;
	border-bottom: 1px solid #f3f4f6;
	position: relative;
}

.cart-item-image {
	width: 80px;
	overflow: hidden;
	position: relative;
}

.cart-item-discount-badge {
	position: absolute;
	top: 6px;
	right: 6px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 24px;
	padding: 0 8px;
	background: #c62828;
	color: #fff;
	font-size: 8px;
	font-weight: 500;
	line-height: 1;
	box-shadow: 0 6px 14px rgba(198, 40, 40, 0.22);
	pointer-events: none;
}

.cart-item-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.cart-item-details {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.cart-item-name {
	font-weight: 600;
	color: #111827;
	text-decoration: none;
	font-size: 14px;
	line-height: 1.3;
}

.cart-item-name:hover {
	color: #7f54b3;
}

/* Dla produktów prezentowych (span zamiast linku) wyłącz efekt hover */
span.cart-item-name {
	cursor: default;
}

span.cart-item-name:hover {
	color: #111827;
}

.cart-item-price {
	color: #6b7280;
	font-size: 14px;
	min-height: 34px;
}

.slide-cart-price-stack {
	display: flex;
	flex-direction: column;
	gap: 2px;
	align-items: flex-start;
}

.slide-cart-price-stack--discounted .slide-cart-price-original {
	display: block;
	font-size: 12px;
	line-height: 1.2;
	color: #9ca3af;
	text-decoration: line-through;
}

.slide-cart-price-current {
	display: block;
	font-size: 14px;
	line-height: 1.25;
	color: #111827;
	font-weight: 700;
}

.cart-item-quantity {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.qty-btn {
	width: 24px;
	height: 24px;
	border: 1px solid #d1d5db;
	background: #fff;
	border-radius: 4px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	transition: all 0.2s;
}

.qty-btn:hover {
	background: #f3f4f6;
	border-color: #9ca3af;
}

.qty-value {
	min-width: 30px;
	text-align: center;
	font-weight: 600;
	font-size: 14px;
}

.cart-item-total {
	font-weight: 400;
	color: #111827;
	font-size: 16px;
	align-self: start;
	text-align: right;
}

.cart-item-total .slide-cart-price-stack {
	align-items: flex-end;
}

.cart-item-total .slide-cart-price-current {
	font-size: 14px;
}

.cart-item-remove {
	position: absolute;
	top: 2px;
	right: 2px;
	background: none;
	border: none;
	font-size: 24px;
	color: #9ca3af;
	cursor: pointer;
	padding: 0;
	width: 24px;
	height: 24px;
	line-height: 1;
	transition: color 0.2s;
}

.cart-item-remove:hover {
	color: #dc2626;
}

.slide-in-cart-totals {
	margin-bottom: 1.5rem;
	padding: 1rem;
	background: #f9fafb;
	border-radius: 8px;
}

.slide-in-cart-applied-coupons {
	margin: -0.5rem 0 1.5rem;
	padding: 0 0.25rem;
}

.slide-in-cart-applied-coupons-label {
	display: block;
	margin-bottom: 0.75rem;
	font-size: 13px;
	font-weight: 600;
	color: #374151;
}

.slide-in-cart-applied-coupons-list {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.slide-in-cart-coupon-pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 999px;
	background: #fff;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

.slide-in-cart-coupon-code {
	line-height: 1;
}

.slide-in-cart-coupon-remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	padding: 0;
	border: 0;
	background: transparent;
	color: #111827;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	opacity: 0.75;
	transition: opacity 0.2s ease;
}

.slide-in-cart-coupon-remove:hover,
.slide-in-cart-coupon-remove:focus-visible {
	opacity: 1;
}

.slide-in-cart-coupon-remove:disabled {
	opacity: 0.35;
	cursor: wait;
}

.cart-total-row {
	display: flex;
	justify-content: space-between;
	font-size: 16px;
}

.cart-total-row + .cart-total-row {
	margin-top: 10px;
}

.cart-total-row--discounts span,
.cart-total-row--discounts strong {
	font-size: 14px;
	color: #185b63;
}

.slide-cart-coupon-total-amount {
	display: inline-block;
	font-weight: 700;
	color: #185b63;
}

.cart-total-row strong {
	font-size: 18px;
	color: #111827;
}

.cart-total-row .slide-cart-total-stack {
	align-items: flex-end;
}

.cart-total-row .slide-cart-total-stack .slide-cart-price-current {
	font-size: 18px;
}

.slide-in-cart-free-shipping {
	margin-bottom: 1.5rem;
	padding: 1rem;
	background: #f0fdf4;
	border-radius: 8px;
	border: 1px solid #86efac;
}

.free-shipping-achieved {
	color: #059669;
	font-weight: 600;
	text-align: center;
}

.free-shipping-progress p {
	margin: 0 0 0.75rem;
	font-size: 14px;
	color: #374151;
}

.progress-bar {
	height: 8px;
	background: #e5e7eb;
	border-radius: 4px;
	overflow: hidden;
	margin-bottom: 0.75rem;
}

.progress-fill {
	height: 100%;
	background: linear-gradient(90deg, #10b981, #059669);
	transition: width 0.3s ease;
}

.free-shipping-link {
	color: black;
	text-decoration: none;
	font-weight: 600;
	font-size: 14px;
	display: inline-block;
}

.free-shipping-link:hover {
	text-decoration: underline;
}

.slide-in-cart-checkout-btn {
	display: block;
	width: 100%;
	padding: 1rem;
	background: #000;
	color: #fff;
	text-align: center;
	text-decoration: none;
	border-radius: 8px;
	font-weight: 700;
	font-size: 16px;
	margin-bottom: 1rem;
	transition: background 0.2s;
}

.slide-in-cart-checkout-btn:hover {
	background: #1a1a1a;
	color: #fff;
}

.slide-in-cart-shipping-info {
	text-align: center;
	color: #6b7280;
	font-size: 10px;
	margin-bottom: 1rem;
}

.slide-in-cart-trust-badges {
	display: flex;
	justify-content: center;
	gap: 1rem;
	flex-wrap: wrap;
}

.slide-in-cart-trust-badges img {
	width: 100%;
	height: auto;
}

/* Mobile responsive */
@media (max-width: 640px) {
	.slide-in-cart {
		max-width: 100%;
	}

	.cart-item-discount-badge {
		position: absolute;
		top: 0;
		left: 0;
		right: auto;
		height: auto;
		padding: 4px 6px;
	}

	.slide-in-cart-floating-toggle {
		top: 48px;
		right: 12px;
		width: 36px;
		height: 36px;
	}

	.slide-in-cart-item {
		grid-template-columns: 60px 1fr auto 24px;
		gap: 0.75rem;
	}

	.cart-item-image {
		width: 60px;
	}
}

/* Gift product styling in slide-in cart */
.slide-in-cart-item.is-gift-item {
	background: linear-gradient(135deg, #fdfaf3 0%, #fef9ee 100%);
	border: 1px solid #e8d5a8;
	border-radius: 4px;
	padding: 0.75rem;
}

.slide-in-cart .gift-badge {
	display: block;
	background: linear-gradient(135deg, #c9a96e, #b8944f);
	color: #fff;
	font-size: 9px;
	font-weight: 700;
	padding: 1px 6px;
	border-radius: 3px;
	margin-right: 4px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	vertical-align: middle;
	width: fit-content;
	margin-bottom: 5px;
}

.slide-in-cart .gift-original-price {
	color: #999;
	font-size: 0.85em;
	text-decoration: line-through;
	margin-right: 3px;
}

.slide-in-cart .gift-price {
	color: #c9a96e;
	font-weight: 700;
	text-decoration: none;
}

.slide-in-cart .gift-quantity {
	display: inline-block;
	padding: 2px 8px;
	background: #f0ead6;
	border-radius: 4px;
	font-weight: 600;
	font-size: 12px;
	color: #8a7340;
}

/* Cart Upsell Products */
.cart-upsell-products {
	margin-top: 12px;
}

.upsell-block + .upsell-block {
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px dashed #d1d5db;
}

.upsell-title {
	font-size: 12px;
	font-weight: 600;
	color: #333;
	margin-bottom: 6px;
	text-align: left;
}

.upsell-products-list {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.upsell-product-item {
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	overflow: hidden;
	transition: border-color 0.2s ease;
	background: #fff;
}

.upsell-product-item:hover {
	border-color: #d1d5db;
}

.upsell-product-main {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 8px;
}

.upsell-product-link {
	display: flex;
	align-items: center;
	text-decoration: none;
	color: inherit;
	min-width: 0;
	flex: 1;
}

.upsell-product-image {
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	margin-right: 8px;
}

.upsell-product-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 4px;
}

.upsell-product-info {
	flex: 1;
	min-width: 0;
}

.upsell-product-name {
	font-size: 12px;
	font-weight: 500;
	color: #333;
	line-height: 1.3;
	margin-bottom: 2px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.upsell-product-price {
	font-size: 11px;
	color: #666;
	font-weight: 600;
}

.upsell-product-actions {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-width: 30px;
}

.upsell-product-actions.only-arrow {
	justify-content: center;
}

.upsell-add-btn,
.upsell-view-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 999px;
	font-size: 16px;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
}

.upsell-add-btn {
	border: 1px solid #111;
	background: #fff;
	color: #111;
	font-weight: 600;
}

.upsell-add-btn:disabled {
	opacity: 0.5;
	cursor: default;
}

.upsell-view-btn {
	border: 1px solid #d1d5db;
	background: #f9fafb;
	color: #111;
}
