/*
 * Mini-cart drawer — global component CSS.
 *
 * IMMUTABLE — wydzielony plik per user mandate 2026-05-28 (jak header-icons.css / wishlist-drawer.css).
 * Hardcoded hex bo zmienne home.css są scope .gk-home → na PDP/listing buttons były transparent.
 *
 * Markup: `inc/template-parts/cart-drawer.php` (shared partial, renderowany w site-footer.php).
 * JS handler: `assets/js/home.js` openMiniCart / closeMiniCart, listener [data-mini-cart].
 */

.gk-mini-cart {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	width: min(420px, 100vw);
	z-index: 100;
	background: #ffffff;
	display: flex;
	flex-direction: column;
	transform: translateX(100%);
	transition: transform 400ms cubic-bezier(0.16, 1, 0.3, 1);
	box-shadow: -20px 0 60px rgba(0, 0, 0, 0.20);
}
.gk-mini-cart.is-open {
	transform: translateX(0);
}

.gk-mini-cart__backdrop {
	position: fixed;
	inset: 0;
	z-index: 99;
	background: rgba(31, 61, 20, 0.45);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	opacity: 0;
	pointer-events: none;
	transition: opacity 300ms ease;
}
.gk-mini-cart__backdrop.is-open {
	opacity: 1;
	pointer-events: auto;
}

.gk-mini-cart__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 22px 24px;
	border-bottom: 1px solid #EEEEEE;
	flex-shrink: 0;
}
.gk-mini-cart__title {
	font-family: 'Playfair Display', Georgia, serif;
	font-size: 20px;
	font-weight: 700;
	color: #1F3D14;
	margin: 0;
	letter-spacing: -0.01em;
}
.gk-mini-cart__count {
	font-size: 13px;
	color: #6B7280;
	margin-left: 8px;
	font-weight: 500;
}
.gk-mini-cart__close {
	all: unset;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 9999px;
	background: #F3F4F0;
	color: #1F3D14;
	cursor: pointer;
	transition: background .2s ease;
}
.gk-mini-cart__close:hover {
	background: #E2E6DD;
}
.gk-mini-cart__close svg {
	display: block;
	pointer-events: none;
}

.gk-mini-cart__body {
	flex: 1;
	overflow-y: auto;
	padding: 12px 0;
	-webkit-overflow-scrolling: touch;
}

/* Empty state */
.gk-mini-cart__empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 16px;
	min-height: 320px;
	padding: 48px 24px;
	text-align: center;
}
.gk-mini-cart__empty-title {
	font-family: 'Playfair Display', Georgia, serif;
	font-size: 18px;
	font-weight: 700;
	color: #1F3D14;
	margin: 0;
}
.gk-mini-cart__empty-text {
	font-size: 14px;
	color: #6B7280;
	max-width: 280px;
	margin: 0;
	line-height: 1.5;
}
.gk-mini-cart__empty-cta {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 24px;
	background: #1F3D14;
	color: #ffffff;
	border-radius: 9999px;
	font-weight: 600;
	font-size: 14px;
	margin-top: 8px;
	text-decoration: none;
	transition: background .2s ease;
}
.gk-mini-cart__empty-cta:hover {
	background: #5DA935;
	color: #ffffff;
}

/* Item */
.gk-mini-cart__item {
	display: grid;
	grid-template-columns: 72px 1fr auto;
	gap: 14px;
	padding: 14px 24px;
	align-items: start;
	border-bottom: 1px solid #F5F5F5;
}
.gk-mini-cart__item:last-child {
	border-bottom: 0;
}
.gk-mini-cart__item-image {
	width: 72px;
	height: 72px;
	border-radius: 12px;
	background: #F9F9F9;
	overflow: hidden;
}
.gk-mini-cart__item-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.gk-mini-cart__item-info {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}
.gk-mini-cart__item-title {
	font-size: 14px;
	font-weight: 700;
	color: #1F3D14;
	line-height: 1.35;
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.gk-mini-cart__item-title a {
	color: inherit;
	text-decoration: none;
}
.gk-mini-cart__item-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}
.gk-mini-cart__qty {
	display: inline-flex;
	align-items: center;
	background: #F3F4F0;
	border-radius: 9999px;
	padding: 3px 4px;
	gap: 2px;
}
.gk-mini-cart__qty-btn {
	all: unset;
	width: 22px;
	height: 22px;
	border-radius: 9999px;
	background: transparent;
	color: #1F3D14;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
}
.gk-mini-cart__qty-btn:hover {
	background: #ffffff;
}
.gk-mini-cart__qty-val {
	min-width: 22px;
	text-align: center;
	font-size: 13px;
	font-weight: 700;
	color: #1F3D14;
}
.gk-mini-cart__item-price {
	font-family: 'Inter', system-ui, sans-serif;
	font-size: 14px;
	font-weight: 700;
	color: #009668;
	letter-spacing: -0.01em;
}
.gk-mini-cart__item-remove {
	background: transparent;
	border: 0;
	width: 28px;
	height: 28px;
	border-radius: 9999px;
	color: #9CA3AF;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: color .2s ease, background .2s ease;
	padding: 0;
	text-decoration: none;
}
.gk-mini-cart__item-remove:hover {
	color: #DC2626;
	background: #FEE2E2;
}
.gk-mini-cart__item-remove svg {
	display: block;
	pointer-events: none;
}

/* Footer */
.gk-mini-cart__footer {
	flex-shrink: 0;
	padding: 18px 24px 24px;
	border-top: 1px solid #EEEEEE;
	background: #FAFAFA;
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.gk-mini-cart__subtotal {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px;
	background: linear-gradient(135deg, #FAF7F2 0%, #F4F6F0 100%);
	border: 1px solid rgba(15, 30, 15, 0.06);
	border-radius: 14px;
}
.gk-mini-cart__subtotal-meta {
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.gk-mini-cart__subtotal-label {
	font-family: 'Inter', system-ui, sans-serif;
	font-size: 13px;
	font-weight: 700;
	color: #1F3D14;
	letter-spacing: -0.01em;
}
.gk-mini-cart__subtotal-tax {
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #6B7280;
}
.gk-mini-cart__subtotal-amount {
	font-family: 'Inter', system-ui, sans-serif;
	font-size: 24px;
	font-weight: 800;
	color: #009668;
	letter-spacing: -0.02em;
	line-height: 1;
	white-space: nowrap;
}

/* CTA */
.gk-mini-cart__actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 4px;
}
.gk-mini-cart__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 52px;
	border-radius: 9999px;
	font-family: 'Inter', system-ui, sans-serif;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.01em;
	transition: background .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease;
	cursor: pointer;
	border: 0;
	text-decoration: none;
	box-sizing: border-box;
}
.gk-mini-cart__cta--checkout {
	background: #1F3D14;
	color: #ffffff;
	box-shadow: 0 8px 24px rgba(31, 61, 20, 0.20);
}
.gk-mini-cart__cta--checkout:hover {
	background: #5DA935;
	color: #ffffff;
	transform: translateY(-1px);
	box-shadow: 0 12px 32px rgba(31, 61, 20, 0.28);
}
.gk-mini-cart__cta--view {
	background: transparent;
	color: #1F3D14;
	border: 1.5px solid #1F3D14;
}
.gk-mini-cart__cta--view:hover {
	background: #1F3D14;
	color: #ffffff;
}
.gk-mini-cart__cta svg {
	display: block;
	pointer-events: none;
}

.gk-mini-cart.is-loading .gk-mini-cart__body {
	opacity: 0.5;
	pointer-events: none;
}

/* === Shipping progress bar (free shipping threshold) === */
.gk-shipping-progress {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 12px 14px;
	border-radius: 12px;
	background: #F4F6F0;
	transition: background .3s ease;
}
.gk-shipping-progress.is-achieved {
	background: rgba(93, 169, 53, 0.10);
}
.gk-shipping-progress__label {
	margin: 0;
	font-size: 12px;
	line-height: 1.4;
	color: #1F3D14;
	display: flex;
	align-items: center;
	gap: 6px;
}
.gk-shipping-progress__label strong {
	font-weight: 800;
}
.gk-shipping-progress.is-achieved .gk-shipping-progress__label {
	color: #1F3D14;
}
.gk-shipping-progress__bar {
	position: relative;
	width: 100%;
	height: 6px;
	background: rgba(15, 30, 15, 0.08);
	border-radius: 9999px;
	overflow: hidden;
}
.gk-shipping-progress__fill {
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	background: linear-gradient(90deg, #5DA935, #4F9028);
	border-radius: 9999px;
	transition: width .5s cubic-bezier(.16, 1, .3, 1);
	box-shadow: 0 0 8px rgba(93, 169, 53, 0.40);
}
.gk-shipping-progress.is-achieved .gk-shipping-progress__fill {
	background: linear-gradient(90deg, #4F9028, #2a6c00);
}
.gk-shipping-progress__hint {
	margin: 0;
	font-size: 11px;
	color: #6B7280;
	line-height: 1.4;
}
.gk-shipping-progress__hint .woocommerce-Price-amount,
.gk-shipping-progress__hint .amount {
	font-size: inherit;
	color: inherit;
	font-weight: 700;
}
.gk-shipping-progress__label .woocommerce-Price-amount,
.gk-shipping-progress__label .amount {
	font-size: inherit;
	color: inherit;
	font-weight: 800;
}
@media (prefers-reduced-motion: reduce) {
	.gk-shipping-progress__fill {
		transition: none;
	}
}
