/**
 * Cart page — div layout, single thumbnail, quantity steppers.
 */

body.pc-cart-page {
	background: var(--pc-home-yellow) !important;
}

body.pc-cart-page .pc-cart-page-panel {
	width: 100%;
	max-width: 1180px;
	margin: 0 auto;
	padding: clamp(24px, 3vw, 36px);
	border: 1px solid rgba(42, 24, 16, 0.1);
	border-radius: 24px;
	background: #fff;
	box-shadow: 0 16px 40px rgba(42, 24, 16, 0.08);
	box-sizing: border-box;
}

body.pc-cart-page .pc-cart-page-panel > .woocommerce {
	display: flex;
	flex-direction: column;
	width: 100%;
}

body.pc-cart-page .pc-cart-page-panel .woocommerce-notices-wrapper,
body.pc-cart-page .pc-cart-page-panel .woocommerce > .woocommerce-message,
body.pc-cart-page .pc-cart-page-panel .woocommerce > .woocommerce-info,
body.pc-cart-page .pc-cart-page-panel .woocommerce > .woocommerce-error {
	order: -10;
	width: 100%;
	margin: 0 0 18px !important;
}

body.pc-cart-page .pc-cart-page-panel .woocommerce-message,
body.pc-cart-page .pc-cart-page-panel .woocommerce-info,
body.pc-cart-page .pc-cart-page-panel .woocommerce-error {
	border-radius: 14px;
	border: 1px solid rgba(42, 24, 16, 0.14);
	background: #fffbeb;
	font-family: var(--pc-font-body);
	color: var(--pc-brown);
}

@media (min-width: 900px) {
	body.pc-cart-page .pc-cart-page-panel > .woocommerce {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
		grid-template-areas:
			"notices notices"
			"items totals";
		gap: 32px 40px;
		align-items: start;
	}

	body.pc-cart-page .pc-cart-page-panel .woocommerce-notices-wrapper,
	body.pc-cart-page .pc-cart-page-panel .woocommerce > .woocommerce-message,
	body.pc-cart-page .pc-cart-page-panel .woocommerce > .woocommerce-info,
	body.pc-cart-page .pc-cart-page-panel .woocommerce > .woocommerce-error {
		grid-area: notices;
	}

	body.pc-cart-page .pc-cart-page-panel .woocommerce-cart-form {
		grid-area: items;
	}

	body.pc-cart-page .pc-cart-page-panel .cart-collaterals {
		grid-area: totals;
	}
}

/* Line items */
body.pc-cart-page .pc-cart-lines {
	display: flex;
	flex-direction: column;
	gap: 0;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
}

body.pc-cart-page .pc-cart-line {
	display: grid;
	grid-template-columns: 96px minmax(0, 1fr) auto;
	gap: 16px 20px;
	align-items: center;
	padding: 20px 0;
	border-bottom: 1px solid rgba(42, 24, 16, 0.12);
}

body.pc-cart-page .pc-cart-line:first-child {
	padding-top: 0;
}

body.pc-cart-page .pc-cart-line__media {
	grid-column: 1;
	display: block !important;
	min-width: 96px;
}

body.pc-cart-page .pc-cart-line__body {
	grid-column: 2;
	min-width: 0;
	display: block !important;
}

body.pc-cart-page .pc-cart-line__thumb,
body.pc-cart-page a.pc-cart-line__thumb {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 96px;
	height: 96px;
	margin: 0;
	padding: 8px;
	border: 1px solid rgba(42, 24, 16, 0.1);
	border-radius: var(--pc-radius-sm);
	background: #fff;
	overflow: hidden;
	box-sizing: border-box;
	text-decoration: none;
}

body.pc-cart-page .pc-cart-line__thumb img,
body.pc-cart-page .pc-cart-item-image {
	display: block;
	width: 100%;
	height: 100%;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

body.pc-cart-page .pc-cart-line__body {
	grid-column: 2;
	min-width: 0;
	display: block !important;
}

body.pc-cart-page .pc-cart-line__body .pc-cart-item-title {
	display: block;
	margin: 0 0 8px;
	font-family: var(--pc-font-display) !important;
	font-size: clamp(1.35rem, 3vw, 1.85rem) !important;
	font-weight: 400 !important;
	line-height: 0.95 !important;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--pc-brown) !important;
	text-decoration: none !important;
}

body.pc-cart-page .pc-cart-item-meta {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
}

body.pc-cart-page .pc-cart-item-pack {
	margin: 0;
	font-size: 0.82rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

body.pc-cart-page .pc-cart-item-unit-price {
	font-size: 0.95rem;
	font-weight: 700;
	color: var(--pc-brown);
}

body.pc-cart-page a.pc-cart-item-remove {
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--pc-brown) !important;
	text-decoration: underline !important;
}

body.pc-cart-page .pc-cart-line__qty {
	grid-column: 3;
	justify-self: end;
}

body.pc-cart-page .pc-cart-qty-stepper {
	display: grid;
	grid-template-columns: 40px 48px 40px;
	align-items: stretch;
	width: 128px;
	border: 1px solid var(--pc-brand);
	border-radius: var(--pc-radius-sm);
	background: #fff;
	overflow: hidden;
}

body.pc-cart-page .pc-cart-qty-stepper.is-updating {
	opacity: 0.65;
	pointer-events: none;
}

body.pc-cart-page .pc-cart-qty-center {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	border-left: 1px solid var(--pc-brand);
	border-right: 1px solid var(--pc-brand);
}

body.pc-cart-page .pc-cart-qty-stepper .quantity {
	position: absolute !important;
	inset: 0 !important;
	opacity: 0 !important;
	pointer-events: none !important;
	margin: 0 !important;
}

body.pc-cart-page .pc-cart-qty-label {
	font-size: 1rem;
	font-weight: 700;
	color: #141814;
}

body.pc-cart-page .pc-cart-qty-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	padding: 0;
	border: 0;
	background: #fff;
	color: var(--pc-brand);
	font-size: 1.1rem;
	font-weight: 700;
	cursor: pointer;
}

body.pc-cart-page .pc-cart-qty-btn:hover {
	background: var(--pc-yellow);
}

/* Coupon + hidden update button */
body.pc-cart-page .pc-cart-form-foot {
	margin-top: 24px;
	padding-top: 24px;
	border-top: 1px solid rgba(42, 24, 16, 0.12);
}

body.pc-cart-page .pc-cart-form-foot .coupon {
	display: flex;
	flex-wrap: nowrap;
	align-items: stretch;
	gap: 12px;
	width: 100%;
}

body.pc-cart-page .pc-cart-form-foot .coupon .input-text {
	flex: 1 1 auto;
	min-width: 0;
	padding: 12px 16px;
	border: 1px solid var(--pc-brand) !important;
	border-radius: var(--pc-radius-sm) !important;
	background: #fff !important;
}

body.pc-cart-page .pc-cart-form-foot .coupon .button {
	flex: 0 0 auto;
	min-width: 130px;
	white-space: nowrap !important;
}

/* Hidden update control — keep clickable for requestSubmit fallback. */
body.pc-cart-page .pc-cart-form-foot {
	position: relative;
}

body.pc-cart-page .pc-cart-form-foot .pc-cart-update-btn,
body.pc-cart-page .pc-cart-form-foot button[name="update_cart"] {
	position: absolute !important;
	left: -9999px !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	opacity: 0 !important;
	pointer-events: auto !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
}

/* Totals card */
body.pc-cart-page .cart-collaterals {
	width: 100%;
	min-width: 0;
}

body.pc-cart-page .cart_totals {
	width: 100% !important;
	min-width: 0;
	padding: clamp(22px, 3vw, 32px);
	border: 2px solid rgba(42, 24, 16, 0.22);
	border-radius: 16px;
	background: #fff;
	box-sizing: border-box;
}

body.pc-cart-page .cart-collaterals,
body.pc-cart-page .cart-collaterals .cart_totals {
	width: 100% !important;
	max-width: 100% !important;
	float: none !important;
	clear: both !important;
}

body.pc-cart-page .cart_totals h2 {
	margin: 0 0 18px;
	font-family: var(--pc-font-display);
	font-size: clamp(1.35rem, 2.8vw, 1.75rem);
	font-weight: 400;
	line-height: 1.05;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #000;
	white-space: nowrap;
}

/* Reset WC table — cart line item rules must not affect totals table. */
body.pc-cart-page .cart_totals table.shop_table {
	display: table !important;
	width: 100% !important;
	border: 0 !important;
	border-collapse: collapse;
	table-layout: fixed;
}

body.pc-cart-page .cart_totals table.shop_table tbody {
	display: table-row-group !important;
	width: 100%;
}

body.pc-cart-page .cart_totals table.shop_table tr {
	display: table-row !important;
}

body.pc-cart-page .cart_totals table.shop_table th,
body.pc-cart-page .cart_totals table.shop_table td {
	display: table-cell !important;
	padding: 14px 0 !important;
	border: 0 !important;
	border-top: 2px solid rgba(42, 24, 16, 0.14) !important;
	vertical-align: middle !important;
	background: transparent !important;
	font-family: var(--pc-font-body);
	font-size: 0.95rem;
	color: var(--pc-brown);
}

body.pc-cart-page .cart_totals table.shop_table th {
	width: 55%;
	min-width: 0;
	padding-right: 20px !important;
	font-weight: 600;
	text-align: left;
	white-space: nowrap;
}

body.pc-cart-page .cart_totals table.shop_table td {
	width: 45%;
	text-align: right !important;
	font-weight: 700;
	white-space: nowrap;
}

body.pc-cart-page .cart_totals table.shop_table td::before,
body.pc-cart-page .cart_totals table.shop_table th::before {
	content: none !important;
	display: none !important;
}

body.pc-cart-page .cart_totals .order-total th,
body.pc-cart-page .cart_totals .order-total td {
	padding-top: 16px !important;
	padding-bottom: 4px !important;
	font-size: 1.1rem;
	font-weight: 700;
	color: var(--pc-brown);
}

body.pc-cart-page .cart_totals .order-total td .amount,
body.pc-cart-page .cart_totals .order-total td .woocommerce-Price-amount {
	color: var(--pc-brand);
	font-weight: 700;
}

body.pc-cart-page .wc-proceed-to-checkout {
	display: block !important;
	width: 100% !important;
	max-width: 100% !important;
	padding-top: 20px;
	margin: 0;
	position: static;
	clear: both !important;
	float: none !important;
	overflow: visible;
}

body.pc-cart-page .pc-cart-main .cart_totals .wc-proceed-to-checkout a.checkout-button,
body.pc-cart-page .pc-cart-main .cart_totals .wc-proceed-to-checkout a.checkout-button.button,
body.pc-cart-page .pc-cart-main .cart_totals .wc-proceed-to-checkout a.checkout-button.button.alt,
body.pc-cart-page .pc-cart-main .cart_totals a.checkout-button,
body.pc-cart-page .pc-cart-main .cart_totals a.checkout-button.button.alt,
body.pc-cart-page .pc-cart-main .cart_totals a.checkout-button.wc-forward {
	position: static !important;
	inset: auto !important;
	float: none !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	box-sizing: border-box !important;
	width: 100% !important;
	max-width: 100% !important;
	min-width: 100% !important;
	min-height: 52px !important;
	margin: 0 !important;
	padding: 14px 20px !important;
	border-radius: var(--pc-radius-sm) !important;
	background: #fff !important;
	color: var(--pc-brand) !important;
	border: 1px solid var(--pc-brand) !important;
	box-shadow: none !important;
	font-family: var(--pc-font-body) !important;
	font-size: 0.9rem !important;
	font-weight: 700 !important;
	line-height: 1.25 !important;
	text-align: center !important;
	text-transform: none !important;
	text-decoration: none !important;
	white-space: nowrap !important;
	overflow: visible !important;
	clip: auto !important;
}

body.pc-cart-page .pc-cart-main .cart_totals a.checkout-button::after,
body.pc-cart-page .pc-cart-main .cart_totals a.wc-forward::after {
	content: none !important;
	display: none !important;
}

body.pc-cart-page .pc-cart-main .cart_totals .wc-proceed-to-checkout a.checkout-button:hover,
body.pc-cart-page .pc-cart-main .cart_totals a.checkout-button:hover,
body.pc-cart-page .pc-cart-main .cart_totals a.checkout-button.button.alt:hover {
	background: var(--pc-yellow) !important;
	border-color: var(--pc-yellow) !important;
	color: var(--pc-brand) !important;
}

/* Override global WooCommerce pill button inside cart totals. */
body.pc-cart-page .cart_totals .button.alt,
body.pc-cart-page .cart_totals a.button.alt {
	background: #fff !important;
	border-radius: var(--pc-radius-sm) !important;
	color: var(--pc-brand) !important;
}

@media (max-width: 899px) {
	body.pc-cart-page .pc-cart-line {
		grid-template-columns: 80px minmax(0, 1fr);
		grid-template-rows: auto auto;
		gap: 12px 14px;
	}

	body.pc-cart-page .pc-cart-line__thumb,
	body.pc-cart-page a.pc-cart-line__thumb {
		width: 80px;
		height: 80px;
	}

	body.pc-cart-page .pc-cart-line__qty {
		grid-column: 1 / -1;
		justify-self: start;
	}

	body.pc-cart-page .pc-cart-form-foot .coupon {
		flex-direction: column;
	}

	body.pc-cart-page .pc-cart-form-foot .coupon .button {
		width: 100%;
	}

	body.pc-cart-page .cart-collaterals {
		margin-top: 8px;
	}
}
