
/* =========================================================================
 * 4. Cart page
 * ========================================================================= */

body.flanfudge-shop.woocommerce-cart .ff-section--shop,
body.flanfudge-shop.woocommerce-checkout .ff-section--shop,
body.flanfudge-shop.woocommerce-order-received .ff-section--shop {
	padding-block: clamp(40px, 5vw, 80px);
}

body.flanfudge-shop.woocommerce-cart h1.entry-title,
body.flanfudge-shop.woocommerce-checkout h1.entry-title,
body.flanfudge-shop.woocommerce-order-received h1.entry-title {
	font-size: clamp(2rem, 2vw + 1rem, 2.75rem);
	font-weight: var(--ff-weight-medium);
	letter-spacing: -0.02em;
	margin: 0 0 var(--ff-space-8);
}

body.flanfudge-shop .woocommerce-cart-form {
	margin-bottom: var(--ff-space-8);
}

body.flanfudge-shop table.shop_table {
	width: 100%;
	border: 0;
	border-collapse: separate;
	border-spacing: 0;
}

body.flanfudge-shop table.shop_table thead {
	background: transparent;
}

body.flanfudge-shop table.shop_table thead th {
	background: transparent;
	border-bottom: 1px solid var(--ff-border);
	padding: 14px 12px;
	font-size: 0.75rem;
	font-weight: var(--ff-weight-semibold);
	letter-spacing: var(--ff-tracking-widest);
	text-transform: uppercase;
	color: var(--ff-muted-fg);
	text-align: left;
}

body.flanfudge-shop table.shop_table tbody td {
	padding: 18px 12px;
	border-top: 1px solid var(--ff-border);
	background: transparent;
	vertical-align: middle;
	color: var(--ff-foreground);
}

body.flanfudge-shop table.shop_table .product-thumbnail img {
	width: 72px;
	height: 72px;
	object-fit: cover;
	border-radius: var(--ff-radius);
	display: block;
}

body.flanfudge-shop table.shop_table .product-name a {
	color: var(--ff-foreground);
	font-weight: var(--ff-weight-medium);
	text-decoration: none;
}

body.flanfudge-shop table.shop_table .product-name a:hover {
	color: var(--ff-accent);
}

body.flanfudge-shop table.shop_table .product-remove a {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--ff-mist);
	color: var(--ff-foreground);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	text-decoration: none;
}

body.flanfudge-shop table.shop_table .product-remove a:hover {
	background: var(--ff-foreground);
	color: var(--ff-cream);
}

body.flanfudge-shop .actions {
	padding: 18px 12px;
	border: 0;
}

body.flanfudge-shop .coupon {
	display: inline-flex;
	gap: 8px;
	flex-wrap: wrap;
}

body.flanfudge-shop .coupon input[name="coupon_code"] {
	min-height: 44px;
	padding: 0 14px;
	border-radius: var(--ff-radius-pill);
	border: 1px solid var(--ff-border);
	background: var(--ff-card);
	color: var(--ff-foreground);
	font-family: inherit;
	font-size: 0.9375rem;
}

body.flanfudge-shop .coupon button[name="apply_coupon"],
body.flanfudge-shop button[name="update_cart"] {
	min-height: 44px;
	padding: 0 22px;
	border-radius: var(--ff-radius-pill);
	border: 1px solid var(--ff-border);
	background: var(--ff-card);
	color: var(--ff-foreground);
	font-family: inherit;
	font-size: 0.9375rem;
	font-weight: var(--ff-weight-semibold);
	cursor: pointer;
	transition: background-color var(--ff-dur-fast) var(--ff-ease),
	            border-color var(--ff-dur-fast) var(--ff-ease);
}

body.flanfudge-shop .coupon button[name="apply_coupon"]:hover,
body.flanfudge-shop button[name="update_cart"]:hover {
	border-color: var(--ff-foreground);
}

body.flanfudge-shop .cart-collaterals {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--ff-space-6);
}

@media (min-width: 960px) {
	body.flanfudge-shop .cart-collaterals {
		grid-template-columns: 1fr;
	}
	body.flanfudge-shop .cart-collaterals .cart_totals {
		max-width: 460px;
		margin-inline-start: auto;
	}
}

/* Classic cart totals on /cart/ — styled in woocommerce-cart-page.css */
body.flanfudge-shop:not(.woocommerce-cart) .cart_totals {
	background: var(--ff-card);
	border: 1px solid var(--ff-border);
	border-radius: var(--ff-radius-lg);
	padding: 24px;
	width: 100%;
	float: none;
}

body.flanfudge-shop .cart_totals h2 {
	font-size: 1.125rem;
	font-weight: var(--ff-weight-medium);
	letter-spacing: -0.01em;
	margin: 0 0 var(--ff-space-3);
}

body.flanfudge-shop .cart_totals table {
	margin: 0;
}

body.flanfudge-shop .cart_totals table th,
body.flanfudge-shop .cart_totals table td {
	padding: 12px 0;
	border: 0;
	background: transparent;
	text-align: left;
}

body.flanfudge-shop .cart_totals table tr {
	border-bottom: 1px solid var(--ff-border);
}

body.flanfudge-shop .cart_totals table tr:last-child {
	border-bottom: 0;
}

body.flanfudge-shop .cart_totals .order-total td {
	font-size: 1.125rem;
	font-weight: var(--ff-weight-bold);
}

body.flanfudge-shop .wc-proceed-to-checkout {
	padding: var(--ff-space-4) 0 0;
}

body.flanfudge-shop .wc-proceed-to-checkout .checkout-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 50px;
	padding: 0 24px;
	border-radius: var(--ff-radius-pill);
	background: var(--ff-foreground);
	color: var(--ff-cream);
	border: 1px solid var(--ff-foreground);
	font-family: inherit;
	font-size: 1rem;
	font-weight: var(--ff-weight-semibold);
	letter-spacing: 0.005em;
	text-decoration: none;
	margin: 0;
}

body.flanfudge-shop .wc-proceed-to-checkout .checkout-button:hover {
	background: var(--ff-olive-soft);
	border-color: var(--ff-olive-soft);
}

/* Empty cart message */

.ff-empty-cart {
	max-width: 460px;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 14px;
	padding: 32px 0;
}

body.flanfudge .ff-empty-cart__title {
	font-size: 1.5rem;
	font-weight: var(--ff-weight-medium);
	letter-spacing: -0.01em;
	color: var(--ff-foreground);
	margin: 0;
}

.ff-empty-cart__sub {
	color: var(--ff-muted-fg);
	margin: 0 0 8px;
	line-height: 1.5;
}

/* =========================================================================
 * 5. Checkout page
 * ========================================================================= */

body.flanfudge-shop.woocommerce-checkout form.checkout {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--ff-space-8);
}

@media (min-width: 960px) {
	body.flanfudge-shop.woocommerce-checkout form.checkout {
		grid-template-columns: 1.2fr 1fr;
		align-items: start;
		gap: clamp(32px, 4vw, 56px);
	}
}

body.flanfudge-shop .col2-set {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--ff-space-8);
	width: 100%;
}

@media (min-width: 720px) {
	body.flanfudge-shop .col2-set {
		grid-template-columns: 1fr 1fr;
	}
}

body.flanfudge-shop .col2-set .col-1,
body.flanfudge-shop .col2-set .col-2 {
	width: 100%;
	float: none;
	max-width: none;
}

body.flanfudge-shop h3#order_review_heading,
body.flanfudge-shop h3#ship-to-different-address {
	font-size: 1.125rem;
	font-weight: var(--ff-weight-medium);
	letter-spacing: -0.01em;
	margin: 0 0 var(--ff-space-4);
}

body.flanfudge-shop .woocommerce-billing-fields h3 {
	font-size: 1.25rem;
	font-weight: var(--ff-weight-medium);
	letter-spacing: -0.01em;
	margin: 0 0 var(--ff-space-4);
}

body.flanfudge-shop .form-row label {
	font-size: 0.8125rem;
	font-weight: var(--ff-weight-semibold);
	color: var(--ff-foreground);
	margin-bottom: 6px;
}

body.flanfudge-shop .form-row input[type="text"],
body.flanfudge-shop .form-row input[type="email"],
body.flanfudge-shop .form-row input[type="tel"],
body.flanfudge-shop .form-row input[type="password"],
body.flanfudge-shop .form-row input[type="number"],
body.flanfudge-shop .form-row textarea,
body.flanfudge-shop .form-row select,
body.flanfudge-shop .select2-selection {
	width: 100%;
	min-height: 46px;
	padding: 0 14px;
	border-radius: var(--ff-radius);
	border: 1px solid var(--ff-border);
	background: var(--ff-card);
	color: var(--ff-foreground);
	font-family: inherit;
	font-size: 0.9375rem;
	transition: border-color var(--ff-dur-fast) var(--ff-ease),
	            box-shadow var(--ff-dur-fast) var(--ff-ease);
}

body.flanfudge-shop .form-row textarea {
	min-height: 110px;
	padding: 12px 14px;
	resize: vertical;
}

body.flanfudge-shop .form-row input:focus,
body.flanfudge-shop .form-row textarea:focus,
body.flanfudge-shop .form-row select:focus {
	outline: none;
	border-color: var(--ff-foreground);
	box-shadow: 0 0 0 3px rgb(31 42 36 / 0.10);
}

/* Block checkout — billing / shipping address form field rhythm */
body.flanfudge-shop.woocommerce-checkout .wc-block-components-address-form {
	gap: var(--ff-space-3);
	row-gap: var(--ff-space-3);
	column-gap: var(--ff-space-3);
}

/* Country → last name (and similar stacked pairs when grid gap is collapsed) */
body.flanfudge-shop.woocommerce-checkout
.wc-block-components-country-input.wc-block-components-address-form__country
+ .wc-block-components-text-input.wc-block-components-address-form__last_name,
body.flanfudge-shop.woocommerce-checkout
.wc-block-components-address-form__country
+ .wc-block-components-address-form__last_name {
	margin-top: var(--ff-space-3);
}

body.flanfudge-shop.woocommerce-checkout
.wc-block-components-address-form__country {
	margin-bottom: var(--ff-space-3);
}

/* Last name after country (or any non–first-name field), not beside first name */
body.flanfudge-shop.woocommerce-checkout
.wc-block-components-text-input.wc-block-components-address-form__last_name {
	margin-top: var(--ff-space-3);
}

@media (min-width: 640px) {
	body.flanfudge-shop.woocommerce-checkout
	.wc-block-components-address-form__first_name
	+ .wc-block-components-address-form__last_name {
		margin-top: 0;
	}
}

/* Mobile — equal vertical gap between first name, last name, and country */
@media (max-width: 639.99px) {
	body.flanfudge-shop.woocommerce-checkout .wc-block-components-address-form {
		display: grid;
		grid-template-columns: minmax(0, 1fr);
		gap: var(--ff-space-3);
		row-gap: var(--ff-space-3);
	}

	body.flanfudge-shop.woocommerce-checkout
	.wc-block-components-address-form__first_name,
	body.flanfudge-shop.woocommerce-checkout
	.wc-block-components-address-form__last_name,
	body.flanfudge-shop.woocommerce-checkout
	.wc-block-components-address-form__country,
	body.flanfudge-shop.woocommerce-checkout
	.wc-block-components-country-input.wc-block-components-address-form__country {
		grid-column: 1 / -1;
		margin-top: 0;
		margin-bottom: 0;
	}

	body.flanfudge-shop.woocommerce-checkout
	.wc-block-components-address-form__first_name
	+ .wc-block-components-address-form__last_name,
	body.flanfudge-shop.woocommerce-checkout
	.wc-block-components-address-form__last_name
	+ .wc-block-components-address-form__country,
	body.flanfudge-shop.woocommerce-checkout
	.wc-block-components-address-form__last_name
	+ .wc-block-components-country-input.wc-block-components-address-form__country {
		margin-top: var(--ff-space-3);
	}
}

body.flanfudge-shop .select2-container--default .select2-selection--single .select2-selection__rendered {
	line-height: 44px;
	color: var(--ff-foreground);
	padding-left: 0;
}

body.flanfudge-shop .select2-container--default .select2-selection--single .select2-selection__arrow {
	height: 44px;
}

body.flanfudge-shop #order_review_heading {
	display: none; /* The order review card has its own header below. */
}

body.flanfudge-shop .woocommerce-checkout-review-order {
	background: var(--ff-card);
	border: 1px solid var(--ff-border);
	border-radius: var(--ff-radius-lg);
	padding: 24px;
	position: sticky;
	top: 88px;
}

body.flanfudge-shop .woocommerce-checkout-review-order::before {
	content: "Order Summary";
	display: block;
	font-size: 1.125rem;
	font-weight: var(--ff-weight-medium);
	color: var(--ff-foreground);
	letter-spacing: -0.01em;
	margin-bottom: var(--ff-space-3);
}

body.flanfudge-shop .woocommerce-checkout-review-order table {
	margin: 0;
}

body.flanfudge-shop .woocommerce-checkout-review-order .product-name {
	color: var(--ff-foreground);
	font-weight: var(--ff-weight-medium);
}

body.flanfudge-shop .woocommerce-checkout-review-order tfoot th {
	font-weight: var(--ff-weight-semibold);
}

body.flanfudge-shop .woocommerce-checkout-review-order .order-total td {
	font-size: 1.125rem;
	font-weight: var(--ff-weight-bold);
	color: var(--ff-foreground);
}

body.flanfudge-shop #payment {
	background: transparent;
	margin-top: var(--ff-space-4);
}

body.flanfudge-shop #payment ul.payment_methods {
	background: var(--ff-cream-soft);
	border: 1px solid var(--ff-border);
	border-radius: var(--ff-radius);
	padding: 12px 16px;
	margin: 0;
}

body.flanfudge-shop #payment ul.payment_methods li {
	background: transparent;
	border: 0;
	padding: 8px 0;
}

body.flanfudge-shop #payment .payment_box {
	background: var(--ff-bg);
	border-radius: var(--ff-radius);
	padding: 14px 16px;
	color: var(--ff-muted-fg);
	font-size: 0.875rem;
	margin-top: 8px;
}

body.flanfudge-shop #place_order {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 52px;
	margin-top: var(--ff-space-4);
	padding: 0 24px;
	border-radius: var(--ff-radius-pill);
	background: var(--ff-foreground);
	color: var(--ff-cream);
	border: 1px solid var(--ff-foreground);
	font-family: inherit;
	font-size: 1rem;
	font-weight: var(--ff-weight-semibold);
	letter-spacing: 0.005em;
}

body.flanfudge-shop #place_order:hover {
	background: var(--ff-olive-soft);
	border-color: var(--ff-olive-soft);
}

/* Notices */

body.flanfudge-shop .woocommerce-notices-wrapper .woocommerce-message,
body.flanfudge-shop .woocommerce-notices-wrapper .woocommerce-info,
body.flanfudge-shop .woocommerce-notices-wrapper .woocommerce-error {
	background: var(--ff-cream-soft);
	color: var(--ff-foreground);
	border-radius: var(--ff-radius);
	border: 1px solid var(--ff-border);
	padding: 14px 18px;
	margin-bottom: var(--ff-space-4);
}

body.flanfudge-shop .woocommerce-notices-wrapper .woocommerce-message::before,
body.flanfudge-shop .woocommerce-notices-wrapper .woocommerce-info::before,
body.flanfudge-shop .woocommerce-notices-wrapper .woocommerce-error::before {
	color: var(--ff-accent);
}

body.flanfudge-shop .woocommerce-notices-wrapper a.button {
	display: inline-flex;
	align-items: center;
	min-height: 36px;
	padding: 0 16px;
	border-radius: var(--ff-radius-pill);
	background: var(--ff-foreground);
	color: var(--ff-cream);
	font-size: 0.8125rem;
	font-weight: var(--ff-weight-semibold);
	text-decoration: none;
}

/* =========================================================================
 * 6. Order received (thank you) — billing + shipping side by side
 * ========================================================================= */

body.flanfudge-shop.woocommerce-order-received .woocommerce-customer-details {
	margin-top: var(--ff-space-6);
	padding: 0;
}

body.flanfudge-shop.woocommerce-order-received
.woocommerce-customer-details .woocommerce-columns--addresses,
body.flanfudge-shop.woocommerce-order-received
.woocommerce-customer-details .woocommerce-columns.addresses,
body.flanfudge-shop.woocommerce-order-received
.woocommerce-customer-details .col2-set.addresses {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: clamp(20px, 3vw, 32px);
	align-items: start;
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
	float: none;
	clear: none;
}

body.flanfudge-shop.woocommerce-order-received
.woocommerce-customer-details .woocommerce-columns--addresses::before,
body.flanfudge-shop.woocommerce-order-received
.woocommerce-customer-details .woocommerce-columns--addresses::after,
body.flanfudge-shop.woocommerce-order-received
.woocommerce-customer-details .col2-set.addresses::before,
body.flanfudge-shop.woocommerce-order-received
.woocommerce-customer-details .col2-set.addresses::after {
	display: none;
	content: none;
}

body.flanfudge-shop.woocommerce-order-received
.woocommerce-customer-details .woocommerce-column,
body.flanfudge-shop.woocommerce-order-received
.woocommerce-customer-details .woocommerce-column--billing-address,
body.flanfudge-shop.woocommerce-order-received
.woocommerce-customer-details .woocommerce-column--shipping-address,
body.flanfudge-shop.woocommerce-order-received
.woocommerce-customer-details .col-1,
body.flanfudge-shop.woocommerce-order-received
.woocommerce-customer-details .col-2 {
	width: 100%;
	max-width: none;
	float: none;
	clear: none;
	margin: 0;
	padding: 0;
}

body.flanfudge-shop.woocommerce-order-received
.woocommerce-customer-details .woocommerce-column__title {
	font-size: 1.125rem;
	font-weight: var(--ff-weight-medium);
	letter-spacing: -0.01em;
	margin: 0 0 var(--ff-space-3);
}

body.flanfudge-shop.woocommerce-order-received
.woocommerce-customer-details address {
	font-style: normal;
	line-height: 1.55;
	margin: 0 0 var(--ff-space-3);
}

@media (max-width: 639.99px) {
	body.flanfudge-shop.woocommerce-order-received
	.woocommerce-customer-details .woocommerce-columns--addresses,
	body.flanfudge-shop.woocommerce-order-received
	.woocommerce-customer-details .col2-set.addresses {
		grid-template-columns: 1fr;
		gap: var(--ff-space-4);
	}
}
