/* Final FC-014 surface rules approved by the Product Owner. */

/*
 * Keep the filled cart compact on desktop: a flexible product column and a
 * deliberately bounded summary column. The row now uses the full content
 * container so the product surface aligns with the page heading instead of
 * creating an artificial left gutter.
 */
@media (min-width: 801px) {
	.fcsu-cart--classic .content-entry__content > .woocommerce,
	.fcsu-cart--block .wp-block-woocommerce-cart .wc-block-components-sidebar-layout {
		width: 100%;
		margin-inline: 0;
	}

	.fcsu-cart--classic .content-entry__content > .woocommerce {
		grid-template-columns: minmax(0, 1fr) minmax(20rem, 21.5rem);
		gap: clamp(1.25rem, 2.2vw, 2rem);
	}

	.fcsu-cart--classic .woocommerce-cart-form,
	.fcsu-cart--classic .cart-collaterals {
		width: 100%;
		min-width: 0;
	}

	.fcsu-cart--block .wp-block-woocommerce-cart .wc-block-components-sidebar-layout {
		display: grid !important;
		grid-template-columns: minmax(0, 1fr) minmax(20rem, 21.5rem) !important;
		gap: clamp(1.25rem, 2.2vw, 2rem) !important;
		align-items: start;
	}

	.fcsu-cart--block .wc-block-components-main,
	.fcsu-cart--block .wc-block-components-sidebar {
		width: 100% !important;
		min-width: 0 !important;
		max-width: none !important;
		flex-basis: auto !important;
	}

	.fcsu-cart--block .wc-block-components-sidebar {
		position: sticky;
		top: calc(var(--fc-header-height) + var(--fc-space-2));
		align-self: start;
	}
}

@media (min-width: 801px) and (max-width: 1050px) {
	.fcsu-cart--classic .content-entry__content > .woocommerce,
	.fcsu-cart--block .wp-block-woocommerce-cart .wc-block-components-sidebar-layout {
		grid-template-columns: minmax(0, 1fr) minmax(18.5rem, 20rem) !important;
		gap: var(--fc-space-2) !important;
	}
}

/* Product list cards must be white, but only the visible card itself. */
.fcsu-cart-page .woocommerce-cart-form,
.fcsu-cart-page .woocommerce-cart-form table.shop_table,
.fcsu-cart-page .wc-block-cart-items {
	background-color: var(--fc-surface, #fff) !important;
	background-image: none !important;
}

.fcsu-cart-page .woocommerce-cart-form,
.fcsu-cart-page .wc-block-cart-items {
	overflow: hidden !important;
}

.fcsu-cart-page .wc-block-components-main,
.fcsu-cart-page .wc-block-cart-items__row,
.fcsu-cart-page .woocommerce-cart-form tr.cart_item {
	background: transparent !important;
}

/* Do not use a colored top-edge accent on cards. */
.fcsu-cart-page .cart-collaterals .cart_totals,
.fcsu-cart-page .wc-block-components-sidebar,
.fcsu-cart-page .woocommerce-cart-form,
.fcsu-cart-page .wc-block-cart-items {
	border-top: 1px solid var(--fc-border) !important;
}

.fcsu-cart-page .cart-collaterals .cart_totals::before,
.fcsu-cart-page .cart-collaterals .cart_totals::after,
.fcsu-cart-page .wc-block-components-sidebar::before,
.fcsu-cart-page .wc-block-components-sidebar::after,
.fcsu-cart-page .woocommerce-cart-form::before,
.fcsu-cart-page .woocommerce-cart-form::after,
.fcsu-cart-page .wc-block-cart-items::before,
.fcsu-cart-page .wc-block-cart-items::after {
	display: none !important;
	content: none !important;
}

/* Keep shipping comfortably separated from the line/section above. */
.fcsu-cart-page .wc-block-components-sidebar .wc-block-components-totals-shipping {
	margin-top: var(--fc-space-2) !important;
	padding-top: 1rem !important;
	border-top: 1px solid var(--fc-border) !important;
}

.fcsu-cart-page .wc-block-components-sidebar .wc-block-components-totals-shipping > :first-child,
.fcsu-cart-page .wc-block-components-sidebar .wc-block-components-totals-shipping .wc-block-components-totals-item:first-child {
	margin-top: 0 !important;
}

.fcsu-cart-page .wc-block-components-sidebar .wc-block-components-totals-shipping .wc-block-components-totals-item,
.fcsu-cart-page .wc-block-components-sidebar .wc-block-components-totals-shipping .wc-block-components-totals-item__description {
	padding-top: 0 !important;
}

/* Paid and free shipping variants share the same spacing and readable line height. */
.fcsu-cart-page .wc-block-components-sidebar .wc-block-components-totals-shipping,
.fcsu-cart-page .wc-block-components-sidebar .wc-block-components-totals-shipping .wc-block-components-totals-item,
.fcsu-cart-page .wc-block-components-sidebar .wc-block-components-totals-shipping .wc-block-components-totals-item__label,
.fcsu-cart-page .wc-block-components-sidebar .wc-block-components-totals-shipping .wc-block-components-totals-item__value,
.fcsu-cart-page .wc-block-components-sidebar .wc-block-components-totals-shipping .wc-block-components-totals-item__description {
	height: auto !important;
	min-height: 0 !important;
	overflow: visible !important;
	line-height: 1.45;
}

/*
 * Delivery-scope heads-up. Informational, not a validation error: checkout owns
 * the address-dependent refusal. It uses the action/copper family so it reads
 * as something to notice without presenting the customer as already wrong.
 */
.fcsu-cart-delivery-notice {
	display: flex;
	align-items: flex-start;
	gap: var(--fc-space-2);
	margin: 0 0 var(--fc-space-3);
	padding: clamp(1rem, 2.4vw, 1.25rem);
	border: 1px solid color-mix(in srgb, var(--fc-brand-accent) 32%, var(--fc-border));
	border-radius: var(--fc-radius-md);
	background: color-mix(in srgb, var(--fc-brand-accent) 6%, var(--fc-surface, #fff));
	color: var(--fc-text);
}

.fcsu-cart-delivery-notice__icon {
	display: grid;
	flex: 0 0 2.5rem;
	width: 2.5rem;
	height: 2.5rem;
	place-items: center;
	border-radius: var(--fc-radius-pill);
	color: var(--fc-brand-accent);
	background: var(--fc-surface, #fff);
}

.fcsu-cart-delivery-notice__icon svg {
	width: 1.35rem;
	height: 1.35rem;
}

.fcsu-cart-delivery-notice__content {
	min-width: 0;
}

.fcsu-cart-delivery-notice__title {
	margin: 0 0 0.25rem;
	font-size: 0.95rem;
	font-weight: 800;
	line-height: 1.4;
}

.fcsu-cart-delivery-notice__text {
	margin: 0;
	color: var(--fc-text-muted);
	font-size: 0.9rem;
	line-height: 1.6;
	overflow-wrap: anywhere;
}

.fcsu-cart--empty .fcsu-cart-delivery-notice {
	display: none;
}

/*
 * Replace only WooCommerce's default empty-cart UI. Keep the surrounding
 * content and notice wrappers available so stock explanations, validation
 * messages and undo links remain visible after the last item is removed.
 */
.fcsu-cart--empty .wp-block-woocommerce-empty-cart-block,
.fcsu-cart--empty .wc-empty-cart-message,
.fcsu-cart--empty .cart-empty,
.fcsu-cart--empty .return-to-shop,
.fcsu-cart--empty .cross-sells,
.fcsu-cart--empty .woocommerce-cart-form,
.fcsu-cart--empty .cart-collaterals {
	display: none !important;
}

.fcsu-cart--empty .woocommerce-notices-wrapper {
	display: block;
}

/*
 * The designed empty state is rendered on every cart page and `fcsu-cart--empty`
 * is what shows it, so the same panel serves a cart that arrived empty and a
 * cart the Cart Block emptied in the browser. Hidden with `display: none`, so a
 * filled cart does not expose it to assistive technology either.
 */
.fcsu-cart-page:not(.fcsu-cart--empty) .fcsu-empty-cart {
	display: none;
}

.fcsu-empty-cart {
	display: grid;
	max-width: 44rem;
	justify-items: center;
	gap: var(--fc-space-2);
	margin: 0 auto;
	padding: clamp(2rem, 7vw, 4.5rem) clamp(1.25rem, 5vw, 3rem);
	border: 1px solid var(--fc-border);
	border-radius: var(--fc-radius-lg);
	background: var(--fc-surface, #fff);
	text-align: center;
}

.fcsu-empty-cart__icon {
	display: grid;
	width: 4.25rem;
	height: 4.25rem;
	place-items: center;
	border-radius: var(--fc-radius-pill);
	color: var(--fc-brand-primary);
	background: var(--fc-background);
}

.fcsu-empty-cart__icon svg {
	width: 2rem;
	height: 2rem;
}

.fcsu-empty-cart__eyebrow {
	margin: 0;
	color: var(--fc-text-muted);
	font-size: 0.8rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.fcsu-empty-cart h2 {
	margin: 0;
	color: var(--fc-brand-primary);
	font-size: clamp(1.7rem, 5vw, 2.35rem);
	line-height: 1.15;
}

.fcsu-empty-cart__text {
	max-width: 34rem;
	margin: 0;
	color: var(--fc-text-muted);
	font-size: 1rem;
	line-height: 1.65;
}

.fcsu-empty-cart__button {
	display: inline-flex;
	min-height: 3rem;
	align-items: center;
	justify-content: center;
	margin-top: var(--fc-space-1);
	padding: 0.8rem 1.4rem;
	border: 1px solid var(--fc-brand-primary);
	border-radius: var(--fc-radius-pill);
	color: var(--fc-surface, #fff);
	background: var(--fc-brand-primary);
	font-weight: 800;
	text-decoration: none;
}

.fcsu-empty-cart__button:hover,
.fcsu-empty-cart__button:focus-visible {
	border-color: var(--fc-brand-secondary);
	background: var(--fc-brand-secondary);
}

@media (max-width: 800px) {
	.fcsu-cart--classic .content-entry__content > .woocommerce,
	.fcsu-cart--block .wp-block-woocommerce-cart .wc-block-components-sidebar-layout {
		width: 100%;
		grid-template-columns: minmax(0, 1fr) !important;
	}

	.fcsu-cart--block .wc-block-components-sidebar {
		position: static;
	}
}

@media (max-width: 700px) {
	.fcsu-cart-page .woocommerce-cart-form,
	.fcsu-cart-page .wc-block-cart-items {
		background-color: var(--fc-surface, #fff) !important;
	}

	.fcsu-cart-page .wc-block-components-main {
		background: transparent !important;
	}

	.fcsu-cart-page .wc-block-components-sidebar .wc-block-components-totals-shipping {
		margin-top: 0.9rem !important;
		padding-top: 0.9rem !important;
	}

	.fcsu-cart-delivery-notice {
		gap: 0.75rem;
		padding: 0.9rem;
	}

	.fcsu-cart-delivery-notice__icon {
		flex-basis: 2.25rem;
		width: 2.25rem;
		height: 2.25rem;
	}

	.fcsu-empty-cart {
		padding: 2rem 1rem;
		border-radius: var(--fc-radius-md);
	}
}
