/**
 * Mobile navigation shell — bottom tab bar, Cart/More drawers, drill-down
 * and checkout header patterns, and the small set of shared component
 * primitives (button, list row, stepper) those pieces are built from.
 *
 * Loaded on every front-end page (see pcf_enqueue_styles()) and, like
 * mobile-cart.css, scoped behind max-width:1025px — above that the existing
 * desktop header nav (astra-child/header.php) is untouched. The exceptions
 * are at the end: the desktop printing popover, and the lightbox's rules for
 * desktop widths.
 *
 * :root here is the one place these design tokens are defined; mobile-cart.css
 * depends on this stylesheet and no longer redeclares them.
 */

:root {
	--accent: #df6f36;
	--accent-hover: #c95f2a;
	--accent-press: #b35324;
	/* The logo's own orange, for the brand mark in headers. */
	--pc-orange-bright: #fa7b3f;
	--pc-brown-dark: #432f1f;
	--pc-brown-text: #52351b;
	--pc-parchment: #f9dfbe;
	--pc-tan: #e8c6a0;
	--pc-tan-soft: #f3dcc6;
	--pc-error: #b5221a;
	--pc-error-soft: #f3dcd9;
	--pc-info: #1a6fb5;
	--pc-info-soft: #d9e6f1;
	--pc-brown-50: rgba(82, 53, 27, 0.5);
	--pc-brown-30: rgba(67, 47, 31, 0.3);
	--pc-brown-08: rgba(67, 47, 31, 0.08);

	--border-strong: var(--pc-brown-dark);
	--border-default: rgba(73, 49, 29, 0.51);
	--border-hairline: rgba(82, 53, 27, 0.15);

	--text-heading: var(--pc-brown-dark);
	--text-body: var(--pc-brown-text);
	--text-muted: var(--pc-brown-text);
	--surface-page: var(--pc-parchment);
	--surface-sunken: var(--pc-tan-soft);
	/* Raised surfaces — product tiles, fields, steppers — sit on the soft
	   tan, never white: everything on the page stays on the brand palette. */
	--surface-card: var(--pc-tan-soft);

	--font-body: "Aspekta 450", sans-serif;
	--font-ui: "Aspekta 500", sans-serif;
	--font-display: "Aspekta 550", sans-serif;

	--space-1: 4px;
	--space-2: 8px;
	--space-3: 12px;
	--space-4: 16px;
	--space-6: 24px;

	--radius-md: 12px;
	--radius-lg: 16px;
	--radius-pill: 9999px;

	--bw-default: 2px;

	--shadow-xs: 0 1px 3px 0 rgba(0, 0, 0, 0.08);
	--shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.16);
	--shadow-lg: 0 10px 24px rgba(0, 0, 0, 0.22);
	--shadow-drawer: -8px 0 24px rgba(0, 0, 0, 0.18);
	--shadow-sheet: 0 -8px 24px rgba(0, 0, 0, 0.18);
	--shadow-focus: 0 0 0 4px rgba(223, 111, 54, 0.22);

	--motion-default: all 0.25s ease-in-out;
}

/* Server-rendered at all widths; hidden above 1025px, same pattern as
   .pc-mobile-cart in mobile-cart.css. */
.pc-tabbar,
.pc-drawer-scrim,
.pc-drawer,
.pc-sheet-backdrop,
.pc-sheet,
.pc-lightbox-backdrop,
.pc-lightbox {
	display: none;
}

/* The brand mark (pcf_brand_mark_svg()): currentColor, so it tints with the
   tab it sits in; headers fix it to the logo orange. Outside the media query
   since it's markup of its own wherever it appears. */
.pc-mark {
	display: block;
	flex: none;
}

.pc-mark--brand {
	color: var(--pc-orange-bright);
}

@media (max-width: 1025px) {

	/* Room for the fixed tab bar so page content isn't hidden underneath it.
	   Only added when the shell actually renders a tab bar (see the
	   pc-has-tabbar body class pcf_body_class() adds — absent on checkout). */
	body.pc-has-tabbar {
		padding-bottom: 62px;
	}

	/* Mobile browsers paint their own translucent "tap highlight" overlay
	   over a tapped element on touchstart, independent of and in addition
	   to :hover/:focus/:active CSS (see the outline: none notes further
	   down for that separate fix) — nothing in this codebase had ever set
	   -webkit-tap-highlight-color, so it was falling back to the browser
	   default, a dark tint that reads as a "light brown box" over this
	   page's warm parchment background. Not reproducible in desktop
	   browser automation (it's a genuine touchscreen behavior), which is
	   why the outline fix alone looked complete under test but didn't
	   actually address this. */
	.pc-tabbar__item,
	.pc-stepper__btn,
	.pc-drawer__close {
		-webkit-tap-highlight-color: transparent;
	}

	/* ---------- Retire the old header's mobile nav controls ----------
	   The tab bar now owns Search/Cart/More, so astra-child/header.php's
	   hamburger + offcanvas menu and mobile cart icon are redundant here.
	   CSS-hidden rather than removed from header.php: the offcanvas also
	   serves as the ALWAYS-VISIBLE desktop nav row (Bootstrap's
	   navbar-expand-lg pattern) so its markup has to stay. The logo stays
	   for branding; only the now-duplicated controls are hidden. This
	   file's 1025px breakpoint sits one pixel under the theme's lg cutoff
	   (1026px in astra-child's Bootstrap build), so the desktop nav row
	   takes over exactly where the tab bar stops and the old hamburger
	   never shows at any width. */
	header[role="banner"] .navbar-toggler,
	header[role="banner"] .menu-item.custom-menu-item {
		display: none !important;
	}

	/* Un-stick the header and let it collapse to the logo's own height.
	   .top-menu (the header's own class — see astra-child/header.php)
	   pins it with position:fixed at all widths; reduced to a bare logo it
	   read as a thick bar permanently pinned over the page while scrolling,
	   so on mobile it now scrolls away with the rest of the content like an
	   ordinary block instead. */
	header[role="banner"] {
		position: static !important;
	}

	header[role="banner"] .main-navbar {
		padding: 10px 0;
	}

	/* The Astra "scroll to top" button (#ast-scroll-top) defaults to
	   bottom:30px, which lands squarely inside the tab bar's own footprint
	   (0–62px from the bottom) and loses to it on z-index — invisible
	   underneath, not clickable. Raised clear of the tab bar; scoped to
	   pc-has-tabbar so the checkout page (no tab bar) keeps the default. */
	body.pc-has-tabbar #ast-scroll-top {
		bottom: 76px;
	}

	/* ---------- Shared primitives ---------- */

	.pc-btn {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		gap: var(--space-2);
		border: var(--bw-default) solid transparent;
		border-radius: var(--radius-lg);
		font-family: var(--font-ui);
		font-weight: 700;
		text-decoration: none;
		cursor: pointer;
		transition: var(--motion-default);
		white-space: nowrap;
	}

	.pc-btn--primary {
		background: var(--accent) !important;
		color: #fff !important;
	}

	.pc-btn--primary:hover,
	.pc-btn--primary:active {
		background: var(--accent-hover) !important;
	}

	.pc-btn--outline {
		background: transparent;
	}

	.pc-btn--danger.pc-btn--outline {
		border-color: var(--pc-error) !important;
		color: var(--pc-error) !important;
	}

	.pc-btn--md {
		min-height: 55px;
		min-width: 170px;
		padding: 0 var(--space-4);
		font-size: 1rem;
	}

	.pc-btn--sm {
		min-height: 44px;
		padding: 0 var(--space-4);
		font-size: 0.85rem;
	}

	/* Quantity stepper — the base unit reused in every cart-adjacent surface.
	   min="0" is set server-side wherever the stepper represents a cart line
	   item (stepping to 0 removes that row); left at the browser default of 1
	   anywhere it isn't attached to a cart item yet. */
	.pc-stepper {
		display: inline-flex;
		align-items: center;
		gap: 2px;
		flex: none;
		border: var(--bw-default) solid var(--border-strong);
		border-radius: var(--radius-pill);
		background: var(--surface-card);
	}

	/* Astra's theme-wide button style (main.min.css) targets a bare `button`
	   selector: background/color/padding unconditionally, plus a separate
	   background/border/color set specifically on :hover and :focus (which
	   a tap fires too). Our own resting styles below already out-specify
	   the unconditional part (class beats plain element), but nothing
	   contested the :hover/:focus-only part — so tapping any plain <button>
	   here painted Astra's accent-hover fill across its full box, which
	   read as a big orange block flashing in given how much larger the
	   invisible tap target is than the visible icon/label. Same reasoning
	   for the leaked `padding: 12px 24px`: nothing here set its own padding
	   to contest it. Same pair of fixes repeated on every plain-button
	   control below (.pc-tabbar__item, .pc-drawer__close). */
	.pc-stepper__btn {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 26px;
		height: 26px;
		min-width: 44px;
		min-height: 44px;
		margin: -9px;
		padding: 0;
		background: none;
		border: none;
		box-shadow: none;
		font-size: 0.9rem;
		line-height: 1;
		color: var(--text-heading);
		cursor: pointer;
	}

	.pc-stepper__btn:hover,
	.pc-stepper__btn:focus,
	.pc-stepper__btn:active {
		background: none;
		border-color: transparent;
		color: var(--text-heading);
		outline: none;
	}

	.pc-stepper__btn:disabled {
		opacity: 0.4;
		cursor: default;
	}

	.pc-stepper__value {
		min-width: 1.2em;
		text-align: center;
		font-family: var(--font-ui);
		font-size: 0.8rem;
		font-weight: 700;
		color: var(--text-heading);
	}

	/* Dimmed while a change is on its way, but still tappable: a tap during
	   a slow request is queued by nav-shell.js rather than lost. */
	.pc-stepper.is-pending {
		opacity: 0.5;
	}

	/* Toggle switch — drawn over proxy-card-scans' "Show card scans"
	   checkbox (its .pcs-scan-toggle markup), wherever that control sits:
	   the Filters screen and the product page. Each placement lays out its
	   own row; this is only the switch. The knob is parchment, never white.
	   Selectors carry the .pcs-scan-toggle ancestor to outrank
	   scan-toggle.css, which loads after this file.

	   .pc-switch is the same switch for markup of our own (the checkout's
	   billing-address row), which has no scan-toggle.css behind it and so
	   brings its own positioning. */
	.pc-switch {
		position: relative;
		display: inline-flex;
		flex: none;
	}

	.pc-switch__input {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		padding: 0;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
		border: 0;
	}

	.pc-switch__track {
		position: relative;
		display: block;
	}

	.pc-switch__thumb {
		position: absolute;
		border-radius: 50%;
	}

	.pcs-scan-toggle .pcs-scan-toggle__track,
	.pc-switch__track {
		box-sizing: border-box;
		width: 44px;
		height: 26px;
		border: var(--bw-default) solid var(--border-default);
		border-radius: var(--radius-pill);
		background: var(--pc-tan);
		transition: var(--motion-default);
	}

	.pcs-scan-toggle .pcs-scan-toggle__thumb,
	.pc-switch__thumb {
		top: 2px;
		left: 2px;
		width: 18px;
		height: 18px;
		background: var(--pc-parchment);
		box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
		transition: transform 0.25s ease-in-out;
	}

	.pcs-scan-toggle .pcs-scan-toggle__input:checked + .pcs-scan-toggle__track,
	.pc-switch__input:checked + .pc-switch__track {
		border-color: var(--accent);
		background: var(--accent);
	}

	.pcs-scan-toggle .pcs-scan-toggle__input:checked + .pcs-scan-toggle__track .pcs-scan-toggle__thumb,
	.pc-switch__input:checked + .pc-switch__track .pc-switch__thumb {
		transform: translateX(18px);
	}

	.pc-switch__input:focus-visible + .pc-switch__track {
		box-shadow: var(--shadow-focus);
	}

	/* Form field — label above, 2px outline, orange focus ring, red border
	   and message on error (checkout flow handoff, 9e). Raised on
	   --surface-card like the steppers, never white. The checkout's own
	   WooCommerce fields are drawn to match in mobile-checkout.css.

	   !important on what the theme contests: Astra's input[type=text] and
	   its dotted :focus border, and WooCommerce's `.woocommerce
	   input[type=text]` white fill, which loads after this file. */
	.pc-field__label {
		display: block;
		margin: 0 0 6px;
		font-family: var(--font-ui);
		font-size: 0.85rem;
		font-weight: 700;
		line-height: 1.3;
		color: var(--text-heading);
	}

	input.pc-field__input {
		box-sizing: border-box;
		width: 100%;
		height: auto !important;
		min-height: 3.25rem;
		margin: 0;
		padding: 0 16px !important;
		border: var(--bw-default) solid var(--border-default) !important;
		border-radius: var(--radius-lg) !important;
		background: var(--surface-card) !important;
		box-shadow: none !important;
		font-family: var(--font-body);
		/* 16px: iOS zooms the page into any smaller field on focus. */
		font-size: 1rem;
		line-height: 1.3;
		color: var(--text-heading) !important;
		transition: border-color 0.15s ease, box-shadow 0.15s ease;
	}

	input.pc-field__input::placeholder {
		color: var(--pc-brown-50);
		opacity: 1;
	}

	input.pc-field__input:focus {
		border: var(--bw-default) solid var(--accent) !important;
		box-shadow: var(--shadow-focus) !important;
		outline: none;
	}

	/* After :focus, so a field being corrected stays red until it's fixed. */
	input.pc-field__input.has-error {
		border-color: var(--pc-error) !important;
	}

	.pc-field__error {
		margin: 6px 0 0;
		font-family: var(--font-ui);
		font-size: 0.8rem;
		line-height: 1.35;
		color: var(--pc-error);
	}

	.pc-field__error[hidden] {
		display: none;
	}

	/* List row — thumbnail + name + price-per-card + stepper. The drawer uses
	   it at 34x46; later chunks (full cart page) can size the thumb larger via
	   .pc-list-row__thumb--lg. */
	.pc-list-row {
		display: flex;
		align-items: center;
		gap: 9px;
		padding: 10px 16px;
		border-bottom: 1px solid var(--border-hairline);
	}

	.pc-list-row__thumb {
		flex: none;
		width: 34px;
		height: 46px;
		border-radius: 8px;
		background: var(--surface-sunken);
		overflow: hidden;
	}

	.pc-list-row__thumb img {
		width: 100%;
		height: 100%;
		object-fit: cover;
		display: block;
	}

	.pc-list-row__body {
		flex: 1;
		min-width: 0;
	}

	.pc-list-row__name {
		display: block;
		font-family: var(--font-display);
		font-weight: 600;
		font-size: 0.8rem;
		color: var(--text-heading);
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.pc-list-row__price {
		font-family: var(--font-ui);
		font-size: 0.7rem;
		font-weight: 700;
		color: var(--accent);
		margin-top: 2px;
	}

	/* ---------- Bottom sheet ----------
	   Shared shell: the printing sheet (nav-shell.js's pcfPrintingSheet,
	   opened by the cart page's printing swap and the decklist importer's
	   printing picker) and the product grids' Sort sheet (mobile-shop.js).
	   Options are rows with an optional thumbnail, a name, a secondary line,
	   and a check on the selected one; tapping one applies it, there is no
	   confirm step.

	   z-index: above everything else fixed/absolute at the bottom of the
	   viewport — this file's tab bar (200) and drawers (205/210), and
	   Astra's #ast-scroll-top (9999, themes/astra's own sticky-add-to-cart
	   compat CSS). This is a modal; nothing should be able to sit on top of
	   it while it's open. */
	.pc-sheet-backdrop {
		position: fixed;
		inset: 0;
		background: rgba(67, 47, 31, 0.35);
		z-index: 10000;
		opacity: 0;
		pointer-events: none;
		transition: opacity 0.25s ease-in-out;
	}

	.pc-sheet-backdrop.is-open {
		display: block;
		opacity: 1;
		pointer-events: auto;
	}

	.pc-sheet {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 10001;
		max-height: 80vh;
		overflow-y: auto;
		border-radius: 20px 20px 0 0;
		border-top: var(--bw-default) solid var(--border-strong);
		box-shadow: var(--shadow-sheet);
		background: var(--surface-page);
		padding: 10px 18px calc(20px + env(safe-area-inset-bottom, 0px));
		transform: translateY(100%);
		transition: transform 0.25s ease-in-out;
	}

	.pc-sheet.is-open {
		display: block;
		transform: translateY(0);
	}

	.pc-sheet__handle {
		width: 36px;
		height: 4px;
		background: var(--pc-brown-30);
		border-radius: var(--radius-pill);
		margin: 0 auto 14px;
	}

	.pc-sheet__title {
		margin: 0 0 var(--space-3);
		font-size: 1rem;
		font-weight: 600;
		color: var(--text-heading);
	}

	.pc-sheet__options {
		display: flex;
		flex-direction: column;
		gap: var(--space-2);
		margin-bottom: var(--space-4);
	}

	.pc-sheet__option {
		display: flex;
		align-items: center;
		gap: var(--space-3);
		width: 100%;
		border-radius: var(--radius-md);
		padding: 8px 14px;
		border: var(--bw-default) solid var(--border-default);
		background: none;
		box-shadow: none;
		text-align: left;
		cursor: pointer;
		-webkit-tap-highlight-color: transparent;
	}

	/* :not(.is-selected) — a plain :hover/:focus/:active rule here would tie
	   in specificity with .pc-sheet__option.is-selected and (by source
	   order) win, wiping the selected option's accent border/background
	   the moment it's tapped again. */
	.pc-sheet__option:not(.is-selected):hover,
	.pc-sheet__option:not(.is-selected):focus,
	.pc-sheet__option:not(.is-selected):active {
		background: none;
		border-color: var(--border-default);
		color: inherit;
		outline: none;
	}

	.pc-sheet__option.is-selected {
		border-color: var(--accent);
		background: var(--pc-tan-soft);
	}

	.pc-sheet__option-text {
		flex: 1;
		min-width: 0;
	}

	.pc-sheet__option-name {
		display: block;
		font-size: 0.85rem;
		font-weight: 700;
		color: var(--text-heading);
	}

	.pc-sheet__option-price {
		display: block;
		font-size: 0.8rem;
		color: var(--text-muted);
	}

	.pc-sheet__option-check {
		flex: 0 0 auto;
		color: var(--accent);
		font-weight: 700;
		visibility: hidden;
	}

	.pc-sheet__option.is-selected .pc-sheet__option-check {
		visibility: visible;
	}

	/* The printing sheet's card thumbnail. Wrapped so tapping it can enlarge
	   the image instead of picking the printing; display:contents keeps the
	   wrap out of the button's flex layout. */
	.pc-sheet__option-thumb-wrap {
		display: contents;
	}

	.pc-sheet__option-thumb {
		flex: 0 0 auto;
		width: 34px;
		height: 47px;
		border-radius: 6px;
		object-fit: cover;
		background: var(--surface-sunken);
		cursor: pointer;
	}

	/* In place of the rows while they load, or when they couldn't. */
	.pc-sheet__message {
		margin: 0;
		padding: 6px 0 2px;
		font-family: var(--font-ui);
		font-size: 0.85rem;
		color: var(--pc-brown-50);
	}

	/* ---------- Tab bar ---------- */

	.pc-tabbar {
		display: flex;
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 200;
		padding: 0 2px;
		background: var(--surface-page);
		border-top: var(--bw-default) solid var(--border-strong);
	}

	/* color !important: Home and Shop are <a> links, and the theme's
	   main.min.css colours links orange with an `a:not(.btn):not(...)` chain
	   whose :not()s out-specify these classes, so both tabs read as active
	   on every page. The active rule below answers it the same way. */
	.pc-tabbar__item {
		flex: 1;
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 3px;
		padding: 9px 0 8px;
		background: none;
		border: none;
		box-shadow: none;
		color: var(--text-muted) !important;
		text-decoration: none;
		font-family: var(--font-ui);
		cursor: pointer;
	}

	/* Search/Cart/More are <button>s (Home/Shop are plain <a> links, not
	   affected by this); :not(.is-active) avoids a specificity tie with
	   .pc-tabbar__item.is-active's own color — see the longer note on
	   .pc-stepper__btn above. */
	.pc-tabbar__item:not(.is-active):hover,
	.pc-tabbar__item:not(.is-active):focus,
	.pc-tabbar__item:not(.is-active):active {
		background: none;
		border-color: transparent;
		color: var(--text-muted) !important;
		outline: none;
	}

	.pc-tabbar__item.is-active,
	.pc-tabbar__item.is-active:hover,
	.pc-tabbar__item.is-active:focus,
	.pc-tabbar__item.is-active:active {
		background: none;
		border-color: transparent;
		color: var(--accent) !important;
		outline: none;
	}

	.pc-tabbar__icon-wrap {
		position: relative;
		display: flex;
	}

	/* Home's brand mark is 20px tall; the stroke icons' 22px box keeps every
	   label on one line. */
	.pc-tabbar__icon-wrap--mark {
		align-items: center;
		height: 22px;
	}

	.pc-tabbar__label {
		font-size: 0.63rem;
		font-weight: 700;
	}

	.pc-tabbar__badge {
		position: absolute;
		top: -5px;
		right: -8px;
		display: flex;
		align-items: center;
		justify-content: center;
		min-width: 15px;
		height: 15px;
		padding: 0 3px;
		border-radius: var(--radius-pill);
		background: var(--accent);
		color: #fff;
		font-family: var(--font-ui);
		font-size: 0.55rem;
		font-weight: 700;
	}

	.pc-tabbar__badge.is-hidden {
		display: none;
	}

	/* Cart pulse — reuses the pcf-cart-pulse/pcf-cart-ring/pcf-badge-pop
	   keyframes from proxy-complex-core.css (loaded sitewide; keyframes are
	   global once loaded, so referencing them here doesn't need a second
	   copy). cart-pulse.js now also targets this button/badge alongside the
	   legacy header's .cart-btn/.cart-count — see that file. */
	.pc-tabbar__item.pcf-cart-pulse .pc-tabbar__icon-wrap svg {
		animation: pcf-cart-pulse 600ms ease-out;
		transform-origin: center center;
	}

	.pc-tabbar__item.pcf-cart-pulse .pc-tabbar__icon-wrap::after {
		content: "";
		position: absolute;
		top: 50%;
		left: 50%;
		width: 34px;
		height: 34px;
		margin: -17px 0 0 -17px;
		border-radius: 50%;
		border: 2px solid var(--accent-press);
		pointer-events: none;
		animation: pcf-cart-ring 600ms ease-out forwards;
	}

	.pc-tabbar__badge.pcf-badge-pop {
		animation: pcf-badge-pop 450ms cubic-bezier(0.34, 1.56, 0.64, 1);
	}

	@media (prefers-reduced-motion: reduce) {
		.pc-tabbar__item.pcf-cart-pulse .pc-tabbar__icon-wrap svg,
		.pc-tabbar__badge.pcf-badge-pop {
			animation: none;
		}

		.pc-tabbar__item.pcf-cart-pulse .pc-tabbar__icon-wrap::after {
			display: none;
		}
	}

	/* ---------- Drawers (Cart, More) ---------- */

	.pc-drawer-scrim {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 205;
		background: rgba(35, 25, 15, 0.4);
		opacity: 0;
		pointer-events: none;
		transition: var(--motion-default);
	}

	.pc-drawer-scrim.is-open {
		opacity: 1;
		pointer-events: auto;
	}

	.pc-drawer {
		display: flex;
		flex-direction: column;
		position: fixed;
		top: 0;
		right: 0;
		bottom: 0;
		z-index: 210;
		width: 82%;
		background: var(--surface-page);
		border-left: var(--bw-default) solid var(--border-strong);
		transform: translateX(100%);
		transition: var(--motion-default);
	}

	/* Shadow only while open: a closed drawer waits just off the right edge,
	   and its leftward shadow reached back into view on every page. The
	   transition above fades it with the slide. */
	.pc-drawer.is-open {
		box-shadow: var(--shadow-drawer);
		transform: translateX(0);
	}

	.pc-drawer__header {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 16px 18px 12px;
		border-bottom: 1px solid var(--border-hairline);
	}

	.pc-drawer__title {
		min-width: 0;
		margin: 0;
		font-family: var(--font-display);
		font-size: 1.05rem;
		font-weight: 600;
		color: var(--text-heading);
	}

	/* A drawer's title sits at the start, across from its close button. */
	.pc-drawer__header .pc-header-brand {
		justify-content: flex-start;
	}

	.pc-drawer__close {
		display: flex;
		align-items: center;
		justify-content: center;
		/* A 44px target; the negative margin keeps the header's height. */
		min-width: 44px;
		min-height: 44px;
		background: none;
		border: none;
		box-shadow: none;
		padding: var(--space-2);
		margin: calc(var(--space-2) * -1);
		font-family: var(--font-ui);
		font-size: 1.1rem;
		color: var(--text-heading);
		cursor: pointer;
	}

	.pc-drawer__close:hover,
	.pc-drawer__close:focus,
	.pc-drawer__close:active {
		background: none;
		border-color: transparent;
		color: var(--text-heading);
		outline: none;
	}

	.pc-drawer__body {
		flex: 1;
		display: flex;
		flex-direction: column;
		min-height: 0;
	}

	/* ---------- Cart drawer contents ---------- */

	.pc-drawer-cart__list {
		flex: 1;
		overflow-y: auto;
		padding: 4px 0;
	}

	/* Shown above the list when a quantity change didn't go through. */
	.pc-drawer-cart__error {
		margin: 0;
		padding: 10px 18px;
		font-family: var(--font-ui);
		font-size: 0.8rem;
		line-height: 1.35;
		color: var(--pc-error);
	}

	.pc-drawer-cart__viewfull {
		display: block;
		text-align: center;
		padding: 10px 18px;
		border-top: 1px solid var(--border-hairline);
		font-family: var(--font-ui);
		font-size: 0.85rem;
		font-weight: 700;
		color: var(--accent) !important;
		text-decoration: none;
	}

	.pc-drawer-cart__footer {
		display: flex;
		align-items: center;
		gap: var(--space-3);
		padding: 12px 18px 16px;
		border-top: var(--bw-default) solid var(--border-strong);
	}

	.pc-drawer-cart__subtotal {
		flex: 1;
	}

	.pc-drawer-cart__subtotal-label {
		display: block;
		font-family: var(--font-ui);
		font-size: 0.7rem;
		color: var(--text-muted);
		text-transform: uppercase;
		letter-spacing: 0.06em;
	}

	.pc-drawer-cart__subtotal-value {
		display: block;
		font-family: var(--font-display);
		font-size: 1.2rem;
		font-weight: 600;
		color: var(--text-heading);
	}

	.pc-drawer-cart__checkout {
		min-width: 150px;
	}

	.pc-drawer-cart__empty {
		flex: 1;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 10px;
		padding: 24px;
		text-align: center;
	}

	.pc-drawer-cart__empty-icon {
		color: var(--pc-brown-30);
	}

	.pc-drawer-cart__empty-title {
		font-family: var(--font-display);
		font-weight: 600;
		font-size: 1rem;
		color: var(--text-heading);
	}

	.pc-drawer-cart__empty-copy {
		font-family: var(--font-body);
		font-size: 0.8rem;
		color: var(--text-muted);
		max-width: 200px;
	}

	.pc-drawer-cart__empty .pc-btn {
		margin-top: 8px;
	}

	/* ---------- More drawer contents ---------- */

	.pc-more-list {
		display: flex;
		flex-direction: column;
	}

	.pc-more-list__row {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 14px 18px;
		border-bottom: 1px solid var(--border-hairline);
		font-family: var(--font-ui);
		font-size: 0.9rem;
		font-weight: 600;
		color: var(--text-heading) !important;
		text-decoration: none;
	}

	.pc-more-list__chevron {
		color: var(--text-muted);
		font-size: 1rem;
	}

	/* ---------- Header brand group ----------
	   The brand mark and a header's title (pcf_header_brand()), grouped so
	   the pair centres as one between the back arrow and the right-hand
	   slot; the mark as a sibling of those would pull the title off centre.
	   Drill-down, checkout, cart page and drawer headers all use it. */
	.pc-header-brand {
		flex: 1;
		min-width: 0;
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 7px;
	}

	/* ---------- Root tab header (Shop, Search) ----------
	   pcf_root_header(): no back arrow, the mark beside the section name at
	   the start, an optional link at the end. The drill-down header's
	   hairline and title type. Where it's pinned is up to each placement. */
	.pc-root-header {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 8px;
		padding: 14px 18px 12px;
		border-bottom: 1px solid var(--border-hairline);
		background: var(--surface-page);
	}

	.pc-root-header .pc-header-brand {
		flex: 0 1 auto;
		justify-content: flex-start;
		gap: 8px;
	}

	/* !important: the theme sets heading sizes with !important. Two classes
	   for the margin: Astra's `.woocommerce-js h2` gives an h2 a bottom
	   margin, which lifted the title off the mark's centre line. */
	.pc-root-header .pc-root-header__title {
		min-width: 0;
		margin: 0;
		font-family: var(--font-display);
		font-size: 1.05rem !important;
		font-weight: 600;
		line-height: 1.3;
		letter-spacing: normal;
		text-transform: none;
		color: var(--text-heading);
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	/* ---------- Drill-down header ---------- */

	.pc-drilldown-header {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: var(--space-2);
		padding: 16px 18px 12px;
		border-bottom: 1px solid var(--border-hairline);
	}

	/* A 44px tap target around a 24px-wide glyph; the negative margin keeps
	   the glyph on the header's padding line. */
	.pc-drilldown-header__back {
		flex: none;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		margin: -10px;
		font-family: var(--font-ui);
		font-size: 1.3rem;
		color: var(--text-heading) !important;
		text-decoration: none;
		line-height: 1;
		-webkit-tap-highlight-color: transparent;
	}

	/* min-width so a long title ellipsizes instead of pushing the back arrow
	   out. !important: the theme sets heading sizes with !important. */
	.pc-drilldown-header__title {
		min-width: 0;
		margin: 0;
		font-family: var(--font-display);
		font-size: 1.05rem !important;
		font-weight: 600;
		line-height: 1.3;
		letter-spacing: normal;
		text-transform: none;
		color: var(--text-heading);
		text-align: center;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	/* As wide as the back arrow's glyph, so the title centres on the screen. */
	.pc-drilldown-header__action {
		flex: none;
		min-width: 24px;
		text-align: right;
	}

	/* ---------- Checkout header (no tab bar) ---------- */

	.pc-checkout-header {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: var(--space-2);
		padding: 16px 18px 12px;
		border-bottom: 1px solid var(--border-hairline);
	}

	/* Same 44px target as .pc-drilldown-header__back. */
	.pc-checkout-header__back {
		flex: none;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		margin: -10px;
		font-family: var(--font-ui);
		font-size: 1.3rem;
		color: var(--text-heading) !important;
		text-decoration: none;
		line-height: 1;
		-webkit-tap-highlight-color: transparent;
	}

	/* !important: the theme sets heading sizes with !important. */
	.pc-checkout-header__title {
		min-width: 0;
		margin: 0;
		font-family: var(--font-display);
		font-size: 1.05rem !important;
		font-weight: 600;
		line-height: 1.3;
		letter-spacing: normal;
		text-transform: none;
		text-align: center;
		color: var(--text-heading);
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.pc-checkout-header__spacer {
		flex: none;
		min-width: 24px;
	}

	.pc-checkout-progress {
		display: flex;
		gap: 6px;
		padding: 14px 18px 0;
	}

	.pc-checkout-progress__segment {
		flex: 1;
		height: 4px;
		border-radius: var(--radius-pill);
		background: var(--border-default);
	}

	/* Done steps stay filled, so the bar reads as progress so far. */
	.pc-checkout-progress__segment.is-active,
	.pc-checkout-progress__segment.is-done {
		background: var(--accent);
	}

	.pc-checkout-progress__labels {
		display: flex;
		justify-content: space-between;
		margin: 0;
		padding: 6px 18px 0;
		list-style: none;
		font-family: var(--font-ui);
		font-size: 0.65rem;
		font-weight: 700;
		text-transform: uppercase;
		letter-spacing: 0.04em;
	}

	.pc-checkout-progress__labels > * {
		margin: 0;
		color: var(--pc-brown-50);
	}

	.pc-checkout-progress__labels > .is-active,
	.pc-checkout-progress__labels > .is-done {
		color: var(--accent);
	}

	/* ---------- Tap-to-enlarge lightbox ----------
	   Shared by the cart drawer (nav-shell.js) and the cart page's own row/
	   printing-swap thumbnails (mobile-cart.js calls window.pcfOpenLightbox,
	   defined below) — lives here rather than mobile-cart.css because the
	   drawer needs it on every page, not just the cart page. z-index well
	   above the tab bar/drawers (200/205/210) and the printing-swap sheet
	   (10001, mobile-cart.css) — this can be opened from a thumbnail inside
	   either. */
	.pc-lightbox-backdrop {
		position: fixed;
		inset: 0;
		background: rgba(20, 12, 6, 0.82);
		z-index: 10010;
		opacity: 0;
		pointer-events: none;
		transition: var(--motion-default);
	}

	.pc-lightbox-backdrop.is-open {
		display: block;
		opacity: 1;
		pointer-events: auto;
	}

	/* The whole overlay is the tap target — no close button, tapping the
	   image or the surrounding area both close it (see nav-shell.js). */
	.pc-lightbox {
		position: fixed;
		inset: 0;
		z-index: 10011;
		display: flex;
		align-items: center;
		justify-content: center;
		padding: 32px 24px;
		opacity: 0;
		pointer-events: none;
		cursor: pointer;
		transition: var(--motion-default);
	}

	.pc-lightbox.is-open {
		display: flex;
		opacity: 1;
		pointer-events: auto;
	}

	.pc-lightbox__image {
		max-width: 100%;
		max-height: 100%;
		border-radius: var(--radius-md);
		box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
	}

	.pc-list-row__thumb {
		cursor: pointer;
	}
}

/* ---------- Tablets ----------
   From 600px to the 1025px breakpoint the phone screens above run on a
   tablet-sized canvas. Lists and forms read in a centred column
   (--pc-measure), grids gain columns, and the overlays stop spanning the
   whole screen: drawers keep a phone's width, sheets and the lightbox sit
   centred. Each page's own sheet has a block like this one for its
   layout. */

@media (min-width: 600px) and (max-width: 1025px) {
	:root {
		--pc-measure: 720px;
		/* Padding that centres a full-bleed block's content in the column. */
		--pc-measure-inset: max(18px, calc((100% - var(--pc-measure)) / 2));
	}

	/* The logo bar spans the screen, as on a phone, rather than sitting in
	   the theme's 540/720px container: the logo keeps to the left edge the
	   headers under it start from. */
	header[role="banner"] > .container {
		max-width: none;
	}

	/* The five tabs gather in the middle instead of spreading 160px apart. */
	.pc-tabbar {
		justify-content: center;
		padding: 0 var(--space-6);
	}

	.pc-tabbar__item {
		flex: 0 1 128px;
		padding: 10px 0 9px;
	}

	.pc-tabbar__label {
		font-size: 0.7rem;
	}

	.pc-drawer {
		width: min(82%, 420px);
	}

	/* Centred, and outlined down both sides now that it has some; the slide
	   is unchanged. */
	.pc-sheet {
		left: max(0px, calc((100% - 560px) / 2));
		right: max(0px, calc((100% - 560px) / 2));
		max-height: 70vh;
		border-inline: var(--bw-default) solid var(--border-strong);
	}

	/* img: out-weighs the any-width .is-open rules at the end of this file. */
	.pc-lightbox.is-open img.pc-lightbox__image {
		max-width: min(100%, 560px);
		max-height: min(100%, 780px);
	}
}

/* ---------- Printing popover ----------
   window.pcfPrintingPopover (nav-shell.js): the desktop dropdown of a card's
   printings, opened from the decklist importer's review grid and the cart
   page's "N other versions" buttons. Outside the mobile media query, unlike
   most of this file, since it's the desktop counterpart of the printing
   sheet. The script appends it to <body> and places it from its trigger's
   rect.

   500px wide: a printing's set name, code badge and price fit on one line,
   and only the longest few set names get cut off. */

.pc-printing-popover__scrim {
	position: fixed;
	inset: 0;
	z-index: 29;
}

.pc-printing-popover {
	position: absolute;
	width: 500px;
	max-width: calc(100vw - 16px);
	z-index: 30;
	background: var(--surface-card);
	border: var(--bw-default) solid var(--border-strong);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-lg);
	padding: 0.5rem;
	animation: pc-printing-popover-in 0.18s ease-out;
}

/* Opened above its trigger: rises into place rather than dropping. */
.pc-printing-popover--above {
	animation-name: pc-printing-popover-in-above;
}

@keyframes pc-printing-popover-in {
	from { transform: translateY(-6px) scale(0.98); }
	to { transform: translateY(0) scale(1); }
}

@keyframes pc-printing-popover-in-above {
	from { transform: translateY(6px) scale(0.98); }
	to { transform: translateY(0) scale(1); }
}

.pc-printing-popover__head {
	padding: 0.5rem 0.6rem 0.4rem;
	font-family: var(--font-ui);
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--text-muted);
}

/* The printings scroll under the heading: six and a half rows (56px each),
   so a cut-off row shows there's more. The script lowers max-height when the
   viewport has less room. Contained, so reaching the end of the list doesn't
   scroll the page on. */
.pc-printing-popover__list {
	max-height: 364px;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: var(--pc-brown-30) var(--pc-brown-08);
}

.pc-printing-popover__list::-webkit-scrollbar {
	width: 10px;
}

.pc-printing-popover__list::-webkit-scrollbar-track {
	background: var(--pc-brown-08);
}

.pc-printing-popover__list::-webkit-scrollbar-thumb {
	background-color: var(--pc-brown-30);
	border-radius: var(--radius-pill);
	border: 2px solid var(--pc-brown-08);
}

.pc-printing-popover__message {
	padding: 0.5rem 0.6rem 0.75rem;
	font-family: var(--font-ui);
	font-size: 0.8125rem;
	color: var(--text-muted);
}

.pc-printing-popover__option {
	width: 100%;
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.5rem 0.6rem;
	border-radius: var(--radius-md);
	border: 1px solid transparent;
	background: transparent;
	box-shadow: none;
	cursor: pointer;
	text-align: left;
	font-family: var(--font-ui);
	transition: var(--motion-default);
}

/* Astra's inline button:focus and :hover fill a button with its accent and
   border it, and outrank the class above, so both are reset to the plain
   row: a click focuses a row, on its thumbnail too, where the popover stays
   open. Hovering the row tints it and borders it with the accent, like the
   importer's printing pills, except over a thumbnail with an image, which
   lights up on its own instead (below). */
.pc-printing-popover__option:focus,
.pc-printing-popover__option:hover {
	background: transparent;
	border-color: transparent;
	outline: none;
}

.pc-printing-popover__option:hover:not(:has(.pc-printing-popover__thumb:hover > img)) {
	background: var(--pc-brown-08);
	border-color: var(--accent);
}

.pc-printing-popover__option:focus-visible {
	background: var(--pc-brown-08);
	box-shadow: inset 0 0 0 2px var(--accent);
}

.pc-printing-popover__thumb {
	width: 28px;
	height: 38px;
	border-radius: 8px;
	background: var(--surface-sunken);
	border: 1px solid var(--border-hairline);
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	position: relative;
	transition: var(--motion-default);
}

/* A thumb with an image enlarges it instead of picking the printing, so it
   scales up when it's hovered itself, as its own separately clickable part
   of the row, and the row's highlight gives way to it (above). */
.pc-printing-popover__thumb:has(img):hover {
	transform: scale(1.15);
	border-color: var(--accent);
	box-shadow: var(--shadow-sm);
	z-index: 1;
}

.pc-printing-popover__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.pc-printing-popover__info {
	display: flex;
	flex-direction: column;
	gap: 2px;
	flex: 1;
	min-width: 0;
}

/* Set name, then the set code's badge, which keeps its size when a long
   name has to give way. */
.pc-printing-popover__set {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	min-width: 0;
}

.pc-printing-popover__set-name {
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--text-heading);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pc-printing-popover__set-code {
	background: var(--pc-tan-soft);
	border: 1px solid var(--border-hairline);
	border-radius: 4px;
	padding: 1px 6px;
	font-size: 0.6875rem;
	font-weight: 700;
	color: var(--text-heading);
	flex: none;
}

.pc-printing-popover__detail {
	font-size: 0.75rem;
	color: var(--text-muted);
}

.pc-printing-popover__price {
	font-family: var(--font-display);
	font-weight: 600;
	font-size: 0.875rem;
	color: var(--text-heading);
	flex: none;
}

.pc-printing-popover__check {
	flex: none;
	width: 16px;
	height: 16px;
	color: var(--accent);
}

.pc-printing-popover__check svg {
	display: block;
}

/* ---------- Lightbox at desktop widths ----------
   The lightbox above only un-hides its .is-open state below 1025px, where the
   cart drawer and product gallery open it (both gate themselves to that
   width in nav-shell.js). The printing popover's thumbnails and the decklist
   importer's review grid open it at any width, and these rules show it there.
   .is-open-qualified, so nothing that doesn't open it changes. */

.pc-lightbox-backdrop.is-open {
	display: block;
	position: fixed;
	inset: 0;
	z-index: 10010;
	opacity: 1;
	pointer-events: auto;
	background: rgba(20, 12, 6, 0.82);
	transition: var(--motion-default);
}

.pc-lightbox.is-open {
	display: flex;
	position: fixed;
	inset: 0;
	z-index: 10011;
	align-items: center;
	justify-content: center;
	opacity: 1;
	pointer-events: auto;
	cursor: pointer;
	padding: 32px 24px;
	transition: var(--motion-default);
}

.pc-lightbox.is-open .pc-lightbox__image {
	max-width: 100%;
	max-height: 100%;
	border-radius: var(--radius-md);
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

/* A full-viewport image looks absurd on a large monitor, so above the phone
   breakpoint it's capped to a card-viewing size. */
@media (min-width: 1026px) {
	.pc-lightbox.is-open .pc-lightbox__image {
		max-width: min(90vw, 480px);
		max-height: min(85vh, 680px);
	}
}
