/**
 * Cart + checkout page styles.
 *
 * Restyles the WooCommerce classic cart/checkout to mirror the reference store
 * (navy summary panel, pill quantity stepper, Shopify-like checkout columns).
 * Loaded only on the cart and checkout pages by inc/cart-page.php.
 */

/* ==========================================================================
   Shared
   ========================================================================== */

#bp-cart-page,
#bp-checkout-page {
	--bp-line: rgba(var(--colors-line-and-border));
	position: relative;
}

#bp-cart-page .woocommerce,
#bp-checkout-page .woocommerce {
	display: block;
}

/* Notices (Woo) */
#bp-cart-page .woocommerce-notices-wrapper,
#bp-checkout-page .woocommerce-notices-wrapper {
	max-width: 1360px;
	margin: 0 auto;
	padding: 16px 20px 0;
}

#bp-cart-page .woocommerce-message,
#bp-cart-page .woocommerce-info,
#bp-cart-page .woocommerce-error,
#bp-checkout-page .woocommerce-message,
#bp-checkout-page .woocommerce-info,
#bp-checkout-page .woocommerce-error {
	list-style: none;
	margin: 0 0 16px;
	padding: 14px 18px;
	border-radius: 8px;
	font-size: 0.875rem;
	background: #fff;
	border: 1px solid var(--bp-line);
	color: rgba(var(--colors-heading));
}

#bp-cart-page .woocommerce-error,
#bp-checkout-page .woocommerce-error {
	border-color: #d9534f;
}

#bp-cart-page .woocommerce-message::before,
#bp-cart-page .woocommerce-info::before,
#bp-cart-page .woocommerce-error::before {
	display: none;
}

@media (min-width: 1024px) {
	#bp-cart-page .woocommerce-notices-wrapper {
		padding-left: 40px;
		padding-right: 40px;
	}
}

/* ==========================================================================
   Cart — items
   ========================================================================== */

#bp-cart-page .bp-cart-thumb::before {
	content: "";
	display: block;
	height: 0;
	padding-bottom: 100%;
}

#bp-cart-page .cart-items {
	border-collapse: collapse;
}

#bp-cart-page .cart-items th,
#bp-cart-page .cart-items td {
	vertical-align: top;
	border-top: 0;
}

#bp-cart-page .cart-items thead th {
	font-weight: 400;
	font-size: 0.875rem;
}

#bp-cart-page .cart-items tbody {
	border-top: 0;
}

#bp-cart-page .cart-item > td {
	border-top: 0;
}

#bp-cart-page .cart-item {
	border-bottom: 1px solid var(--bp-line);
}

#bp-cart-page .cart-item:last-child {
	border-bottom: 1px solid var(--bp-line);
}

#bp-cart-page .cart-item img {
	display: block;
}

#bp-cart-page .cart-item .price,
#bp-cart-page .cart-item .woocommerce-Price-amount {
	font-size: 0.9375rem;
	color: rgba(var(--colors-text));
}

#bp-cart-page .cart-item dl.variation,
#bp-cart-page .cart-item dl.text-normal {
	margin: 0;
}

#bp-cart-page .cart-item dl.text-normal dt,
#bp-cart-page .cart-item dl.text-normal dd {
	margin: 0;
	font-weight: 400;
}

#bp-cart-page .cart-item .p-break-words {
	word-break: break-word;
}

/* Remove the native blue "update cart" line */
#bp-cart-page .cart-items .actions {
	display: none;
}

/* Quantity stepper */
#bp-cart-page .cart-item-qty {
	-moz-appearance: textfield;
	appearance: textfield;
	flex: 0 0 33.3333%;
	width: 33.3333%;
	height: 100%;
	border: 0;
	background: transparent;
	text-align: center;
	font-size: 0.875rem;
	padding: 0;
	margin: 0;
	color: rgba(var(--colors-heading));
}

#bp-cart-page .cart-item-qty::-webkit-outer-spin-button,
#bp-cart-page .cart-item-qty::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

#bp-cart-page .cart-item-qty:focus {
	outline: none;
}

#bp-cart-page [data-bp-cart-qty-minus],
#bp-cart-page [data-bp-cart-qty-plus] {
	background: transparent;
	border: 0;
	padding: 0;
	cursor: pointer;
	color: inherit;
	flex: 0 0 33.3333%;
	width: 33.3333%;
}

#bp-cart-page [data-bp-cart-remove] {
	background: transparent;
	border: 0;
	cursor: pointer;
	color: inherit;
}

#bp-cart-page [data-bp-cart-qty-minus]:disabled,
#bp-cart-page [data-bp-cart-qty-plus]:disabled {
	opacity: 0.35;
	cursor: default;
}

#bp-cart-page [data-bp-cart-remove]:hover {
	opacity: 1;
}

/* Totals panel */
#bp-cart-page .form-checkout #checkout-submit {
	background-color: rgb(var(--colors-button));
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 52px;
	padding-top: 0;
	padding-bottom: 0;
	color: rgba(var(--colors-button-text));
	text-decoration: none;
	font-size: 0.875rem;
	line-height: 1;
}

#bp-cart-page .form-checkout #checkout-submit:hover {
	color: rgba(var(--colors-button-text));
	opacity: 0.92;
}

#bp-cart-page .bp-cart-wallet {
	height: 32px;
}

/* Mobile cart grid (reference collapses the table below 768px) */
@media (max-width: 767px) {
	#bp-cart-page .cart-items,
	#bp-cart-page .cart-items thead,
	#bp-cart-page .cart-items tbody {
		display: block;
		width: 100%;
	}

	#bp-cart-page .cart-items thead tr {
		display: flex;
		justify-content: space-between;
	}

	/* Reference mobile header row is 25px tall (line box + padding + 1px border). */
	#bp-cart-page .cart-items thead th {
		line-height: 18px;
		padding: 0 0 6px;
	}

	#bp-cart-page .cart-item {
		display: grid;
		grid-template-columns: repeat(4, minmax(0, 1fr));
		align-items: start;
	}

	#bp-cart-page .cart-item > td {
		display: block;
		border: 0;
	}

	/* Keep utility-hidden cells (desktop price, etc.) out of the mobile grid. */
	#bp-cart-page .cart-item > td.hidden {
		display: none;
	}
}

/* ==========================================================================
   Checkout
   ========================================================================== */

#bp-checkout-page {
	background: #fff;
}

.bp-checkout-page .woocommerce {
	display: block;
}

.bp-checkout-grid {
	display: block;
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 20px;
}

.bp-checkout-main {
	padding: 28px 0 8px;
	min-width: 0;
}

.bp-checkout-aside {
	min-width: 0;
	padding: 8px 0 40px;
}

/* Section headings */
.bp-checkout-main h2,
.bp-checkout-main h3,
.bp-checkout-summary__title,
.bp-co-payment__title {
	margin: 0 0 16px;
	font-family: var(--font-heading-family);
	font-weight: 500;
	font-size: 1.25rem;
	line-height: 1.25;
	color: rgba(var(--colors-heading));
}

.bp-checkout-main h3 {
	margin-top: 28px;
	font-size: 1.125rem;
}

/* Billing / shipping blocks */
#customer_details {
	display: block;
}

#customer_details .col-1,
#customer_details .col-2 {
	width: 100%;
	float: none;
}

.woocommerce-billing-fields__field-wrapper,
.woocommerce-shipping-fields__field-wrapper,
.woocommerce-additional-fields__field-wrapper {
	display: flex;
	flex-wrap: wrap;
	gap: 0 12px;
}

#bp-checkout-page .form-row {
	display: flex;
	flex-direction: column;
	width: 100%;
	margin: 0 0 14px;
	padding: 0;
	float: none;
}

#bp-checkout-page .form-row-first,
#bp-checkout-page .form-row-last {
	width: calc(50% - 6px);
}

#bp-checkout-page .form-row label {
	display: block;
	margin: 0 0 6px;
	font-size: 0.8125rem;
	line-height: 1.4;
	color: rgba(var(--colors-heading));
}

#bp-checkout-page .form-row label abbr.required {
	text-decoration: none;
	color: inherit;
}

#bp-checkout-page input[type="text"],
#bp-checkout-page input[type="email"],
#bp-checkout-page input[type="tel"],
#bp-checkout-page input[type="password"],
#bp-checkout-page input[type="number"],
#bp-checkout-page input[type="search"],
#bp-checkout-page select,
#bp-checkout-page textarea,
#bp-checkout-page .input-text {
	width: 100%;
	height: 48px;
	padding: 0 14px;
	border: 1px solid var(--bp-line);
	border-radius: 8px;
	background: #fff;
	font-family: var(--font-body-family);
	font-size: 0.875rem;
	color: rgba(var(--colors-heading));
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
}

#bp-checkout-page select {
	padding-right: 36px;
	background-image: linear-gradient(45deg, transparent 50%, rgb(var(--colors-heading)) 50%), linear-gradient(135deg, rgb(var(--colors-heading)) 50%, transparent 50%);
	background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px;
	background-size: 5px 5px, 5px 5px;
	background-repeat: no-repeat;
}

#bp-checkout-page textarea {
	height: auto;
	min-height: 96px;
	padding: 12px 14px;
	line-height: 1.5;
}

#bp-checkout-page input:focus,
#bp-checkout-page select:focus,
#bp-checkout-page textarea:focus {
	outline: none;
	border-color: rgba(var(--colors-heading));
	box-shadow: 0 0 0 1px rgba(var(--colors-heading));
}

#bp-checkout-page ::placeholder {
	color: rgba(var(--colors-text), 0.45);
	opacity: 1;
}

/* Different-address toggle */
#ship-to-different-address {
	margin: 20px 0 12px;
	font-size: 1rem;
}

#bp-checkout-page .woocommerce-form__label-for-checkbox,
#bp-checkout-page label.checkbox {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	font-size: 0.875rem;
	cursor: pointer;
}

#bp-checkout-page input[type="checkbox"],
#bp-checkout-page input[type="radio"] {
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: rgb(var(--colors-heading));
}

/* Order summary */
.bp-checkout-summary {
	padding: 24px 20px;
	border-radius: 16px;
	background: rgba(var(--colors-background));
}

.bp-checkout-summary__title {
	margin-bottom: 18px;
}

#bp-checkout-page .bp-co-items,
#bp-checkout-page .bp-co-totals {
	width: 100%;
	border-collapse: collapse;
	table-layout: auto;
	margin: 0;
}

#bp-checkout-page .bp-co-items tr {
	border: 0;
}

#bp-checkout-page .bp-co-items td {
	border: 0;
	padding: 8px 0;
	vertical-align: middle;
}

#bp-checkout-page .bp-co-item__thumb {
	width: 64px;
}

#bp-checkout-page .bp-co-item__thumb img {
	display: block;
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: 8px;
}

#bp-checkout-page .bp-co-item__name {
	padding-left: 14px !important;
	font-size: 0.875rem;
	line-height: 1.35;
	color: rgba(var(--colors-heading));
}

#bp-checkout-page .bp-co-item__qty {
	display: inline-block;
	margin-left: 4px;
	font-size: 0.8125rem;
	color: rgba(var(--colors-text), 0.6);
}

#bp-checkout-page .bp-co-item__title {
	display: block;
}

#bp-checkout-page .bp-co-item__variant {
	display: block;
	margin-top: 1px;
	font-size: 0.8125rem;
	line-height: 1.35;
	color: rgba(var(--colors-text), 0.65);
}

#bp-checkout-page .bp-co-item__total {
	text-align: right;
	font-size: 0.875rem;
	white-space: nowrap;
	color: rgba(var(--colors-heading));
}

#bp-checkout-page .bp-co-totals th,
#bp-checkout-page .bp-co-totals td {
	border: 0;
	padding: 6px 0;
	font-weight: 400;
	font-size: 0.875rem;
	text-align: left;
	vertical-align: top;
}

#bp-checkout-page .bp-co-totals td {
	text-align: right;
	white-space: nowrap;
}

#bp-checkout-page .bp-co-totals th {
	color: rgba(var(--colors-text), 0.7);
}

#bp-checkout-page .bp-co-totals .order-total th,
#bp-checkout-page .bp-co-totals .order-total td {
	padding-top: 14px;
	font-family: var(--font-heading-family);
	font-weight: 500;
	font-size: 1.0625rem;
	color: rgba(var(--colors-heading));
}

#bp-checkout-page .bp-co-totals tr.cart-subtotal th,
#bp-checkout-page .bp-co-totals tr.cart-subtotal td {
	padding-top: 14px;
}

#bp-checkout-page .bp-co-totals a.remove {
	display: none;
}

#bp-checkout-page #order_review {
	position: relative;
}

/* Coupon / gift card */
.bp-co-coupon-toggle {
	margin-top: 12px;
	border-top: 1px solid rgba(var(--colors-heading), 0.12);
}

.bp-co-coupon-toggle__btn {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 16px 0 4px;
	border: 0;
	background: transparent;
	font-family: var(--font-body-family);
	font-size: 0.875rem;
	cursor: pointer;
	color: rgba(var(--colors-heading));
}

.bp-co-coupon-toggle__icon {
	font-size: 1rem;
	line-height: 1;
}

.bp-co-coupon-form {
	display: flex;
	flex-wrap: wrap;
	gap: 0 10px;
	margin-top: 12px;
}

.bp-co-coupon-form[hidden] {
	display: none;
}

.bp-co-coupon-form__field {
	flex: 1 1 160px;
}

.bp-co-coupon-form__submit {
	flex: 0 0 96px;
}

.bp-co-coupon-form__submit .button {
	width: 100%;
	height: 48px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 0.8125rem;
}

/* Payment */
.bp-co-payment {
	margin-top: 24px;
	border-top: 1px solid rgba(var(--colors-heading), 0.12);
	padding-top: 22px;
}

#bp-checkout-page .wc_payment_methods {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 0 0 4px;
	padding: 0;
	list-style: none;
}

#bp-checkout-page .wc_payment_method {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	padding: 14px 16px;
	border: 1px solid var(--bp-line);
	border-radius: 10px;
	background: #fff;
}

#bp-checkout-page .wc_payment_method > label {
	margin: 0;
	font-size: 0.875rem;
}

#bp-checkout-page .payment_box {
	width: 100%;
	margin: 4px 0 0 28px;
	font-size: 0.8125rem;
	line-height: 1.5;
	color: rgba(var(--colors-text), 0.7);
}

#bp-checkout-page .payment_box p {
	margin: 0;
}

#bp-checkout-page .wc_payment_method.payment_method_cod .payment_box,
#bp-checkout-page .wc_payment_method.payment_method_bacs .payment_box {
	display: none;
}

#bp-checkout-page .woocommerce-terms-and-conditions-wrapper {
	margin: 14px 0 0;
	font-size: 0.8125rem;
	line-height: 1.5;
}

#bp-checkout-page .place-order {
	width: 100%;
	margin: 0;
}

#bp-checkout-page .bp-co-paynow,
#bp-checkout-page button.bp-co-paynow {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 52px;
	margin-top: 16px;
	border: 0;
	border-radius: var(--border-radius);
	background: var(--colors-button-hover);
	color: rgba(var(--colors-button-text));
	font-family: var(--font-button);
	font-weight: 500;
	font-size: 0.875rem;
	line-height: 1;
	cursor: pointer;
	transition: opacity 0.2s;
}

#bp-checkout-page .bp-co-paynow:hover {
	color: rgba(var(--colors-button-text));
	opacity: 0.92;
}

#bp-checkout-page .bp-co-paynow:disabled {
	opacity: 0.5;
	cursor: wait;
}

#bp-checkout-page .woocommerce-form-login-toggle,
#bp-checkout-page .woocommerce-form-coupon-toggle {
	margin-bottom: 20px;
}

#bp-checkout-page .woocommerce-form-login {
	margin-bottom: 24px;
	padding: 18px;
	border: 1px solid var(--bp-line);
	border-radius: 12px;
}

#bp-checkout-page .woocommerce-form-login p {
	margin: 0 0 12px;
}

#bp-checkout-page .woocommerce-form-login .lost_password {
	margin: 0;
	font-size: 0.8125rem;
}

#bp-checkout-page .woocommerce-form-login .button {
	height: 48px;
	padding: 0 22px;
	font-size: 0.875rem;
}

#bp-checkout-page .woocommerce-form-login__rememberme {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 12px;
	font-size: 0.875rem;
}

/* Desktop layout */
@media (min-width: 1024px) {
	.bp-checkout-grid {
		display: grid;
		grid-template-columns: minmax(0, 1fr) 440px;
		gap: 60px;
		padding: 0 40px;
	}

	.bp-checkout-main {
		padding: 48px 0 40px;
	}

	.bp-checkout-aside {
		padding: 48px 0 40px;
	}

	.bp-checkout-summary {
		position: sticky;
		top: 24px;
		padding: 28px;
	}

	.bp-next-steps {
		margin-top: 12px;
		font-size: 0.8125rem;
		color: rgba(var(--colors-text), 0.6);
	}
}

/* Order received / thank you */
#bp-checkout-page .woocommerce-order,
#bp-checkout-page .woocommerce-thankyou-order-received {
	max-width: 760px;
	margin: 0 auto;
}

#bp-checkout-page .woocommerce-order {
	padding: 48px 20px 64px;
}

#bp-checkout-page .woocommerce-thankyou-order-received {
	margin-bottom: 24px;
	font-family: var(--font-heading-family);
	font-weight: 500;
	font-size: 1.35rem;
	line-height: 1.3;
	color: rgba(var(--colors-heading));
}

#bp-checkout-page ul.woocommerce-order-overview {
	display: flex;
	flex-wrap: wrap;
	gap: 18px 32px;
	margin: 0 0 32px;
	padding: 0;
	list-style: none;
}

#bp-checkout-page ul.woocommerce-order-overview li {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 0.8125rem;
	text-transform: none;
	color: rgba(var(--colors-heading));
}

#bp-checkout-page .woocommerce-order-details,
#bp-checkout-page .woocommerce-customer-details {
	margin-top: 28px;
}

#bp-checkout-page .woocommerce-table--order-details {
	width: 100%;
	border-collapse: collapse;
}

#bp-checkout-page .woocommerce-table--order-details th,
#bp-checkout-page .woocommerce-table--order-details td {
	padding: 12px 8px;
	border-bottom: 1px solid var(--bp-line);
	font-size: 0.875rem;
	text-align: left;
}

#bp-checkout-page .woocommerce-table--order-details td:last-child,
#bp-checkout-page .woocommerce-table--order-details th:last-child {
	text-align: right;
}

#bp-checkout-page .woocommerce-customer-details address {
	padding: 16px;
	border: 1px solid var(--bp-line);
	border-radius: 12px;
	font-style: normal;
	line-height: 1.6;
}

@media (min-width: 768px) {
	#bp-cart-page .cart-items thead th {
		padding-bottom: 6px;
	}
}

/* The reference store has no "cart is empty" notice — our empty view supplies copy. */
#bp-cart-page .wc-empty-cart-message {
	display: none;
}

/* Hide empty notice wrappers produced by WooCommerce shortcodes. */
#bp-cart-page .woocommerce-notices-wrapper:empty,
#bp-checkout-page .woocommerce-notices-wrapper:empty {
	display: none;
}

/* Empty-cart "Continue shopping" keeps its intrinsic pill width. */
#bp-cart-page a.button.button-outline {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
