/**
 * Product-page fulfilment buy box (#2246 / design 2k).
 *
 * Two peer cards (Delivery / Pick Up), each with their own state. Delivery
 * carries an inline postcode + Check; Pick Up lists the nearest collection
 * points with distance + "ready by". The theme primary drives the selected
 * state, with a blue fallback so it reads correctly without theme tokens.
 */

.wb-buybox {
	--wb-buybox-primary: var(--wp--preset--color--primary, #1a5fe0);
	--wb-buybox-border: #e4e7ec;
	margin: 14px 0 18px;
}

.wb-buybox__eyebrow {
	margin: 0 0 8px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #6b7280;
}

.wb-buybox__cards {
	display: grid;
	/* auto-fit so the cards stack whenever the container (not just the
	   viewport) is too narrow for two — the theme keeps the summary column
	   narrow on tablet/mobile. */
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 12px;
	/* Stretch so the Delivery and Pick Up cards are equal height side by side
	   (the Pick Up card is taller with its store list). */
	align-items: stretch;
}

.wb-buybox__card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 15px 16px;
	border: 1px solid var(--wb-buybox-border);
	border-radius: 14px;
	background: #fff;
	cursor: pointer;
	transition:
		border-color 150ms ease,
		box-shadow 150ms ease,
		background 150ms ease;
}

.wb-buybox__card:hover {
	border-color: #c7dcff;
}

.wb-buybox__card.is-selected {
	border-color: var(--wb-buybox-primary);
	box-shadow: inset 0 0 0 1px var(--wb-buybox-primary);
	background: #f6f9ff;
}

.wb-buybox__card-head {
	display: flex;
	align-items: center;
	gap: 9px;
}

.wb-buybox__radio {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--wb-buybox-primary);
	cursor: pointer;
}

.wb-buybox__card-icon {
	display: inline-flex;
	color: #16181d;
}

.wb-buybox__card.is-selected .wb-buybox__card-icon {
	color: var(--wb-buybox-primary);
}

.wb-buybox__card-title {
	font-weight: 700;
	font-size: 15px;
	color: #16181d;
}

.wb-buybox__card-aside {
	margin-left: auto;
	font-size: 15px;
	font-weight: 700;
	color: #16181d;
}

.wb-buybox__card-free {
	margin-left: auto;
	font-weight: 800;
	font-size: 16px;
	color: #1a7f3c;
}

/* "Only option" badge — the sole available method on a single-mode product. */
.wb-buybox__card-badge {
	margin-left: auto;
	padding: 2px 10px;
	border-radius: 999px;
	background: #e8f0ff;
	color: var(--wb-buybox-primary);
	font-weight: 600;
	font-size: 12px;
	white-space: nowrap;
}

/* Greyed, non-interactive card stating why the other method is unavailable. */
.wb-buybox__card--unavailable,
.wb-buybox__card--unavailable:hover {
	background: #f7f8fa;
	border-color: var(--wb-buybox-border);
	box-shadow: none;
	cursor: default;
}

.wb-buybox__card--unavailable .wb-buybox__card-title {
	color: #9aa1ad;
	font-weight: 600;
}

.wb-buybox__card--unavailable .wb-buybox__card-icon {
	color: #b6bcc6;
}

.wb-buybox__card-hint,
.wb-buybox__pickup-meta {
	margin: 0;
	font-size: 13px;
	color: #6b7280;
	line-height: 1.45;
}

/* --- Delivery: inline postcode + Check ---------------------------------- */

.wb-buybox__postcode {
	display: flex;
	gap: 8px;
	margin-top: 2px;
}

.wb-buybox__postcode-input {
	flex: 1 1 auto;
	min-width: 0;
	padding: 10px 14px;
	border: 1px solid var(--wb-buybox-border);
	border-radius: 999px;
	background: #f6f5f2;
	font-size: 14px;
	color: #16181d;
}

.wb-buybox__postcode-input:focus {
	outline: none;
	border-color: var(--wb-buybox-primary);
	background: #fff;
}

.wb-buybox__postcode-btn {
	flex: 0 0 auto;
	padding: 10px 18px;
	border: 1px solid var(--wb-buybox-border);
	border-radius: 999px;
	background: #f2f3f5;
	font-size: 14px;
	font-weight: 600;
	color: #16181d;
	cursor: pointer;
	transition: background 150ms ease;
}

.wb-buybox__postcode-btn:hover {
	background: #e8eaed;
}

.wb-buybox__postcode-btn:disabled {
	opacity: 0.6;
	cursor: default;
}

/* --- Pick Up: nearest collection points --------------------------------- */

.wb-buybox__stores {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.wb-buybox__store {
	display: flex;

	/* flex-start, not center: a long store name + distance can wrap onto a
	   second line, and centering against that taller block drifts the radio
	   away from the first line instead of sitting next to it. */
	align-items: flex-start;
	gap: 10px;
	padding: 10px 12px;
	border: 1px solid var(--wb-buybox-border);
	border-radius: 12px;
	background: #fff;
	cursor: pointer;
	transition:
		border-color 150ms ease,
		box-shadow 150ms ease;
}

/* Each row is a <label>, and WooCommerce's own block-theme stylesheet ships
   a sitewide `.woocommerce-page label { margin-bottom: .7em }` rule that
   outranks a bare `.wb-buybox__store` class on specificity (it also matches
   the `label` element). Left unset, that margin stacks on top of the `gap`
   above and roughly doubles the visual space between rows. The extra class
   here wins on specificity and resets it back to the gap alone. */
.wb-buybox__stores .wb-buybox__store {
	margin: 0;
}

.wb-buybox__store:hover {
	border-color: #c7dcff;
}

.wb-buybox__store.is-active {
	border-color: var(--wb-buybox-primary);
	box-shadow: inset 0 0 0 1px var(--wb-buybox-primary);
}

.wb-buybox__store-radio {
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	margin: 0;
	accent-color: var(--wb-buybox-primary);
	cursor: pointer;
}

.wb-buybox__store-body {
	display: flex;
	flex-direction: column;
	gap: 1px;
	min-width: 0;
}

.wb-buybox__store-name {
	font-size: 14px;
	font-weight: 600;
	color: #16181d;
}

.wb-buybox__store-distance {
	font-weight: 600;
	color: #16181d;
}

.wb-buybox__store-ready {
	font-size: 12px;
	color: #6b7280;
}

.wb-buybox__link {
	align-self: flex-start;
	margin-top: 2px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--wb-buybox-primary);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}

.wb-buybox__link:hover {
	text-decoration: underline;
}

/* Extra collection points beyond the visible slots, and the toggle itself when
 * there are none, are hidden until "See all stores" expands the list (#2354). */
.wb-buybox__store.is-hidden,
.wb-buybox__link.is-hidden {
	display: none;
}

/* "contact us" link in the out-of-area delivery hint (#2357). */
.wb-buybox__contact {
	color: var(--wb-buybox-primary);
	font-weight: 600;
	text-decoration: underline;
}
