/**
 * Cart page styles — PokerCoaching cart flow redesign.
 * Loaded only on the cart page (see functions.php).
 */

/* Both states render their own heading — hide the theme's page title */
.woocommerce-cart .entry-header,
.woocommerce-cart h1.entry-title {
	display: none;
}

/* Empty-cart state uses the shared .pc-status component (store-flow.css) */

/* --- Notices ----------------------------------------------------------- */

/* The wrapper positions the stack; negative bottom margin eats into the
   .pc-cart top padding so notices don't push the content down */
.woocommerce-cart .woocommerce-notices-wrapper:not(:empty) {
	max-width: 592px;
	margin: 16px auto -24px;
}

/* Card look is shared via store-flow.css; only the page width differs */
.woocommerce-cart .woocommerce-error,
.woocommerce-cart .woocommerce-info,
.woocommerce-cart .woocommerce-message {
	max-width: 592px;
}

/* --- Cart with items --------------------------------------------------- */

.pc-cart {
	max-width: 640px;
	margin: 0 auto;
	padding: 48px 24px 96px;
}

.pc-cart__title {
	margin: 0 0 24px;
	font-size: 28px;
	font-weight: 700;
	color: #17181c;
}

/* One card: items, promo, and totals separated by section delimiters */

.pc-cart__layout {
	display: block;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	overflow: hidden;
}

.pc-cart__items {
	background: transparent;
	border: none;
	border-radius: 0;
}

.pc-cart-item {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 20px;
}

.pc-cart-item + .pc-cart-item {
	border-top: 1px solid #eef0f2;
}

.pc-cart-item__thumb img {
	display: block;
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: 8px;
	border: 1px solid #eef0f2;
}

.pc-cart-item__info {
	flex: 1;
	min-width: 0;
}

.pc-cart-item__name,
.pc-cart-item__name a {
	font-size: 16px;
	font-weight: 600;
	color: #17181c;
	text-decoration: none;
}

.pc-cart-item__name a:hover {
	color: #3fb859;
}

.pc-cart-item__billing {
	margin-top: 4px;
	font-size: 14px;
	color: #6b7280;
}

.pc-cart-item__billing .woocommerce-Price-amount {
	color: inherit;
	font-weight: 400;
}

.pc-cart-item__subtotal {
	font-size: 16px;
	font-weight: 600;
	color: #17181c;
	text-align: right;
	white-space: nowrap;
}

.pc-cart-item__remove a.remove {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	font-size: 18px;
	line-height: 1;
	color: #9ca3af !important;
	background: transparent;
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.pc-cart-item__remove a.remove:hover {
	color: #dc2626 !important;
	background: #fef2f2;
}

/* Coupon — its own section between items and totals */

.pc-cart__actions {
	padding: 18px 20px;
	border-top: 1px solid #e5e7eb;
}

/* No visible coupon field — keep only the hidden nonce/hooks, no empty strip */
.pc-cart__actions--bare {
	margin: 0;
	padding: 0;
	border-top: none;
}

/* The whole row is the toggle: tag icon + label, chevron pushed right */
.pc-cart__coupon summary {
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	font-size: 14px;
	color: #6b7280;
	list-style: none;
	user-select: none;
	transition: color 0.15s ease;
}

.pc-cart__coupon summary::-webkit-details-marker {
	display: none;
}

.pc-cart__coupon summary::before {
	content: '';
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z'/><circle cx='7.5' cy='7.5' r='.5' fill='black'/></svg>") no-repeat center / contain;
	mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z'/><circle cx='7.5' cy='7.5' r='.5' fill='black'/></svg>") no-repeat center / contain;
}

.pc-cart__coupon summary::after {
	content: '';
	flex: 0 0 auto;
	margin-left: auto;
	width: 16px;
	height: 16px;
	background: currentColor;
	opacity: 0.6;
	-webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>") no-repeat center / contain;
	mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>") no-repeat center / contain;
	transition: transform 0.2s ease;
}

.pc-cart__coupon summary:hover,
.pc-cart__coupon[open] summary {
	color: #17181c;
}

.pc-cart__coupon[open] summary::after {
	transform: rotate(180deg);
}

/* Input + Apply styles are shared via store-flow.css */
.pc-cart__coupon-row {
	display: flex;
	gap: 8px;
	/* Extra bottom air so the open field doesn't sit tight on the totals band */
	margin: 14px 0 6px;
}

/* Totals — bottom section of the card, split off by a delimiter */

.pc-cart .cart-collaterals {
	width: 100%;
	margin: 0;
}

.pc-summary {
	background: #fff;
	/* !important: Astra's .cart_totals rules (#ddd border, square corners,
	   30px bottom margin, zeroed vertical padding) are more specific */
	border: none !important;
	border-top: 1px solid #e5e7eb !important;
	border-radius: 0 !important;
	margin: 0 !important;
	padding: 20px 20px 24px !important;
	float: none !important;
	width: 100% !important;
}

.pc-summary table.pc-summary__table {
	width: 100%;
	margin: 0;
	border: none;
	border-collapse: collapse;
}

.pc-summary .pc-summary__table th,
.pc-summary .pc-summary__table td {
	padding: 10px 0 !important; /* beat Astra's .shop_table 15px side padding */
	border: none;
	background: transparent;
	font-size: 15px;
	font-weight: 400;
	color: #4b5563;
	text-align: left;
}

.pc-summary .pc-summary__table td {
	text-align: right;
}

.pc-summary .pc-summary__table a {
	color: #3fb859;
	text-decoration: none;
}

.pc-summary .pc-summary__table a:hover {
	text-decoration: underline;
}

/* Coupon row: chip with code + green savings amount */

.pc-summary .pc-summary__table tr.cart-discount th,
.pc-summary .pc-summary__table tr.cart-discount td {
	vertical-align: middle;
}

.pc-summary .pc-summary__table tr.cart-discount td {
	color: #16a34a;
	font-weight: 600;
	white-space: nowrap;
}

/* Chip itself is shared via store-flow.css; re-assert the remove-link colors
   over the generic .pc-summary__table link styles above */
.pc-summary .pc-summary__table a.pc-coupon-chip__remove {
	color: #6fa583;
	text-decoration: none;
}

.pc-summary .pc-summary__table a.pc-coupon-chip__remove:hover {
	color: #dc2626;
	text-decoration: none;
}

/* "Total due today" — the key line: highlighted band, vertically centered */
.pc-summary .pc-summary__table tr.order-total:not(.recurring-total) th,
.pc-summary .pc-summary__table tr.order-total:not(.recurring-total) td {
	padding: 14px 14px !important;
	background: #f0fdf4;
	background-clip: padding-box;
	border-top: 10px solid transparent; /* gap above the band, keeps card bg visible */
	font-size: 16px;
	font-weight: 700;
	color: #17181c;
	vertical-align: middle;
}

.pc-summary .pc-summary__table tr.order-total:not(.recurring-total) th {
	border-radius: 8px 0 0 8px;
	white-space: nowrap;
}

.pc-summary .pc-summary__table tr.order-total:not(.recurring-total) td {
	border-radius: 0 8px 8px 0;
	font-size: 20px;
	line-height: 1.2;
}

/* Renewal note styles are shared via store-flow.css (pc_renewal_note()) */

/* Cart keeps the delimiter above the note */
.pc-summary .pc-summary__renewal {
	margin-top: 14px;
	padding-top: 14px;
	border-top: 1px solid #eef0f2;
}

/* Checkout CTA */

.pc-summary .wc-proceed-to-checkout {
	margin-top: 20px;
	padding: 0;
}

a.pc-summary__checkout {
	display: block;
	width: 100%;
	padding: 15px 24px;
	border-radius: 8px;
	background: #3fb859;
	color: #fff !important;
	font-size: 16px;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	transition: background-color 0.15s ease, transform 0.15s ease;
}

a.pc-summary__checkout:hover,
a.pc-summary__checkout:focus {
	background: #35a04c;
	transform: translateY(-1px);
}

/* Extra payment buttons injected below the CTA (e.g. Stripe Link) */
.pc-summary .wc-proceed-to-checkout > *:not(.pc-summary__checkout) {
	margin-top: 12px;
}

/* Trust line under the buttons */
.pc-summary__trust {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin-top: 14px;
	font-size: 13px;
	color: #9ca3af;
}

@media (max-width: 600px) {
	.pc-cart {
		padding: 32px 16px 64px;
	}

	.pc-cart-item {
		flex-wrap: wrap;
		padding: 16px;
	}

	.pc-cart-item__info {
		flex: 1 1 60%;
	}

	.pc-cart-item__subtotal {
		flex: 1 1 100%;
		order: 4;
		text-align: left;
		padding-left: 80px;
	}
}
