/**
 * Cart page
 *
 * Scoped to the page-cart template. Section colors come from each group's native
 * background/text color settings; the cart itself is the WooCommerce Cart block, restyled
 * here only. Line items, quantities, totals, coupons and checkout stay native WooCommerce.
 */

.bm-cart-main {
	padding: 0;
}

.bm-cart-main > *,
.bm-cart-content > * + * {
	margin-block: 0;
}

/* Classic notices (e.g. after a non-AJAX add to cart) sit above the hero. */
.bm-cart-main .bm-cart-notices .woocommerce-notices-wrapper:not(:empty) {
	max-width: 1200px;
	margin-inline: auto;
	padding: 24px var(--bm-gutter) 0;
}

/* Sections ------------------------------------------------------------------ */

.bm-cart-main .bm-cart-section {
	padding: clamp(48px, 6vw, 88px) var(--bm-gutter);
}

.bm-cart-main .bm-cart-section > .alignwide {
	max-width: 1200px;
}

.bm-cart-hero__inner > * {
	margin-block: 0;
}

.bm-cart-main h1,
.bm-cart-main h2 {
	margin: 0;
	font-family: var(--wp--preset--font-family--cormorant-garamond);
	font-weight: 500;
	line-height: 1.1;
	color: inherit;
	text-wrap: balance;
}

.bm-cart-main h1 {
	font-size: var(--bm-fs-h1);
}

.bm-cart-main .bm-eyebrow {
	margin-bottom: 14px;
	line-height: 1.4;
}

.bm-cart-main .bm-cart-hero {
	padding-block: clamp(56px, 7vw, 104px);
}

.bm-cart-main .bm-cart-hero__intro {
	max-width: 560px;
	margin-top: 20px;
	color: var(--wp--preset--color--stone);
	font-size: var(--bm-fs-card);
	line-height: 1.6;
}

.bm-cart-main a:focus-visible,
.bm-cart-main button:focus-visible,
.bm-cart-main input:focus-visible,
.bm-cart-main [role="button"]:focus-visible {
	outline: 2px solid var(--wp--preset--color--amber-deep);
	outline-offset: 2px;
	box-shadow: none;
}

/* Cart block ---------------------------------------------------------------- */

.bm-cart-main .wp-block-woocommerce-cart {
	color: var(--wp--preset--color--charcoal);
	font-family: var(--wp--preset--font-family--manrope);
}

.bm-cart-main .wc-block-cart {
	margin: 0;
}

/* Line items */

.bm-cart-main table.wc-block-cart-items {
	margin: 0;
}

.bm-cart-main table.wc-block-cart-items th {
	padding-bottom: 14px;
	border-bottom-color: var(--wp--preset--color--stone);
	color: var(--wp--preset--color--ink-muted);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.bm-cart-main table.wc-block-cart-items .wc-block-cart-items__row {
	border-bottom-color: var(--wp--preset--color--stone);
}

.bm-cart-main table.wc-block-cart-items td {
	border-top-color: var(--wp--preset--color--stone);
}

.bm-cart-main .wc-block-cart-item__image img {
	background: #fffdf8;
	border: 1px solid var(--wp--preset--color--stone);
	object-fit: contain;
}

.bm-cart-main .wc-block-cart-item__wrap {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
}

.bm-cart-main .wc-block-cart-item__wrap > * {
	margin: 0;
}

.bm-cart-main .wc-block-cart .wc-block-cart-items a.wc-block-components-product-name {
	max-width: none;
	color: var(--wp--preset--color--charcoal);
	font-family: var(--wp--preset--font-family--cormorant-garamond);
	font-size: clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem);
	font-weight: 600;
	line-height: 1.25;
	text-decoration: none;
}

.bm-cart-main .wc-block-cart .wc-block-cart-items a.wc-block-components-product-name:hover {
	color: var(--wp--preset--color--amber-deep);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

.bm-cart-main .wc-block-cart-item__prices,
.bm-cart-main .wc-block-components-product-metadata {
	color: var(--wp--preset--color--ink-muted);
	font-size: var(--bm-fs-text);
}

.bm-cart-main .wc-block-components-product-metadata {
	line-height: 1.6;
}

.bm-cart-main .wc-block-cart-item__total {
	font-weight: 600;
}

.bm-cart-main .wc-block-components-product-badge {
	border-color: var(--wp--preset--color--amber-deep);
	border-radius: 0;
	color: var(--wp--preset--color--amber-deep);
}

/* Quantity and remove */

.bm-cart-main .wc-block-cart-item__quantity {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 16px;
	margin-top: 6px;
}

.bm-cart-main .wc-block-components-quantity-selector {
	width: 124px;
	min-height: 44px;
	margin: 0;
	border: 1px solid var(--wp--preset--color--taupe);
	border-radius: 0;
	background: #fffdf8;
}

.bm-cart-main .wc-block-components-quantity-selector::after {
	display: none;
}

.bm-cart-main .wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input {
	min-width: 0;
	color: var(--wp--preset--color--charcoal);
	font-size: 15px;
	font-weight: 600;
}

.bm-cart-main .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button {
	min-width: 40px;
	color: var(--wp--preset--color--charcoal);
	font-size: 18px;
	opacity: 1;
	cursor: pointer;
}

.bm-cart-main .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:hover:not(:disabled) {
	background: var(--wp--preset--color--paper);
}

.bm-cart-main .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:disabled {
	color: var(--wp--preset--color--taupe);
	cursor: not-allowed;
}

/* WooCommerce draws only a 1px inset shadow here; replace it with a clear 2px ring. */
.bm-cart-main .wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input:focus,
.bm-cart-main .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:focus-visible {
	outline: 2px solid var(--wp--preset--color--amber-deep);
	outline-offset: -2px;
	box-shadow: none;
}

.bm-cart-main button.wc-block-cart-item__remove-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	color: var(--wp--preset--color--ink-muted);
	cursor: pointer;
}

.bm-cart-main button.wc-block-cart-item__remove-link:hover {
	color: #a3261b;
}

.bm-cart-main button.wc-block-cart-item__remove-link svg {
	fill: currentColor;
}

/* Summary panel */

.bm-cart-main .wc-block-cart__sidebar {
	align-self: flex-start;
}

.bm-cart-main .wp-block-woocommerce-cart-totals-block {
	padding: clamp(24px, 3vw, 36px);
	border: 1px solid var(--wp--preset--color--stone);
	background: #fffdf8;
}

.bm-cart-main .wc-block-cart .wc-block-cart__totals-title {
	padding: 0 0 16px;
	border-bottom: 1px solid var(--wp--preset--color--stone);
	color: var(--wp--preset--color--charcoal);
	font-family: var(--wp--preset--font-family--cormorant-garamond);
	font-size: var(--bm-fs-h3);
	font-weight: 500;
	letter-spacing: 0;
	line-height: 1.2;
	text-align: left;
	text-transform: none;
}

.bm-cart-main .wc-block-components-totals-wrapper {
	padding-inline: 0;
	border-top-color: var(--wp--preset--color--stone);
}

.bm-cart-main .wc-block-components-totals-wrapper:first-of-type,
.bm-cart-main .wc-block-cart__totals-title + .wc-block-components-totals-wrapper {
	border-top: 0;
}

.bm-cart-main .wc-block-components-panel__button {
	color: var(--wp--preset--color--charcoal);
	font-size: var(--bm-fs-text);
	font-weight: 600;
}

.bm-cart-main .wc-block-components-totals-item {
	font-size: var(--bm-fs-text);
}

.bm-cart-main .wc-block-components-totals-item__description {
	color: var(--wp--preset--color--ink-muted);
}

.bm-cart-main .wc-block-components-totals-footer-item .wc-block-components-totals-item__label {
	font-family: var(--wp--preset--font-family--cormorant-garamond);
	font-size: var(--bm-fs-card);
	font-weight: 600;
}

.bm-cart-main .wc-block-components-totals-footer-item .wc-block-components-totals-item__value {
	font-size: var(--bm-fs-card);
	font-weight: 700;
}

/* Coupon form and shipping calculator fields */

.bm-cart-main .wc-block-components-text-input input,
.bm-cart-main .wc-block-components-combobox .wc-block-components-combobox-control input,
.bm-cart-main .wc-blocks-components-select .wc-blocks-components-select__select {
	border: 1px solid var(--wp--preset--color--taupe);
	border-radius: 0;
	background: #fffdf8;
	color: var(--wp--preset--color--charcoal);
}

.bm-cart-main .wc-block-components-text-input input:focus {
	border-color: var(--wp--preset--color--charcoal);
	box-shadow: inset 0 0 0 1px var(--wp--preset--color--charcoal);
}

.bm-cart-main .wc-block-components-text-input label {
	color: var(--wp--preset--color--ink-muted);
}

.bm-cart-main .wc-block-components-totals-coupon__button,
.bm-cart-main .wc-block-components-shipping-calculator-address__button {
	border: 1px solid var(--wp--preset--color--charcoal);
	border-radius: 0;
	background: var(--wp--preset--color--charcoal);
	color: var(--wp--preset--color--ivory);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.bm-cart-main .wc-block-components-totals-coupon__button:hover:not(:disabled),
.bm-cart-main .wc-block-components-shipping-calculator-address__button:hover:not(:disabled) {
	background: var(--wp--preset--color--espresso);
}

.bm-cart-main .wc-block-components-validation-error,
.bm-cart-main .wc-block-components-text-input.has-error label {
	color: #a3261b;
}

.bm-cart-main .wc-block-components-text-input.has-error input {
	border-color: #a3261b;
}

/* Proceed to checkout */

.bm-cart-main .wc-block-cart__submit {
	margin: 24px 0 0;
}

.bm-cart-main .wc-block-cart__submit-button.wc-block-components-button {
	width: 100%;
	min-height: 56px;
	border: 1px solid var(--wp--preset--color--charcoal);
	border-radius: 0;
	background: var(--wp--preset--color--charcoal);
	color: var(--wp--preset--color--ivory);
	font-family: var(--wp--preset--font-family--manrope);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-decoration: none;
	text-transform: uppercase;
}

.bm-cart-main .wc-block-cart__submit-button.wc-block-components-button:hover {
	background: var(--wp--preset--color--espresso);
	color: var(--wp--preset--color--ivory);
}

.bm-cart-main .wc-block-cart__submit-button.wc-block-components-button:focus-visible {
	outline: 2px solid var(--wp--preset--color--amber-deep);
	outline-offset: 3px;
}

/* Notices: native WooCommerce banners, squared to match the theme. */

.bm-cart-main .wc-block-components-notice-banner {
	border-radius: 0;
	color: var(--wp--preset--color--charcoal);
	font-size: var(--bm-fs-text);
}

/* Empty cart ---------------------------------------------------------------- */

.bm-cart-main .bm-cart-empty {
	max-width: 560px;
	margin-inline: auto;
	padding-block: clamp(16px, 4vw, 48px);
	text-align: center;
}

.bm-cart-main .bm-cart-empty > * {
	margin-block: 0;
}

.bm-cart-main .bm-cart-empty h2 {
	font-size: var(--bm-fs-h2);
}

.bm-cart-main .bm-cart-empty p {
	margin-top: 16px;
	color: var(--wp--preset--color--ink-muted);
	font-size: var(--bm-fs-card);
	line-height: 1.6;
}

.bm-cart-main .bm-cart-empty .wp-block-buttons {
	justify-content: center;
	margin-top: 32px;
}

.bm-cart-main .bm-cart-empty .wp-block-button__link {
	padding: 17px 36px;
	border: 1px solid var(--wp--preset--color--charcoal);
	border-radius: 0;
	background: var(--wp--preset--color--charcoal);
	color: var(--wp--preset--color--ivory);
	font-family: var(--wp--preset--font-family--manrope);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-decoration: none;
	text-transform: uppercase;
}

.bm-cart-main .bm-cart-empty .wp-block-button__link:hover {
	background: var(--wp--preset--color--espresso);
	color: var(--wp--preset--color--ivory);
}

.bm-cart-main .bm-cart-empty .wp-block-button__link:focus-visible {
	outline-offset: 3px;
}

/* Responsive ---------------------------------------------------------------- */

@media (max-width: 599px) {
	.bm-cart-main .wp-block-woocommerce-cart-totals-block {
		margin-inline: calc(var(--bm-gutter) * -0.5);
	}
}
