/* Classic WooCommerce checkout/cart, restyled to match the site's visual language. */

/* Visually move phone right after the name row, regardless of the field
   array's actual server-side order (WooCommerce's internal field caching
   made the `priority` filter unreliable in testing -- CSS order is exact). */
.woocommerce-billing-fields__field-wrapper {
	display: flex;
	flex-wrap: wrap;
	gap: 0 var(--space-4);
}
.woocommerce-billing-fields__field-wrapper > .form-row { flex: 1 1 100%; }
#billing_first_name_field,
#billing_last_name_field { flex: 1 1 calc(50% - var(--space-2)); }
#billing_phone_field { order: 1; }
#billing_country_field { order: 2; }
#billing_address_1_field { order: 3; }
#billing_address_2_field { order: 4; }
#billing_city_field { order: 5; }
#billing_state_field { order: 6; }
#billing_postcode_field { order: 7; }
#billing_email_field { order: 8; }

@media (max-width: 599px) {
	#billing_first_name_field,
	#billing_last_name_field { flex: 1 1 100%; }
}

/* Page shell */
.woocommerce-cart .site-main, .woocommerce-checkout .site-main { padding-bottom: var(--space-24); }
.woocommerce-cart .container > h1, .woocommerce-checkout .container > h1 { margin-top: var(--space-4); }

/* Shared field styling (cart coupon fields + all checkout inputs) */
.woocommerce form .form-row label { font-size: var(--text-sm); font-weight: 500; color: var(--color-ink); margin-bottom: var(--space-1); display: block; }
.woocommerce form .form-row .required { color: var(--color-accent); text-decoration: none; }
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select,
.woocommerce-cart table.cart td.actions .coupon input.input-text {
	width: 100%;
	height: 48px;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	padding-inline: var(--space-4);
	font-size: var(--text-base);
	color: var(--color-ink);
	font-family: var(--font-body);
}
.woocommerce form .form-row textarea { height: auto; padding-block: var(--space-3); }
.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus,
.woocommerce form .form-row select:focus {
	outline: 2px solid var(--color-accent);
	outline-offset: 2px;
	border-color: var(--color-accent);
}
.woocommerce form .form-row { margin-bottom: var(--space-4); }
.woocommerce-billing-fields h3, .woocommerce-additional-fields h3, #order_review_heading {
	font-family: var(--font-heading);
	font-weight: 600;
	font-size: var(--text-lg);
	color: var(--color-heading);
	margin-block: var(--space-8) var(--space-4);
}
.woocommerce-billing-fields__field-wrapper #billing_country_field .select2-container,
.woocommerce form .form-row select { appearance: none; }

/* Notices */
.woocommerce-error, .woocommerce-message, .woocommerce-info {
	list-style: none;
	padding: var(--space-4);
	border-radius: var(--radius-md);
	background: var(--color-surface);
	border-inline-start: 3px solid var(--color-accent);
	font-size: var(--text-sm);
	color: var(--color-ink);
	margin-bottom: var(--space-6);
}
.woocommerce-message { border-inline-start-color: var(--color-success); }

/* Order review / summary table (checkout) */
#order_review { background: var(--color-surface); border-radius: var(--radius-md); box-shadow: var(--shadow-card); padding: var(--space-6); }
table.shop_table { width: 100%; border-collapse: collapse; }
table.shop_table thead { display: none; }
table.shop_table .cart_item td { padding-block: var(--space-3); font-size: var(--text-sm); border-bottom: 1px solid var(--color-border); }
table.shop_table .cart-subtotal td, table.shop_table .order-total td, table.shop_table tr:not(.cart_item) td {
	padding-block: var(--space-3);
	font-size: var(--text-sm);
	color: var(--color-muted);
	border: none;
}
table.shop_table .order-total td { font-family: var(--font-heading); font-weight: 600; font-size: var(--text-lg); color: var(--color-heading); border-top: 1px solid var(--color-border); padding-top: var(--space-4); }
table.shop_table .order-total th { border-top: 1px solid var(--color-border); padding-top: var(--space-4); font-family: var(--font-heading); font-weight: 600; color: var(--color-heading); }
table.shop_table th { text-align: left; font-size: var(--text-sm); color: var(--color-muted); font-weight: 400; }

/* Payment section (gateway-agnostic styling) */
#payment { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-6); margin-top: var(--space-6); }
ul.wc_payment_methods { list-style: none; margin: 0; padding: 0; }
ul.wc_payment_methods li.wc_payment_method { padding-block: var(--space-3); border-bottom: 1px solid var(--color-border); }
ul.wc_payment_methods li.wc_payment_method:last-child { border-bottom: none; }
.wc_payment_method label { font-size: var(--text-base); font-weight: 500; color: var(--color-ink); }
.wc_payment_method .payment_box {
	margin-top: var(--space-3);
	padding: var(--space-4);
	background: var(--color-bg);
	border-radius: var(--radius-sm);
	font-size: var(--text-sm);
	color: var(--color-muted);
	line-height: var(--leading-body);
}
.wc_payment_method .payment_box p { margin: 0; }
#place_order {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 48px;
	margin-top: var(--space-6);
	border: none;
	border-radius: var(--radius-pill);
	background: var(--color-primary);
	color: #fff;
	font-family: var(--font-body);
	font-size: var(--text-sm);
	font-weight: 600;
	cursor: pointer;
	transition: background var(--transition);
}
#place_order:hover { background: var(--color-primary-hover); }
.woocommerce-terms-and-conditions-wrapper { font-size: var(--text-xs); color: var(--color-muted); margin-top: var(--space-3); }
.woocommerce-terms-and-conditions-wrapper a { color: var(--color-accent); text-decoration: underline; }

/* Cart page */
.woocommerce-cart table.cart { width: 100%; border-collapse: collapse; margin-top: var(--space-8); }
.woocommerce-cart table.cart thead { display: none; }
.woocommerce-cart table.cart td { padding-block: var(--space-6); border-bottom: 1px solid var(--color-border); vertical-align: middle; }
.woocommerce-cart table.cart td.product-thumbnail img { width: 96px; height: 115px; object-fit: cover; border-radius: var(--radius-sm); }
.woocommerce-cart table.cart td.product-name a { font-family: var(--font-heading); font-weight: 600; font-size: var(--text-base); color: var(--color-heading); text-decoration: none; }
.woocommerce-cart table.cart td.product-price { font-size: var(--text-sm); color: var(--color-muted); }
.woocommerce-cart table.cart td.product-quantity .qty { width: 64px; height: 40px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); text-align: center; }
.woocommerce-cart table.cart td.product-subtotal { font-family: var(--font-heading); font-weight: 600; text-align: right; }
.woocommerce-cart table.cart td.product-remove a { color: var(--color-muted); font-size: var(--text-lg); text-decoration: none; }
.woocommerce-cart table.cart td.product-remove a:hover { color: var(--color-accent); }
.woocommerce-cart table.cart td.actions { border-bottom: none; padding-top: var(--space-6); }
.woocommerce-cart table.cart td.actions .coupon { display: flex; gap: var(--space-2); align-items: center; }
.woocommerce-cart table.cart td.actions .coupon input.input-text { width: auto; flex: 1; max-width: 240px; }
.woocommerce-cart table.cart td.actions .button { height: 44px; }
.cart-collaterals { margin-top: var(--space-8); display: flex; justify-content: flex-end; }
.cart-collaterals .cart_totals { width: 100%; max-width: 400px; background: var(--color-surface); border-radius: var(--radius-md); box-shadow: var(--shadow-card); padding: var(--space-6); }
.cart-collaterals .cart_totals h2 { font-family: var(--font-heading); font-weight: 600; font-size: var(--text-lg); color: var(--color-heading); margin-bottom: var(--space-4); }
.cart-collaterals .wc-proceed-to-checkout { margin-top: var(--space-6); }
.cart-collaterals .wc-proceed-to-checkout .checkout-button { display: flex; align-items: center; justify-content: center; width: 100%; height: 48px; border-radius: var(--radius-pill); background: var(--color-primary); color: #fff; text-decoration: none; font-size: var(--text-sm); font-weight: 600; }
.cart-collaterals .wc-proceed-to-checkout .checkout-button:hover { background: var(--color-primary-hover); }

/* Thank-you page */
.woocommerce-order-received h1 { margin-top: var(--space-8); }
.woocommerce-thankyou-order-details { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-6); margin: var(--space-6) 0; }
.woocommerce-thankyou-order-details li { font-size: var(--text-sm); color: var(--color-muted); }
.woocommerce-thankyou-order-details li strong { display: block; color: var(--color-heading); font-family: var(--font-heading); font-weight: 600; margin-top: var(--space-1); }

@media (max-width: 899px) {
	.woocommerce-cart table.cart td.product-thumbnail { width: 80px; }
	.woocommerce-cart table.cart td.product-thumbnail img { width: 80px; height: 96px; }
}
