/**
 * WooCommerce cart — Cursus Groep
 */

/* Page shell (shortcode inside page template) */
body.csg-cart-page-active article > .csg-heading--primary,
body.csg-cart-page-active article > h1:first-child {
	display: none;
}

body.csg-cart-page-active .entry-content > article {
	max-width: none;
}

body.csg-cart-page-active .woocommerce {
	max-width: none;
}

.csg-cart-shell {
	margin-bottom: 2rem;
}

.csg-cart-shell .csg-breadcrumb {
	margin-bottom: 1.25rem;
}

.csg-cart-shell__title {
	margin-bottom: 1.5rem;
}

.csg-cart-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem);
	gap: 1.75rem 2rem;
	align-items: start;
}

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

.csg-cart-sidebar {
	min-width: 0;
	position: sticky;
	top: 1.5rem;
}

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

.csg-cart-sidebar .cart_totals {
	float: none;
	width: 100%;
}

/* Notices */
.woocommerce-cart .woocommerce-message,
.woocommerce-cart .woocommerce-info,
.woocommerce-cart .woocommerce-error {
	border-radius: 4px;
	border-left: 4px solid var(--bs-primary);
	padding: 0.85rem 1rem;
	margin-bottom: 1.25rem;
	font-size: 0.9375rem;
}

.woocommerce-cart .woocommerce-message {
	background: rgba(var(--bs-primary-rgb), 0.08);
	border-color: var(--bs-primary);
}

.woocommerce-cart .woocommerce-message a {
	color: var(--bs-primary);
	font-weight: 600;
	text-decoration: underline;
}

.woocommerce-cart .woocommerce-error {
	border-color: #dc3545;
	background: #fff5f5;
}

/* Cart table card */
.woocommerce-cart-form {
	background: #fff;
	border: 1px solid #e8e8e8;
	border-radius: 8px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
	overflow: hidden;
}

.woocommerce-cart-form__contents {
	width: 100%;
	border-collapse: collapse;
	margin: 0;
}

.woocommerce-cart-form__contents thead th {
	background: var(--csg-surface, #f3f2f2);
	padding: 0.75rem 1rem;
	font-size: 0.8125rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--csg-text-muted, #6c757d);
	border-bottom: 1px solid #e8e8e8;
}

.woocommerce-cart-form__contents thead .product-remove,
.woocommerce-cart-form__contents thead .product-thumbnail {
	width: 1%;
}

.woocommerce-cart-form__contents tbody td {
	padding: 1.25rem 1rem;
	vertical-align: top;
	border-bottom: 1px solid #eee;
}

.woocommerce-cart-form__contents tbody tr:last-child td {
	border-bottom: 0;
}

.woocommerce-cart-form__contents .product-thumbnail img {
	width: 5.5rem;
	height: auto;
	border-radius: 4px;
	border: 1px solid #eee;
	display: block;
}

.woocommerce-cart-form__contents .product-name {
	min-width: 12rem;
}

.csg-cart-item__name {
	font-weight: 700;
	font-size: 1.0625rem;
	color: var(--bs-primary);
	text-decoration: none;
}

.csg-cart-item__name:hover {
	color: var(--csg-accent, #122fff);
	text-decoration: underline;
}

/* Booking meta (datum, deelnemers) */
.woocommerce-cart-form__contents .product-name dl,
.woocommerce-cart-form__contents .product-name .variation {
	margin: 0.65rem 0 0;
	font-size: 0.875rem;
	color: var(--csg-text-muted, #444);
}

.woocommerce-cart-form__contents .product-name dl dt,
.woocommerce-cart-form__contents .product-name dl dd {
	margin: 0;
	padding: 0;
	display: inline;
}

.woocommerce-cart-form__contents .product-name dl dt {
	font-weight: 600;
	color: var(--bs-body-color);
}

.woocommerce-cart-form__contents .product-name dl dd::after {
	content: '';
	display: block;
	margin-bottom: 0.25rem;
}

.woocommerce-cart-form__contents .product-name dl dd[class*='certificaatpas'],
.woocommerce-cart-form__contents .product-name dl dt[class*='certificaatpas-summary'] {
	display: inline;
}

.woocommerce-cart-form__contents .product-name dl dd[class*='certificaatpas'] p,
.woocommerce-cart-form__contents .product-name dl dd[class*='certificaatpas-summary'] p {
	display: inline;
	margin: 0;
}

.woocommerce-cart-form__contents .product-name ul {
	margin: 0.5rem 0 0;
	padding: 0;
	list-style: none;
}

.woocommerce-cart-form__contents .product-name ul li {
	margin-bottom: 0.2rem;
}

.woocommerce-cart-form__contents .product-price,
.woocommerce-cart-form__contents .product-subtotal {
	font-weight: 600;
	white-space: nowrap;
	text-align: right;
}

.woocommerce-cart-form__contents .product-quantity {
	text-align: center;
	width: 7rem;
}

.woocommerce-cart-form__contents .product-quantity .quantity {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.csg-cart-qty-display {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-width: 3.5rem;
	padding: 0.35rem 0.5rem;
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 1.2;
	color: var(--bs-body-color);
	background: var(--csg-surface, #f3f2f2);
	border-radius: 4px;
}

.csg-cart-qty-display__label {
	font-size: 0.6875rem;
	font-weight: 600;
	color: var(--csg-text-muted, #6c757d);
	text-transform: lowercase;
}

.woocommerce-cart-form__contents .csg-cart-qty,
.woocommerce-cart-form__contents input.qty {
	width: 3.5rem !important;
	max-width: 3.5rem;
	min-width: 0;
	padding: 0.4rem 0.35rem;
	text-align: center;
	border: 1px solid #ced4da;
	border-radius: 4px;
	font-size: 1rem;
	background: #fff;
}

/* Remove */
.csg-cart-remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	border-radius: 50%;
	background: var(--csg-surface, #f3f2f2);
	color: var(--csg-text-muted, #666) !important;
	font-size: 1.25rem;
	line-height: 1;
	text-decoration: none !important;
	transition: background 0.15s ease, color 0.15s ease;
}

.csg-cart-remove:hover {
	background: #fde8e8;
	color: #c0392b !important;
}

.csg-cart-remove__icon {
	line-height: 1;
}

/* Actions row */
.woocommerce-cart-form__contents tr.actions td {
	background: var(--csg-surface, #f3f2f2);
	padding: 1rem 1.25rem;
	border-top: 1px solid #e8e8e8;
}

.woocommerce-cart-form__contents .actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1rem;
}

.woocommerce-cart-form__contents .coupon {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	flex: 1 1 auto;
	min-width: min(100%, 16rem);
}

.woocommerce-cart-form__contents .coupon label {
	flex: 1 1 100%;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--csg-text-muted);
	margin: 0;
}

.woocommerce-cart-form__contents .coupon #coupon_code {
	flex: 1 1 10rem;
	max-width: 14rem;
	padding: 0.5rem 0.75rem;
	border: 1px solid #ced4da;
	border-radius: 4px;
	font-size: 0.9375rem;
	background: #fff;
}

.woocommerce-cart-form__contents .coupon .button,
.woocommerce-cart-form__contents .actions > .button[name='update_cart'] {
	padding: 0.5rem 1rem;
	font-size: 0.875rem;
	font-weight: 600;
	border-radius: 4px;
	line-height: 1.3;
	cursor: pointer;
}

.woocommerce-cart-form__contents .coupon .button {
	background: #fff;
	border: 2px solid var(--bs-primary);
	color: var(--bs-primary);
}

.woocommerce-cart-form__contents .coupon .button:hover {
	background: rgba(var(--bs-primary-rgb), 0.08);
}

.woocommerce-cart-form__contents .actions > .button[name='update_cart'] {
	background: #fff;
	border: 1px solid #ced4da;
	color: var(--bs-body-color);
	margin-left: auto;
}

.woocommerce-cart-form__contents .actions > .button[name='update_cart']:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

/* Quantity is fixed to deelnemers — no cart update needed for amount. */
body.csg-cart-page-active .woocommerce-cart-form__contents .actions > .button[name='update_cart'] {
	display: none !important;
}

/* Totals card */
.csg-cart-totals {
	background: #fff;
	border: 1px solid #e8e8e8;
	border-radius: 8px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
	padding: 1.25rem 1.35rem;
}

.csg-cart-totals__title {
	font-size: 1.125rem;
	font-weight: 700;
	margin: 0 0 1rem;
	color: var(--bs-body-color);
}

.csg-cart-totals__table {
	width: 100%;
	border: 0;
	margin: 0;
}

.csg-cart-totals__table th,
.csg-cart-totals__table td {
	padding: 0.45rem 0;
	border: 0;
	font-size: 0.9375rem;
	vertical-align: top;
}

.csg-cart-totals__table th {
	font-weight: 600;
	color: var(--csg-text-muted);
	text-align: left;
	padding-right: 1rem;
}

.csg-cart-totals__table td {
	text-align: right;
	font-weight: 600;
}

.csg-cart-totals__table tr.order-total th,
.csg-cart-totals__table tr.order-total td {
	padding-top: 0.75rem;
	border-top: 1px solid #e8e8e8;
	font-size: 1.0625rem;
	color: var(--bs-body-color);
}

.csg-cart-totals__table tr.order-total td {
	color: var(--bs-primary);
}

.csg-cart-proceed {
	margin-top: 1.25rem;
	padding-top: 0;
}

.csg-cart-proceed .csg-cart-checkout-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 2.75rem;
	padding: 0.65rem 1.25rem;
	font-size: 1.0625rem;
	font-weight: 700;
	border-radius: 4px;
	text-decoration: none;
}

.csg-cart-proceed .checkout-button {
	display: none;
}

/* Primary button utility (match booking) */
.btn-csg {
	background: var(--bs-primary);
	border-color: var(--bs-primary);
	color: #fff;
}

.btn-csg:hover,
.btn-csg:focus {
	background: var(--bs-primary);
	border-color: var(--bs-primary);
	color: #fff;
	filter: brightness(0.92);
}

/* Responsive: stacked card rows */
@media (max-width: 991.98px) {
	.csg-cart-layout {
		grid-template-columns: 1fr;
	}

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

@media (max-width: 767.98px) {
	.woocommerce-cart-form__contents thead {
		display: none;
	}

	.woocommerce-cart-form__contents tbody tr.cart_item {
		display: grid;
		grid-template-columns: auto 1fr;
		grid-template-areas:
			'remove thumb'
			'name name'
			'meta meta'
			'price qty'
			'subtotal subtotal';
		gap: 0.35rem 0.75rem;
		padding: 1rem;
	}

	.woocommerce-cart-form__contents tbody tr.cart_item td {
		padding: 0;
		border: 0;
		display: block;
	}

	.woocommerce-cart-form__contents .product-remove {
		grid-area: remove;
	}

	.woocommerce-cart-form__contents .product-thumbnail {
		grid-area: thumb;
	}

	.woocommerce-cart-form__contents .product-name {
		grid-area: name;
	}

	.woocommerce-cart-form__contents .product-price {
		grid-area: price;
		text-align: left;
	}

	.woocommerce-cart-form__contents .product-price::before {
		content: attr(data-title) ': ';
		font-weight: 600;
		color: var(--csg-text-muted);
	}

	.woocommerce-cart-form__contents .product-quantity {
		grid-area: qty;
		text-align: left;
		width: auto;
	}

	.woocommerce-cart-form__contents .product-quantity::before {
		content: attr(data-title) ': ';
		font-weight: 600;
		color: var(--csg-text-muted);
		display: inline-block;
		margin-right: 0.35rem;
	}

	.woocommerce-cart-form__contents .product-quantity .csg-cart-qty-display {
		display: inline-flex;
		flex-direction: row;
		gap: 0.35rem;
		align-items: baseline;
	}

	.woocommerce-cart-form__contents .product-subtotal {
		grid-area: subtotal;
		text-align: left;
		padding-top: 0.5rem;
		border-top: 1px dashed #e8e8e8;
		margin-top: 0.35rem;
	}

	.woocommerce-cart-form__contents .product-subtotal::before {
		content: attr(data-title) ': ';
		font-weight: 600;
		color: var(--csg-text-muted);
	}

	.woocommerce-cart-form__contents tr.actions td {
		display: block;
	}

	.woocommerce-cart-form__contents .actions > .button[name='update_cart'] {
		margin-left: 0;
		width: 100%;
	}
}
