/*
 * Allergy Buddy — WooCommerce cart / checkout brand styling.
 * Styles the native Woo Blocks to the brand (no markup changes — keeps the
 * commerce intact). Loaded on cart/checkout/account only. The account area
 * itself is assets/css/account-v2/*.
 */

/* contain the cart/checkout blocks on wide viewports */
.wp-block-woocommerce-cart, .wp-block-woocommerce-checkout,
.woocommerce-cart .entry-content, .woocommerce-checkout .entry-content { max-width: 1200px; margin-inline: auto; }

/* ─── Buttons (blocks + classic) → accent pill ─── */
.woocommerce .wc-block-components-button.contained,
.woocommerce a.button, .woocommerce button.button, .woocommerce input.button,
.woocommerce #respond input#submit, .wp-block-button__link, .wc-block-components-button.wc-block-components-button.contained {
	background-color: var(--accent);
	color: #fff;
	border: 1.5px solid var(--accent);
	border-radius: 999px;
	font-family: var(--font-sans);
	font-weight: 500;
	letter-spacing: 0;
	transition: background-color .18s, border-color .18s;
}
.woocommerce .wc-block-components-button.contained:hover,
.woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce input.button:hover,
.wc-block-components-button.contained:hover {
	background-color: var(--accent-deep);
	border-color: var(--accent-deep);
	color: #fff;
}
.wc-block-components-button.outlined, .woocommerce a.button.alt.wc-forward {
	border-radius: 999px;
}
/* secondary / ghost buttons */
.wc-block-components-button:not(.contained) {
	color: var(--accent);
}

/* ─── Inputs ─── */
.woocommerce .wc-block-components-text-input input,
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce .select2-container .select2-selection,
.wc-block-components-text-input input.input-text,
.wc-block-checkout select, .wc-block-components-combobox input {
	border-radius: 10px !important;
	border: 1.5px solid var(--line-2) !important;
	font-family: var(--font-sans);
	background: var(--bg);
}
/* Accent ring on focus only. NB: .is-active means "has a value" (floated label),
   NOT focused — highlighting it painted every filled field as if it were an error. */
.woocommerce form .form-row input.input-text:focus,
.wc-block-components-text-input input:focus {
	border-color: var(--accent) !important;
	box-shadow: 0 0 0 3px var(--accent-soft) !important;
	background: var(--paper);
}
.wc-block-components-text-input.is-active label,
.wc-block-components-checkout-step--with-step-number .wc-block-components-checkout-step__title { color: var(--ink); }

/* ─── Headings / steps ─── */
.wc-block-components-title, .woocommerce-cart h1, .woocommerce-checkout h1,
.wc-block-components-checkout-step__title, .wc-block-cart__totals-title, .wc-block-components-totals-item__label {
	font-family: var(--font-sans);
	color: var(--ink);
	letter-spacing: -0.02em;
}
.wc-block-components-checkout-step__heading-content { color: var(--ink-2); }

/* Checkout section headers → mockup's mono-uppercase labels with an underline. */
.wc-block-components-checkout-step__title {
	font-family: var(--font-mono);
	font-weight: 500;
	font-size: 13px;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--ink-3);
}
.wc-block-components-checkout-step__heading {
	padding-bottom: 12px;
	border-bottom: 1px solid var(--line);
	margin-bottom: 6px;
}

/* ─── Order summary / totals sidebar → paper card ─── */
.wc-block-checkout__sidebar .wc-block-components-totals-wrapper,
.wp-block-woocommerce-checkout-order-summary-block,
.wc-block-cart__totals-title + .wc-block-components-totals-wrapper,
.wc-block-cart .wc-block-cart__sidebar .is-large {
	background: var(--bg-2);
	border: 1px solid var(--line);
	border-radius: 16px;
}
.wc-block-components-totals-item__value, .wc-block-formatted-money-amount { font-family: var(--font-mono); color: var(--ink); }
.wc-block-components-totals-footer-item .wc-block-components-totals-item__value { color: var(--ink); font-weight: 600; }

/* ─── Payment + shipping option cards (mockup .pay-option) ───
   The radio <input> is position:absolute left:16px top:16px, so the option needs
   left padding to clear it and enough block padding for the radio not to spill. */
.wc-block-components-radio-control__option,
.wc-block-components-radio-control-accordion-option {
	border: 1.5px solid var(--line-2);
	border-radius: 12px;
	margin-bottom: 12px;
	padding: 15px 18px 15px 48px;
}
.wc-block-components-radio-control__option:last-child,
.wc-block-components-radio-control-accordion-option:last-child { margin-bottom: 0; }

/* The radio dot itself, vertically aligned to the first label line + brand colour. */
.wc-block-components-radio-control__input { left: 18px; top: 17px; accent-color: var(--accent); }

/* Selected option → accent ring + soft wash (actual checked classes). */
.wc-block-components-radio-control__option-checked,
.wc-block-components-radio-control__option--checked-option-highlighted,
.wc-block-components-radio-control-accordion-option--checked-option-highlighted {
	border-color: var(--accent);
	background: var(--accent-soft);
}

/* Label / price typography to match the mockup. */
.wc-block-components-radio-control__label { font-weight: 600; font-size: 15px; color: var(--ink); }
.wc-block-components-radio-control__description { font-size: 13px; color: var(--ink-2); margin-top: 3px; }
.wc-block-components-radio-control__secondary-label,
.wc-block-components-radio-control__secondary-description { font-family: var(--font-mono); font-size: 12px; color: var(--ink); }
.ab-po-fields .ab-po-label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); display: block; margin: 10px 0 5px; }
.ab-po-fields .ab-po-input { width: 100%; padding: 12px 13px; border: 1.5px solid var(--line-2); border-radius: 10px; font-family: var(--font-sans); font-size: 15px; }
.ab-po-fields .ab-po-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ab-po-desc { font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }

/* ───────────────── CHECKOUT FOCUS (Checkout block, payment step) ─────────
   Body class from inc/woo-checkout-focus.php. Blue stands in for red here:
   a checkout should feel calm. Spacing and 1px outlines follow Shopify's
   checkout — hairline borders, a 1px focus ring, room between sections.
   The block markup is untouched. */
body.ab-checkout-focus {
	--accent: var(--blue);
	--accent-deep: #1c3468;
	--accent-soft: #e4ebf6;
	background: var(--bg);
}
.ab-checkout-focus .ab-topbar,
.ab-checkout-focus #masthead,
.ab-checkout-focus .site-header { display: none !important; }
.ab-checkout-focus .site-content,
.ab-checkout-focus .inside-article { background: var(--bg); }

/* Same lockup as the site header, on a quiet bar. */
.ab-checkout-header {
	position: sticky;
	top: var(--ab-admin, 0px);
	z-index: 20;
	background: var(--bg);
	border-bottom: 1px solid var(--line);
}
.ab-checkout-header__inner {
	max-width: 1080px;
	margin-inline: auto;
	min-height: 96px;
	padding: 8px 28px;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}
.ab-checkout-header__logo { display: inline-flex; align-items: center; color: var(--ink); text-decoration: none; line-height: 0; }
.ab-checkout-header__logo img { display: block; height: 74px; width: auto; transform: translateY(-4px); }
.ab-checkout-header__cart {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 999px;
	color: var(--ink);
	text-decoration: none;
	transform: translateY(8px);
}
.ab-checkout-header__cart:hover,
.ab-checkout-header__cart:focus-visible { background: var(--accent-soft); color: var(--ink); }
.ab-checkout-header__count {
	position: absolute;
	top: 0;
	right: 0;
	min-width: 18px;
	height: 18px;
	padding-inline: 5px;
	border-radius: 999px;
	background: var(--accent);
	color: #fff;
	font: 600 11px/18px var(--mono);
	text-align: center;
	box-sizing: border-box;
}

/* The page title is the logo. GeneratePress's "Checkout" heading sits
   full-bleed and out of the column — drop it on the payment step only. */
.ab-checkout-focus .entry-header { display: none; }
.ab-checkout-focus .entry-content,
.ab-checkout-focus .wp-block-woocommerce-checkout {
	max-width: 1080px;
	box-sizing: border-box;
}
.ab-checkout-focus .entry-content {
	margin-top: 40px;
	margin-bottom: 72px;
	padding-inline: 28px;
}

/* Sections breathe. Shopify leaves a clear gap between groups and does not
   underline the label. */
.ab-checkout-focus .wc-block-components-checkout-step { margin-bottom: 48px; }
.ab-checkout-focus .wc-block-components-checkout-step:last-child { margin-bottom: 0; }
.ab-checkout-focus .wc-block-components-checkout-step__heading {
	border: 0;
	padding: 0;
	margin: 0;
}
.ab-checkout-focus .wc-block-components-checkout-step__heading-container { margin-bottom: 16px; }
.ab-checkout-focus .wc-block-components-checkout-step__title {
	font-family: var(--font-sans);
	font-weight: 500;
	font-size: 18px;
	letter-spacing: -0.02em;
	text-transform: none;
	color: var(--ink);
}
.ab-checkout-focus .wc-block-components-checkout-step__description,
.ab-checkout-focus .wc-block-components-checkout-step__heading-content {
	color: var(--ink-2);
	font-size: 14px;
	line-height: 1.45;
}

/* Fields: 1px outline, 6px radius, 1px blue ring on focus. */
.ab-checkout-focus .wc-block-components-text-input input,
.ab-checkout-focus .wc-block-components-combobox input,
.ab-checkout-focus .wc-blocks-components-select__select,
.ab-checkout-focus .wc-block-components-form select,
.ab-checkout-focus .ab-po-fields .ab-po-input {
	border: 1px solid var(--line-2) !important;
	border-radius: 6px !important;
	background: var(--paper) !important;
	box-shadow: none !important;
	min-height: 48px;
	color: var(--ink);
}
.ab-checkout-focus .wc-block-components-text-input input:focus,
.ab-checkout-focus .wc-block-components-combobox input:focus,
.ab-checkout-focus .wc-blocks-components-select__select:focus,
.ab-checkout-focus .wc-block-components-form select:focus,
.ab-checkout-focus .ab-po-fields .ab-po-input:focus {
	border-color: var(--accent) !important;
	box-shadow: 0 0 0 1px var(--accent) !important;
	outline: none;
	background: var(--paper) !important;
}
.ab-checkout-focus .wc-block-components-checkbox__input,
.ab-checkout-focus .wc-block-components-radio-control__input { accent-color: var(--accent); }

/* Option rows: hairline card, blue ring when chosen, no colour wash. */
.ab-checkout-focus .wc-block-components-radio-control__option,
.ab-checkout-focus .wc-block-components-radio-control-accordion-option {
	border: 1px solid var(--line-2) !important;
	border-radius: 8px !important;
	background: var(--paper);
	box-shadow: none;
	margin-bottom: 12px;
	padding: 16px 16px 16px 48px;
}
.ab-checkout-focus .wc-block-components-radio-control__option:last-child,
.ab-checkout-focus .wc-block-components-radio-control-accordion-option:last-child { margin-bottom: 0; }
.ab-checkout-focus .wc-block-components-radio-control__option-checked,
.ab-checkout-focus .wc-block-components-radio-control__option--checked-option-highlighted,
.ab-checkout-focus .wc-block-components-radio-control-accordion-option--checked-option-highlighted {
	border-color: var(--accent) !important;
	box-shadow: 0 0 0 1px var(--accent) !important;
	background: var(--paper);
}
.ab-checkout-focus .wc-block-components-radio-control__input {
	border-color: color-mix(in srgb, var(--ink) 35%, transparent) !important;
}
.ab-checkout-focus .wc-block-components-radio-control__input:checked {
	border-color: var(--accent) !important;
}
.ab-checkout-focus .wc-block-components-radio-control__input:checked::before {
	background: var(--accent) !important;
}
.ab-checkout-focus .wc-block-components-radio-control__input:focus {
	outline-color: var(--accent);
}
.ab-checkout-focus .wc-block-components-checkbox__input:checked {
	border-color: var(--accent) !important;
}
.ab-checkout-focus .wc-block-components-checkbox__mark {
	fill: var(--accent);
}
.ab-checkout-focus .wc-block-components-checkbox__input:focus {
	outline-color: var(--accent);
}
.ab-checkout-focus .wc-block-checkout__order-notes { margin-bottom: 28px; }

/* Delivery details: two quiet columns, then the note and the holiday tick. */
.ab-checkout-focus .wc-block-checkout__order-fields .wc-block-components-address-form {
	display: grid;
	grid-template-columns: 1fr 1fr;
	column-gap: 14px;
	row-gap: 12px;
	align-items: start;
}
.ab-checkout-focus .wc-block-checkout__order-fields .wc-block-components-address-form > * {
	min-width: 0;
}
.ab-checkout-focus .wc-block-checkout__order-fields .wc-block-components-text-input,
.ab-checkout-focus .wc-block-checkout__order-fields .wc-block-components-select,
.ab-checkout-focus .wc-block-checkout__order-fields .wc-blocks-components-select {
	margin-top: 0;
}
.ab-checkout-focus .wc-block-checkout__order-fields .wc-block-components-address-form__allergy-buddy-delivery-instructions,
.ab-checkout-focus .wc-block-checkout__order-fields .wc-block-components-checkbox {
	grid-column: 1 / -1;
}
@media (max-width: 600px) {
	.ab-checkout-focus .wc-block-checkout__order-fields .wc-block-components-address-form {
		grid-template-columns: 1fr;
	}
}
.ab-checkout-focus .wc-block-checkout__sidebar.is-sticky {
	top: calc(var(--ab-admin, 0px) + 112px);
}
/* Payment methods draw the outline on the accordion, not the inner row. */
.ab-checkout-focus .wc-block-checkout__payment-method .wc-block-components-radio-control-accordion-option {
	padding: 0;
}
.ab-checkout-focus .wc-block-checkout__payment-method .wc-block-components-radio-control__option {
	border: 0 !important;
	box-shadow: none !important;
	background: transparent;
	margin: 0;
	border-radius: 0 !important;
}

/* Place order fills the column. The cart already lives in the header. */
.ab-checkout-focus .wc-block-checkout__actions { margin-top: 8px; margin-bottom: 0; }
.ab-checkout-focus .wc-block-checkout__actions_row {
	flex-direction: column-reverse;
	align-items: stretch;
	gap: 14px;
}
.ab-checkout-focus .wc-block-components-checkout-place-order-button,
.ab-checkout-focus .wc-block-components-button.contained {
	width: 100%;
	min-height: 52px;
	border-radius: 999px;
	background-color: var(--accent);
	border: 1px solid var(--accent);
	color: #fff;
	font-weight: 500;
	font-size: 16px;
}
.ab-checkout-focus .wc-block-components-checkout-place-order-button:hover,
.ab-checkout-focus .wc-block-components-button.contained:hover {
	background-color: var(--accent-deep);
	border-color: var(--accent-deep);
	color: #fff;
}

/* Order summary: one paper card, 1px outline. Inner totals are not cards. */
.ab-checkout-focus .wc-block-checkout__sidebar .wc-block-components-totals-wrapper {
	background: transparent;
	border: 0;
	border-radius: 0;
}
.ab-checkout-focus .wp-block-woocommerce-checkout-order-summary-block {
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: 8px;
	padding: 8px 4px;
}
.ab-checkout-focus .wc-block-components-checkout-order-summary__title,
.ab-checkout-focus .wp-block-woocommerce-checkout-order-summary-block .wc-block-components-title {
	font-family: var(--font-sans);
	font-weight: 500;
	font-size: 18px;
	letter-spacing: -0.02em;
	color: var(--ink);
}

@media (max-width: 860px) {
	.ab-checkout-header__inner { min-height: 80px; padding-inline: 20px; }
	.ab-checkout-header__logo img { height: 58px; }
	.ab-checkout-header__cart { transform: translateY(6px); }
	.ab-checkout-focus .entry-content { margin-top: 28px; padding-inline: 20px; }
	.ab-checkout-focus .wc-block-components-checkout-step { margin-bottom: 40px; }
}
