/*
 * Miracles Basic — all styling.
 *
 * Colours and fonts arrive as CSS variables from functions.php, which reads
 * them from Book Store → Site Settings → Colours & fonts:
 *   --bg --surface --text --muted --line --line-soft --well
 *   --accent --accent-ink --accent-wash --btn --btn-ink --btn-hover
 *   --font-head --font-body
 */

/* ---------- Base ---------- */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-padding-top: 96px;
}

/* The page behind an open panel stays put. The padding stands in for the
   scrollbar that goes away, so nothing shifts sideways (shop.js measures it). */
html.mb-locked {
	overflow: hidden;
}

html.mb-locked body {
	padding-right: var(--mb-scrollbar, 0px);
}

body.mb-body {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

.mb-main {
	flex: 1 0 auto;
	width: 100%;
}

img {
	max-width: 100%;
	height: auto;
}

a {
	color: var(--accent);
}

[hidden] {
	display: none !important;
}

:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

.mb-wrap {
	width: 100%;
	max-width: 1200px;
	margin-inline: auto;
	padding-inline: 24px;
}

.mb-icon {
	flex: none;
	display: block;
}

/* ---------- Buttons ---------- */

.mb-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 42px;
	padding: 9px 18px;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--surface);
	color: var(--text);
	font: inherit;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.mb-btn:hover {
	border-color: var(--text);
}

.mb-btn:disabled {
	cursor: default;
	opacity: 0.55;
	border-color: var(--line);
}

.mb-btn-primary {
	border-color: var(--btn);
	background: var(--btn);
	color: var(--btn-ink);
}

.mb-btn-primary:hover:not(:disabled) {
	border-color: var(--btn-hover);
	background: var(--btn-hover);
}

.mb-btn-wide {
	width: 100%;
	min-height: 48px;
	font-size: 16px;
	font-weight: 600;
}

/* ---------- Sale banner ---------- */

.mb-banner {
	padding: 9px 20px;
	background: var(--accent);
	color: var(--accent-ink);
	font-size: 14px;
	font-weight: 500;
	letter-spacing: 0.01em;
	text-align: center;
}

/* ---------- Header ---------- */

.mb-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--surface);
	border-bottom: 1px solid var(--line);
}

.admin-bar .mb-header {
	top: 32px;
}

.mb-header-in {
	display: flex;
	align-items: center;
	gap: 24px;
	min-height: 72px;
	padding-block: 12px;
}

.mb-brand {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
	margin-right: auto;
	color: inherit;
	text-decoration: none;
}

.mb-logo {
	flex: none;
	width: 44px;
	height: 44px;
	object-fit: contain;
}

.mb-brand-text {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.mb-name {
	font-family: var(--font-head);
	font-size: 21px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: -0.005em;
}

.mb-tagline {
	margin-top: 1px;
	color: var(--muted);
	font-size: 13px;
	line-height: 1.3;
}

/* Search box */
.mb-search {
	position: relative;
	display: flex;
	align-items: center;
	flex: 0 1 360px;
	color: var(--muted);
}

.mb-search .mb-icon {
	position: absolute;
	left: 14px;
	width: 18px;
	height: 18px;
	pointer-events: none;
}

.mb-search input {
	width: 100%;
	height: 44px;
	padding: 0 14px 0 42px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--bg);
	color: var(--text);
	font: inherit;
	font-size: 15px;
	-webkit-appearance: none;
	appearance: none;
}

.mb-search input::placeholder {
	color: var(--muted);
	opacity: 1;
}

.mb-search input:focus {
	outline: none;
	border-color: var(--text);
	background: var(--surface);
}

.mb-search-row {
	display: none;
}

/* Cart button */
.mb-cart-btn {
	flex: none;
	padding-inline: 16px;
	border-radius: 999px;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.mb-cart-btn.has-books {
	border-color: var(--btn);
	background: var(--btn);
	color: var(--btn-ink);
}

.mb-cart-btn.has-books:hover {
	border-color: var(--btn-hover);
	background: var(--btn-hover);
}

/* Both wordings share one spot; the unseen one keeps the button a steady width. */
.mb-cart-btn-text {
	display: inline-grid;
}

.mb-cart-btn-text > * {
	grid-area: 1 / 1;
	text-align: left;
}

.mb-cart-btn-ghost {
	visibility: hidden;
}

.mb-cart-btn.is-bump {
	animation: mb-bump 0.4s ease;
}

@keyframes mb-bump {
	35% { transform: scale(1.08); }
}

/* Links under the header */
.mb-nav {
	border-top: 1px solid var(--line-soft);
}

.mb-nav-list,
.mb-footer-menu {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 22px;
	margin-block: 0;
	list-style: none;
}

.mb-nav-list {
	padding-block: 10px;
}

.mb-nav-list a,
.mb-footer-menu a {
	color: var(--text);
	font-size: 14px;
	text-decoration: none;
}

.mb-nav-list a:hover,
.mb-footer-menu a:hover,
.mb-nav-list .current-menu-item > a {
	color: var(--accent);
}

/* ---------- Shelves (filters) ---------- */

.mb-shop {
	padding-block: 28px 64px;
}

.mb-shelves {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 28px;
}

.mb-chip {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	min-height: 38px;
	padding: 6px 14px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--surface);
	color: var(--text);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.2;
	text-decoration: none;
	transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}

.mb-chip:hover {
	border-color: var(--text);
}

.mb-chip.is-on {
	border-color: var(--text);
	background: var(--text);
	color: var(--bg);
}

.mb-chip-dot {
	flex: none;
	width: 9px;
	height: 9px;
	border-radius: 50%;
}

.mb-chip.is-on .mb-chip-dot {
	box-shadow: 0 0 0 1.5px var(--bg);
}

.mb-chip-n {
	color: var(--muted);
	font-size: 12px;
	font-weight: 400;
	font-variant-numeric: tabular-nums;
}

.mb-chip.is-on .mb-chip-n {
	color: inherit;
	opacity: 0.7;
}

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

.mb-bar {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px 24px;
	flex-wrap: wrap;
	margin-bottom: 24px;
	padding-bottom: 18px;
	border-bottom: 1px solid var(--line);
}

.mb-title {
	margin: 0;
	font-family: var(--font-head);
	font-size: clamp(26px, 3.2vw, 34px);
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: -0.01em;
	overflow-wrap: anywhere;
}

.mb-sub {
	margin: 6px 0 0;
	color: var(--muted);
	font-size: 15px;
}

.mb-sub:empty {
	display: none;
}

.mb-sort {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--muted);
	font-size: 14px;
}

.mb-sort select {
	height: 40px;
	padding: 0 34px 0 12px;
	border: 1px solid var(--line);
	border-radius: 8px;
	background-color: var(--surface);
	background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
	background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px;
	background-size: 5px 5px;
	background-repeat: no-repeat;
	color: var(--text);
	font: inherit;
	font-size: 14px;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.mb-sort select:hover {
	border-color: var(--text);
}

.mb-empty {
	margin: 48px 0;
	color: var(--muted);
	font-size: 17px;
	text-align: center;
}

/* ---------- The books ---------- */

.mb-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
	gap: 36px 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mb-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

/* Every cover sits whole, uncropped, in a tile of the same shape. */
.mb-cover {
	--pad: 16px;
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 5 / 7;
	margin: 0 0 14px;
	padding: 0;
	border: 0;
	border-radius: 10px;
	background: var(--well);
	color: inherit;
	font: inherit;
}

button.mb-cover {
	cursor: pointer;
}

/* The shadow follows the picture itself, whatever its proportions. */
.mb-cover img {
	position: absolute;
	inset: var(--pad);
	width: calc(100% - 2 * var(--pad));
	height: calc(100% - 2 * var(--pad));
	object-fit: contain;
	filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.16)) drop-shadow(0 7px 9px rgba(0, 0, 0, 0.2));
	transition: transform 0.2s ease;
}

button.mb-cover:hover img {
	transform: translateY(-3px);
}

/* A book with no picture: a plain cover in its shelf's colour, with the first letter of the title. */
.mb-cover-blank {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 2 / 3;
	border-radius: 3px;
	background: var(--shelf, var(--muted));
	color: #fff;
	font-family: var(--font-head);
	font-size: 44px;
	font-weight: 600;
	line-height: 1;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.14), 0 8px 18px -6px rgba(0, 0, 0, 0.28);
}

.mb-cover > .mb-cover-blank {
	position: absolute;
	top: var(--pad);
	bottom: var(--pad);
	left: 50%;
	transform: translateX(-50%);
	transition: transform 0.2s ease;
}

button.mb-cover:hover > .mb-cover-blank {
	transform: translateX(-50%) translateY(-3px);
}

.mb-cover-blank > span {
	opacity: 0.92;
}

.mb-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	padding: 4px 8px;
	border-radius: 6px;
	background: var(--accent);
	color: var(--accent-ink);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0.01em;
}

.mb-badge-inline {
	position: static;
	align-self: center;
}

.mb-soldout {
	display: none;
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	padding: 7px 14px;
	border-radius: 6px;
	background: var(--text);
	color: var(--bg);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	white-space: nowrap;
}

.mb-card.is-out .mb-soldout {
	display: block;
}

.mb-card.is-out .mb-cover img,
.mb-card.is-out .mb-cover-blank,
.mb-quick-cover.is-out img {
	opacity: 0.4;
	filter: grayscale(0.6);
}

.mb-card.is-out button.mb-cover:hover img {
	transform: none;
}

.mb-card.is-out .mb-badge {
	display: none;
}

.mb-card-title {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
	margin: 0;
	font-family: var(--font-head);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.3;
	overflow-wrap: anywhere;
}

.mb-card-author {
	overflow: hidden;
	margin: 3px 0 0;
	color: var(--muted);
	font-size: 14px;
	line-height: 1.35;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mb-card-author:empty {
	display: none;
}

.mb-price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0 8px;
	margin: 8px 0 0;
	font-variant-numeric: tabular-nums;
}

.mb-now {
	font-size: 17px;
	font-weight: 600;
}

.mb-was {
	color: var(--muted);
	font-size: 14px;
}

.mb-stock {
	flex-basis: 100%;
	min-height: 20px;
	margin: 0;
	color: var(--accent);
	font-size: 13px;
	line-height: 20px;
}

.mb-add {
	width: 100%;
	margin-top: auto;
}

.mb-card .mb-price {
	margin-bottom: 12px;
}

.mb-add[aria-pressed="true"],
.mb-btn.is-in {
	border-color: var(--accent);
	background: var(--accent-wash);
	color: var(--accent);
}

.mb-more-wrap {
	display: flex;
	justify-content: center;
	margin-top: 40px;
}

.mb-more-wrap .mb-btn {
	min-width: 220px;
}

/* ---------- Panels (cart, closer look) ---------- */

dialog.mb-drawer,
dialog.mb-quick {
	border: 0;
	padding: 0;
	background: var(--surface);
	color: var(--text);
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

dialog.mb-drawer::backdrop,
dialog.mb-quick::backdrop {
	background: rgba(20, 16, 12, 0.48);
}

.mb-x {
	display: grid;
	place-items: center;
	flex: none;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: none;
	color: var(--text);
	cursor: pointer;
}

.mb-x:hover {
	background: var(--well);
}

/* The cart slides in from the right. */
dialog.mb-drawer {
	inset: 0 0 0 auto;
	width: min(420px, 100vw);
	max-width: none;
	height: 100%;
	height: 100dvh;
	max-height: none;
	margin: 0;
}

dialog.mb-drawer[open] {
	display: flex;
	flex-direction: column;
	animation: mb-slide-in 0.22s ease-out;
}

@keyframes mb-slide-in {
	from { transform: translateX(40px); opacity: 0; }
}

.mb-drawer-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 16px 6px 24px;
}

.mb-drawer-title,
.mb-summary-title {
	margin: 0;
	font-family: var(--font-head);
	font-size: 22px;
	font-weight: 600;
	line-height: 1.2;
}

.mb-drawer-note {
	margin: 0;
	padding: 0 24px 14px;
	color: var(--muted);
	font-size: 14px;
}

.mb-drawer-body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 0 24px;
	border-top: 1px solid var(--line);
	overscroll-behavior: contain;
}

.mb-drawer-empty {
	margin: 40px 0;
	color: var(--muted);
	text-align: center;
}

.mb-drawer-foot {
	padding: 16px 24px max(20px, env(safe-area-inset-bottom));
	border-top: 1px solid var(--line);
	background: var(--surface);
}

.mb-drawer-foot .mb-btn {
	margin-top: 14px;
}

/* A book in the cart or in the order summary */
.mb-lines {
	margin: 0;
	padding: 0;
	list-style: none;
}

.mb-line {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 0;
	border-bottom: 1px solid var(--line-soft);
}

.mb-line:last-child {
	border-bottom: 0;
}

.mb-line-cover {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 44px;
	height: 62px;
}

.mb-line-cover img,
.mb-line-cover .mb-cover-blank {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	border-radius: 2px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
}

.mb-line-cover .mb-cover-blank {
	height: 100%;
	font-size: 20px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
}

.mb-line-text {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-width: 0;
}

.mb-line-title {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
	font-family: var(--font-head);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
}

.mb-line-author {
	overflow: hidden;
	color: var(--muted);
	font-size: 13px;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mb-line-price {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	flex: none;
	line-height: 1.25;
	font-variant-numeric: tabular-nums;
}

.mb-line-price .mb-now {
	font-size: 15px;
}

.mb-line-price .mb-was {
	font-size: 13px;
}

.mb-line-remove {
	flex: none;
	width: 32px;
	height: 32px;
	margin-right: -8px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: none;
	color: var(--muted);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}

.mb-line-remove:hover {
	background: var(--well);
	color: var(--text);
}

/* Totals */
.mb-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	padding: 3px 0;
	color: var(--muted);
	font-size: 15px;
	font-variant-numeric: tabular-nums;
}

.mb-row-total {
	margin-top: 6px;
	color: var(--text);
	font-size: 19px;
	font-weight: 600;
}

.mb-save {
	margin: 0;
	color: var(--accent);
	font-size: 15px;
	font-weight: 500;
}

/* A closer look */
dialog.mb-quick {
	width: min(760px, calc(100vw - 32px));
	max-height: calc(100dvh - 32px);
	border-radius: 14px;
	overflow: auto;
}

dialog.mb-quick[open] {
	animation: mb-pop-in 0.18s ease-out;
}

@keyframes mb-pop-in {
	from { transform: translateY(10px); opacity: 0; }
}

.mb-quick > .mb-x {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 1;
}

.mb-quick-in {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
}

.mb-quick-cover {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 420px;
	padding: 32px;
	background: var(--well);
}

.mb-quick-cover img,
.mb-quick-cover .mb-cover-blank {
	max-width: 100%;
	max-height: 400px;
	width: auto;
	height: auto;
	border-radius: 3px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.16), 0 16px 30px -10px rgba(0, 0, 0, 0.35);
}

.mb-quick-cover .mb-cover-blank {
	height: 300px;
	font-size: 96px;
}

.mb-quick-text {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 44px 36px 36px;
}

.mb-quick-shelf {
	display: flex;
	align-items: center;
	gap: 7px;
	margin: 0 0 10px;
	color: var(--muted);
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.mb-quick-title {
	margin: 0;
	font-family: var(--font-head);
	font-size: 27px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: -0.01em;
	overflow-wrap: anywhere;
}

.mb-quick-author {
	margin: 8px 0 0;
	color: var(--muted);
	font-size: 16px;
}

.mb-price-lg {
	margin-top: 20px;
}

.mb-price-lg .mb-now {
	font-size: 24px;
}

.mb-price-lg .mb-was {
	font-size: 16px;
}

.mb-quick-text .mb-stock {
	flex: none;
	margin-top: 4px;
}

.mb-quick-text .mb-btn {
	margin-top: 22px;
}

/* ---------- Checkout ---------- */

.mb-checkout {
	padding-block: 24px 72px;
}

.mb-back {
	display: inline-block;
	margin-bottom: 18px;
	color: var(--muted);
	font-size: 14px;
	text-decoration: none;
}

.mb-back:hover {
	color: var(--accent);
}

.mb-co {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
	align-items: start;
	gap: 48px;
}

.mb-group {
	min-width: 0;
	margin: 30px 0 0;
	padding: 0;
	border: 0;
}

.mb-group > legend {
	margin-bottom: 12px;
	padding: 0;
	font-family: var(--font-head);
	font-size: 19px;
	font-weight: 600;
}

.mb-field {
	display: block;
	margin-top: 12px;
}

.mb-field:first-child {
	margin-top: 0;
}

.mb-field > span {
	display: block;
	margin-bottom: 5px;
	font-size: 14px;
	font-weight: 500;
}

.mb-input {
	width: 100%;
	height: 46px;
	padding: 0 14px;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--surface);
	color: var(--text);
	font: inherit;
	-webkit-appearance: none;
	appearance: none;
}

.mb-input:focus {
	outline: none;
	border-color: var(--text);
	box-shadow: 0 0 0 1px var(--text);
}

.mb-input.is-missing {
	border-color: var(--accent);
	box-shadow: 0 0 0 1px var(--accent);
}

.mb-fields {
	margin-top: 16px;
}

.mb-field-row {
	display: grid;
	grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
	gap: 12px;
	margin-top: 12px;
}

.mb-field-row .mb-field {
	margin-top: 0;
}

.mb-options {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 10px;
}

.mb-option {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 52px;
	padding: 10px 14px;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--surface);
	color: var(--text);
	font: inherit;
	font-size: 15px;
	text-align: left;
	cursor: pointer;
}

.mb-option:hover {
	border-color: var(--text);
}

.mb-option.is-on {
	border-color: var(--text);
	box-shadow: 0 0 0 1px var(--text);
}

.mb-option-dot {
	flex: none;
	width: 18px;
	height: 18px;
	border: 1.5px solid var(--muted);
	border-radius: 50%;
}

.mb-option.is-on .mb-option-dot {
	border: 5.5px solid var(--text);
}

.mb-option-label {
	flex: 1 1 auto;
	font-weight: 500;
}

.mb-option-cost {
	color: var(--muted);
	font-variant-numeric: tabular-nums;
}

.mb-co-text {
	margin: 14px 0 0;
	color: var(--muted);
	font-size: 15px;
}

.mb-co-text strong {
	color: var(--text);
	font-weight: 600;
}

/* Hidden from people; only bots fill it in. */
.mb-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.mb-summary {
	position: sticky;
	top: 100px;
	padding: 24px;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--surface);
}

.mb-summary .mb-co-text {
	margin-top: 10px;
}

.mb-summary .mb-lines {
	margin-top: 6px;
}

.mb-totals {
	margin-top: 8px;
	padding-top: 14px;
	border-top: 1px solid var(--line);
}

.mb-totals .mb-save {
	margin-top: 2px;
	text-align: right;
}

.mb-error {
	margin: 16px 0 0;
	padding: 10px 14px;
	border-radius: 8px;
	background: var(--accent-wash);
	color: var(--accent);
	font-size: 15px;
	font-weight: 500;
}

.mb-summary > .mb-btn {
	margin-top: 18px;
}

/* Thank you */
.mb-thanks {
	display: flex;
	flex-direction: column;
	align-items: center;
	max-width: 560px;
	margin: 40px auto 0;
	padding: 48px 32px;
	border: 1px solid var(--line);
	border-radius: 14px;
	background: var(--surface);
	text-align: center;
}

.mb-thanks-mark {
	display: grid;
	place-items: center;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--accent-wash);
	color: var(--accent);
}

.mb-thanks-mark .mb-icon {
	width: 28px;
	height: 28px;
}

.mb-thanks-stamp {
	margin: 18px 0 6px;
	color: var(--accent);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.mb-thanks-text {
	margin: 14px 0 0;
	font-size: 17px;
}

.mb-thanks .mb-save {
	margin-top: 10px;
}

.mb-thanks .mb-btn {
	margin-top: 28px;
}

/* ---------- Other pages (About, Contact, posts…) ---------- */

.mb-page {
	padding-block: 28px 72px;
}

.mb-article {
	max-width: 720px;
	margin-inline: auto;
}

.mb-article + .mb-article {
	margin-top: 48px;
}

.mb-meta {
	margin: 8px 0 0;
	color: var(--muted);
	font-size: 14px;
}

.mb-content {
	margin-top: 24px;
	font-size: 17px;
	line-height: 1.7;
	overflow-wrap: break-word;
}

.mb-content > :first-child {
	margin-top: 0;
}

.mb-content h2,
.mb-content h3,
.mb-content h4 {
	margin: 1.8em 0 0.5em;
	font-family: var(--font-head);
	font-weight: 600;
	line-height: 1.25;
}

.mb-content h2 { font-size: 26px; }
.mb-content h3 { font-size: 21px; }
.mb-content h4 { font-size: 18px; }

.mb-content p,
.mb-content ul,
.mb-content ol,
.mb-content blockquote,
.mb-content figure,
.mb-content table {
	margin: 0 0 1.1em;
}

.mb-content blockquote {
	padding: 4px 0 4px 20px;
	border-left: 3px solid var(--accent);
	color: var(--muted);
}

.mb-content img {
	border-radius: 6px;
}

.mb-content figcaption {
	margin-top: 6px;
	color: var(--muted);
	font-size: 14px;
	text-align: center;
}

.mb-content table {
	width: 100%;
	border-collapse: collapse;
}

.mb-content th,
.mb-content td {
	padding: 8px 10px;
	border-bottom: 1px solid var(--line);
	text-align: left;
}

.mb-content hr {
	margin: 2em 0;
	border: 0;
	border-top: 1px solid var(--line);
}

.mb-content input[type="text"],
.mb-content input[type="email"],
.mb-content input[type="url"],
.mb-content input[type="search"],
.mb-content textarea {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--surface);
	color: var(--text);
	font: inherit;
}

.mb-content input[type="submit"],
.mb-content button,
.mb-content .wp-block-button__link {
	padding: 11px 20px;
	border: 1px solid var(--btn);
	border-radius: 8px;
	background: var(--btn);
	color: var(--btn-ink);
	font: inherit;
	font-weight: 500;
	text-decoration: none;
	cursor: pointer;
}

.mb-post-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.mb-post-list li {
	padding: 22px 0;
	border-bottom: 1px solid var(--line);
}

.mb-post-list h2 {
	margin: 0;
	font-size: 22px;
}

.mb-post-list h2 a {
	color: var(--text);
	text-decoration: none;
}

.mb-post-list h2 a:hover {
	color: var(--accent);
}

.mb-pagination {
	display: flex;
	justify-content: space-between;
	margin-top: 24px;
	font-size: 15px;
}

.alignleft { float: left; margin: 0.3em 1.4em 1em 0; }
.alignright { float: right; margin: 0.3em 0 1em 1.4em; }
.aligncenter { display: block; margin-inline: auto; }

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* ---------- Footer ---------- */

.mb-footer {
	flex: none;
	border-top: 1px solid var(--line);
	background: var(--surface);
	color: var(--muted);
	font-size: 14px;
}

.mb-footer-in {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px 24px;
	padding-block: 22px;
}

.mb-footer-menu {
	padding: 0;
}

/* ---------- Tablets ---------- */

@media (max-width: 1000px) {
	.mb-co {
		grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
		gap: 32px;
	}
}

@media (max-width: 782px) {
	.admin-bar .mb-header {
		top: 46px;
	}
}

/* ---------- Phones ---------- */

@media (max-width: 720px) {
	.mb-wrap {
		padding-inline: 16px;
	}

	.mb-banner {
		padding: 8px 14px;
		font-size: 13px;
	}

	.mb-header-in {
		gap: 12px;
		min-height: 60px;
		padding-block: 8px;
	}

	.mb-logo {
		width: 36px;
		height: 36px;
	}

	.mb-brand {
		gap: 10px;
	}

	.mb-name {
		font-size: 17px;
	}

	.mb-tagline {
		display: none;
	}

	/* The search box moves out of the header to a row of its own beneath it. */
	.mb-header .mb-search {
		display: none;
	}

	.mb-search-row {
		display: block;
		padding-block: 12px 0;
	}

	.mb-search-row .mb-search {
		flex: none;
	}

	.mb-search-row .mb-search .mb-icon {
		left: 30px;
	}

	.mb-at-checkout .mb-search-row {
		display: none;
	}

	.mb-cart-btn {
		min-height: 40px;
		padding-inline: 13px;
		font-size: 14px;
	}

	.mb-shop {
		padding-block: 16px 48px;
	}

	.mb-shelves {
		gap: 7px;
		margin-bottom: 20px;
	}

	.mb-chip {
		min-height: 36px;
		padding: 5px 12px;
	}

	.mb-bar {
		margin-bottom: 18px;
		padding-bottom: 14px;
	}

	.mb-sort {
		width: 100%;
		justify-content: space-between;
	}

	.mb-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 28px 14px;
	}

	.mb-cover {
		--pad: 12px;
		margin-bottom: 10px;
		border-radius: 8px;
	}

	.mb-card-title {
		font-size: 15px;
	}

	.mb-card-author {
		font-size: 13px;
	}

	.mb-btn.mb-add {
		min-height: 40px;
		padding-inline: 8px;
		font-size: 14px;
	}

	.mb-quick-in {
		grid-template-columns: minmax(0, 1fr);
	}

	.mb-quick-cover {
		min-height: 0;
		padding: 28px 24px 22px;
	}

	.mb-quick-cover img,
	.mb-quick-cover .mb-cover-blank {
		max-height: 44vh;
	}

	.mb-quick-text {
		padding: 22px 22px 24px;
	}

	.mb-quick-title {
		font-size: 22px;
	}

	.mb-checkout {
		padding-block: 16px 48px;
	}

	.mb-co {
		grid-template-columns: minmax(0, 1fr);
		gap: 28px;
	}

	.mb-summary {
		position: static;
		padding: 18px;
	}

	.mb-thanks {
		margin-top: 16px;
		padding: 36px 20px;
	}

	.mb-footer-in {
		flex-direction: column;
		align-items: flex-start;
	}
}

@media (max-width: 360px) {
	.mb-name {
		font-size: 15px;
	}

	.mb-cart-btn .mb-icon {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation: none !important;
		transition: none !important;
	}
}

@media print {
	.mb-header,
	.mb-banner,
	.mb-search-row,
	.mb-shelves,
	.mb-sort,
	.mb-add,
	.mb-footer {
		display: none;
	}
}
