/**
 * Enterprise cart styling for the whole store.
 *
 * Scoped to `body.cxml-cart` (added on any page that renders the WooCommerce
 * cart) so it applies to every customer. Two labels — the "Your requisition"
 * heading and the transfer reassurance — only appear for a PunchOut shopper
 * (`body.cxml-punchout-active`). Targets stock WooCommerce cart markup (Astra
 * theme) so it needs no template overrides.
 */

body.cxml-cart {
	--pc-bg:      #f4f6fb;
	--pc-surface: #ffffff;
	--pc-ink:     #0f172a;
	--pc-muted:   #64748b;
	--pc-line:    #e5e9f2;
	--pc-brand:   #2563eb;
	--pc-brand-d: #1d4ed8;
	--pc-brand-ink:#ffffff;
	--pc-accent:  #eef2ff;
	--pc-radius:  14px;
	--pc-shadow:  0 1px 2px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.06);
	background: var(--pc-bg);
	font-feature-settings: "cv02","cv03","cv04","ss01";
}

/* ---- Page frame ---- */
body.cxml-cart .entry-content,
body.cxml-cart .ast-container,
body.cxml-cart #primary {
	max-width: 1180px;
}

body.cxml-cart .entry-title,
body.cxml-cart .woocommerce-products-header__title {
	font-weight: 700;
	letter-spacing: -.02em;
	color: var(--pc-ink);
}

/* A quiet "requisition" heading above the cart. */
body.cxml-cart.cxml-punchout-active .woocommerce-cart-form::before {
	content: "Your requisition";
	display: block;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--pc-muted);
	margin: 0 0 10px;
}

/* ---- Two-column layout: items | sticky summary ---- */
@media (min-width: 900px) {
	body.cxml-cart .woocommerce {
		display: grid;
		grid-template-columns: minmax(0, 1fr) 380px;
		gap: 28px;
		align-items: start;
	}
	body.cxml-cart .woocommerce-notices-wrapper,
	body.cxml-cart .woocommerce > .woocommerce-message,
	body.cxml-cart .woocommerce-cart-form + .wc-cxml-transfer-form {
		grid-column: 1 / -1;
	}
	body.cxml-cart .woocommerce-cart-form { grid-column: 1; margin: 0; }
	body.cxml-cart .cart-collaterals   { grid-column: 2; width: 100% !important; }
	body.cxml-cart .cart-collaterals .cart_totals {
		position: sticky;
		top: 24px;
		width: 100% !important;
		float: none !important;
	}
}

/* ---- Cart items as a clean card ---- */
body.cxml-cart .woocommerce-cart-form__contents {
	background: var(--pc-surface);
	border: 1px solid var(--pc-line);
	border-radius: var(--pc-radius);
	box-shadow: var(--pc-shadow);
	border-collapse: separate;
	overflow: hidden;
	margin: 0;
}
body.cxml-cart .woocommerce-cart-form__contents thead th {
	background: #fafbfe;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .07em;
	text-transform: uppercase;
	color: var(--pc-muted);
	border: 0;
	border-bottom: 1px solid var(--pc-line);
	padding: 14px 18px;
}
body.cxml-cart .woocommerce-cart-form__contents td {
	border: 0;
	border-bottom: 1px solid var(--pc-line);
	padding: 18px;
	vertical-align: middle;
	background: transparent;
}
body.cxml-cart .cart_item:hover td { background: #fafbff; }
body.cxml-cart .cart_item:last-child td { border-bottom: 0; }

body.cxml-cart .product-thumbnail img {
	width: 60px;
	height: 60px;
	object-fit: cover;
	border-radius: 10px;
	border: 1px solid var(--pc-line);
}
body.cxml-cart td.product-name a {
	color: var(--pc-ink);
	font-weight: 600;
	text-decoration: none;
}
body.cxml-cart td.product-name a:hover { color: var(--pc-brand); }
body.cxml-cart .product-price,
body.cxml-cart .product-subtotal { color: var(--pc-ink); font-variant-numeric: tabular-nums; }

/* ---- Quantity stepper ---- */
body.cxml-cart .quantity input.qty {
	height: 40px;
	width: 68px;
	border: 1px solid var(--pc-line);
	border-radius: 10px;
	text-align: center;
	font-weight: 600;
	color: var(--pc-ink);
	background: #fff;
}
body.cxml-cart .quantity input.qty:focus {
	border-color: var(--pc-brand);
	box-shadow: 0 0 0 3px rgba(37,99,235,.15);
	outline: none;
}

/* Remove item — quiet until hover */
body.cxml-cart td.product-remove a.remove {
	color: var(--pc-muted) !important;
	background: transparent !important;
	font-size: 22px;
	line-height: 1;
	transition: color .15s ease;
}
body.cxml-cart td.product-remove a.remove:hover { color: #dc2626 !important; }

/* Coupon + update row */
body.cxml-cart .cart .actions {
	padding: 16px 18px;
	background: #fafbfe;
	border-top: 1px solid var(--pc-line);
}
body.cxml-cart .cart .actions .coupon input[type="text"] {
	height: 40px;
	border: 1px solid var(--pc-line);
	border-radius: 10px;
	padding: 0 12px;
}

/* ---- Order-summary card ---- */
body.cxml-cart .cart_totals {
	background: var(--pc-surface);
	border: 1px solid var(--pc-line);
	border-radius: var(--pc-radius);
	box-shadow: var(--pc-shadow);
	padding: 22px;
}
body.cxml-cart .cart_totals > h2 {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--pc-muted);
	margin: 0 0 14px;
}
body.cxml-cart .cart_totals table { border: 0; margin: 0; }
body.cxml-cart .cart_totals th,
body.cxml-cart .cart_totals td {
	border: 0;
	border-bottom: 1px solid var(--pc-line);
	padding: 12px 0;
	color: var(--pc-ink);
	font-variant-numeric: tabular-nums;
}
body.cxml-cart .cart_totals tr:last-child th,
body.cxml-cart .cart_totals tr:last-child td { border-bottom: 0; }
body.cxml-cart .cart_totals .order-total th { font-size: 15px; }
body.cxml-cart .cart_totals .order-total .amount {
	font-size: 22px;
	font-weight: 700;
	color: var(--pc-ink);
}

/* ---- The Transfer-to-Coupa call to action ---- */
body.cxml-cart .wc-cxml-transfer-form { margin: 18px 0 0; }
body.cxml-cart .wc-cxml-transfer-button,
body.cxml-cart a.checkout-button {
	display: block;
	width: 100%;
	text-align: center;
	padding: 15px 20px;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: .01em;
	color: var(--pc-brand-ink) !important;
	background: linear-gradient(180deg, var(--pc-brand), var(--pc-brand-d)) !important;
	border: 0;
	border-radius: 12px;
	box-shadow: 0 6px 16px rgba(37,99,235,.28);
	transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
body.cxml-cart .wc-cxml-transfer-button::before { content: "↩  "; opacity: .9; }
body.cxml-cart .wc-cxml-transfer-button:hover {
	filter: brightness(1.03);
	transform: translateY(-1px);
	box-shadow: 0 10px 22px rgba(37,99,235,.34);
}
body.cxml-cart .wc-cxml-transfer-button:active { transform: translateY(0); }

/* A reassuring line under the CTA. */
body.cxml-cart .wc-cxml-transfer-form::after {
	content: "Your cart returns to Coupa for approval. No checkout or payment happens here.";
	display: block;
	margin-top: 10px;
	font-size: 12px;
	line-height: 1.5;
	color: var(--pc-muted);
	text-align: center;
}

/* ---- PunchOut session banner (footer) ---- */
body.cxml-cart .wc-cxml-session-banner,
body.cxml-cart #wc-cxml-session-banner {
	background: var(--pc-ink);
	color: #e2e8f0;
	border-radius: 999px;
	box-shadow: var(--pc-shadow);
	font-size: 13px;
}

/* ---- Responsive polish ---- */
@media (max-width: 899px) {
	body.cxml-cart .cart_totals { margin-top: 20px; }
	body.cxml-cart .woocommerce-cart-form__contents td.product-name { font-size: 15px; }
}
