/* =========================================================================
   Basket page — modelled on loewe.com/eur/en/basket, measured at 1440px
   and 375px. Markup: inc/basket.php.

   Desktop (1024px and up)
     A 12-column split with no gutters (6fr | 2fr | 4fr): the items take the
     first half of the page, and the summary takes the last third and sticks
     24px from the top.
     "Basket · n" 18px over a 1px ink rule; items 24px apart.
     Item: image a third of the column (4:5 here; 2:3 on the reference),
     24px gap, then name and price in 14px on one line, attributes in 12px,
     and − qty + with Remove 32px below.
     Summary: "Order summary" 18px, 14px rows, then the black checkout block
     (label over total, 16px 16px 24px padding, as on the reference), then
     the +/− info rows.
   Below 1024px
     One column. The summary follows the items, and its checkout block
     sticks to the bottom of the screen above the tab bar until the summary
     scrolls into view.

   Colours and type come from header.css (--ao-paper, --ao-ink, --ao-rule,
   --ao-sans). The page's side margins are the theme's own (body padding).
   ====================================================================== */

.ao-basket-page { margin: 0; }

.ao-bk {
	display: grid;
	grid-template-columns: minmax(0, 6fr) minmax(0, 2fr) minmax(0, 4fr);
	align-items: start;
	padding: 104px 0 120px;
	font-family: var(--ao-sans);
	font-size: 14px;
	font-weight: 400;
	line-height: 20px;
	color: var(--ao-ink);
	-webkit-font-smoothing: antialiased;
}
.ao-bk *, .ao-bk *::before, .ao-bk *::after { box-sizing: border-box; }
.ao-bk p { margin: 0; }
.ao-bk a { color: inherit; }
.ao-bk ul { list-style: none; margin: 0; padding: 0; }
.ao-bk button {
	font: inherit;
	color: inherit;
	background: none;
	border: 0;
	padding: 0;
	margin: 0;
	border-radius: 0;
	cursor: pointer;
}
.ao-bk :focus-visible { outline: 1px solid var(--ao-ink); outline-offset: 3px; }

.ao-bk__basket { grid-column: 1; min-width: 0; transition: opacity 0.2s; }
.ao-bk.is-busy .ao-bk__basket,
.ao-bk.is-busy .ao-bk__rows,
.ao-bk.is-busy .ao-bk__checkout { opacity: 0.45; pointer-events: none; }

/* ---------- Title ---------- */

.ao-bk__title,
.ao-bk__summary-title {
	margin: 0;
	font-family: inherit;
	font-size: 18px;
	font-weight: 400;
	line-height: 22.5px;
	letter-spacing: normal;
}
.ao-bk__title {
	padding-bottom: 16px;
	margin-bottom: 24px;
	border-bottom: 1px solid var(--ao-ink);
}

/* ---------- Notices ---------- */

.ao-bk__notices:empty { display: none; }
.ao-bk__notices { margin-bottom: 24px; }
.ao-bk__notices .woocommerce-message,
.ao-bk__notices .woocommerce-info,
.ao-bk__notices .woocommerce-error,
.ao-bk__notices .wc-block-components-notice-banner {
	margin: 0 0 8px;
	padding: 12px 16px;
	list-style: none;
	font-size: 12px;
	line-height: 1.4;
	background: rgba(0, 0, 0, 0.04);
	border: 0;
	border-radius: 0;
	color: var(--ao-ink);
}
.ao-bk__notices .woocommerce-message::before,
.ao-bk__notices .woocommerce-info::before,
.ao-bk__notices .woocommerce-error::before,
.ao-bk__notices .wc-block-components-notice-banner > svg { display: none; }
.ao-bk__notices a { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Items ---------- */

.ao-bk__items { display: flex; flex-direction: column; gap: 24px; }

.ao-bk__item {
	display: grid;
	grid-template-columns: 33.5% minmax(0, 1fr);
	column-gap: 24px;
	align-items: start;
}

.ao-bk__thumb {
	display: block;
	aspect-ratio: 4 / 5;
	overflow: hidden;
	background: rgba(0, 0, 0, 0.05);
}
.ao-bk__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }

.ao-bk__info { min-width: 0; }

.ao-bk__top {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 24px;
}
.ao-bk__name { max-width: 15rem; }
.ao-bk__name a { text-decoration: none; }
.ao-bk__name a:hover { text-decoration: underline; text-underline-offset: 2px; }
.ao-bk__price { flex: none; white-space: nowrap; }
.ao-bk__price .woocommerce-Price-amount { font-weight: inherit; }

.ao-bk__attr { margin-top: 7px !important; font-size: 12px; line-height: 17px; }
.ao-bk__attr + .ao-bk__attr { margin-top: 0 !important; }

.ao-bk__actions {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 32px;
}

.ao-bk__qty { display: flex; align-items: center; }
.ao-bk__qty button {
	display: grid;
	place-items: center;
	width: 24px;
	height: 24px;
	margin: 0 -7px; /* 10px glyph, 24px tap area */
}
.ao-bk__qty svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1.2; }
.ao-bk__qty button:disabled { opacity: 0.3; cursor: default; }
.ao-bk__qty output { min-width: 1ch; margin: 0 16px; text-align: center; }
.ao-bk__qty-fixed { font-size: 12px; }

.ao-bk__remove {
	font-size: 12px;
	line-height: 17px;
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* ---------- Summary ---------- */

/* Pinned where it first appears: it doesn't move at all while the items
   scroll past, and leaves with the end of the basket, before the footer.
   basket.js sets --ao-bk-sum-top to the summary's starting position (below
   the header and its wordmark, so the header never meets it), or higher on
   short screens so the whole summary always fits.
   Without JS: 24px below the header bar, moving with it (header.js
   publishes the bar's height as --ao-header-h, 0 while hidden). */
.ao-bk__summary {
	grid-column: 3;
	position: sticky;
	top: var(--ao-bk-sum-top, calc(var(--wp-admin--admin-bar--height, 0px) + var(--ao-header-h, 0px) + 24px));
	min-width: 0;
}
.ao-bk:not(.has-pin) .ao-bk__summary { transition: top 0.5s var(--ao-ease); }

/* The wordmark's paper band, which comes back with the header, stops where
   the summary column starts (column 9 of 12 inside the page margins). The
   pinned summary normally sits below it anyway; this covers short screens,
   where it has to pin higher. */
@media (min-width: 1024px) {
	body.woocommerce-cart .ao-wordmark {
		right: calc(var(--ao-page-pad, 24px) + (100% - 2 * var(--ao-page-pad, 24px)) / 3);
	}
}
.ao-bk__summary-title { padding-bottom: 32px; }

.ao-bk__rows { margin: 0; padding-bottom: 24px; display: flex; flex-direction: column; gap: 3px; }
.ao-bk__rows > div { display: flex; justify-content: space-between; gap: 16px; }
.ao-bk__rows dt, .ao-bk__rows dd { margin: 0; }
.ao-bk__rows dd { text-align: right; }

/* The checkout block: label over total, top-left, as on the reference and
   on the product page's buy button */
.ao-bk .ao-bk__checkout,
.ao-bk .ao-bk__cta {
	display: flex;
	flex-direction: column;
	min-height: 81px;
	padding: 16px 16px 24px;
	background: var(--ao-ink);
	color: var(--ao-paper);
	text-decoration: none;
	transition: opacity 0.2s;
}
.ao-bk .ao-bk__checkout:hover,
.ao-bk .ao-bk__cta:hover { opacity: 0.88; }
.ao-bk__checkout .woocommerce-Price-amount { font-weight: inherit; color: inherit; }

/* Info rows: +/− disclosures */
.ao-bk__info-rows { margin-top: 48px; }
.ao-bk__more summary {
	position: relative;
	display: block;
	padding: 8px 24px 8px 0;
	list-style: none;
	cursor: pointer;
}
.ao-bk__more summary::-webkit-details-marker { display: none; }
.ao-bk__more summary::before,
.ao-bk__more summary::after {
	content: "";
	position: absolute;
	right: 2px;
	top: 50%;
	width: 9px;
	height: 1px;
	background: currentColor;
}
.ao-bk__more summary::after { transform: rotate(90deg); transition: transform 0.2s var(--ao-ease-out); }
.ao-bk__more[open] summary::after { transform: rotate(0deg); }
.ao-bk__more summary:hover { text-decoration: underline; text-underline-offset: 2px; }
.ao-bk__more-body { padding: 0 24px 12px 0; font-size: 12px; line-height: 17px; }
.ao-bk__more-body p + p { margin-top: 8px; }
.ao-bk__more-body a { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Empty ---------- */

.ao-bk.is-empty { grid-template-columns: minmax(0, 1fr); }
.ao-bk.is-empty .ao-bk__basket { max-width: 50%; }
.ao-bk__empty p { margin-bottom: 32px !important; }
.ao-bk .ao-bk__cta { max-width: 320px; }

/* ---------- Tablet and phone ---------- */

@media (max-width: 1023px) {
	.ao-bk { grid-template-columns: minmax(0, 1fr); padding: 56px 0 48px; }
	.ao-bk.is-empty .ao-bk__basket { max-width: none; }

	.ao-bk__item { grid-template-columns: 36% minmax(0, 1fr); column-gap: 16px; }
	.ao-bk__top { gap: 16px; }

	/* The summary's children join the page grid, so the checkout bar can
	   stick within the whole page rather than only within the summary. */
	.ao-bk__summary { display: contents; }
	.ao-bk__summary-title { padding-top: 80px; }

	.ao-bk__cta-bar {
		position: sticky;
		z-index: 5;
		bottom: calc(var(--ao-tabbar-h, 56px) + env(safe-area-inset-bottom));
		padding: 16px 0;
		background: var(--ao-paper);
	}
	.ao-bk__info-rows { margin-top: 32px; }
}

@media (prefers-reduced-motion: reduce) {
	.ao-bk__basket, .ao-bk__summary, .ao-bk__more summary::after, .ao-bk .ao-bk__checkout { transition: none; }
}

/* Estimated delivery (inc/delivery.php) */
.ao-bk .ao-bk__delivery { margin: -8px 0 24px; }
