/*
 * My House Aura - checkout.
 *
 * Two columns like the reference: address, delivery and payment on the left, the order summary in a
 * sticky rail on the right. WooCommerce's own field markup is restyled in place rather than replaced.
 */

/* The theme puts a clearfix ::before/::after on form.checkout. In a grid container a generated box is
   a GRID ITEM: it took the first cell, which pushed the form into column 2 (380px) and the rail onto
   a second row (1172px) - the exact reverse of the intended layout, with no placement rule anywhere
   to explain it. */
/* The theme prints the page's own <h1>Checkout</h1> banner above the form, and WooCommerce prints a
   blue "Have a coupon?" notice - the rail carries its own promo panel, and the steps carry their own
   headings, so both are noise here. WooCommerce's "Billing details" heading duplicates ours too. */
body.woocommerce-checkout .entry-header,
body.woocommerce-checkout .woocommerce-form-coupon-toggle,
.aura-checkout .woocommerce-billing-fields > h3,
.aura-checkout .woocommerce-shipping-fields > h3 { display: none; }

form.checkout.aura-checkout::before,
form.checkout.aura-checkout::after {
	content: none !important;
	display: none !important;
}

.aura-checkout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 380px;
	gap: 32px;
	align-items: start;
	padding: 24px 0 64px;
}
.aura-checkout__main { min-width: 0; }

.aura-checkout__h {
	margin: 0 0 16px;
	font-size: 20px; font-weight: 700;
	color: var(--aura-ink, #3B2F2F);
}
.aura-checkout__h--rail { font-size: 17px; }

.aura-checkout__step {
	padding: 0 0 24px;
	margin: 0 0 24px;
	border-bottom: 1px solid var(--aura-line, #DADCDF);
}
.aura-checkout__step:last-child { border-bottom: 0; margin-bottom: 0; }

/* ------------------------------------------------------------------ WooCommerce's fields */

.aura-checkout .woocommerce-billing-fields__field-wrapper,
.aura-checkout .woocommerce-shipping-fields__field-wrapper,
.aura-checkout .woocommerce-additional-fields__field-wrapper {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px 16px;
}
.aura-checkout .form-row { margin: 0; padding: 0; }
/* the fields that deserve the full width */
.aura-checkout #billing_address_1_field,
.aura-checkout #billing_address_2_field,
.aura-checkout #billing_company_field,
.aura-checkout #shipping_address_1_field,
.aura-checkout #shipping_address_2_field,
.aura-checkout .form-row-wide { grid-column: 1 / -1; }

.aura-checkout .form-row label {
	display: block; margin: 0 0 5px;
	font-size: 13px; color: var(--aura-body, #2F3337);
}
.aura-checkout .form-row .required { color: var(--aura-sale, #C52D05); text-decoration: none; }

.aura-checkout .input-text,
.aura-checkout select,
.aura-checkout textarea,
.aura-checkout .select2-container .select2-selection--single {
	width: 100%; box-sizing: border-box;
	min-height: 46px; padding: 11px 13px;
	border: 1px solid var(--aura-line, #DADCDF); border-radius: 4px;
	background: #fff;
	font: inherit; font-size: 15px; color: var(--aura-ink, #3B2F2F);
}
.aura-checkout textarea { min-height: 96px; }
.aura-checkout .input-text:focus,
.aura-checkout select:focus,
.aura-checkout textarea:focus {
	outline: 2px solid var(--aura-navy, #0D396A); outline-offset: 1px; border-color: transparent;
}
/* select2, which WooCommerce uses for country and state */
.aura-checkout .select2-container .select2-selection--single { display: flex; align-items: center; }
.aura-checkout .select2-container--default .select2-selection--single .select2-selection__arrow { height: 44px; }

/* ------------------------------------------------------------------ the extra rows */

.aura-checkout__row { margin: 0 0 12px; }
.aura-checkout__toggle {
	display: flex; align-items: flex-start; gap: 11px;
	margin: 0; padding: 14px;
	border: 1px solid var(--aura-line, #DADCDF); border-radius: 4px;
	cursor: pointer; font-size: 14px;
}
.aura-checkout__toggle:hover { border-color: var(--aura-navy, #0D396A); }
.aura-checkout__toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.aura-checkout__box {
	width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px;
	border: 1px solid #8a8a8a; border-radius: 3px;
	background: #fff; position: relative;
}
.aura-checkout__toggle input:checked + .aura-checkout__box {
	border-color: var(--aura-navy, #0D396A);
	background: var(--aura-navy, #0D396A);
}
.aura-checkout__toggle input:checked + .aura-checkout__box::after {
	content: ""; position: absolute;
	left: 6px; top: 2px; width: 4px; height: 9px;
	border-right: 2px solid #fff; border-bottom: 2px solid #fff;
	transform: rotate(45deg);
}
.aura-checkout__toggle input:focus-visible + .aura-checkout__box {
	outline: 2px solid var(--aura-navy, #0D396A); outline-offset: 2px;
}
.aura-checkout__toggle-text { flex: 1 1 auto; min-width: 0; }
.aura-checkout__toggle-text small { display: block; margin-top: 2px; color: var(--aura-muted, #736D63); }
.aura-checkout__toggle-price { flex: 0 0 auto; font-weight: 700; }
.aura-checkout__gift { margin: 10px 0 0; }
.aura-checkout__gift[hidden] { display: none; }

/* ------------------------------------------------------------------ the rail */

.aura-checkout__rail { position: sticky; top: 16px; }
.aura-checkout__panel {
	padding: 18px 20px;
	border: 1px solid var(--aura-line, #DADCDF); border-radius: 4px;
	background: #F7F5F0;
}

.aura-checkout__promo { padding: 0 0 14px; margin: 0 0 14px; border-bottom: 1px solid var(--aura-line, #DADCDF); }
.aura-checkout__promo-toggle {
	display: flex; align-items: center; gap: 8px;
	width: 100%; min-width: 0; min-height: 0; margin: 0; padding: 0;
	border: 0; background: none; cursor: pointer;
	font: inherit; font-size: 15px; font-weight: 700; text-align: left;
	color: var(--aura-ink, #3B2F2F);
}
.aura-checkout__promo-body { margin-top: 10px; font-size: 13px; }
.aura-checkout__promo-body a { color: var(--aura-navy, #0D396A); text-decoration: underline; }

.aura-checkout__items { margin: 0 0 14px; padding: 0; list-style: none; }
.aura-checkout__items li {
	display: flex; align-items: flex-start; gap: 11px;
	padding: 10px 0;
	border-bottom: 1px solid rgba(0, 0, 0, .06);
	font-size: 13px;
}
.aura-checkout__item-pic { flex: 0 0 52px; }
.aura-checkout__item-pic img { display: block; width: 52px; height: auto; border-radius: 3px; }
.aura-checkout__item-body { flex: 1 1 auto; min-width: 0; }
.aura-checkout__item-name { display: block; font-weight: 600; }
.aura-checkout__item-addon { display: block; color: var(--aura-muted, #736D63); }
.aura-checkout__item-qty { display: block; color: var(--aura-muted, #736D63); }
.aura-checkout__item-price { flex: 0 0 auto; font-weight: 700; }

.aura-checkout__saved {
	margin: 0 0 12px; padding: 8px 10px;
	background: #fff; border-radius: 3px;
	font-size: 13px;
}
.aura-checkout__saved strong { color: var(--aura-sale, #C52D05); }

.aura-checkout__figures {
	display: grid; grid-template-columns: 1fr auto; gap: 8px 12px;
	margin: 0 0 12px; font-size: 14px;
}
.aura-checkout__figures dt { margin: 0; }
.aura-checkout__figures dd { margin: 0; text-align: right; }
.aura-checkout__figures dd.is-save { color: var(--aura-sale, #C52D05); }
.aura-checkout__shipping ul { margin: 0; padding: 0; list-style: none; }
.aura-checkout__shipping label { font-size: 13px; }

.aura-checkout__total {
	display: flex; align-items: baseline; justify-content: space-between;
	margin: 0 0 14px; padding-top: 12px;
	border-top: 1px solid var(--aura-line, #DADCDF);
	font-size: 16px; font-weight: 700;
}
.aura-checkout__total strong { font-size: 22px; }

/* ------------------------------------------------------------------ WooCommerce's payment box */

#payment { background: none; border-radius: 0; }
#payment ul.payment_methods {
	margin: 0 0 14px; padding: 0;
	border: 1px solid var(--aura-line, #DADCDF); border-radius: 4px;
	background: #fff;
	list-style: none;
}
#payment ul.payment_methods li { padding: 14px; border-bottom: 1px solid var(--aura-line, #DADCDF); }
#payment ul.payment_methods li:last-child { border-bottom: 0; }
#payment ul.payment_methods label { font-size: 15px; font-weight: 600; }
#payment .payment_box {
	margin: 10px 0 0; padding: 12px;
	background: #F7F5F0; border-radius: 3px;
	font-size: 13px; color: var(--aura-body, #2F3337);
}
#payment .payment_box::before { display: none; }

#payment .place-order { padding: 0; margin: 0; }
#place_order,
.aura-checkout #place_order {
	display: flex; align-items: center; justify-content: center;
	width: 100%; min-height: 52px; padding: 14px 20px;
	border: 0; border-radius: 3px;
	background: var(--aura-ink, #3B2F2F); cursor: pointer;
	font: inherit; font-size: 16px; font-weight: 700; color: #fff;
}
#place_order:hover { background: #2a221f; }
.woocommerce-terms-and-conditions-wrapper { margin: 0 0 12px; font-size: 12px; }
.woocommerce-privacy-policy-text { font-size: 12px; color: var(--aura-muted, #736D63); }

/* ------------------------------------------------------------------ narrower */

@media (max-width: 1100px) {
	.aura-checkout { grid-template-columns: minmax(0, 1fr); }
	.aura-checkout__rail { position: static; }
}
@media (max-width: 700px) {
	.aura-checkout .woocommerce-billing-fields__field-wrapper,
	.aura-checkout .woocommerce-shipping-fields__field-wrapper { grid-template-columns: minmax(0, 1fr); }
	.aura-checkout__h { font-size: 18px; }
}
