/* Nersi Store — Cart */

body.ns-cart-page .site-content--cart {
	padding-top: clamp(20px, 3vw, 28px);
	padding-bottom: clamp(48px, 6vw, 72px);
}

body.ns-cart-page .entry-title,
body.ns-cart-page .entry__title,
body.ns-cart-page .woocommerce > h1:first-child {
	display: none;
}

/* ── Header ── */
.ns-cart-head {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin-bottom: 20px;
}

.ns-cart-head__inner {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4px 16px 14px;
	text-align: center;
	overflow: hidden;
}

.ns-cart-head__bg {
	position: absolute;
	inset: 50% auto auto 50%;
	transform: translate(-50%, -58%);
	z-index: 0;
	font-size: clamp(1.8rem, 5vw, 3rem);
	font-weight: 900;
	line-height: 1;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	white-space: nowrap;
	pointer-events: none;
	user-select: none;
	background: linear-gradient(180deg, rgba(245, 184, 0, 0.18) 0%, rgba(26, 26, 26, 0.04) 72%, transparent 100%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.ns-cart-head__content {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	max-width: 640px;
}

.ns-cart-head__eyebrow {
	display: inline-flex;
	padding: 3px 12px;
	border-radius: 999px;
	background: linear-gradient(135deg, var(--ns-brand-soft), rgba(255, 255, 255, 0.95));
	color: var(--ns-brand-deep);
	font-size: 0.72rem;
	font-weight: 800;
	box-shadow: 0 0 0 1px rgba(245, 184, 0, 0.2);
}

.ns-cart-head__title {
	margin: 0;
}

.ns-cart-head__title-text {
	position: relative;
	display: inline-block;
	font-size: clamp(1.35rem, 2.8vw, 1.75rem);
	font-weight: 900;
	color: var(--ns-black);
	line-height: 1.35;
}

.ns-cart-head__title-text strong {
	color: var(--ns-brand-deep);
}

.ns-cart-head__title-text::before,
.ns-cart-head__title-text::after {
	content: "";
	position: absolute;
	top: 50%;
	width: 18px;
	height: 3px;
	border-radius: 999px;
	background: var(--af-gradient-brand);
}

.ns-cart-head__title-text::before {
	inset-inline-end: calc(100% + 10px);
}

.ns-cart-head__title-text::after {
	inset-inline-start: calc(100% + 10px);
}

.ns-cart-head__desc {
	margin: 0;
	font-size: 0.88rem;
	line-height: 1.7;
	color: var(--af-muted);
	text-align: center;
}

/* ── Layout ── */
.ns-cart__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
	gap: 20px;
	align-items: start;
}

.ns-cart-main {
	min-width: 0;
}

.ns-cart-sidebar {
	position: sticky;
	top: 24px;
}

.ns-cart-sidebar .cart-collaterals {
	margin: 0;
	width: 100%;
	float: none;
}

/* ── Table ── */
.ns-cart-table-card {
	border-radius: 16px;
	border: 1px solid var(--af-border);
	background: var(--af-white);
	box-shadow: 0 8px 28px rgba(26, 26, 26, 0.06);
	overflow: hidden;
}

body.ns-cart-page .woocommerce-cart-form__contents {
	width: 100%;
	border: 0 !important;
	border-collapse: separate !important;
	border-spacing: 0;
	margin: 0;
	background: transparent;
	box-shadow: none;
}

body.ns-cart-page .woocommerce-cart-form__contents thead {
	background: var(--af-cream);
}

body.ns-cart-page .woocommerce-cart-form__contents th {
	padding: 14px 16px !important;
	border: 0 !important;
	border-bottom: 1px solid rgba(245, 184, 0, 0.35) !important;
	font-size: 0.78rem;
	font-weight: 800;
	color: var(--ns-black);
}

body.ns-cart-page .woocommerce-cart-form__contents td {
	padding: 16px !important;
	border: 0 !important;
	border-bottom: 1px solid var(--af-border) !important;
	vertical-align: middle !important;
}

body.ns-cart-page .woocommerce-cart-form__contents tbody tr:last-child td {
	border-bottom: 0 !important;
}

body.ns-cart-page .product-thumbnail img {
	width: 76px;
	height: 76px;
	object-fit: cover;
	border-radius: 12px;
	border: 1px solid var(--af-border);
}

body.ns-cart-page .product-name a {
	font-weight: 800;
	color: var(--ns-black);
	line-height: 1.6;
	text-decoration: none;
}

body.ns-cart-page .product-name a:hover {
	color: var(--ns-brand-deep);
}

body.ns-cart-page .product-price,
body.ns-cart-page .product-subtotal {
	font-weight: 800;
	color: var(--ns-brand-deep);
}

body.ns-cart-page .product-remove a {
	display: inline-grid;
	place-items: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: rgba(26, 26, 26, 0.06);
	color: var(--ns-black) !important;
	font-size: 1.2rem;
	line-height: 1;
	text-decoration: none;
	transition: background 0.2s, color 0.2s, transform 0.2s;
}

body.ns-cart-page .product-remove a:hover {
	background: var(--ns-black);
	color: #fff !important;
	transform: scale(1.05);
}

body.ns-cart-page .product-quantity {
	text-align: center;
}

body.ns-cart-page .ns-qty {
	display: inline-grid;
	grid-template-columns: 34px minmax(0, 1fr) 34px;
	align-items: stretch;
	width: 112px;
	max-width: 100%;
	height: 38px;
	border: 1px solid var(--af-border);
	border-radius: 10px;
	overflow: hidden;
	background: var(--af-white);
}

body.ns-cart-page .ns-qty__btn {
	display: grid;
	place-items: center;
	padding: 0;
	border: 0;
	background: var(--af-bg);
	color: var(--ns-black);
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
}

body.ns-cart-page .ns-qty__btn:hover {
	background: var(--ns-brand-soft);
	color: var(--ns-brand-deep);
}

body.ns-cart-page .ns-qty .qty {
	width: 100%;
	min-width: 0;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0 !important;
	border-inline: 1px solid var(--af-border) !important;
	border-radius: 0;
	background: transparent;
	text-align: center;
	font-family: var(--af-font) !important;
	font-size: 0.9rem;
	font-weight: 700;
	color: var(--ns-black);
	-moz-appearance: textfield;
}

body.ns-cart-page .ns-qty .qty::-webkit-outer-spin-button,
body.ns-cart-page .ns-qty .qty::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

body.ns-cart-page .actions {
	padding: 0 !important;
	background: var(--af-bg);
	border-top: 1px solid var(--af-border) !important;
}

.ns-cart-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: stretch;
	justify-content: space-between;
	width: 100%;
	padding: 18px 20px;
	box-sizing: border-box;
}

body.ns-cart-page .coupon {
	display: flex;
	flex-wrap: nowrap;
	gap: 10px;
	align-items: stretch;
	flex: 1 1 320px;
	min-width: min(100%, 260px);
}

body.ns-cart-page .coupon input.input-text {
	flex: 1 1 auto;
	min-width: 0;
	min-height: 46px;
	padding: 12px 14px;
	border: 1px solid var(--af-border);
	border-radius: 12px;
	background: var(--af-white);
	font-family: var(--af-font) !important;
	font-size: 0.9rem;
	color: var(--ns-black);
}

body.ns-cart-page .coupon .button {
	flex: 0 0 auto;
	min-height: 46px;
	padding: 0 22px !important;
	border: 0 !important;
	border-radius: 12px !important;
	background: var(--ns-black) !important;
	color: var(--ns-brand-bright) !important;
	font-size: 0.88rem !important;
	white-space: nowrap;
	box-shadow: none !important;
}

body.ns-cart-page .coupon .button:hover {
	background: var(--ns-brand-deep) !important;
	color: var(--ns-black) !important;
}

body.ns-cart-page .ns-cart-update-btn {
	flex: 0 0 auto;
	min-height: 46px;
	padding: 0 22px !important;
	border-radius: 12px !important;
	font-size: 0.88rem !important;
	white-space: nowrap;
	background: var(--af-white) !important;
	color: var(--ns-brand-deep) !important;
	border: 1px solid rgba(245, 184, 0, 0.45) !important;
	box-shadow: none !important;
}

body.ns-cart-page .ns-cart-update-btn:hover {
	background: var(--af-cream) !important;
}

/* ── Totals ── */
.ns-cart-totals {
	padding: 20px 18px;
	border-radius: 16px;
	border: 1px solid rgba(245, 184, 0, 0.35);
	background: var(--af-white);
	box-shadow: 0 10px 32px rgba(245, 184, 0, 0.1);
}

.ns-cart-totals__title {
	margin: 0 0 16px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--af-border);
	font-size: 1.05rem;
	font-weight: 900;
	color: var(--ns-black);
}

body.ns-cart-page .ns-cart-totals .shop_table {
	display: block;
	width: 100%;
	border: 0 !important;
	box-shadow: none !important;
	background: transparent !important;
}

body.ns-cart-page .ns-cart-totals .shop_table tbody {
	display: block;
}

body.ns-cart-page .ns-cart-totals .shop_table tr {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 12px;
	align-items: center;
	padding: 12px 0;
	border-bottom: 1px dashed var(--af-border);
}

body.ns-cart-page .ns-cart-totals .shop_table th,
body.ns-cart-page .ns-cart-totals .shop_table td {
	display: block;
	padding: 0 !important;
	border: 0 !important;
	background: transparent !important;
	font-size: 0.88rem;
}

body.ns-cart-page .ns-cart-totals .shop_table th {
	font-weight: 700;
	color: var(--af-muted);
	text-align: start;
}

body.ns-cart-page .ns-cart-totals .shop_table td {
	font-weight: 800;
	color: var(--ns-black);
	text-align: end;
	white-space: nowrap;
}

body.ns-cart-page .ns-cart-totals tr.woocommerce-shipping-totals,
body.ns-cart-page .ns-cart-totals tr.shipping {
	grid-template-columns: 1fr;
	gap: 10px;
	align-items: start;
}

body.ns-cart-page .ns-cart-totals tr.woocommerce-shipping-totals td,
body.ns-cart-page .ns-cart-totals tr.shipping td {
	text-align: start;
	white-space: normal;
	font-weight: 400;
}

body.ns-cart-page .ns-cart-totals .order-total {
	border-bottom: 0;
	border-top: 2px dashed rgba(245, 184, 0, 0.45);
	margin-top: 4px;
	padding-top: 14px;
}

body.ns-cart-page .ns-cart-totals .order-total th,
body.ns-cart-page .ns-cart-totals .order-total td {
	font-size: 1rem;
	font-weight: 900;
	color: var(--ns-black);
}

body.ns-cart-page .wc-proceed-to-checkout {
	padding-top: 16px;
}

body.ns-cart-page .wc-proceed-to-checkout a.checkout-button,
body.ns-cart-page .wc-proceed-to-checkout .checkout-button.button.alt {
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 56px !important;
	padding: 14px 24px !important;
	font-size: 1.05rem !important;
	font-weight: 900 !important;
	line-height: 1.4 !important;
	border-radius: 999px !important;
	background: var(--af-gradient-brand) !important;
	color: var(--ns-black) !important;
	box-shadow: 0 10px 26px rgba(245, 184, 0, 0.32) !important;
	text-align: center;
}

body.ns-cart-page .wc-proceed-to-checkout a.checkout-button:hover,
body.ns-cart-page .wc-proceed-to-checkout .checkout-button.button.alt:hover {
	color: var(--ns-black) !important;
	transform: translateY(-1px);
}

/* ── Mobile sticky checkout CTA ── */
@media (max-width: 991px) {
	body.ns-cart-page:not(.woocommerce-cart-is-empty) {
		padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
	}

	body.ns-cart-page .wc-proceed-to-checkout {
		position: fixed;
		inset-inline: 0;
		bottom: 0;
		z-index: 490;
		margin: 0;
		padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
		background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.94) 24%, #fff 100%);
		border-top: 1px solid var(--af-border);
		box-shadow: 0 -10px 28px rgba(26, 26, 26, 0.08);
	}

	body.ns-cart-page .wc-proceed-to-checkout a.checkout-button,
	body.ns-cart-page .wc-proceed-to-checkout .checkout-button.button.alt {
		min-height: 52px !important;
		font-size: 0.98rem !important;
	}
}

.ns-cart-trust {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid var(--af-border);
}

.ns-cart-trust__item {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.76rem;
	font-weight: 700;
	color: var(--af-muted);
}

.ns-cart-trust__item::before {
	content: "✓";
	display: inline-grid;
	place-items: center;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--ns-brand-soft);
	color: var(--ns-brand-deep);
	font-size: 0.68rem;
	flex-shrink: 0;
}

/* ── Empty cart ── */
.ns-cart--empty {
	max-width: min(100%, 560px);
	margin-inline: auto;
}

.ns-cart-empty {
	padding: 48px 28px;
	border-radius: 16px;
	border: 1px dashed rgba(245, 184, 0, 0.45);
	background: var(--af-white);
	box-shadow: 0 10px 32px rgba(26, 26, 26, 0.06);
	text-align: center;
}

.ns-cart-empty__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 80px;
	height: 80px;
	margin-bottom: 16px;
	border-radius: 50%;
	background: var(--af-cream);
	border: 1px solid rgba(245, 184, 0, 0.35);
	color: var(--ns-brand-deep);
}

.ns-cart-empty__icon svg {
	width: 36px;
	height: 36px;
}

.ns-cart-empty__title {
	margin: 0 0 8px;
	font-size: 1.2rem;
	font-weight: 900;
	color: var(--ns-black);
}

.ns-cart-empty__desc {
	margin: 0 0 20px;
	font-size: 0.88rem;
	line-height: 1.8;
	color: var(--af-muted);
}

.ns-cart-empty__btn {
	min-height: 46px !important;
	padding: 10px 24px !important;
	border-radius: 999px !important;
	font-weight: 900 !important;
	background: var(--af-gradient-brand) !important;
	color: var(--ns-black) !important;
	box-shadow: 0 8px 22px rgba(245, 184, 0, 0.28) !important;
}

/* ── Buttons & notices ── */
body.ns-cart-page .button,
body.ns-cart-page .woocommerce .button {
	border-radius: 12px !important;
	font-weight: 800 !important;
}

body.ns-cart-page .woocommerce-message,
body.ns-cart-page .woocommerce-notices-wrapper .woocommerce-message {
	display: none !important;
}

body.ns-cart-page .woocommerce-error,
body.ns-cart-page .woocommerce-info,
body.ns-cart-page .woocommerce-notices-wrapper .woocommerce-error,
body.ns-cart-page .woocommerce-notices-wrapper .woocommerce-info {
	display: block;
}

body.ns-cart-page .woocommerce-info,
body.ns-cart-page .woocommerce-error {
	border-radius: 12px !important;
	margin-bottom: 16px !important;
}

body.ns-cart-page .cross-sells {
	margin-top: 24px;
	padding: 20px;
	border-radius: 16px;
	border: 1px solid var(--af-border);
	background: var(--af-white);
}

body.ns-cart-page .cross-sells > h2 {
	margin: 0 0 14px;
	font-size: 1rem;
	font-weight: 900;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
	.ns-cart__layout {
		grid-template-columns: 1fr;
	}

	.ns-cart-sidebar {
		position: static;
	}
}

@media (max-width: 768px) {
	body.ns-cart-page .ns-cart-head .ns-checkout-steps,
	.ns-cart-head__desc {
		display: none;
	}

	.ns-cart-table-card {
		border: 0;
		border-radius: 0;
		box-shadow: none;
		background: transparent;
	}

	body.ns-cart-page .woocommerce-cart-form__contents thead {
		display: none;
	}

	body.ns-cart-page .woocommerce-cart-form__contents tbody tr.cart_item {
		display: grid !important;
		grid-template-columns: 68px minmax(0, 1fr) auto;
		grid-template-rows: auto auto auto auto;
		gap: 0 10px;
		margin: 0 0 12px;
		padding: 14px;
		border: 1px solid var(--af-border) !important;
		border-radius: 14px;
		background: var(--af-white);
		box-shadow: 0 6px 20px rgba(26, 26, 26, 0.05);
	}

	body.ns-cart-page .woocommerce-cart-form__contents tbody tr.cart_item td {
		display: block !important;
		width: auto !important;
		padding: 0 !important;
		border: 0 !important;
		text-align: start !important;
		background: transparent !important;
	}

	body.ns-cart-page .woocommerce-cart-form__contents tbody tr.cart_item td::before {
		display: none !important;
		content: none !important;
	}

	body.ns-cart-page .woocommerce-cart-form__contents tbody tr.cart_item td.product-thumbnail {
		grid-column: 1;
		grid-row: 1;
	}

	body.ns-cart-page .woocommerce-cart-form__contents tbody tr.cart_item td.product-name {
		grid-column: 2;
		grid-row: 1;
		align-self: center;
	}

	body.ns-cart-page .woocommerce-cart-form__contents tbody tr.cart_item td.product-remove {
		display: flex !important;
		grid-column: 3;
		grid-row: 1;
		justify-content: flex-end;
	}

	body.ns-cart-page .woocommerce-cart-form__contents tbody tr.cart_item td.product-thumbnail img {
		width: 68px;
		height: 68px;
	}

	body.ns-cart-page .woocommerce-cart-form__contents tbody tr.cart_item td.product-price,
	body.ns-cart-page .woocommerce-cart-form__contents tbody tr.cart_item td.product-quantity,
	body.ns-cart-page .woocommerce-cart-form__contents tbody tr.cart_item td.product-subtotal {
		display: flex !important;
		grid-column: 1 / -1;
		justify-content: space-between;
		align-items: center;
		gap: 10px;
		margin-top: 12px;
		padding-top: 10px !important;
		border-top: 1px dashed var(--af-border) !important;
		font-size: 0.86rem;
	}

	body.ns-cart-page .woocommerce-cart-form__contents tbody tr.cart_item td.product-price::before,
	body.ns-cart-page .woocommerce-cart-form__contents tbody tr.cart_item td.product-quantity::before,
	body.ns-cart-page .woocommerce-cart-form__contents tbody tr.cart_item td.product-subtotal::before {
		display: block !important;
		content: attr(data-title) !important;
		font-size: 0.74rem;
		font-weight: 800;
		color: var(--af-muted);
	}

	body.ns-cart-page .woocommerce-cart-form__contents tbody tr:last-child {
		display: block !important;
		margin: 0;
		padding: 14px;
		border: 1px solid var(--af-border) !important;
		border-radius: 14px;
		background: var(--af-white);
	}

	body.ns-cart-page .woocommerce-cart-form__contents tbody tr:last-child td.actions {
		display: block !important;
		width: 100% !important;
		padding: 0 !important;
		border: 0 !important;
	}

	.ns-cart-actions {
		flex-direction: column;
		align-items: stretch;
		gap: 10px;
		padding: 16px;
	}

	body.ns-cart-page .coupon {
		flex-direction: column;
		align-items: stretch;
		flex: 1 1 auto;
		min-width: 0;
		width: 100%;
	}

	body.ns-cart-page .coupon input.input-text,
	body.ns-cart-page .coupon .button,
	body.ns-cart-page .ns-cart-update-btn {
		width: 100% !important;
		min-height: 48px;
	}

	.ns-cart-head__title-text::before,
	.ns-cart-head__title-text::after {
		width: 12px;
	}

	.ns-cart-empty {
		padding: 36px 18px;
	}
}
