/* Cart drawer — Peaked-style panel */

.cart-drawer {
	position: fixed;
	inset: 0;
	z-index: 90;
}

.cart-drawer__backdrop {
	position: absolute;
	inset: 0;
	background: rgb(19 21 19 / 0.35);
	backdrop-filter: blur(3px);
	opacity: 0;
	transition: opacity 0.25s var(--ease-out);
}

.cart-drawer__panel {
	position: absolute;
	will-change: transform;
	top: var(--gutter);
	right: var(--gutter);
	bottom: var(--gutter);
	width: min(28rem, calc(100vw - 2 * var(--gutter)));
	background: var(--card);
	border-radius: var(--radius-l);
	box-shadow: var(--shadow-drawer);
	display: flex;
	flex-direction: column;
	transform: translateX(calc(100% + 2 * var(--gutter)));
	transition: transform 0.32s var(--ease-out);
	overflow: hidden;
}

.cart-drawer.is-open .cart-drawer__backdrop {
	opacity: 1;
}

.cart-drawer.is-open .cart-drawer__panel {
	transform: translateX(0);
}

.cart-drawer.is-busy .cart-drawer__panel {
	pointer-events: none;
}

/* Busy dim lives on an overlay: animating the panel's own opacity churns
   compositor layers against the blurred backdrop and flashes a mis-scaled
   repaint frame (Chromium). */
.cart-drawer__panel::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 5;
	border-radius: inherit;
	background: rgb(255 255 255 / 0.45);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.15s var(--ease-out);
}

.cart-drawer.is-busy .cart-drawer__panel::after {
	opacity: 1;
}

.cart-drawer__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: var(--space-5);
	border-bottom: 1px solid var(--line);
}

.cart-drawer__title {
	display: flex;
	align-items: center;
	gap: var(--space-3);
	font-size: var(--text-s);
	font-weight: 600;
	letter-spacing: var(--tracking-wide);
	text-transform: uppercase;
	margin: 0;
}

.cart-drawer__title svg {
	width: 20px;
	height: 20px;
}

.cart-drawer__badge {
	display: grid;
	place-items: center;
	line-height: 1;
	min-width: 1.4rem;
	height: 1.4rem;
	padding-top: 2px;
	border-radius: var(--radius-s);
	background: var(--white);
	border: 1px solid var(--line);
	font-size: var(--text-xs);
}

.cart-drawer__close {
	background: none;
	border: 0;
	font-size: 1.6rem;
	line-height: 1;
	color: var(--gray);
}

/* Free shipping progress */

.cart-drawer__shipbar {
	padding: var(--space-4) var(--space-5);
	border-bottom: 1px solid var(--line);
}

.cart-drawer__shipbar-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: var(--space-3);
	font-size: var(--text-xs);
	font-weight: 500;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--gray);
	margin-bottom: var(--space-2);
	white-space: nowrap;
}

.cart-drawer__shipbar-row span {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
}

.cart-drawer__shipbar-row strong {
	flex: none;
}

.cart-drawer__shipbar-row strong {
	color: var(--ink);
}

.cart-drawer__track {
	height: 4px;
	border-radius: var(--radius-pill);
	background: var(--line);
	overflow: hidden;
}

.cart-drawer__fill {
	height: 100%;
	width: 0;
	background: var(--accent);
	border-radius: inherit;
	transition: width 0.4s var(--ease-out);
}

/* Body */

.cart-drawer__body {
	flex: 1;
	overflow-y: auto;
	padding: var(--space-5);
}

.cart-drawer__empty {
	color: var(--gray);
	text-align: center;
	margin-top: var(--space-7);
}

.line-item {
	display: flex;
	gap: var(--space-4);
	padding-block: var(--space-4);
	border-bottom: 1px solid var(--line);
}

.line-item__thumb {
	flex: none;
	display: grid;
	place-items: center;
	width: 4.5rem;
	height: 4.5rem;
	background: var(--white);
	border: 1px solid var(--line);
	border-radius: var(--radius-s);
	overflow: hidden;
}

.line-item__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.line-item__meta {
	flex: 1;
	min-width: 0;
}

.line-item__name {
	font-weight: 600;
	margin: 0;
}

.line-item__variation {
	font-size: var(--text-xs);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--gray);
	margin: 2px 0 0;
}

.line-item__qty {
	display: inline-flex;
	align-items: center;
	gap: var(--space-3);
	border: 1px solid var(--line);
	border-radius: var(--radius-s);
	background: var(--white);
	padding: 0 var(--space-2);
	margin-top: var(--space-3);
}

.line-item__qty-btn {
	background: none;
	border: 0;
	padding: var(--space-1) var(--space-2);
	color: var(--gray);
	font-size: var(--text-m);
}

.line-item__qty-value {
	font-weight: 600;
	font-size: var(--text-s);
}

.line-item__side {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	justify-content: space-between;
}

.line-item__remove {
	background: none;
	border: 0;
	padding: 0;
	color: var(--gray);
}

.line-item__remove svg {
	width: 16px;
	height: 16px;
}

.line-item__remove:hover {
	color: var(--ink);
}

.line-item__price {
	font-weight: 650;
	margin: 0;
}

/* Upsells */

.cart-drawer__upsell {
	margin-top: var(--space-5);
}

.cart-drawer__upsell-label {
	font-size: var(--text-xs);
	font-weight: 600;
	letter-spacing: var(--tracking-wide);
	text-transform: uppercase;
	color: var(--gray);
	margin-bottom: var(--space-3);
}

.upsell-row {
	display: flex;
	align-items: center;
	gap: var(--space-3);
	background: var(--white);
	border: 1px solid var(--line);
	border-radius: var(--radius-m);
	padding: var(--space-3) var(--space-4);
	margin-bottom: var(--space-2);
}

.upsell-row__thumb {
	flex: none;
	width: 3rem;
	height: 3rem;
	border-radius: var(--radius-s);
	overflow: hidden;
	border: 1px solid var(--line);
}

.upsell-row__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.upsell-row__meta {
	display: grid;
}

.upsell-row__name {
	font-weight: 600;
	font-size: var(--text-s);
}

.upsell-row__price {
	font-size: var(--text-xs);
	color: var(--gray);
}

.upsell-row__add {
	margin-left: auto;
	display: grid;
	place-items: center;
	width: 2.2rem;
	height: 2.2rem;
	border: 1px solid var(--line);
	border-radius: 50%;
	background: var(--white);
	font-size: 1.1rem;
	transition: background 0.2s var(--ease-out);
}

.upsell-row__add:hover {
	background: var(--bg);
}

/* Footer */

.cart-drawer__footer {
	padding: var(--space-5);
	border-top: 1px solid var(--line);
	background: var(--white);
}

.cart-drawer__row {
	display: flex;
	justify-content: space-between;
	font-size: var(--text-s);
	color: var(--gray);
	margin-bottom: var(--space-2);
}

.cart-drawer__row--total {
	color: var(--ink);
	font-weight: 600;
	align-items: baseline;
}

.cart-drawer__total {
	font-size: 1.6rem;
	font-weight: 650;
	letter-spacing: var(--tracking-tight);
}

.cart-drawer__checkout {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-2);
	width: 100%;
	margin-top: var(--space-3);
	padding: 1em;
	border-radius: var(--radius-pill);
	background: var(--accent);
	color: var(--white);
	font-size: var(--text-s);
	font-weight: 600;
	letter-spacing: var(--tracking-wide);
	text-transform: uppercase;
	text-decoration: none;
	transition: background 0.2s var(--ease-out);
}

.cart-drawer__checkout svg {
	width: 16px;
	height: 16px;
}

.cart-drawer__checkout:hover {
	background: var(--accent-deep);
}

.cart-drawer__note {
	font-size: var(--text-xs);
	color: var(--gray);
	text-align: center;
	margin: var(--space-3) 0 0;
}

body.drawer-open {
	overflow: hidden;
}

/* ══════════ Mobile optimization pass ══════════ */

.line-item__qty-btn {
	min-width: 2.25rem;
	min-height: 2.25rem;
	display: inline-grid;
	place-items: center;
}

/* Footer clears the iPhone home indicator. */
.cart-drawer__footer {
	padding-bottom: calc(var(--space-5) + env(safe-area-inset-bottom, 0px));
}

/* Free gift line: strike-through + FREE, no qty/remove controls. */
.line-item__price del {
	color: var(--gray);
	font-weight: 400;
	margin-right: 0.35em;
}

.line-item__free {
	color: var(--accent);
	font-weight: 700;
	letter-spacing: 0.05em;
}

.line-item__variation--gift {
	color: var(--accent);
	font-weight: 600;
}

/* Free BAC water teaser (orders over $400) */
.cart-drawer__bac {
	display: flex;
	align-items: center;
	gap: var(--space-2);
	padding: var(--space-2) var(--space-3);
	margin-bottom: var(--space-3);
	border: 1px dashed var(--accent);
	border-radius: var(--radius-s);
	background: var(--accent-tint);
	font-size: var(--text-xs);
}

.cart-drawer__bac-icon {
	display: inline-flex;
	flex: none;
	color: var(--accent-deep);
}

.cart-drawer__bac-icon svg { width: 18px; height: 18px; }

.cart-drawer__bac-text {
	flex: 1;
	font-weight: 600;
	color: var(--ink);
}

.cart-drawer__bac-price { white-space: nowrap; }
.cart-drawer__bac-price del { color: var(--gray); opacity: 0.7; margin-right: 0.3em; }
.cart-drawer__bac-price strong { color: var(--accent-deep); }

/* BAC note: honor the [hidden] attribute (the .cart-drawer__bac display:flex
   was overriding it), and a muted "teaser" state below the $400 threshold. */
.cart-drawer__bac[hidden] {
	display: none !important;
}

.cart-drawer__bac.is-locked {
	border-color: var(--line);
	background: var(--card);
	color: var(--gray);
}

.cart-drawer__bac.is-locked .cart-drawer__bac-price {
	display: none;
}

/* Free Starter Research Kit teaser — lighter blue, solid (no dash). */
.cart-drawer__kit {
	display: flex;
	align-items: center;
	gap: var(--space-2);
	padding: var(--space-2) var(--space-3);
	margin-bottom: var(--space-3);
	border: 1px solid #a9c6e8;
	border-radius: var(--radius-s);
	background: #eff5fd;
	font-size: var(--text-xs);
}

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

.cart-drawer__kit .cart-drawer__bac-icon,
.cart-drawer__kit .cart-drawer__bac-price strong {
	color: #4d78ad;
}

/* TEMP: hide the standalone "Free BAC Water at Checkout" teaser — BAC is now
   included in the Complete Research Kit. Delete this block to restore it. */
[data-azoth-bac-note] {
	display: none !important;
}
