/*
 * American Peptides cart drawer — values copied from the source (source-cdp/css/merged.css:
 * .cart-overlay, .cart-drawer, .cart-head, .freeship, .cart-item, .cart-essentials, .cart-foot).
 * Source defect fixed (RECON §7): the closed drawer's box-shadow bled into the right edge of
 * every page; closed = visibility hidden + no shadow.
 */
.apck-cart {
	--apck-ink: #0a1220;
	--apck-navy: #0a1220;
	--apck-navy-3: #14213d;
	--apck-red: #da303d;
	--apck-cream: #f6f1e7;
	--apck-muted: #5b6b86;
	--apck-line: rgba(10, 18, 32, .1);
	--apck-serif: Fraunces, Georgia, "Times New Roman", serif;
}

.apck-cart__overlay {
	position: fixed;
	inset: 0;
	background: rgba(10, 20, 38, .55);
	z-index: 1000;
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s;
}

.apck-cart.is-open .apck-cart__overlay {
	opacity: 1;
	pointer-events: auto;
}

.apck-drawer {
	position: fixed;
	top: 0;
	right: 0;
	height: 100%;
	height: 100dvh;
	width: min(420px, 92vw);
	background: var(--apck-cream);
	color: var(--apck-ink);
	z-index: 1001;
	transform: translateX(100%);
	visibility: hidden;
	box-shadow: none;
	transition: transform .24s ease, visibility 0s linear .24s, box-shadow 0s linear .24s;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	outline: none;
	font-size: 16px;
	line-height: 1.55;
}

.apck-cart.is-open .apck-drawer {
	transform: translateX(0);
	visibility: visible;
	box-shadow: -20px 0 50px rgba(0, 0, 0, .25);
	transition: transform .24s ease, visibility 0s, box-shadow 0s;
}

html.apck-cart-open,
html.apck-cart-open body {
	overflow: hidden;
}

.apck-drawer__inner {
	display: flex;
	flex-direction: column;
	height: 100%;
	min-height: 0;
}

.apck-drawer *,
.apck-drawer *::before,
.apck-drawer *::after {
	box-sizing: border-box;
}

/* Head */
.apck-drawer__head {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 22px;
	border-bottom: 1px solid var(--apck-line);
	background: var(--apck-navy);
	color: var(--apck-cream);
}

.apck-drawer__head h3 {
	margin: 0;
	font-size: 1.1rem;
	font-weight: 700;
	color: var(--apck-cream);
	font-family: inherit;
	letter-spacing: 0;
}

.apck-drawer__actions {
	display: inline-flex;
	align-items: center;
	gap: 12px;
}

.apck-drawer__clear {
	background: none;
	border: 1px solid rgba(255, 255, 255, .35);
	color: var(--apck-cream);
	font: inherit;
	font-size: .75rem;
	font-weight: 600;
	padding: 6px 12px;
	border-radius: 999px;
	cursor: pointer;
	white-space: nowrap;
	line-height: 1;
	opacity: .9;
}

.apck-drawer__clear:hover {
	opacity: 1;
	color: #ff8a80;
	border-color: #ff8a80;
}

.apck-drawer__close {
	background: none;
	border: 0;
	cursor: pointer;
	font-size: 1.5rem;
	line-height: 1;
	color: var(--apck-cream);
	padding: 0 2px;
}

.apck-drawer__ruo {
	flex: none;
	margin: 0;
	padding: 6px 16px;
	font-size: .74rem;
	font-weight: 600;
	text-align: center;
	color: #fff;
	background: var(--apck-red);
}

/* Scroll area */
.apck-drawer__scroll {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	padding-top: 14px;
}

.apck-drawer__empty {
	padding: 40px 22px;
	text-align: center;
	color: var(--apck-muted);
}

.apck-drawer__empty p {
	margin: 0 0 18px;
	font-size: .95rem;
}

/* Free shipping */
.apck-freeship {
	margin: 0 20px 6px;
	padding: 12px 15px;
	border-radius: 11px;
	background: #f2f6fb;
	border: 1px solid rgba(10, 18, 32, .08);
}

.apck-freeship--won {
	background: #e8f6ee;
	border-color: rgba(21, 127, 75, .28);
}

.apck-freeship__label {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	font-size: .85rem;
	color: var(--apck-navy-3);
	margin-bottom: 9px;
}

.apck-freeship__label b {
	color: var(--apck-ink);
	font-weight: 700;
}

.apck-freeship__label .woocommerce-Price-amount {
	font-weight: 700;
}

.apck-freeship--won .apck-freeship__label {
	color: #157f4b;
	font-weight: 700;
}

.apck-freeship__truck {
	font-size: 1rem;
	flex: none;
}

.apck-freeship--won .apck-freeship__truck {
	color: #157f4b;
	font-weight: 800;
}

.apck-freeship__track {
	height: 7px;
	border-radius: 999px;
	background: rgba(10, 18, 32, .1);
	overflow: hidden;
}

.apck-freeship__fill {
	height: 100%;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--apck-red), #b3152a);
	transition: width .4s cubic-bezier(.4, 0, .2, 1);
}

.apck-freeship--won .apck-freeship__fill {
	background: linear-gradient(90deg, #1a7f4b, #157f4b);
}

/* Items */
.apck-items {
	padding: 12px 18px;
}

.apck-item {
	display: grid;
	grid-template-columns: 62px 1fr auto;
	gap: 12px;
	align-items: center;
	padding: 14px 0;
	border-bottom: 1px solid var(--apck-line);
}

.apck-item__thumb {
	width: 62px;
	height: 62px;
	border-radius: 9px;
	background: #fff;
	border: 1px solid var(--apck-line);
	display: grid;
	place-items: center;
	padding: 6px;
	overflow: hidden;
}

.apck-item__thumb img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	mix-blend-mode: multiply;
}

.apck-item__body {
	min-width: 0;
}

.apck-item__name {
	font-weight: 700;
	font-size: .92rem;
	color: var(--apck-ink);
	line-height: 1.3;
}

.apck-item__name a {
	color: inherit;
	text-decoration: none;
}

.apck-item__variant {
	font-size: .8rem;
	color: var(--apck-muted);
}

.apck-item__price {
	font-weight: 700;
	color: var(--apck-ink);
	font-size: .92rem;
	font-family: var(--apck-serif);
	font-variant-numeric: lining-nums;
	letter-spacing: -.01em;
	white-space: nowrap;
}

.apck-mini-qty {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 5px;
}

.apck-mini-qty__btn {
	width: 24px;
	height: 24px;
	border: 1px solid var(--apck-line);
	background: #fff;
	border-radius: 6px;
	cursor: pointer;
	font-size: .9rem;
	line-height: 1;
	color: var(--apck-ink);
	padding: 0;
}

.apck-mini-qty__btn:disabled {
	opacity: .4;
	cursor: default;
}

.apck-mini-qty__val {
	min-width: 14px;
	text-align: center;
	font-size: .9rem;
}

.apck-item__remove {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: none;
	border: 0;
	color: #c0392b;
	font: inherit;
	font-size: .82rem;
	font-weight: 600;
	cursor: pointer;
	padding: 5px 4px;
	margin-top: 6px;
	margin-left: 16px;
}

.apck-item__remove:hover {
	text-decoration: underline;
}

.apck-item__remove span {
	font-size: .75rem;
}

/* Essentials upsell */
.apck-ess {
	margin: 0 20px 14px;
	padding: 14px 15px;
	border-radius: 12px;
	background: #fbf1e5;
	border: 1px solid rgba(200, 16, 46, .22);
}

.apck-ess__head {
	display: flex;
	gap: 11px;
	align-items: flex-start;
	margin-bottom: 12px;
}

.apck-ess__tag {
	flex: none;
	width: 22px;
	height: 22px;
	border-radius: 6px;
	margin-top: 1px;
	background: var(--apck-red);
	color: #fff;
	font-weight: 800;
	font-size: .95rem;
	display: grid;
	place-items: center;
}

.apck-ess__head strong {
	font-size: .92rem;
	color: #0a1426;
	display: block;
}

.apck-ess__head p {
	margin: 3px 0 0;
	font-size: .8rem;
	line-height: 1.42;
	color: #6b5a45;
}

.apck-ess__item {
	display: flex;
	align-items: center;
	gap: 11px;
	background: #fff;
	border: 1px solid rgba(200, 16, 46, .3);
	border-radius: 9px;
	padding: 8px 9px;
}

.apck-ess__thumb {
	flex: none;
	width: 40px;
	height: 40px;
	border-radius: 7px;
	overflow: hidden;
	background: #f2f5f9;
	display: grid;
	place-items: center;
}

.apck-ess__thumb img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.apck-ess__body {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.apck-ess__name {
	font-size: .82rem;
	font-weight: 600;
	color: var(--apck-ink);
	line-height: 1.25;
	display: flex;
	align-items: center;
	gap: 7px;
	flex-wrap: wrap;
}

.apck-ess__req {
	font-size: .6rem;
	font-weight: 800;
	letter-spacing: .05em;
	text-transform: uppercase;
	color: var(--apck-red);
	background: rgba(200, 16, 46, .1);
	border-radius: 4px;
	padding: 1px 6px;
}

.apck-ess__price {
	font-size: .8rem;
	color: var(--apck-muted);
	font-weight: 600;
}

.apck-ess__add {
	flex: none;
	border: 1px solid var(--apck-navy);
	background: var(--apck-navy);
	color: #fff;
	font: inherit;
	font-weight: 700;
	font-size: .78rem;
	border-radius: 8px;
	padding: 8px 14px;
	cursor: pointer;
	transition: background .14s ease;
}

.apck-ess__add:hover {
	background: var(--apck-navy-3);
}

.apck-ess__add.is-added,
.apck-ess__add:disabled {
	background: #1a7f4b;
	border-color: #1a7f4b;
	cursor: default;
}

/* Foot */
.apck-drawer__foot {
	flex: none;
	max-height: 60vh;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 18px 22px calc(24px + env(safe-area-inset-bottom));
	border-top: 1px solid var(--apck-line);
	background: #fff;
}

.apck-subtotal {
	display: flex;
	justify-content: space-between;
	font-weight: 700;
	margin-bottom: 5px;
	color: var(--apck-ink);
}

.apck-subtotal span:last-child {
	font-family: var(--apck-serif);
	font-variant-numeric: lining-nums;
	letter-spacing: -.01em;
}

.apck-subtotal--discount {
	color: rgb(15, 81, 50);
	font-size: 14px;
	font-weight: 600;
}

.apck-ship-note {
	font-size: .78rem;
	color: var(--apck-muted);
	margin-bottom: 14px;
}

.apck-ruo-note {
	font-size: .72rem;
	color: var(--apck-muted);
	text-align: center;
	margin-top: 12px;
	line-height: 1.4;
}

/* Buttons (source .btn-primary / .btn-dark) */
.apck-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 52px;
	padding: 14px 26px;
	border-radius: 999px;
	border: 0;
	font: inherit;
	font-size: 15.7px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.apck-btn--primary {
	background: var(--apck-red);
	color: #fff;
	box-shadow: 0 14px 34px -16px rgba(218, 48, 61, .65);
}

.apck-btn--primary:hover {
	background: #c52733;
	color: #fff;
}

.apck-btn--dark {
	background: var(--apck-navy);
	color: var(--apck-cream);
}

.apck-drawer__checkout {
	width: 100%;
}

/* Busy state */
.apck-drawer__loader {
	position: absolute;
	inset: 0;
	background: rgba(246, 241, 231, .55);
	opacity: 0;
	pointer-events: none;
	transition: opacity .15s;
}

.apck-cart.is-busy .apck-drawer__loader {
	opacity: 1;
	pointer-events: auto;
	cursor: progress;
}

[data-ap-add].is-loading {
	opacity: .7;
	cursor: progress;
}

/* Short screens: compact foot (source values). */
@media (max-height: 760px), (max-width: 560px) {
	.apck-drawer__foot {
		padding: 12px 18px calc(14px + env(safe-area-inset-bottom));
	}

	.apck-ship-note {
		font-size: .72rem;
		margin-bottom: 9px;
	}

	.apck-ruo-note {
		font-size: .65rem;
		margin-top: 7px;
		line-height: 1.32;
	}
}

@media (prefers-reduced-motion: reduce) {
	.apck-drawer,
	.apck-cart.is-open .apck-drawer,
	.apck-cart__overlay,
	.apck-freeship__fill {
		transition: none;
	}
}
