/**
 * Page shell, header, footer, navigation, drawers and modals.
 */

.tcgsf-container {
	width: 100%;
	max-width: var( --tcgsf-content-width );
	margin: 0 auto;
	padding: 0 20px;
}

.tcgsf-layout-boxed .tcgsf-page {
	max-width: calc( var( --tcgsf-content-width ) + 80px );
	margin: 0 auto;
	background: var( --tcgsf-surface );
	box-shadow: var( --tcgsf-shadow );
}

.tcgsf-layout-full .tcgsf-container {
	max-width: none;
	padding: 0 32px;
}

.tcgsf-main {
	display: block;
	min-height: 50vh;
	padding: var( --tcgsf-gap ) 0 var( --tcgsf-gap-lg );
}

.tcgsf-main__inner {
	display: grid;
	gap: var( --tcgsf-gap );
	align-items: start;
}

.tcgsf-main--full-width .tcgsf-main__inner {
	grid-template-columns: minmax( 0, 1fr );
}

.tcgsf-main--sidebar-left .tcgsf-main__inner {
	grid-template-columns: 272px minmax( 0, 1fr );
}

.tcgsf-main--sidebar-right .tcgsf-main__inner {
	grid-template-columns: minmax( 0, 1fr ) 272px;
}

@media ( max-width: 1024px ) {
	.tcgsf-main--sidebar-left .tcgsf-main__inner,
	.tcgsf-main--sidebar-right .tcgsf-main__inner {
		grid-template-columns: minmax( 0, 1fr );
	}
}

.tcgsf-main__content {
	min-width: 0;
}

/* --------------------------------------------------------------------------
 * Top bar and header
 * ----------------------------------------------------------------------- */

.tcgsf-topbar {
	background: var( --tcgsf-brand-charcoal );
	color: #dfe6ff;
	font-size: 13px;
}

.tcgsf-topbar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var( --tcgsf-gap-sm );
	min-height: 38px;
}

.tcgsf-topbar__message { margin: 0; }

.tcgsf-topbar__menu {
	display: flex;
	gap: 18px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tcgsf-topbar a { color: inherit; }
.tcgsf-topbar a:hover { color: var( --tcgsf-brand-teal ); }

.tcgsf-header {
	position: relative;
	z-index: 40;
	background: var( --tcgsf-surface );
	border-bottom: 1px solid var( --tcgsf-border );
}

.tcgsf-header.is-sticky.is-stuck {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	box-shadow: var( --tcgsf-shadow );
	animation: tcgsf-slide-down 0.25s var( --tcgsf-ease );
}

@keyframes tcgsf-slide-down {
	from { transform: translateY( -100% ); }
	to   { transform: translateY( 0 ); }
}

/*
 * Header grid.
 *
 * Explicit areas rather than source order: the header holds five children but
 * only three columns, so relying on auto-placement drops the tools onto their
 * own row. Named areas keep the desktop shape (brand / search / tools, with
 * the nav beneath) independent of the markup order the mobile layout needs.
 */
.tcgsf-header__inner {
	display: grid;
	grid-template-columns: auto minmax( 0, 1fr ) auto;
	grid-template-areas:
		'burger brand tools'
		'search search search';
	align-items: center;
	gap: 10px var( --tcgsf-gap-sm );
	min-height: var( --tcgsf-header-height );
	padding-block: 10px;
}

.tcgsf-header__burger { grid-area: burger; }
.tcgsf-header__brand  {
	grid-area: brand;
	/* Air around the wordmark: it was flush to the top edge and a hand's
	   width from the search box. */
	padding: 8px 24px 8px 0;
	display: flex;
	align-items: center;
}
.tcgsf-header__search { grid-area: search; min-width: 0; }
.tcgsf-header__tools  { grid-area: tools; }
.tcgsf-header__nav    { grid-area: nav; display: none; }

.tcgsf-header__brand img {
	display: block;
	max-height: 50px;
	width: auto;
}

.tcgsf-brand__title { margin: 0; font-family: var( --tcgsf-font-head ); font-size: 22px; font-weight: 700; }
.tcgsf-brand__title a { color: var( --tcgsf-ink ); }
.tcgsf-brand__tagline { margin: 0; font-size: 12px; color: var( --tcgsf-muted ); }

.tcgsf-header__burger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 1px solid var( --tcgsf-border );
	border-radius: var( --tcgsf-radius-sm );
	background: var( --tcgsf-surface );
	cursor: pointer;
}

.tcgsf-burger,
.tcgsf-burger::before,
.tcgsf-burger::after {
	display: block;
	width: 18px;
	height: 2px;
	border-radius: 2px;
	background: var( --tcgsf-ink );
	transition: transform 0.2s var( --tcgsf-ease );
}

.tcgsf-burger { position: relative; }
.tcgsf-burger::before,
.tcgsf-burger::after { content: ''; position: absolute; left: 0; }
.tcgsf-burger::before { top: -6px; }
.tcgsf-burger::after  { top: 6px; }

@media ( min-width: 1025px ) {
	.tcgsf-header__inner {
		grid-template-columns: auto minmax( 0, 1fr ) auto;
		grid-template-areas:
			'brand search tools'
			'nav   nav    nav';
		padding-block: 0;
	}

	.tcgsf-header__burger { display: none; }

	.tcgsf-header__nav {
		display: block;
		margin-top: 2px;
		border-top: 1px solid var( --tcgsf-border );
	}

	/* Compact puts everything on a single line. */
	.tcgsf-header--compact .tcgsf-header__inner {
		grid-template-columns: auto auto minmax( 0, 1fr ) auto;
		grid-template-areas: 'brand nav search tools';
	}

	.tcgsf-header--compact .tcgsf-header__nav { border-top: 0; margin-top: 0; }
}

/* --------------------------------------------------------------------------
 * Search
 * ----------------------------------------------------------------------- */

.tcgsf-search {
	position: relative;
	display: flex;
	align-items: stretch;
}

.tcgsf-search__field {
	flex: 1 1 auto;
	min-width: 0;
	border-radius: var( --tcgsf-radius-pill ) 0 0 var( --tcgsf-radius-pill );
	border-right: 0;
}

.tcgsf-search__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	border: 1px solid var( --tcgsf-primary );
	border-radius: 0 var( --tcgsf-radius-pill ) var( --tcgsf-radius-pill ) 0;
	background: var( --tcgsf-primary );
	color: #fff;
	cursor: pointer;
}

.tcgsf-search__submit:hover { background: var( --tcgsf-primary-dark ); }

.tcgsf-search__results {
	position: absolute;
	top: calc( 100% + 8px );
	left: 0;
	right: 0;
	z-index: 50;
	max-height: 60vh;
	overflow-y: auto;
	padding: 6px;
	border: 1px solid var( --tcgsf-border );
	border-radius: var( --tcgsf-radius );
	background: var( --tcgsf-surface );
	box-shadow: var( --tcgsf-shadow-lg );
}

.tcgsf-search__result {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px;
	border-radius: var( --tcgsf-radius-sm );
	color: var( --tcgsf-ink );
}

.tcgsf-search__result:hover,
.tcgsf-search__result:focus-visible {
	background: var( --tcgsf-surface-alt );
	text-decoration: none;
}

.tcgsf-search__result img {
	width: 44px;
	height: 44px;
	border-radius: var( --tcgsf-radius-sm );
	object-fit: cover;
}

.tcgsf-search__result-title { font-size: 14px; font-weight: 600; }
.tcgsf-search__result-price { font-size: 13px; color: var( --tcgsf-primary ); }

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

.tcgsf-tools {
	display: flex;
	align-items: center;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tcgsf-tools__link {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	padding: 8px 10px;
	border-radius: var( --tcgsf-radius-sm );
	color: var( --tcgsf-ink-soft );
	font-size: 11px;
	font-weight: 600;
}

.tcgsf-tools__link:hover {
	background: var( --tcgsf-surface-alt );
	color: var( --tcgsf-primary );
	text-decoration: none;
}

.tcgsf-tools__label { display: none; }

@media ( min-width: 640px ) {
	.tcgsf-tools__label { display: block; }
}

.tcgsf-tools__count {
	position: absolute;
	top: 2px;
	right: 2px;
	min-width: 18px;
	padding: 0 5px;
	border-radius: var( --tcgsf-radius-pill );
	background: var( --tcgsf-accent );
	color: #3a2a00;
	font-size: 10px;
	font-weight: 700;
	line-height: 18px;
	text-align: center;
}

.tcgsf-tools__count:empty,
.tcgsf-tools__count[data-count='0'] { display: none; }

/* --------------------------------------------------------------------------
 * Menu and mega menu
 * ----------------------------------------------------------------------- */

.tcgsf-menu {
	display: flex;
	flex-wrap: wrap;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tcgsf-menu__item { position: relative; }

.tcgsf-menu__link {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 14px 16px;
	color: var( --tcgsf-ink-soft );
	font-size: 15px;
	font-weight: 600;
}

.tcgsf-menu__item.is-current > .tcgsf-menu__link,
.tcgsf-menu__link:hover {
	color: var( --tcgsf-primary );
	text-decoration: none;
}

.tcgsf-menu__item.is-current > .tcgsf-menu__link::after {
	content: '';
	position: absolute;
	left: 16px;
	right: 16px;
	bottom: 6px;
	height: 2px;
	border-radius: 2px;
	background: var( --tcgsf-primary );
}

.tcgsf-menu__caret {
	width: 8px;
	height: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate( 45deg ) translateY( -2px );
}

.tcgsf-menu__toggle { display: none; }

.tcgsf-menu__sub {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 60;
	min-width: 220px;
	margin: 0;
	padding: 8px;
	border: 1px solid var( --tcgsf-border );
	border-radius: var( --tcgsf-radius );
	background: var( --tcgsf-surface );
	box-shadow: var( --tcgsf-shadow-lg );
	list-style: none;
	opacity: 0;
	visibility: hidden;
	transform: translateY( 6px );
	transition: opacity 0.16s var( --tcgsf-ease ), transform 0.16s var( --tcgsf-ease ), visibility 0.16s;
}

.tcgsf-menu__item:hover > .tcgsf-menu__sub,
.tcgsf-menu__item:focus-within > .tcgsf-menu__sub {
	opacity: 1;
	visibility: visible;
	transform: translateY( 0 );
}

.tcgsf-menu__sub .tcgsf-menu__link {
	padding: 9px 12px;
	border-radius: var( --tcgsf-radius-sm );
	font-size: 14px;
}

.tcgsf-menu__sub .tcgsf-menu__link:hover {
	background: var( --tcgsf-surface-alt );
}

/* Mega: a menu item tagged `mega-menu` spreads its children into columns
   across the full content width. */
.tcgsf-menu__item--mega { position: static; }

.tcgsf-menu__item--mega > .tcgsf-menu__sub {
	left: 0;
	right: 0;
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 190px, 1fr ) );
	gap: var( --tcgsf-gap-sm );
	padding: var( --tcgsf-gap );
}

.tcgsf-menu__item--mega > .tcgsf-menu__sub > .tcgsf-menu__item > .tcgsf-menu__link {
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var( --tcgsf-muted );
}

.tcgsf-menu__item--mega .tcgsf-menu__sub .tcgsf-menu__sub {
	position: static;
	opacity: 1;
	visibility: visible;
	transform: none;
	padding: 0;
	border: 0;
	box-shadow: none;
	background: none;
}

.tcgsf-menu__desc {
	display: block;
	font-size: 12px;
	font-weight: 400;
	color: var( --tcgsf-muted );
}

/* --------------------------------------------------------------------------
 * Drawers
 * ----------------------------------------------------------------------- */

.tcgsf-drawer {
	position: fixed;
	inset: 0;
	z-index: 200;
}

.tcgsf-drawer[hidden] { display: none; }

.tcgsf-drawer__backdrop {
	position: absolute;
	inset: 0;
	background: rgba( 19, 26, 58, 0.55 );
	opacity: 0;
	transition: opacity 0.25s var( --tcgsf-ease );
}

.tcgsf-drawer.is-open .tcgsf-drawer__backdrop { opacity: 1; }

.tcgsf-drawer__panel {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	display: flex;
	flex-direction: column;
	width: min( 380px, 88vw );
	background: var( --tcgsf-surface );
	box-shadow: var( --tcgsf-shadow-lg );
	transform: translateX( -100% );
	transition: transform 0.3s var( --tcgsf-ease );
}

.tcgsf-drawer--cart .tcgsf-drawer__panel {
	left: auto;
	right: 0;
	transform: translateX( 100% );
}

.tcgsf-drawer.is-open .tcgsf-drawer__panel { transform: translateX( 0 ); }

.tcgsf-drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	border-bottom: 1px solid var( --tcgsf-border );
}

.tcgsf-drawer__title { font-family: var( --tcgsf-font-head ); font-size: 17px; font-weight: 700; }

.tcgsf-drawer__close,
.tcgsf-modal__close,
.tcgsf-sidebar__close {
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: var( --tcgsf-radius-sm );
	background: var( --tcgsf-surface-alt );
	color: var( --tcgsf-ink );
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}

.tcgsf-drawer__body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 20px;
}

.tcgsf-drawer__search { margin-bottom: var( --tcgsf-gap-sm ); }

.tcgsf-drawer__menu,
.tcgsf-drawer__links {
	margin: 0 0 var( --tcgsf-gap );
	padding: 0;
	list-style: none;
}

.tcgsf-drawer__menu a,
.tcgsf-drawer__links a {
	display: block;
	padding: 12px 0;
	border-bottom: 1px solid var( --tcgsf-border );
	color: var( --tcgsf-ink );
	font-size: 16px;
	font-weight: 600;
}

.tcgsf-drawer__menu .sub-menu {
	margin: 0 0 0 14px;
	padding: 0;
	list-style: none;
}

.tcgsf-drawer__menu .sub-menu a { font-size: 15px; font-weight: 500; }

.tcgsf-minicart__shipping {
	padding: 14px 20px;
	border-bottom: 1px solid var( --tcgsf-border );
	background: var( --tcgsf-surface-alt );
	font-size: 13px;
}

.tcgsf-minicart__shipping p { margin: 0 0 8px; }

/* --------------------------------------------------------------------------
 * Modal
 * ----------------------------------------------------------------------- */

.tcgsf-modal {
	position: fixed;
	inset: 0;
	z-index: 220;
	display: grid;
	place-items: center;
	padding: 20px;
}

.tcgsf-modal[hidden] { display: none; }

.tcgsf-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba( 19, 26, 58, 0.6 );
}

.tcgsf-modal__panel {
	position: relative;
	width: min( 940px, 100% );
	max-height: 88vh;
	overflow-y: auto;
	border-radius: var( --tcgsf-radius );
	background: var( --tcgsf-surface );
	box-shadow: var( --tcgsf-shadow-lg );
}

.tcgsf-modal__close {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 2;
}

.tcgsf-modal__body { padding: var( --tcgsf-gap-lg ) var( --tcgsf-gap ); }

/* --------------------------------------------------------------------------
 * Sidebar
 * ----------------------------------------------------------------------- */

.tcgsf-sidebar {
	min-width: 0;
}

.tcgsf-sidebar__head { display: none; }

.tcgsf-sidebar .widget {
	padding: var( --tcgsf-gap-sm ) 0;
	border-bottom: 1px solid var( --tcgsf-border );
}

.tcgsf-sidebar .widget:last-child { border-bottom: 0; }

.widget__title {
	margin: 0 0 10px;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var( --tcgsf-muted );
}

.tcgsf-sidebar ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.tcgsf-sidebar li a {
	display: block;
	padding: 5px 0;
	color: var( --tcgsf-ink-soft );
	font-size: 14px;
}

/* On narrow screens the shop sidebar becomes a drawer. */
@media ( max-width: 1024px ) {
	.tcgsf-sidebar--shop {
		position: fixed;
		top: 0;
		bottom: 0;
		left: 0;
		z-index: 200;
		width: min( 340px, 88vw );
		background: var( --tcgsf-surface );
		box-shadow: var( --tcgsf-shadow-lg );
		transform: translateX( -100% );
		transition: transform 0.3s var( --tcgsf-ease );
		display: flex;
		flex-direction: column;
	}

	.tcgsf-sidebar--shop.is-open { transform: translateX( 0 ); }

	.tcgsf-sidebar--shop .tcgsf-sidebar__head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 16px 20px;
		border-bottom: 1px solid var( --tcgsf-border );
	}

	.tcgsf-sidebar--shop .tcgsf-sidebar__body {
		flex: 1 1 auto;
		overflow-y: auto;
		padding: 20px;
	}

	.tcgsf-sidebar__title { font-family: var( --tcgsf-font-head ); font-size: 17px; font-weight: 700; }
}

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

.tcgsf-footer {
	margin-top: auto;
	background: var( --tcgsf-brand-charcoal );
	color: #c9d2f5;
}

.tcgsf-footer__widgets { padding: var( --tcgsf-gap-lg ) 0; }

.tcgsf-footer__grid {
	display: grid;
	grid-template-columns: repeat( var( --tcgsf-footer-columns, 4 ), minmax( 0, 1fr ) );
	gap: var( --tcgsf-gap );
}

@media ( max-width: 900px ) {
	.tcgsf-footer__grid { grid-template-columns: repeat( 2, minmax( 0, 1fr ) ); }
}

@media ( max-width: 520px ) {
	.tcgsf-footer__grid { grid-template-columns: minmax( 0, 1fr ); }
}

.tcgsf-footer .widget__title { color: #fff; }
.tcgsf-footer a { color: #c9d2f5; }
.tcgsf-footer a:hover { color: var( --tcgsf-brand-teal ); }

.tcgsf-footer ul { margin: 0; padding: 0; list-style: none; }
.tcgsf-footer li { padding: 4px 0; }

.tcgsf-footer__bar {
	border-top: 1px solid rgba( 255, 255, 255, 0.1 );
	font-size: 13px;
}

.tcgsf-footer__bar-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var( --tcgsf-gap-sm );
	padding: 18px 20px;
}

.tcgsf-footer__copyright { margin: 0; }

.tcgsf-footer__menu {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* --------------------------------------------------------------------------
 * Shared bits
 * ----------------------------------------------------------------------- */

.tcgsf-breadcrumbs {
	margin-bottom: var( --tcgsf-gap-sm );
	font-size: 13px;
	color: var( --tcgsf-muted );
}

.tcgsf-breadcrumbs a { color: var( --tcgsf-muted ); }
.tcgsf-breadcrumbs a:hover { color: var( --tcgsf-primary ); }
.tcgsf-breadcrumbs__sep { margin: 0 8px; opacity: 0.5; }

.tcgsf-archive-head { margin-bottom: var( --tcgsf-gap ); }
.tcgsf-archive-head__title { margin: 0 0 6px; }
.tcgsf-archive-head__desc { margin: 0; color: var( --tcgsf-muted ); }

.tcgsf-pagination ul {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: var( --tcgsf-gap ) 0 0;
	padding: 0;
	list-style: none;
}

.tcgsf-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	height: 42px;
	padding: 0 12px;
	border: 1px solid var( --tcgsf-border );
	border-radius: var( --tcgsf-radius-sm );
	background: var( --tcgsf-surface );
	color: var( --tcgsf-ink-soft );
	font-weight: 600;
}

.tcgsf-pagination .page-numbers:hover { border-color: var( --tcgsf-primary ); color: var( --tcgsf-primary ); text-decoration: none; }
.tcgsf-pagination .page-numbers.current { background: var( --tcgsf-primary ); border-color: var( --tcgsf-primary ); color: #fff; }

/* Posts */
.tcgsf-posts {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 280px, 1fr ) );
	gap: var( --tcgsf-gap );
}

.tcgsf-post-card {
	display: flex;
	flex-direction: column;
	border: 1px solid var( --tcgsf-border );
	border-radius: var( --tcgsf-radius );
	background: var( --tcgsf-surface );
	overflow: hidden;
	box-shadow: var( --tcgsf-shadow );
}

.tcgsf-post-card__media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.tcgsf-post-card__body { padding: var( --tcgsf-gap-sm ); }
.tcgsf-post-card__title { margin: 0 0 6px; font-size: 18px; }
.tcgsf-post-card__title a { color: var( --tcgsf-ink ); }
.tcgsf-post-card__meta { margin: 0 0 8px; font-size: 13px; color: var( --tcgsf-muted ); }

.tcgsf-entry { max-width: 72ch; }

/* 72ch is a reading width for prose pages. The seller dashboard, My Account,
   the basket and checkout are applications, and were being squeezed into it:
   a 240px sidebar left a 430px content column on a desktop monitor. */
body.tcgmp-dashboard .tcgsf-entry,
body.woocommerce-account .tcgsf-entry,
body.woocommerce-cart .tcgsf-entry,
body.woocommerce-checkout .tcgsf-entry { max-width: none; }
.tcgsf-entry__media { margin: 0 0 var( --tcgsf-gap ); }
.tcgsf-entry__media img { border-radius: var( --tcgsf-radius ); }
.tcgsf-entry__meta { color: var( --tcgsf-muted ); font-size: 14px; }
.tcgsf-entry__content { font-size: 17px; }

.tcgsf-404 { padding: var( --tcgsf-gap-lg ) 0; text-align: center; }
.tcgsf-404__code { margin: 0; font-family: var( --tcgsf-font-head ); font-size: clamp( 72px, 16vw, 150px ); font-weight: 700; line-height: 1; color: var( --tcgsf-primary-soft ); }
.tcgsf-404__text { max-width: 44ch; margin: 0 auto 1.5em; color: var( --tcgsf-muted ); }
.tcgsf-404__search { max-width: 460px; margin: 0 auto var( --tcgsf-gap ); }

/* --------------------------------------------------------------------------
 * Header tools inside a page-builder header
 *
 * Dropped into an Elementor header via [tcgsf_header_tools], the icons sit on
 * whatever background that header uses — often a photograph. They need their
 * own surface to stay legible, matching the pill the nav menu already uses.
 * ----------------------------------------------------------------------- */

.elementor-location-header .tcgsf-header__tools,
.elementor-widget-shortcode .tcgsf-header__tools {
	display: flex;
	justify-content: center;
}

.elementor-location-header .tcgsf-tools,
.elementor-widget-shortcode .tcgsf-tools {
	gap: 2px;
	padding: 6px 10px;
	border-radius: var( --tcgsf-radius-pill );
	background: var( --tcgsf-surface );
	box-shadow: 0 2px 12px rgba( 19, 26, 58, 0.18 );
}

.elementor-location-header .tcgsf-tools__link,
.elementor-widget-shortcode .tcgsf-tools__link {
	padding: 6px 12px;
	color: var( --tcgsf-ink-soft );
}

.elementor-location-header .tcgsf-tools__link:hover,
.elementor-widget-shortcode .tcgsf-tools__link:hover {
	background: var( --tcgsf-primary-soft );
	color: var( --tcgsf-primary-dark );
}

/* The count badge sits over the icon, which is tight in a compact pill. */
.elementor-location-header .tcgsf-tools__count,
.elementor-widget-shortcode .tcgsf-tools__count {
	top: 0;
	right: 4px;
}

/* Seller call to action in the header. */
.tcgsf-seller-cta {
	flex: 0 0 auto;
	margin-left: 8px;
	padding: 11px 20px;
	font-size: 14px;
	white-space: nowrap;
}

/* Phones: the button's home is the drawer ("Sell Your Cards"). It has to beat
   `.woocommerce .tcgsf-btn.tcgsf-btn` (0,3,0) from base.css, which re-shows it
   on WooCommerce pages — it then pushed the tools off-screen and squeezed the
   logo column to nothing, so the page scrolled sideways. */
@media ( max-width: 640px ) {
	.tcgsf-header .tcgsf-header__tools .tcgsf-seller-cta.tcgsf-seller-cta { display: none; }
}

.tcgsf-header__tools {
	display: flex;
	align-items: center;
}

/* --------------------------------------------------------------------------
 * Logo, light and dark
 *
 * Both are in the markup and CSS chooses: swapping the src in JavaScript would
 * show the wrong logo for a frame on every load.
 * ----------------------------------------------------------------------- */

.tcgsf-brand__link {
	display: inline-block;
	line-height: 0;
}

/* Sizing first, then visibility — and the visibility rules carry the same
   weight as the sizing rule, or `display: block` here would resurrect the
   hidden variant. */
.tcgsf-header__brand .tcgsf-logo img,
.tcgsf-header__brand img.tcgsf-logo {
	display: block;
	max-height: 50px;
	width: auto;
}

.tcgsf-header__brand .tcgsf-logo--dark,
.tcgsf-header__brand img.tcgsf-logo--dark {
	display: none;
}

:root[ data-tcgsf-theme='dark' ] .tcgsf-header__brand .tcgsf-logo--light,
:root[ data-tcgsf-theme='dark' ] .tcgsf-header__brand img.tcgsf-logo--light {
	display: none;
}

:root[ data-tcgsf-theme='dark' ] .tcgsf-header__brand .tcgsf-logo--dark,
:root[ data-tcgsf-theme='dark' ] .tcgsf-header__brand img.tcgsf-logo--dark {
	display: block;
}

/* The footer is always dark, so it always takes the light wordmark. */
.tcgsf-footer .tcgsf-logo--light { display: none; }
.tcgsf-footer .tcgsf-logo--dark { display: inline-block; }

@media (max-width: 640px) {
	.tcgsf-header__brand { padding: 6px 12px 6px 0; min-width: 0; }
	.tcgsf-header__brand .tcgsf-logo img,
	.tcgsf-header__brand img.tcgsf-logo,
	.tcgsf-header__brand img { max-height: 40px; }
}

/* ---- Mini-cart items ---------------------------------------------------
   WooCommerce's mini-cart list had no styling at all: each card rendered
   its full-size thumbnail, one item per screen. Card orders run to dozens
   of lines, so this is a dense list with the totals pinned at the bottom. */
.tcgsf-drawer--cart .tcgsf-drawer__body { display: flex; flex-direction: column; min-height: 0; }
.tcgsf-drawer--cart .tcgsf-minicart__content { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.tcgsf-drawer--cart .woocommerce-mini-cart { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.tcgsf-drawer--cart .woocommerce-mini-cart-item { position: relative; display: grid; grid-template-columns: 44px minmax( 0, 1fr ) auto; gap: 4px 12px; align-items: center; padding: 10px 28px 10px 0; border-bottom: 1px solid var( --tcgsf-border ); font-size: 14px; line-height: 1.3; }
.tcgsf-drawer--cart .woocommerce-mini-cart-item > a:not(.remove) { grid-column: 1 / 3; display: grid; grid-template-columns: 44px minmax( 0, 1fr ); gap: 12px; align-items: center; color: var( --tcgsf-ink ); font-weight: 600; }
.tcgsf-drawer--cart .woocommerce-mini-cart-item img { width: 44px; height: 58px; object-fit: cover; border-radius: 6px; display: block; }
.tcgsf-drawer--cart .woocommerce-mini-cart-item .quantity { grid-column: 3; white-space: nowrap; color: var( --tcgsf-muted ); font-size: 13px; }
.tcgsf-drawer--cart .woocommerce-mini-cart-item .quantity .woocommerce-Price-amount { color: var( --tcgsf-ink ); font-weight: 600; }
.tcgsf-drawer--cart .woocommerce-mini-cart-item a.remove { position: absolute; right: 0; top: 50%; transform: translateY( -50% ); width: 22px; height: 22px; line-height: 20px; text-align: center; border-radius: 50%; color: var( --tcgsf-muted ); font-size: 18px; text-decoration: none; }
.tcgsf-drawer--cart .woocommerce-mini-cart-item a.remove:hover { background: var( --tcgsf-danger-soft ); color: var( --tcgsf-danger ); }
.tcgsf-drawer--cart .woocommerce-mini-cart-item .variation { grid-column: 2; margin: 0; font-size: 12px; color: var( --tcgsf-muted ); }
.tcgsf-drawer--cart .woocommerce-mini-cart__total { display: flex; justify-content: space-between; margin: 12px 0 10px; padding-top: 12px; border-top: 2px solid var( --tcgsf-border ); font-size: 15px; }
.tcgsf-drawer--cart .woocommerce-mini-cart__buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.tcgsf-drawer--cart .woocommerce-mini-cart__buttons .button { margin: 0; text-align: center; }
.tcgsf-drawer--cart .woocommerce-mini-cart__empty-message { padding: 24px 0; text-align: center; color: var( --tcgsf-muted ); }

/* Small phones (360px and under): tighten the header so burger, logo and the
   four tool icons still share one row without clipping. */
@media ( max-width: 380px ) {
	.tcgsf-header__inner { column-gap: 6px; }
	.tcgsf-header__brand { padding-right: 4px; }
	.tcgsf-header__brand .tcgsf-logo img,
	.tcgsf-header__brand img.tcgsf-logo,
	.tcgsf-header__brand img { max-height: 32px; max-width: 100%; }
	.tcgsf-header .tcgsf-header__tools .tcgsf-tools__link { padding-inline: 6px; }
}

/* ---- Mobile audit, 2026-10 ---------------------------------------------- */

/* Footer links were 16px-tall inline text: a comfortable thumb target needs
   some vertical padding, and the rows gain a little air with it. */
.tcgsf-footer__menu a,
.tcgsf-footer li a {
	display: inline-block;
	padding: 6px 0;
}

/* Live search: the title and price shared one inline span and ran together
   ("Tony Tony. ChopperR400,00"). Stack them. */
.tcgsf-search__result > span {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.tcgsf-search__result-title,
.tcgsf-search__result-price {
	display: block;
}

/* Mini-cart remove was 22px; the whole row is tappable territory anyway. */
.tcgsf-drawer--cart .woocommerce-mini-cart-item { padding-right: 36px; }
.tcgsf-drawer--cart .woocommerce-mini-cart-item a.remove {
	width: 32px;
	height: 32px;
	line-height: 30px;
}

/* Prose tables (shipping guide, articles) were clipped at the right edge of
   a phone: let the table scroll sideways inside its own box instead. */
@media ( max-width: 640px ) {
	.tcgsf-entry__content table {
		display: block;
		width: 100%;
		max-width: 100%;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}
}
