/*
 * Glade Cart presentation.
 * The Cart form, totals, notices and actions remain WooCommerce-owned. This
 * file only styles the native output within the Cart page scope.
 */

body.glade-cart-page {
	--glade-cart-surface: #fffdf9;
	--glade-cart-line: rgba(40, 35, 31, 0.16);
	--glade-cart-soft-line: rgba(40, 35, 31, 0.1);
	--glade-cart-gutter: clamp(20px, 4vw, 62px);
	background: var(--glade-child-bg);
}

body.glade-cart-page .ct-container-full {
	width: 100%;
	max-width: none;
	padding-inline: 0;
}

/* Keep the Cart page inside the layout viewport when the shared full-bleed
 * footer uses 100vw; 100vw includes the scrollbar gutter on desktop. */
body.glade-cart-page .glade-footer {
	width: 100%;
	margin-left: 0;
}

body.glade-cart-page .hero-section,
body.glade-cart-page .entry-header {
	width: min(100% - (2 * var(--glade-cart-gutter)), 1320px);
	margin-inline: auto;
}

body.glade-cart-page .hero-section {
	padding-block: clamp(42px, 7vw, 92px) clamp(26px, 4vw, 48px);
}

body.glade-cart-page .page-title {
	max-width: 12ch;
	margin: 0;
	color: var(--glade-child-ink);
	font-family: var(--glade-child-display);
	font-size: clamp(2.7rem, 6vw, 5.7rem);
	font-weight: 400;
	letter-spacing: -0.045em;
	line-height: 0.96;
}

body.glade-cart-page .entry-content.is-layout-constrained {
	width: 100%;
	max-width: none;
	margin: 0;
}

body.glade-cart-page .entry-content.is-layout-constrained > .woocommerce {
	width: 100%;
	max-width: none;
	margin: 0;
}

body.glade-cart-page .woocommerce-notices-wrapper {
	width: min(100% - (2 * var(--glade-cart-gutter)), 1320px);
	margin: 0 auto clamp(16px, 3vw, 28px);
}

body.glade-cart-page .glade-cart-shell {
	width: min(100% - (2 * var(--glade-cart-gutter)), 1320px);
	margin-inline: auto;
	padding-bottom: clamp(70px, 10vw, 140px);
}

body.glade-cart-page .glade-cart-layout {
	display: block;
}

/* Blocksy owns the real Cart pair: the native form and the direct .cart_totals
 * child of .ct-woocommerce-cart-form. Keep this wrapper as the only layout
 * owner so the custom shell cannot place the pair in a nested grid column. */
body.glade-cart-page .ct-woocommerce-cart-form {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: clamp(30px, 4vw, 48px);
	align-items: start;
}

body.glade-cart-page .ct-woocommerce-cart-form > form.woocommerce-cart-form {
	grid-column: 1;
	min-width: 0;
	width: 100%;
}

body.glade-cart-page .ct-woocommerce-cart-form > .cart_totals {
	grid-column: 1;
	width: min(100%, 520px);
	justify-self: end;
	position: static;
	margin: 0;
	box-sizing: border-box;
	padding: clamp(22px, 3vw, 34px);
	border: 1px solid var(--glade-cart-line);
	border-radius: 0;
	background: var(--glade-cart-surface);
}

body.glade-cart-page form.woocommerce-cart-form {
	min-width: 0;
}

body.glade-cart-page table.shop_table.cart {
	width: 100%;
	margin: 0;
	border: 0;
	border-collapse: collapse;
	table-layout: auto;
	background: transparent;
}

body.glade-cart-page table.shop_table.cart thead {
	border-bottom: 1px solid var(--glade-cart-line);
}

body.glade-cart-page table.shop_table.cart th {
	padding: 0 12px 14px;
	color: var(--glade-child-muted);
	font-family: var(--glade-child-body);
	font-size: 0.69rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	line-height: 1.2;
	text-align: left;
	text-transform: uppercase;
}

body.glade-cart-page table.shop_table.cart th:first-child,
body.glade-cart-page table.shop_table.cart td:first-child {
	padding-left: 0;
}

body.glade-cart-page table.shop_table.cart th:last-child,
body.glade-cart-page table.shop_table.cart td:last-child {
	padding-right: 0;
	text-align: right;
}

body.glade-cart-page table.shop_table.cart td {
	padding: 22px 12px;
	border: 0;
	border-bottom: 1px solid var(--glade-cart-soft-line);
	vertical-align: middle;
}

body.glade-cart-page table.shop_table.cart tbody tr.cart_item {
	transition: background-color 180ms ease;
}

body.glade-cart-page table.shop_table.cart tbody tr.cart_item:hover {
	background: rgb(255 255 255 / 0.42);
}

body.glade-cart-page table.shop_table.cart td.product-remove {
	width: 44px;
	padding-right: 0;
}

body.glade-cart-page table.shop_table.cart th.product-remove {
	width: 44px;
}

body.glade-cart-page table.shop_table.cart th.product-thumbnail {
	width: 112px;
	font-size: 0;
}

body.glade-cart-page table.shop_table.cart th.product-price,
body.glade-cart-page table.shop_table.cart th.product-quantity,
body.glade-cart-page table.shop_table.cart th.product-subtotal {
	width: 92px;
}

body.glade-cart-page table.shop_table.cart td.product-remove a {
	display: inline-grid;
	width: 44px;
	height: 44px;
	place-items: center;
	color: var(--glade-child-muted);
	font-size: 1.1rem;
	line-height: 1;
	text-decoration: none;
}

body.glade-cart-page table.shop_table.cart td.product-remove a:focus-visible {
	outline: 1px solid currentColor;
	outline-offset: 2px;
}

body.glade-cart-page table.shop_table.cart td.product-thumbnail {
	width: 112px;
	padding-left: 0;
}

body.glade-cart-page table.shop_table.cart td.product-thumbnail img {
	display: block;
	width: 96px;
	height: 96px;
	border-radius: 14px;
	background: #ece8df;
	object-fit: cover;
}

body.glade-cart-page table.shop_table.cart td.product-name {
	min-width: 0;
	word-break: normal;
	overflow-wrap: break-word;
	white-space: normal;
}

body.glade-cart-page table.shop_table.cart td.product-name a {
	color: var(--glade-child-ink);
	font-family: var(--glade-child-display);
	font-size: clamp(1.1rem, 1.7vw, 1.42rem);
	font-weight: 400;
	letter-spacing: -0.02em;
	line-height: 1.08;
	text-decoration: none;
	text-wrap: pretty;
}

body.glade-cart-page table.shop_table.cart td.product-price,
body.glade-cart-page table.shop_table.cart td.product-subtotal {
	color: var(--glade-child-ink);
	font-family: var(--glade-child-body);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

body.glade-cart-page table.shop_table.cart td.product-price .amount,
body.glade-cart-page table.shop_table.cart td.product-subtotal .amount {
	font-weight: 600;
}

body.glade-cart-page table.shop_table.cart td.product-quantity {
	white-space: nowrap;
}

body.glade-cart-page table.shop_table.cart .quantity .qty {
	box-sizing: border-box;
	width: 66px;
	min-width: 66px;
	height: 46px;
	min-height: 42px;
	padding-inline: 10px;
	border: 1px solid var(--glade-cart-line);
	border-radius: 0;
	background: transparent;
	color: var(--glade-child-ink);
	font-variant-numeric: tabular-nums;
	text-align: center;
}

body.glade-cart-page table.shop_table.cart .actions {
	display: table-cell;
	width: 100%;
	box-sizing: border-box;
	padding: 20px 0 0;
}

body.glade-cart-page table.shop_table.cart .coupon {
	display: inline-grid;
	grid-template-columns: minmax(0, 1fr) auto;
	width: auto;
	max-width: 100%;
	min-width: 0;
	gap: 8px;
	align-items: center;
	vertical-align: bottom;
}

body.glade-cart-page table.shop_table.cart .coupon .input-text {
	box-sizing: border-box;
	width: 100%;
	height: 46px;
	min-width: 0;
	min-height: 46px;
	padding: 12px 14px;
	border: 1px solid var(--glade-cart-line);
	border-radius: 0;
	background: transparent;
}

body.glade-cart-page table.shop_table.cart .actions > .button,
body.glade-cart-page table.shop_table.cart .actions > button {
	display: inline-block;
	margin-left: 12px;
	vertical-align: bottom;
}

body.glade-cart-page .button,
body.glade-cart-page button.button,
body.glade-cart-page a.checkout-button {
	min-height: 46px;
	padding: 13px 20px;
	border: 1px solid var(--glade-child-ink);
	border-radius: 0;
	background: var(--glade-child-ink);
	color: #fffaf2;
	font-family: var(--glade-child-body);
	font-size: 0.74rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	line-height: 1.2;
	white-space: nowrap;
	text-decoration: none;
	text-transform: uppercase;
	transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

body.glade-cart-page .button:hover,
body.glade-cart-page button.button:hover,
body.glade-cart-page a.checkout-button:hover {
	background: transparent;
	color: var(--glade-child-ink);
}

body.glade-cart-page .button:active,
body.glade-cart-page button.button:active,
body.glade-cart-page a.checkout-button:active {
	transform: translateY(1px);
}

body.glade-cart-page .cart-collaterals {
	width: auto;
	float: none;
	margin: 0;
	padding: clamp(22px, 3vw, 34px);
	border: 1px solid var(--glade-cart-line);
	background: var(--glade-cart-surface);
}

body.glade-cart-page .cart_totals {
	width: 100%;
}

body.glade-cart-page .cart_totals h2 {
	margin: 0 0 24px;
	color: var(--glade-child-ink);
	font-family: var(--glade-child-display);
	font-size: clamp(1.55rem, 2.5vw, 2.15rem);
	font-weight: 400;
	letter-spacing: -0.025em;
	line-height: 1;
}

body.glade-cart-page .cart_totals table.shop_table {
	margin: 0 0 22px;
	border: 0;
	border-collapse: collapse;
	font-variant-numeric: tabular-nums;
}

body.glade-cart-page .cart_totals table.shop_table th,
body.glade-cart-page .cart_totals table.shop_table td {
	padding: 12px 0;
	border: 0;
	border-bottom: 1px solid var(--glade-cart-soft-line);
	color: var(--glade-child-ink);
	vertical-align: top;
}

body.glade-cart-page .cart_totals table.shop_table th {
	font-weight: 500;
	text-align: left;
}

body.glade-cart-page .cart_totals table.shop_table td {
	font-weight: 600;
	text-align: right;
}

body.glade-cart-page .cart_totals .wc-proceed-to-checkout {
	padding: 0;
}

body.glade-cart-page .cart_totals .checkout-button {
	display: flex;
	width: 100%;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	text-align: center;
}

body.glade-cart-page .wc-proceed-to-checkout p {
	margin: 12px 0 0;
	color: var(--glade-child-muted);
	font-size: 0.8rem;
	line-height: 1.5;
}

body.glade-cart-page .woocommerce-error,
body.glade-cart-page .woocommerce-info,
body.glade-cart-page .woocommerce-message {
	border-top-color: var(--glade-child-accent);
	background: rgb(255 253 249 / 0.72);
	color: var(--glade-child-ink);
}

body.glade-cart-page.glade-cart-empty .wc-empty-cart-message,
body.glade-cart-page.glade-cart-empty .return-to-shop {
	width: min(100% - (2 * var(--glade-cart-gutter)), 760px);
	margin-inline: auto;
}

body.glade-cart-page.glade-cart-empty .wc-empty-cart-message {
	padding: clamp(38px, 8vw, 100px) 0 18px;
}

body.glade-cart-page.glade-cart-empty .cart-empty {
	margin: 0;
	padding: 26px 0 0;
	border-top: 1px solid var(--glade-cart-line);
	background: transparent;
	color: var(--glade-child-ink);
	font-family: var(--glade-child-display);
	font-size: clamp(1.75rem, 4vw, 3rem);
	font-weight: 400;
	line-height: 1.08;
}

body.glade-cart-page.glade-cart-empty .return-to-shop {
	padding-bottom: clamp(70px, 10vw, 140px);
}

body.glade-cart-page :where(a, button, input, select, textarea):focus-visible {
	outline: 2px solid var(--glade-child-accent);
	outline-offset: 3px;
}

@media (max-width: 620px) {
	body.glade-cart-page .ct-container-full {
		padding-top: 28px;
	}

	body.glade-cart-page .hero-section,
	body.glade-cart-page .entry-header {
		width: calc(100% - (2 * var(--glade-cart-gutter)));
	}

	body.glade-cart-page .glade-cart-shell,
	body.glade-cart-page .woocommerce-notices-wrapper {
		width: calc(100% - (2 * var(--glade-cart-gutter)));
	}

	body.glade-cart-page table.shop_table.cart {
		display: block;
	}

	body.glade-cart-page table.shop_table.cart tbody > tr:not(.cart_item) {
		display: block;
		width: 100%;
	}

	body.glade-cart-page table.shop_table.cart tbody > tr:not(.cart_item) td.actions {
		display: block;
		width: 100%;
	}

	body.glade-cart-page table.shop_table.cart thead {
		display: none;
	}

	body.glade-cart-page table.shop_table.cart tbody,
	body.glade-cart-page table.shop_table.cart tr.cart_item,
	body.glade-cart-page table.shop_table.cart td {
		display: block;
	}

	body.glade-cart-page table.shop_table.cart tr.cart_item {
		position: relative;
		display: grid;
		grid-template-columns: 82px minmax(0, 1fr);
		grid-template-areas: "thumb name" "thumb price" "thumb quantity" "thumb subtotal";
		column-gap: 16px;
		padding: 20px 0;
		border-bottom: 1px solid var(--glade-cart-soft-line);
	}

	body.glade-cart-page table.shop_table.cart td {
		padding: 0;
		border: 0;
		text-align: left;
	}

	body.glade-cart-page table.shop_table.cart td.product-remove {
		position: absolute;
		top: 14px;
		right: 0;
		z-index: 1;
		width: auto;
		padding: 0;
	}

	body.glade-cart-page table.shop_table.cart td.product-thumbnail {
		grid-area: thumb;
		width: auto;
	}

	body.glade-cart-page table.shop_table.cart td.product-thumbnail img {
		width: 82px;
		height: 82px;
	}

	body.glade-cart-page table.shop_table.cart td.product-name {
		grid-area: name;
		min-width: 0;
		padding-right: 56px;
	}

	body.glade-cart-page table.shop_table.cart td.product-name a {
		font-size: 1.14rem;
	}

	body.glade-cart-page table.shop_table.cart td.product-price {
		grid-area: price;
		padding-top: 5px;
	}

	body.glade-cart-page table.shop_table.cart td.product-quantity {
		grid-area: quantity;
		padding-top: 12px;
	}

	body.glade-cart-page table.shop_table.cart td.product-quantity .quantity {
		display: block;
		width: 100%;
	}

	body.glade-cart-page table.shop_table.cart td.product-quantity .quantity .qty {
		width: 100%;
		max-width: 100%;
	}

	body.glade-cart-page table.shop_table.cart td.product-subtotal {
		grid-area: subtotal;
		padding-top: 10px;
		font-size: 0.88rem;
	}

	body.glade-cart-page table.shop_table.cart td.product-subtotal::before {
		content: attr(data-title) " ";
		color: var(--glade-child-muted);
		font-weight: 400;
	}

	body.glade-cart-page table.shop_table.cart .actions {
		display: table-cell;
		width: 100%;
		box-sizing: border-box;
		padding-top: 18px;
	}

	body.glade-cart-page table.shop_table.cart .coupon {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		width: 100%;
	}

	body.glade-cart-page table.shop_table.cart .coupon .button {
		padding-inline: 14px;
	}

	body.glade-cart-page table.shop_table.cart .actions > .button,
	body.glade-cart-page table.shop_table.cart .actions > button {
		display: block;
		width: 100%;
		margin: 12px 0 0;
	}

	body.glade-cart-page .cart-collaterals,
	body.glade-cart-page .ct-woocommerce-cart-form > .cart_totals {
		padding: 22px 18px;
	}
}

/* On phones, keep the coupon input and its action on separate rows so the
 * controls remain readable and comfortably tappable. */
@media (max-width: 520px) {
	body.glade-cart-page table.shop_table.cart .coupon {
	grid-template-columns: 1fr;
	}

	body.glade-cart-page table.shop_table.cart .coupon .button {
	width: 100%;
	}
}

/* 861–1365px: the real Blocksy Cart wrapper stays one column. The product
 * form therefore owns a full row and the direct totals card is compact and
 * right aligned below it. */
@media (min-width: 861px) and (max-width: 1365px) {
	body.glade-cart-page .ct-woocommerce-cart-form {
	grid-template-columns: minmax(0, 1fr);
	}

	body.glade-cart-page .ct-woocommerce-cart-form > .cart_totals {
	width: min(100%, 520px);
	justify-self: end;
	}
}

/* At 1366px the table has enough room for readable product names plus the
 * native utility columns, so the same real wrapper may use two columns. */
@media (min-width: 1366px) {
	body.glade-cart-page .ct-woocommerce-cart-form {
	grid-template-columns: minmax(0, 1fr) minmax(340px, 380px);
	gap: clamp(34px, 5vw, 72px);
	}

	body.glade-cart-page .ct-woocommerce-cart-form > form.woocommerce-cart-form {
	grid-column: 1;
	}

	body.glade-cart-page .ct-woocommerce-cart-form > .cart_totals {
	grid-column: 2;
	width: auto;
	justify-self: stretch;
	}
}

@media (max-width: 860px) {
	body.glade-cart-page .ct-woocommerce-cart-form {
	grid-template-columns: minmax(0, 1fr);
	gap: 38px;
	}

	body.glade-cart-page .ct-woocommerce-cart-form > .cart_totals {
	width: 100%;
	justify-self: stretch;
	}
}

@media (prefers-reduced-motion: reduce) {
	body.glade-cart-page table.shop_table.cart tbody tr.cart_item,
	body.glade-cart-page .button,
	body.glade-cart-page button.button,
	body.glade-cart-page a.checkout-button {
		transition: none;
	}
}
