/**
 * Cart page (STORE-PAGES.md §4). Loaded only on is_cart().
 *
 * Without JavaScript the "Update cart" button shows; .is-enhanced (set by cart.js) hides it
 * because quantities then update on their own.
 */

.content-area--cart {
	max-width: 1240px;
	padding-top: 28px;
	padding-bottom: 72px;
}

.content-area--cart .entry,
.content-area--cart .woocommerce {
	margin: 0;
}

.ns-cart {
	color: var(--ui-text);
	font-size: 15px;
	line-height: 1.55;
	transition: opacity 0.4s ease;
}

.ns-cart.is-fading {
	opacity: 0;
}

.ns-cart__crumbs {
	margin-bottom: 10px;
	color: var(--ui-text-3);
	font-size: 13px;
}

.ns-cart__crumbs a {
	color: var(--ui-text-3);
}

.ns-cart__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 26px;
}

.ns-cart .ns-cart__title {
	margin: 0;
	font-family: var(--serif);
	font-size: 44px;
	font-weight: 500;
	line-height: 1.1;
}

.ns-cart__count {
	color: var(--ui-text-3);
	font-family: var(--sans);
	font-size: 16px;
	font-weight: 500;
}

/* 1 Cart — 2 Checkout — 3 Confirmation */
.ns-steps {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 0;
	color: var(--ui-muted);
	font-size: 13px;
	list-style: none;
}

.ns-steps__step {
	display: flex;
	align-items: center;
	gap: 6px;
}

.ns-steps__num {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border: 1.5px solid var(--ui-field);
	border-radius: 50%;
	font-size: 11px;
}

.ns-steps__step.is-current {
	color: var(--ui-dark);
	font-weight: 600;
}

.ns-steps__step.is-current .ns-steps__num {
	border-color: var(--ui-dark);
	background: var(--ui-dark);
	color: var(--ui-on-dark);
}

.ns-steps__line {
	width: 24px;
	height: 1px;
	background: var(--ui-field);
}

/* Layout */

.ns-cart__layout {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 28px;
}

.ns-cart__main {
	display: flex;
	flex: 999 1 560px;
	flex-direction: column;
	min-width: 0;
}

.woocommerce .ns-cart__side {
	position: sticky;
	top: calc(var(--header-h) + 18px);
	flex: 1 1 320px;
	float: none;
	width: auto;
	min-width: 0;
}

.ns-cart__form {
	margin: 0;
}

/* WooCommerce floats the totals at 48% width; ours fill the summary column. */
.woocommerce .ns-cart__side .cart_totals,
.woocommerce-page .ns-cart__side .cart_totals {
	float: none;
	width: auto;
}

/* Item cards */

.ns-citems {
	display: flex;
	flex-direction: column;
}

.ns-citem-wrap {
	transition: grid-template-rows 0.5s var(--ui-ease) 0.15s, opacity 0.3s ease, transform 0.4s var(--ui-ease), margin 0.5s var(--ui-ease);
}

.ns-citem-wrap.is-open {
	margin-bottom: 14px;
}

.ns-citem-wrap.is-removing {
	transform: translateX(-24px);
}

.ns-citem {
	display: flex;
	flex-wrap: wrap;
	gap: 18px;
	padding: 18px;
	border: 1px solid var(--ui-line);
	border-radius: 20px;
	background: var(--ui-card);
}

.ns-citem__img {
	display: block;
	flex: none;
	width: 104px;
	height: 130px;
	overflow: hidden;
	border-radius: 14px;
	background: var(--ui-tint);
}

.ns-citem__img img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ns-citem__body {
	display: flex;
	flex: 1 1 200px;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.ns-citem__top {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
}

.ns-cart .ns-citem__name {
	margin: 0;
	font-family: var(--serif);
	font-size: 19px;
	font-weight: 500;
	line-height: 1.3;
}

.ns-citem__name a {
	color: var(--ui-text);
	text-decoration: none;
}

.ns-citem__name a:hover {
	text-decoration: underline;
}

.woocommerce .ns-citem a.ns-citem__remove {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: -10px -10px 0 0;
	border-radius: 50%;
	background: transparent;
	color: var(--ui-muted) !important;
	font-size: inherit;
	transition: color 0.2s ease, background-color 0.2s ease;
}

.woocommerce .ns-citem a.ns-citem__remove:hover {
	background: var(--ui-error-bg);
	color: var(--ui-error) !important;
}

.ns-citem__meta {
	margin: 0;
	color: var(--ui-text-3);
	font-size: 13px;
}

.ns-stock {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--ui-success);
	font-size: 12px;
	font-weight: 500;
}

.ns-stock::before {
	content: "";
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: currentColor;
}

.ns-stock--low {
	color: var(--ui-amber);
}

.ns-stock--low::before {
	background: var(--ui-amber-dot);
}

.ns-citem__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 6px;
}

.ns-qty {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--ui-track);
	border-radius: 999px;
}

.ns-qty__btn {
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--ui-dark);
	font-size: 18px;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.ns-qty__btn:hover {
	background: var(--ui-tint);
}

.ns-qty__btn:focus-visible,
.ns-qty__input:focus-visible {
	outline: 2px solid var(--ui-focus);
	outline-offset: -2px;
}

.ns-qty__input {
	width: 40px;
	height: 44px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--ui-text);
	font: inherit;
	font-weight: 600;
	text-align: center;
	-moz-appearance: textfield;
}

.ns-qty__input::-webkit-outer-spin-button,
.ns-qty__input::-webkit-inner-spin-button {
	margin: 0;
	-webkit-appearance: none;
}

.ns-citem__single {
	color: var(--ui-text-3);
	font-size: 14px;
}

.ns-citem__price {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	margin-left: auto;
}

.ns-citem__price strong {
	font-size: 17px;
	font-weight: 600;
}

.ns-citem__price > span {
	color: var(--ui-text-3);
	font-size: 12px;
}

.ns-cart[aria-busy="true"] [data-sync^="price-"],
.ns-cart[aria-busy="true"] .ns-sum__rows {
	opacity: 0.5;
	transition: opacity 0.2s ease;
}

.ns-cart__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 10px;
	margin-bottom: 14px;
}

.ns-cart__actions:empty {
	display: none;
}

.ns-cart.is-enhanced .ns-cart__update {
	display: none;
}

.ns-cart__coupon {
	display: flex;
	flex: 1 1 300px;
	gap: 8px;
}

.ns-cart__note {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin: 4px 0 0;
	padding: 16px 18px;
	border-radius: 16px;
	background: var(--ui-soft);
	color: var(--ui-text-2);
	font-size: 14px;
}

.ns-cart__note .icon {
	color: var(--ui-brand);
}

.ns-cart__continue {
	display: inline-flex;
	align-self: flex-start;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	margin-top: 18px;
	color: var(--ui-dark);
	font-size: 14px;
	font-weight: 600;
	text-decoration: underline;
	text-decoration-color: transparent;
	text-underline-offset: 3px;
}

.ns-cart__continue:hover {
	color: var(--ui-brand);
	text-decoration-color: currentColor;
}

/* Summary */

.ns-sum {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 26px;
	border: 1px solid var(--ui-line);
	border-radius: 22px;
	background: var(--ui-card);
	box-shadow: 0 14px 36px rgba(43, 27, 18, 0.07);
}

.woocommerce .ns-cart .ns-sum__title {
	margin: 0 0 4px;
	font-family: var(--serif);
	font-size: 24px;
	font-weight: 500;
}

.ns-sum__rows {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin: 0;
	font-size: 14px;
}

.ns-sum__rows > div {
	display: flex;
	justify-content: space-between;
	gap: 12px;
}

.ns-sum__rows dt {
	color: var(--ui-text-2);
}

.ns-sum__rows dd {
	margin: 0;
	font-weight: 500;
	text-align: right;
}

.ns-sum__rows .ns-sum__muted {
	color: var(--ui-text-3);
	font-weight: 400;
}

.ns-sum__rows .ns-sum__total {
	align-items: baseline;
	padding-top: 14px;
	border-top: 1px solid var(--ui-line);
}

.ns-sum__total dt {
	color: var(--ui-text);
	font-size: 15px;
	font-weight: 600;
}

.ns-sum__total dd {
	font-family: var(--serif);
	font-size: 30px;
	font-weight: 600;
}

.ns-sum__currency {
	margin: -8px 0 0;
	color: var(--ui-text-3);
	font-size: 12px;
}

.woocommerce .ns-sum .wc-proceed-to-checkout {
	padding: 0;
}

.woocommerce .ns-sum .wc-proceed-to-checkout a.checkout-button {
	display: flex;
	min-height: 56px;
	margin: 0;
	padding: 0 28px;
	border: 0;
	border-radius: 999px;
	background: var(--ui-dark);
	color: var(--ui-on-dark);
	font-size: 15px;
}

.woocommerce .ns-sum .wc-proceed-to-checkout a.checkout-button:hover {
	background: var(--ui-dark-hover);
	color: var(--ui-on-dark);
}

.ns-sum__secure {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: 0;
	color: var(--ui-text-3);
	font-size: 12px;
}

.ns-sum__secure svg {
	color: var(--ui-success);
}

/* Mobile sticky bar: hidden on wide screens. */
.ns-cart__bar {
	display: none;
}

/* Empty cart */

.ns-cempty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	max-width: 460px;
	margin: 20px auto 0;
	padding: 30px 0 10px;
	text-align: center;
}

.ns-cempty__art {
	position: relative;
	width: 150px;
	height: 150px;
	margin-bottom: 8px;
	border-radius: 50%;
	background: var(--ui-tile);
}

.ns-cempty__bag {
	position: absolute;
	inset: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--ui-brand);
	animation: ns-cart-bob 4s ease-in-out infinite;
}

@keyframes ns-cart-bob {
	0%,
	100% {
		transform: translateY(0) rotate(-4deg);
	}

	50% {
		transform: translateY(-10px) rotate(2deg);
	}
}

.ns-cart .ns-cempty__title {
	margin: 0;
	font-family: var(--serif);
	font-size: 32px;
	font-weight: 500;
}

.ns-cempty__text {
	margin: 0 0 8px;
	color: var(--ui-text-3);
}

/* You may also like */

.ns-recs {
	margin-top: 64px;
}

.ns-recs__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 20px;
}

.woocommerce .ns-recs .ns-recs__title {
	margin: 0;
	font-family: var(--serif);
	font-size: 30px;
	font-weight: 500;
}

.ns-recs__all {
	color: var(--ui-dark);
	font-size: 14px;
	font-weight: 600;
}

.ns-recs__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ns-rec {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ns-rec__media {
	position: relative;
	aspect-ratio: 4 / 5;
	overflow: hidden;
	border-radius: 16px;
	background: var(--ui-tint);
}

.ns-rec__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.6s var(--ui-ease);
}

.ns-rec__pill {
	position: absolute;
	right: 10px;
	bottom: 10px;
	left: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	border-radius: 999px;
	background: #2b1b12;
	color: #ffffff;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	transition: opacity 0.3s ease, transform 0.4s var(--ui-ease), background-color 0.25s ease;
}

.ns-rec__pill:hover {
	background: #4a3021;
	color: #ffffff;
}

.ns-rec__pill.is-busy {
	opacity: 0.6;
	pointer-events: none;
}

.ns-rec__pill:focus-visible {
	outline: 2px solid #ffffff;
	outline-offset: -4px;
	box-shadow: 0 0 0 2px var(--ui-focus);
}

/* The pill slides up on hover; touch screens always show it. */
@media (hover: hover) {
	.ns-rec__pill {
		opacity: 0;
		transform: translateY(8px);
	}

	.ns-rec:hover .ns-rec__pill,
	.ns-rec__pill:focus-visible {
		opacity: 1;
		transform: none;
	}

	.ns-rec:hover .ns-rec__media img {
		transform: scale(1.05);
	}
}

.woocommerce .ns-rec .ns-rec__name {
	margin: 0;
	font-family: var(--serif);
	font-size: 16px;
	font-weight: 400;
}

.ns-rec__name a {
	color: var(--ui-text);
	text-decoration: none;
}

.ns-rec__name a:hover {
	text-decoration: underline;
}

.ns-rec__price {
	font-size: 14px;
	font-weight: 600;
}

.ns-rec__price del {
	color: var(--ui-text-3);
	font-weight: 400;
}

.ns-rec__price ins {
	color: var(--sale);
	text-decoration: none;
}

/* Phones: the checkout button moves to a sticky bar at the bottom. */
@media (max-width: 860px) {
	.ns-cart .ns-cart__title {
		font-size: 34px;
	}

	.ns-steps {
		display: none;
	}

	.woocommerce .ns-cart__side {
		position: static;
	}

	.ns-sum__go,
	.ns-sum__secure {
		display: none !important;
	}

	.ns-cart:not(.ns-cart--empty) {
		padding-bottom: 90px;
	}

	.ns-cart:not(.ns-cart--empty) .ns-cart__bar {
		position: fixed;
		right: 0;
		bottom: 0;
		left: 0;
		z-index: 40;
		display: flex;
		align-items: center;
		gap: 14px;
		padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
		border-top: 1px solid var(--ui-line);
		background: var(--ui-card);
		box-shadow: 0 -10px 30px rgba(43, 27, 18, 0.08);
	}

	.ns-cart__bar-total {
		display: flex;
		flex-direction: column;
		line-height: 1.2;
	}

	.ns-cart__bar-total span {
		color: var(--ui-text-3);
		font-size: 12px;
	}

	.ns-cart__bar-total strong {
		font-family: var(--serif);
		font-size: 22px;
		font-weight: 600;
	}

	.ns-cart__bar-btn {
		flex: 1;
		min-height: 52px;
	}

	.ns-citem {
		gap: 14px;
		padding: 14px;
	}

	.ns-citem__img {
		width: 88px;
		height: 110px;
	}

	.ns-recs {
		margin-top: 48px;
	}

	.woocommerce .ns-recs .ns-recs__title {
		font-size: 24px;
	}

	.ns-recs__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 14px;
	}
}

/* The floating WhatsApp button sits above the sticky bar. */
@media (max-width: 860px) {
	.woocommerce-cart .whatsapp-float {
		bottom: 96px;
	}
}
