/*
 * The ordering workflow (migration order 6): the schools basket and checkout (structure/simple/layout/basket.php
 * and src/Views/Basket/), moving to the design system. The page and its pop-ups are inside .checkoutPage.
 *
 * Not basket.css, which is legacy CSS. Loaded on every main-site page, like account.css. Unlayered, so
 * these rules win over everything in the legacy layer, including legacy rules on IDs: keep selectors
 * scoped to .checkoutPage and set only the properties that need to change. Colours are changed in
 * default.css in place, so the legacy cascade between its rules is unchanged.
 */

/* Keyboard focus. Legacy CSS removes the outline from fields. */
.checkoutPage :focus-visible {
	outline: var(--focus-ring);
	outline-offset: var(--focus-ring-offset);
}

/* Links in text are underlined, as in the style guide (.ds-link): steel is too close to the text colour
   for colour alone to show them */
.checkoutPage p a:not(.button) {
	text-decoration: underline;
}

/* Sentence case and the page's font: legacy CSS puts every button in capitals, and browsers give
   <button>s their own font. Many of these were <div>s and <span>s. */
.checkoutPage button,
.checkoutPage .button {
	text-transform: none;
	font-family: inherit;
}

/* Controls that were links without an href, <span>s or <i>s and are now buttons: no button look, as the
   text or icon they were. Legacy rules still set their colour and spacing. */
.checkoutPage .checkoutPlainButton {
	background: none;
	border: 0;
	margin: 0;
	padding: 0;
	width: auto;
	font: inherit;
	color: inherit;
	line-height: inherit;
	text-align: inherit;
	cursor: pointer;
}

.checkoutPage .checkoutPlainButton:hover {
	background: none;
}

/* The row actions (Delete, Move to wishlist) were links: the link colour, underlined on hover. At least
   24px tall, as they sit close together (WCAG 2.5.8). */
.checkoutPage .basketTable .checkoutPlainButton {
	color: var(--color-primary);
	display: inline-block;
	min-height: 24px;
}

.checkoutPage .basketTable .checkoutPlainButton:hover {
	color: var(--color-primary-hover);
	text-decoration: underline;
}

/* The quantity arrow (sets every item to the first item's quantity) keeps the icon's size, padding and
   border (legacy CSS gave the <i> a 1px black one) */
.checkoutPage .bulkQtyButton {
	font-size: 1rem;
	padding: .5rem;
	border: 1px solid var(--color-text);
}

/* Back is hidden on the first step with opacity and pointer-events (basket.php): take it out of the Tab
   order and away from screen readers too */
.checkoutPage .back[style*="opacity: 0"] {
	visibility: hidden;
}

/* "Schools who purchased books in your basket also bought" (widgets/ajax/ajax.basket.cross-selling.php):
   6px between a book's title and author links, so each is clear of the other's 24px target area, as in
   the home page carousels. Add to basket is a <button> now: its text was a <p> that didn't wrap. */
.checkoutPage .crossSellingItemBookDetails > div + div {
	margin-top: 6px;
}

.checkoutPage .addToBasketContainer .wishlistText {
	white-space: nowrap;
}

/* Servicing, barcodes and single delivery: the checkboxes are invisible over the boxes drawn for them,
   so the drawn box shows the focus */
.checkoutPage .eventContainer input:focus-visible ~ .eventCheckmark {
	outline: var(--focus-ring);
	outline-offset: var(--focus-ring-offset);
}

/* Warnings and validation in the checkout steps (they were inline pink, 3.5:1 on white) */
.checkoutPage .checkoutWarning {
	color: var(--color-error);
}

/* React checkouts (components/libsCheckout.js, forSchoolCheckout.js) */

/* Row actions (Edit, Delete): buttons now (they were links without an href). basket.css still gives them
   their size and round hover; undo the button rule's white text and block. */
.checkoutPage menu.btn-group.newTheme button.btn {
	color: inherit;
	display: inline-block;
	width: auto;
	border: 0;
	text-transform: none;
}

/* The for-school checkout's steps (Ant Design): the steps still to come were light grey (3.4:1). The title
   selector is as long as Ant's own, which is unlayered too. */
.checkoutPage .ant-steps-item-wait > .ant-steps-item-container > .ant-steps-item-content > .ant-steps-item-title,
.checkoutPage .ant-steps-item-wait .ant-steps-item-icon .ant-steps-icon {
	color: var(--color-text-muted);
}

/* The same steps in dark mode: Ant's colours are for a white page (near-black titles, white circles, light
   grey lines). The current step's circle is basket.css's Peters blue fill, which reads in both themes. */
[data-theme="dark"] .checkoutPage .ant-steps-item > .ant-steps-item-container > .ant-steps-item-content > .ant-steps-item-title {
	color: var(--color-text);
}

[data-theme="dark"] .checkoutPage .ant-steps-item-wait > .ant-steps-item-container > .ant-steps-item-content > .ant-steps-item-title {
	color: var(--color-text-muted);
}

[data-theme="dark"] .checkoutPage .ant-steps-item-wait .ant-steps-item-icon,
[data-theme="dark"] .checkoutPage .ant-steps-item-finish .ant-steps-item-icon {
	border-color: var(--color-border-field);
	background-color: var(--color-surface);
}

[data-theme="dark"] .checkoutPage .ant-steps-item > .ant-steps-item-container > .ant-steps-item-tail::after,
[data-theme="dark"] .checkoutPage .ant-steps-item > .ant-steps-item-container > .ant-steps-item-content > .ant-steps-item-title::after {
	background-color: var(--color-border);
}

/* Buttons that look like links (Edit basket details, Weave outcome) */
.checkoutPage .checkoutLinkButton {
	color: var(--color-primary);
	text-decoration: underline;
}

.checkoutPage .checkoutLinkButton:hover {
	color: var(--color-primary-hover);
}

/* The truncation buttons were <span class="button small">: keep their size */
.checkoutPage .sortContainer .button.small {
	display: inline-block;
	width: auto;
	margin: 0 2px;
}
