/**
 * KE Dropship — unified slide-out cart drawer.
 * Brand-tokenized via --keds-* (emitted on body.ke-ds-drawer). Mobile-first.
 * Self-contained: does not depend on the single/shop product stylesheet.
 */

html.ke-ds-cart-locked { overflow: hidden; }

.ke-ds-cart-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, .55);
	opacity: 0;
	transition: opacity .3s ease;
	z-index: 100000;
}
.ke-ds-cart-overlay.is-open { opacity: 1; }

.ke-ds-cart {
	position: fixed;
	top: 0;
	right: 0;
	height: 100%;
	width: min(420px, 92vw);
	max-width: 100%;
	background: var(--keds-surface, #17151a);
	color: var(--keds-ink, #fff);
	box-shadow: -12px 0 40px rgba(0, 0, 0, .45);
	transform: translateX(100%);
	transition: transform .32s cubic-bezier(.4, 0, .2, 1);
	z-index: 100001;
	display: flex;
	flex-direction: column;
	font-size: 15px;
	line-height: 1.4;
}
.ke-ds-cart.is-open { transform: translateX(0); }
.ke-ds-cart:focus { outline: none; }

/* ---- header ---- */
.ke-ds-cart__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 20px;
	border-bottom: 1px solid rgba(255, 255, 255, .1);
	flex: 0 0 auto;
}
.ke-ds-cart__title {
	margin: 0;
	font-family: var(--keds-display, inherit);
	font-size: 22px;
	letter-spacing: .02em;
	text-transform: uppercase;
	color: var(--keds-ink, #fff);
}
.ke-ds-cart__close {
	background: none;
	border: 0;
	color: var(--keds-muted, #b7b3bd);
	cursor: pointer;
	padding: 6px;
	line-height: 0;
	border-radius: 999px;
}
.ke-ds-cart__close:hover { color: var(--keds-ink, #fff); }

/* ---- body (fragment region) ---- */
.ke-ds-cart__body {
	flex: 1 1 auto;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	display: flex;
	flex-direction: column;
}
.ke-ds-cart__body.is-empty { justify-content: center; }
.ke-ds-cart__empty-msg {
	text-align: center;
	color: var(--keds-muted, #b7b3bd);
	padding: 40px 20px;
	margin: 0;
}

/* ---- free shipping progress ---- */
.ke-ds-cart-freeship {
	padding: 14px 20px;
	border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.ke-ds-cart-freeship__msg {
	display: block;
	font-size: 13px;
	color: var(--keds-ink, #fff);
	margin-bottom: 8px;
}
.ke-ds-progress {
	display: block;
	height: 8px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .14);
	overflow: hidden;
}
.ke-ds-progress-bar {
	display: block;
	height: 100%;
	background: var(--keds-primary, #e11d48);
	transition: width .35s ease;
}

/* ---- items ---- */
.ke-ds-cart__items {
	list-style: none;
	margin: 0;
	padding: 4px 20px;
}
.ke-ds-cart__item {
	display: grid;
	grid-template-columns: 64px 1fr auto;
	gap: 12px;
	align-items: start;
	padding: 16px 0;
	border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.ke-ds-cart__thumb {
	display: block;
	width: 64px;
	height: 64px;
	border-radius: var(--keds-radius, 10px);
	overflow: hidden;
	background: var(--keds-surface-2, #201d24);
}
.ke-ds-cart__thumb img,
.ke-ds-cart__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.ke-ds-cart__meta { min-width: 0; }
.ke-ds-cart__name {
	color: var(--keds-ink, #fff);
	text-decoration: none;
	font-weight: 600;
	font-size: 14px;
	display: block;
}
.ke-ds-cart__name:hover { color: var(--keds-primary, #e11d48); }
.ke-ds-cart__attrs {
	color: var(--keds-muted, #b7b3bd);
	font-size: 12px;
	margin-top: 2px;
}
.ke-ds-cart__attrs p { margin: 0; }
.ke-ds-cart__controls {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-top: 10px;
}
.ke-ds-cart__stepper {
	display: inline-flex;
	align-items: center;
	border: 1px solid rgba(255, 255, 255, .2);
	border-radius: 999px;
	overflow: hidden;
}
.ke-ds-cart__step {
	background: none;
	border: 0;
	color: var(--keds-ink, #fff);
	width: 30px;
	height: 30px;
	font-size: 17px;
	line-height: 1;
	cursor: pointer;
}
.ke-ds-cart__step:hover { background: rgba(255, 255, 255, .1); }
.ke-ds-cart__qty {
	width: 34px;
	text-align: center;
	background: none;
	border: 0;
	color: var(--keds-ink, #fff);
	font-size: 14px;
	-moz-appearance: textfield;
}
.ke-ds-cart__qty::-webkit-outer-spin-button,
.ke-ds-cart__qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ke-ds-cart__qty-fixed { color: var(--keds-muted, #b7b3bd); font-size: 13px; }
.ke-ds-cart__line { font-weight: 600; font-size: 14px; white-space: nowrap; }
.ke-ds-cart__remove {
	background: none;
	border: 0;
	color: var(--keds-muted, #b7b3bd);
	cursor: pointer;
	padding: 2px;
	line-height: 0;
	align-self: start;
}
.ke-ds-cart__remove:hover { color: var(--keds-accent, #f59e0b); }

/* ---- footer ---- */
.ke-ds-cart__foot {
	padding: 16px 20px 20px;
	border-top: 1px solid rgba(255, 255, 255, .12);
	background: var(--keds-surface-2, #201d24);
	flex: 0 0 auto;
}
.ke-ds-cart__subtotal {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	font-size: 15px;
	margin-bottom: 14px;
}
.ke-ds-cart__subtotal-val {
	font-weight: 700;
	font-size: 18px;
	font-family: var(--keds-display, inherit);
}
.ke-ds-cart__checkout {
	display: block;
	text-align: center;
	background: var(--keds-primary, #e11d48);
	color: var(--keds-primary-ink, #fff);
	text-decoration: none;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
	padding: 15px;
	border-radius: var(--keds-radius, 10px);
	transition: filter .15s ease;
}
.ke-ds-cart__checkout:hover { filter: brightness(1.08); }
.ke-ds-cart__viewcart {
	display: block;
	text-align: center;
	color: var(--keds-muted, #b7b3bd);
	text-decoration: underline;
	font-size: 13px;
	padding: 12px 0 4px;
}
.ke-ds-cart__viewcart:hover { color: var(--keds-ink, #fff); }
.ke-ds-cart__trust {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	color: var(--keds-muted, #b7b3bd);
	font-size: 12px;
	margin: 6px 0 0;
}

/* Body actions vs. the empty-state "Start shopping" link. */
.ke-ds-cart__empty-actions { display: none; padding: 0 20px 24px; }
.ke-ds-cart.is-empty .ke-ds-cart__empty-actions { display: block; }
.ke-ds-cart__shop {
	display: block;
	text-align: center;
	border: 1px solid var(--keds-primary, #e11d48);
	color: var(--keds-ink, #fff);
	text-decoration: none;
	padding: 13px;
	border-radius: var(--keds-radius, 10px);
	font-weight: 600;
}

/* ---- loading ---- */
.ke-ds-cart.is-loading .ke-ds-cart__body { opacity: .55; pointer-events: none; }
.ke-ds-cart.is-loading { cursor: progress; }

@media (prefers-reduced-motion: reduce) {
	.ke-ds-cart, .ke-ds-cart-overlay, .ke-ds-progress-bar { transition: none; }
}
