/*
 * The slide-out cart panel (inc/drawer.php), on pages of the next theme only. Everything is scoped to the panel
 * (#htp-next-drawer / .htp-next-drawer), whose own tokens come from the theme's variables; the seller's tag and the
 * parcel boxes follow the checkout's (base.css), smaller. 440 px at the right edge on wide screens, the full width on
 * phones (as in the design concept's product-cart page). It slides in only when no reduced motion is asked for.
 *
 * Contents: 1 tokens and frame  2 head, added line, loading  3 parcels  4 totals and buttons  5 empty cart
 *           6 phones  7 motion
 */

/* 1. Tokens and frame ---------------------------------------------------------------------------------------- */

.htp-next-drawer {
	--htp-next-green: var(--htp-green, #137a35);
	--htp-next-green-deep: var(--htp-green-dark, #0e5c28);
	--htp-next-ink: var(--htp-ink, #1d2a21);
	--htp-next-text: var(--htp-text, #2c332e);
	--htp-next-muted: var(--htp-muted, #566159);
	--htp-next-line: var(--htp-line, #dbe4dc);
	--htp-next-line-strong: #c4cfc6;
	--htp-next-wash: var(--htp-tint, #edf4ee);
	--htp-next-mist: #f4f7f4;
	--htp-next-kraft: #e4d2b3;
	--htp-next-kraft-ink: #4d3b1f;
	--htp-next-font: var(--htp-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
	--htp-next-display: var(--htp-display, "Doppio One", "Trebuchet MS", "Helvetica Neue", Arial, sans-serif);
	color: var(--htp-next-text);
	font-family: var(--htp-next-font);
	font-size: 16px;
	inset: 0;
	line-height: 1.5;
	position: fixed;
	/* Above WordPress's toolbar (99999) for signed-in staff, and so above the cookie notice too. */
	z-index: 100000;
}

.htp-next-drawer[hidden] {
	display: none;
}

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

html.htp-next-drawer-open,
html.htp-next-drawer-open body {
	overflow: hidden;
}

.htp-next-drawer__scrim {
	background: rgba(20, 30, 23, 0.45);
	inset: 0;
	position: absolute;
}

.htp-next-drawer__panel {
	background: #fff;
	bottom: 0;
	box-shadow: -18px 0 48px rgba(20, 30, 23, 0.22);
	display: flex;
	flex-direction: column;
	max-width: 100%;
	position: absolute;
	right: 0;
	top: 0;
	width: 440px;
}

.htp-next-drawer :focus-visible {
	outline: 3px solid var(--htp-next-green);
	outline-offset: 2px;
}

/* The dialog itself takes the focus when it opens (so screen readers name it); it needs no ring of its own. */
.htp-next-drawer .htp-next-drawer__panel:focus,
.htp-next-drawer .htp-next-drawer__panel:focus-visible {
	outline: 0;
}

/* 2. Head, the added line, loading ----------------------------------------------------------------------------- */

.htp-next-drawer__head {
	align-items: center;
	border-bottom: 1px solid var(--htp-next-line);
	display: flex;
	flex: none;
	justify-content: space-between;
	padding: 10px 12px 10px 22px;
}

.htp-next-drawer .htp-next-drawer__title {
	color: var(--htp-next-ink);
	font-family: var(--htp-next-display);
	font-size: 22px;
	font-weight: 400;
	line-height: 1.2;
	margin: 0;
}

.htp-next-drawer .htp-next-drawer__x {
	align-items: center;
	background: none;
	border: 0;
	border-radius: 8px;
	color: var(--htp-next-ink);
	cursor: pointer;
	display: inline-flex;
	height: 48px;
	justify-content: center;
	margin: 0;
	min-height: 0;
	padding: 0;
	width: 48px;
}

.htp-next-drawer .htp-next-drawer__x:hover {
	background: var(--htp-next-mist);
}

.htp-next-drawer__added {
	align-items: center;
	background: var(--htp-next-wash);
	color: var(--htp-next-ink);
	display: flex;
	flex: none;
	font-size: 14px;
	font-weight: 600;
	gap: 8px;
	margin: 0;
	padding: 10px 22px;
}

.htp-next-drawer__added svg {
	color: var(--htp-next-green);
	flex: none;
}

.htp-next-drawer__loading {
	color: var(--htp-next-muted);
	font-size: 15px;
	margin: 0;
	padding: 24px 22px;
}

.htp-next-drawer.is-loading .htp-next-drawer__content {
	visibility: hidden;
}

.htp-next-drawer__content {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-height: 0;
}

.htp-next-drawer__body {
	flex: 1 1 auto;
	overflow: auto;
	overscroll-behavior: contain;
	padding: 16px 22px;
}

/* 3. Parcels: one box per seller, compact ------------------------------------------------------------------------ */

.htp-next-drawer .htp-next-parcel {
	background: #fff;
	border: 1px solid var(--htp-next-line);
	border-radius: 14px;
}

.htp-next-drawer .htp-next-parcel + .htp-next-parcel {
	margin-top: 12px;
}

.htp-next-drawer .htp-next-parcel__head {
	align-items: center;
	border-bottom: 1px solid var(--htp-next-line);
	display: flex;
	flex-wrap: wrap;
	gap: 6px 10px;
	justify-content: space-between;
	padding: 10px 14px;
}

.htp-next-drawer .htp-next-tag {
	background: var(--htp-next-kraft);
	clip-path: polygon(9px 0, 100% 0, 100% 100%, 9px 100%, 0 50%);
	color: var(--htp-next-kraft-ink);
	display: inline-block;
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1;
	max-width: 100%;
	overflow: hidden;
	padding: 6px 9px 6px 22px;
	position: relative;
	text-overflow: ellipsis;
	vertical-align: middle;
	white-space: nowrap;
}

.htp-next-drawer .htp-next-tag::before {
	background: #fff;
	border-radius: 50%;
	content: "";
	height: 6px;
	left: 10px;
	position: absolute;
	top: calc(50% - 3px);
	width: 6px;
}

.htp-next-drawer .htp-next-parcel__n {
	color: var(--htp-next-muted);
	flex: none;
	font-size: 13px;
}

.htp-next-drawer .htp-next-parcel__items {
	list-style: none;
	margin: 0;
	padding: 0;
}

.htp-next-drawer .htp-next-item {
	align-items: start;
	display: grid;
	gap: 12px;
	grid-template-columns: 56px minmax(0, 1fr) auto;
	margin: 0;
	padding: 10px 14px;
}

.htp-next-drawer .htp-next-item__pic {
	aspect-ratio: 1;
	background: var(--htp-next-mist);
	border-radius: 10px;
	display: block;
	overflow: hidden;
}

.htp-next-drawer .htp-next-item__pic img {
	display: block;
	height: 100%;
	max-width: none;
	mix-blend-mode: multiply;
	object-fit: contain;
	padding: 8%;
	width: 100%;
}

.htp-next-drawer .htp-next-item__body {
	display: block;
	min-width: 0;
}

.htp-next-drawer .htp-next-item__name {
	color: var(--htp-next-ink);
	display: block;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	overflow-wrap: anywhere;
}

.htp-next-drawer .htp-next-item dl.variation {
	color: var(--htp-next-muted);
	font-size: 13px;
	margin: 2px 0 0;
}

.htp-next-drawer .htp-next-item dl.variation dt,
.htp-next-drawer .htp-next-item dl.variation dd,
.htp-next-drawer .htp-next-item dl.variation dd p {
	display: inline;
	float: none;
	margin: 0;
	padding: 0;
}

.htp-next-drawer .htp-next-item__qty {
	color: var(--htp-next-muted);
	display: block;
	font-size: 14px;
}

/* "Remove": WooCommerce's mini-cart link as a quiet text link with a 44 px tall target. WooCommerce's own red
   cross rule (.woocommerce a.remove) uses !important for its colours, so these do too. */
.htp-next-drawer a.htp-next-drawer__remove {
	align-items: center;
	background: none !important;
	border: 0;
	border-radius: 0;
	color: var(--htp-next-muted) !important;
	display: inline-flex;
	font-size: 14px;
	font-weight: 500;
	height: auto;
	line-height: 1.2;
	margin: -6px 0 -10px;
	min-height: 44px;
	padding: 0 2px;
	text-decoration: underline;
	text-underline-offset: 3px;
	width: auto;
}

.htp-next-drawer a.htp-next-drawer__remove:hover {
	background: none !important;
	color: #9c2327 !important;
}

.htp-next-drawer .htp-next-item__total {
	color: var(--htp-next-ink);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.htp-next-drawer .htp-next-parcel__ship {
	align-items: center;
	background: var(--htp-next-mist);
	border-radius: 0 0 13px 13px;
	display: flex;
	flex-wrap: wrap;
	font-size: 14px;
	gap: 4px 10px;
	justify-content: space-between;
	padding: 10px 14px;
}

.htp-next-drawer .htp-next-parcel__cost {
	color: var(--htp-next-ink);
	font-variant-numeric: tabular-nums;
	font-weight: 700;
}

.htp-next-drawer .htp-next-wait {
	color: var(--htp-next-muted);
	font-weight: 400;
}

/* 4. Totals and buttons ---------------------------------------------------------------------------------------- */

.htp-next-drawer__foot {
	border-top: 1px solid var(--htp-next-line);
	display: grid;
	flex: none;
	gap: 10px;
	padding: 16px 22px 20px;
}

.htp-next-drawer table.htp-next-totals {
	background: none;
	border: 0;
	border-collapse: collapse;
	margin: 0;
	width: 100%;
}

.htp-next-drawer table.htp-next-totals th,
.htp-next-drawer table.htp-next-totals td {
	background: none;
	border: 0;
	color: var(--htp-next-text);
	font-size: 16px;
	font-weight: 400;
	line-height: 1.5;
	padding: 3px 0;
	text-align: left;
	vertical-align: baseline;
}

.htp-next-drawer table.htp-next-totals td {
	font-variant-numeric: tabular-nums;
	padding-left: 12px;
	text-align: right;
}

.htp-next-drawer table.htp-next-totals td.htp-next-wait {
	color: var(--htp-next-muted);
	font-size: 15px;
}

.htp-next-drawer table.htp-next-totals tr.order-total th,
.htp-next-drawer table.htp-next-totals tr.order-total td {
	color: var(--htp-next-ink);
	font-size: 19px;
	font-weight: 700;
	padding-top: 6px;
}

.htp-next-drawer__buttons {
	align-items: center;
	display: grid;
	gap: 4px;
}

.htp-next-drawer a.htp-next-drawer__checkout {
	align-items: center;
	background: var(--htp-next-green);
	border-radius: 10px;
	color: #fff;
	display: flex;
	font-size: 17px;
	font-weight: 650;
	justify-content: center;
	min-height: 52px;
	padding: 10px 22px;
	text-decoration: none;
}

.htp-next-drawer a.htp-next-drawer__checkout:hover {
	background: var(--htp-next-green-deep);
	color: #fff;
}

.htp-next-drawer a.htp-next-drawer__viewcart {
	align-items: center;
	color: var(--htp-next-green);
	display: flex;
	font-weight: 600;
	justify-content: center;
	min-height: 44px;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Where payment plug-ins put their own button (PayPal's mini-cart button on the live site). */
.htp-next-drawer .ppc-button-wrapper {
	margin: 0;
	width: 100%;
}

/* 5. Empty cart ------------------------------------------------------------------------------------------------- */

.htp-next-drawer__empty {
	padding: 28px 22px;
}

.htp-next-drawer__empty p {
	color: var(--htp-next-ink);
	font-size: 18px;
	margin: 0 0 16px;
}

.htp-next-drawer a.htp-next-drawer__shop {
	align-items: center;
	background: var(--htp-next-green);
	border-radius: 10px;
	color: #fff;
	display: inline-flex;
	font-weight: 650;
	min-height: 48px;
	padding: 0 24px;
	text-decoration: none;
}

.htp-next-drawer a.htp-next-drawer__shop:hover {
	background: var(--htp-next-green-deep);
	color: #fff;
}

/* 6. Phones: the panel takes the full width ------------------------------------------------------------------- */

@media (max-width: 600px) {

	.htp-next-drawer__panel {
		width: 100%;
	}

	.htp-next-drawer__head {
		padding-left: 16px;
	}

	.htp-next-drawer__added,
	.htp-next-drawer__loading {
		padding-left: 16px;
		padding-right: 16px;
	}

	.htp-next-drawer__body {
		padding: 14px 16px;
	}

	.htp-next-drawer__foot {
		padding: 14px 16px 18px;
	}

	.htp-next-drawer .htp-next-item {
		gap: 10px;
		grid-template-columns: 48px minmax(0, 1fr) auto;
		padding: 10px 12px;
	}
}

/* 7. Motion: slide in only when no reduced motion is asked for ------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {

	.htp-next-drawer .htp-next-drawer__panel {
		transform: translateX(100%);
		transition: transform 0.22s ease-out;
	}

	.htp-next-drawer .htp-next-drawer__scrim {
		opacity: 0;
		transition: opacity 0.22s ease-out;
	}

	.htp-next-drawer.is-open .htp-next-drawer__panel {
		transform: none;
	}

	.htp-next-drawer.is-open .htp-next-drawer__scrim {
		opacity: 1;
	}
}
