/**
 * The slide-over cart drawer — Alpha Peptides Checkout.
 *
 * ⚠️ NOT hand-designed. Every value below was lifted from the SOURCE's own
 * drawer rules, read out of the 168 KB stylesheet it inlines into `wp_head`
 * (`source-cdp/inline/apex-sitewide-css.css`, the "SLIDE CART DRAWER" block) and
 * cross-checked against the live drawer capture
 * (`source-cdp/drawer-probe.json`, `_shots/cart-drawer-1440.png`).
 *
 * Two deliberate differences from the source's copy of these rules:
 *
 *  1. The source scopes every rule under `body.ap-stg` and sets `!important` on
 *     literally every declaration, because it is patching a Blocksy theme it
 *     does not own. We own our markup, so the scope is `.ap-cart-drawer` and
 *     `!important` appears only where WooCommerce's own `woocommerce.css` would
 *     otherwise win (list resets, button resets).
 *  2. `.ap-cart-upsell` gets explicit grid placement for its text wrapper. The
 *     source relies on auto-placement into the `text` named area, which works
 *     but silently depends on the `img` cell spanning two rows. Explicit is
 *     cheaper to keep correct.
 *
 * ⚠️ CROSS-AGENT: this file is the ONLY stylesheet that may style `.ap-cart-*`.
 * tuju-woo owns `.ap-hdr__cart` (the trigger) and nothing inside the drawer.
 *
 * Verified at 390 first, then 820 / 1440.
 */

/* ============================================================ shell */

html.ap-cart-open,
body.ap-cart-open { overflow: hidden !important; }

.ap-cart-drawer {
	position: fixed;
	inset: 0;
	z-index: 10020;                 /* source-measured */
	pointer-events: none;
	/* clip the off-canvas panel — the source's iOS sideways-scroll fix */
	overflow: hidden;
	font-family: var(--ap-font, 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
}

.ap-cart-drawer[hidden] { display: none !important; }

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

.ap-cart-drawer__overlay {
	position: absolute;
	inset: 0;
	background: rgba(7, 15, 30, .54);
	opacity: 0;
	transition: opacity .22s ease;
}

.ap-cart-drawer__panel {
	position: absolute;
	top: 0;
	right: 0;
	width: min(520px, 100vw);
	height: 100dvh;
	display: grid;
	grid-template-rows: auto auto 1fr auto;
	background: #fff;
	color: var(--ap-ink, #0B1322);
	box-shadow: -28px 0 70px rgba(7, 15, 30, .22);
	transform: translateX(104%);
	transition: transform .28s cubic-bezier(.2, .7, .2, 1);
	pointer-events: auto;
}

.ap-cart-drawer.is-open { pointer-events: auto; }
.ap-cart-drawer.is-open .ap-cart-drawer__overlay { opacity: 1; }
.ap-cart-drawer.is-open .ap-cart-drawer__panel { transform: translateX(0); }

/* A pending request dims the panel rather than swapping in a spinner, so the
   line the customer just tapped does not jump. */
.ap-cart-drawer.is-busy .ap-cart-drawer__panel::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, .38);
	pointer-events: none;
}

/* ============================================================ head */

.ap-cart-drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 26px 26px 18px;
	border-bottom: 1px solid rgba(226, 230, 237, .75);
}

.ap-cart-drawer__head h2 {
	margin: 0;
	color: #2B2B30;
	font-size: clamp(22px, 3vw, 28px);
	font-weight: 700;
	letter-spacing: -.3px;
	line-height: 1.1;
}

.ap-cart-drawer__head h2 span { font-weight: 700; }

.ap-cart-drawer__close {
	width: 42px;
	height: 42px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	background: transparent;
	color: #2B2B30;
	font-size: 38px;
	font-weight: 300;
	line-height: 1;
	cursor: pointer;
	padding: 0;
	flex: 0 0 auto;
}

/* ============================================================ free-ship bar */

.ap-cart-drawer__ship { padding: 18px 26px 34px; }

.ap-cart-drawer__ship p {
	margin: 0 0 14px;
	color: #8A8A98;
	font-size: clamp(15px, 2.2vw, 19px);
	font-weight: 400;
	line-height: 1.35;
	text-align: center;
}

.ap-cart-drawer__ship strong { color: #4A5468; font-weight: 800; }

.ap-cart-drawer__bar {
	position: relative;
	height: 16px;
	margin: 0 92px 10px 0;
	border-radius: 999px;
	background: #E0E2EC;
}

.ap-cart-drawer__bar > span {
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	border-radius: inherit;
	background: #22A912;
	transition: width .25s ease;
}

/* The "Free Shipping" end-marker: a white disc on the track's right, with the
   label hanging under it. Source-measured geometry. */
.ap-cart-drawer__bar i {
	position: absolute;
	right: -94px;
	top: -20px;
	width: 88px;
	height: 82px;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	color: #3A3A40;
	font-size: 15px;
	font-style: normal;
	font-weight: 500;
	line-height: 1.08;
	text-align: center;
}

.ap-cart-drawer__bar i::before {
	content: "";
	position: absolute;
	top: 6px;
	left: 19px;
	width: 50px;
	height: 50px;
	border-radius: 50%;
	background: #fff;
	border: 4px solid #D8DBE8;
	box-shadow: inset 0 0 0 8px #fff;
}

.ap-cart-drawer__bar.is-unlocked { background: #CCF6DD; }
.ap-cart-drawer__bar.is-unlocked i::before { border-color: #22A912; }

/* ============================================================ items */

.ap-cart-drawer__items {
	overflow: auto;
	padding: 0 26px 18px;
	-webkit-overflow-scrolling: touch;
}

.ap-cart-drawer__empty {
	min-height: 260px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	color: var(--ap-ink-3, #6E7890);
}

.ap-cart-drawer__empty strong {
	color: var(--ap-ink, #0B1322);
	font-size: 24px;
	font-weight: 800;
	letter-spacing: -.4px;
}

.ap-cart-drawer__empty p { margin: 8px 0 0; font-size: 15px; }

.ap-cart-drawer__empty a {
	margin-top: 14px;
	color: var(--ap-blue, #2563EB);
	font-weight: 800;
	text-decoration: none;
}

.ap-cart-item {
	position: relative;
	display: grid;
	grid-template-columns: 96px 1fr auto;
	gap: 18px;
	align-items: start;
	padding: 18px 0 22px;
	border-bottom: 1px solid rgba(226, 230, 237, .65);
}

.ap-cart-item:last-child { border-bottom: 0; }

.ap-cart-item__remove {
	position: absolute;
	left: -13px;
	top: 10px;
	width: 28px;
	height: 28px;
	display: grid;
	place-items: center;
	border: 0;
	border-radius: 999px;
	background: #E6E8F2;
	color: #1E2430;
	font-size: 22px;
	font-weight: 300;
	line-height: 1;
	cursor: pointer;
	z-index: 2;
	padding: 0;
}

.ap-cart-item__img {
	display: block;
	width: 96px;
	aspect-ratio: 1 / 1;
	border: 1px solid #D9DDE8;
	border-radius: 10px;
	overflow: hidden;
	background: #F2F4F8;
}

.ap-cart-item__img img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
	padding: 8px;
}

.ap-cart-item__body { min-width: 0; }

.ap-cart-item__body h3 {
	margin: 2px 0 6px;
	color: #303035;
	font-size: 19px;
	font-weight: 750;
	line-height: 1.12;
	letter-spacing: -.3px;
	overflow-wrap: anywhere;
}

.ap-cart-item__meta {
	color: #1768B5;
	font-size: 13px;
	font-weight: 650;
	line-height: 1.35;
	margin-bottom: 10px;
}

.ap-cart-qty {
	display: inline-grid;
	grid-template-columns: 44px 52px 44px;
	border: 1px solid #D8DCE8;
	border-radius: 12px;
	overflow: hidden;
	height: 44px;
	background: #fff;
}

.ap-cart-qty button,
.ap-cart-qty span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-right: 1px solid #D8DCE8;
	background: transparent;
	color: #2D2D32;
	font-size: 22px;
	font-weight: 400;
	line-height: 1;
	padding: 0;
}

.ap-cart-qty button { cursor: pointer; }
.ap-cart-qty span { font-size: 18px; font-weight: 600; }
.ap-cart-qty button:last-child { border-right: 0; }

.ap-cart-item__price {
	min-width: 104px;
	padding-top: 4px;
	text-align: right;
}

.ap-cart-item__price del {
	display: block;
	color: #B7B7BF;
	font-size: 14px;
	font-weight: 500;
	text-decoration: line-through;
	margin-bottom: 4px;
}

.ap-cart-item__price strong {
	display: inline-block;
	color: #2D2D32;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.1;
	white-space: nowrap;
}

/* ============================================================ foot */

.ap-cart-drawer__foot {
	border-top: 1px solid #DDE1EA;
	background: #fff;
	box-shadow: 0 -12px 30px rgba(7, 15, 30, .04);
}

.ap-cart-coupon {
	padding: 14px 26px;
	border-bottom: 1px solid #DDE1EA;
}

.ap-cart-coupon summary {
	cursor: pointer;
	color: #2D2D32;
	font-size: 16px;
	font-weight: 750;
	list-style: none;
	margin-bottom: 6px;
}

.ap-cart-coupon summary::-webkit-details-marker { display: none; }

.ap-cart-coupon__form {
	display: grid;
	grid-template-columns: 1fr 120px;
	margin-top: 12px;
	border: 1px solid #D8DCE8;
	border-radius: 12px;
	overflow: hidden;
}

.ap-cart-coupon__form input {
	min-height: 50px;
	border: 0;
	padding: 0 16px;
	color: #2D2D32;
	font-size: 16px;
	font-family: inherit;
	background: #fff;
}

.ap-cart-coupon__form button {
	border: 0;
	background: #1768B5;
	color: #fff;
	font-size: 18px;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
}

.ap-cart-coupon__applied {
	list-style: none !important;
	margin: 10px 0 0 !important;
	padding: 0 !important;
}

.ap-cart-coupon__applied li {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 10px;
	background: #EAF6EE;
	border: 1px solid #C6E4CF;
	border-radius: 7px;
	margin: 0 0 6px;
	font-size: 13px;
	line-height: 1.2;
}

.ap-cart-coupon__applied-code { font-weight: 700; color: #15623A; }
.ap-cart-coupon__applied-amount { margin-left: auto; color: #15623A; font-weight: 600; }

.ap-cart-coupon__remove {
	background: transparent;
	border: 0;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	color: #666;
	padding: 0 2px;
}

.ap-cart-coupon__remove:hover { color: #C00; }

.ap-cart-drawer__notice {
	margin-top: 8px;
	color: var(--ap-ink-3, #6E7890);
	font-size: 13px;
	font-weight: 650;
	min-height: 0;
}

.ap-cart-drawer__notice.is-error { color: #B42318; }

/* ============================================================ order bump */

.ap-cart-upsell {
	display: grid;
	grid-template-columns: 84px 1fr 96px;
	grid-template-areas:
		"img text toggle"
		"img text price";
	gap: 0 18px;
	align-items: center;
	padding: 16px 26px;
	background: #F4F5FA;
	border-bottom: 1px solid #E1E4ED;
}

.ap-cart-upsell img {
	grid-area: img;
	width: 84px;
	height: 84px;
	object-fit: contain;
	padding: 6px;
	border-radius: 8px;
	border: 1px solid #D8DCE8;
	background: #fff;
}

.ap-cart-upsell > div { grid-area: text; min-width: 0; }

.ap-cart-upsell strong {
	display: block;
	color: #303035;
	font-size: 18px;
	font-weight: 750;
	line-height: 1.15;
	letter-spacing: -.25px;
}

.ap-cart-upsell span {
	display: block;
	color: #8A8A98;
	font-size: 13px;
	font-weight: 600;
	margin-top: 4px;
}

.ap-cart-upsell__toggle {
	grid-area: toggle;
	justify-self: end;
	width: 64px;
	height: 36px;
	border: 0;
	border-radius: 999px;
	background: #878994;
	cursor: pointer;
	position: relative;
	padding: 0;
	transition: background .18s ease;
}

.ap-cart-upsell__toggle::before {
	content: "";
	position: absolute;
	top: 4px;
	left: 5px;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: #F3F4F8;
	transition: transform .18s ease;
}

.ap-cart-upsell__toggle:hover { background: #1768B5; }
.ap-cart-upsell__toggle:hover::before { transform: translateX(26px); }

.ap-cart-upsell--disabled .ap-cart-upsell__toggle { cursor: not-allowed; }

.ap-cart-upsell b {
	grid-area: price;
	justify-self: end;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	min-width: 76px;
	color: #2D2D32;
	font-size: 19px;
	font-weight: 500;
	line-height: 1.15;
	white-space: nowrap;
}

.ap-cart-upsell b del {
	display: block;
	color: #9AA2B3;
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	margin: 0 0 4px;
	text-decoration: line-through;
	white-space: nowrap;
}

.ap-cart-upsell b strong {
	display: block;
	color: #2D2D32;
	font-size: 19px;
	font-weight: 700;
	line-height: 1;
	white-space: nowrap;
}

/* The price values are Woo `wc_price()` spans — keep them on one line. */
.ap-cart-upsell b .woocommerce-Price-amount,
.ap-cart-upsell b .woocommerce-Price-amount bdi,
.ap-cart-upsell b .woocommerce-Price-currencySymbol { display: inline; white-space: nowrap; }

/* ============================================================ totals + CTA */

.ap-cart-totals { padding: 18px 26px 8px; }

.ap-cart-totals div {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	color: #2D2D32;
	font-size: 19px;
	line-height: 1.25;
}

.ap-cart-totals div + div { margin-top: 6px; font-size: 16px; color: #16A34A; }
.ap-cart-totals strong { font-weight: 750; }

.ap-cart-totals p {
	margin: 8px 0 0;
	color: #585866;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.35;
}

.ap-cart-checkout {
	display: flex !important;
	align-items: center;
	justify-content: center;
	min-height: 62px;
	margin: 16px 26px 14px;
	border-radius: 12px;
	background: #1768B5;
	color: #fff !important;
	text-decoration: none !important;
	font-size: 22px;
	font-weight: 600;
	line-height: 1;
}

.ap-cart-checkout:hover { background: #0F4F8C; }

.ap-cart-continue {
	display: block;
	width: calc(100% - 52px);
	margin: 0 26px 22px;
	border: 0;
	background: transparent;
	color: #8A8A98;
	font-family: inherit;
	font-size: 18px;
	font-weight: 500;
	cursor: pointer;
	padding: 0;
}

/* ============================================================ ≤560: phones
   Measured at 390 first. The panel goes full-bleed, the item grid drops to two
   columns with the price under the name, and every horizontal pad tightens. */

@media (max-width: 560px) {
	.ap-cart-drawer__panel { width: 100vw; }

	.ap-cart-drawer__head,
	.ap-cart-drawer__ship,
	.ap-cart-drawer__items,
	.ap-cart-coupon,
	.ap-cart-totals { padding-left: 18px; padding-right: 18px; }

	.ap-cart-item { grid-template-columns: 78px 1fr; gap: 14px; }
	.ap-cart-item__img { width: 78px; }
	.ap-cart-item__remove { left: -9px; }

	.ap-cart-item__price {
		grid-column: 2;
		text-align: left;
		padding-top: 0;
		min-width: 0;
	}

	.ap-cart-item__price del { display: inline-block; margin: 0 8px 0 0; }
	.ap-cart-item__body h3 { font-size: 17px; }

	.ap-cart-coupon__form { grid-template-columns: 1fr 96px; }

	.ap-cart-upsell {
		grid-template-columns: 66px 1fr 72px;
		padding-left: 18px;
		padding-right: 18px;
		gap: 0 12px;
	}

	.ap-cart-upsell img { width: 66px; height: 66px; }
	.ap-cart-upsell strong { font-size: 16px; }
	.ap-cart-upsell b,
	.ap-cart-upsell b strong { font-size: 16px; }
	.ap-cart-upsell__toggle { width: 56px; height: 32px; }
	.ap-cart-upsell__toggle::before { width: 24px; height: 24px; }
	.ap-cart-upsell__toggle:hover::before { transform: translateX(22px); }

	.ap-cart-checkout { margin-left: 18px; margin-right: 18px; min-height: 56px; font-size: 19px; }
	.ap-cart-continue { width: calc(100% - 36px); margin-left: 18px; margin-right: 18px; font-size: 16px; }

	.ap-cart-drawer__head h2 { font-size: 21px; }
	.ap-cart-totals div { font-size: 17px; }
}

/* The end-marker disc needs the 92px right gutter; below ~400px that gutter eats
   the bar itself, so the marker collapses to a small right-aligned caption UNDER
   the track. ⚠️ The `<br>` is kept — `display:none` on it would concatenate the
   words into "FreeShipping", since there is no whitespace between them in the
   source markup. */
@media (max-width: 400px) {
	.ap-cart-drawer__bar { margin-right: 0; margin-bottom: 34px; }

	.ap-cart-drawer__bar i {
		right: 0;
		left: auto;
		top: 100%;
		width: auto;
		height: auto;
		display: block;
		margin-top: 6px;
		font-size: 11px;
		font-weight: 700;
		letter-spacing: .08em;
		line-height: 1.25;
		text-transform: uppercase;
		text-align: right;
		color: #6E7890;
	}

	.ap-cart-drawer__bar i::before { display: none; }
	.ap-cart-drawer__bar i br { display: inline; }
	.ap-cart-drawer__ship { padding-bottom: 20px; }
}
