/*
 * TechMart — components
 * Buttons, badges, forms, cards, sections, hero, banners, benefits,
 * countdown, breadcrumbs, pagination, empty states.
 */

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

.tm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px; /* Comfortable touch target at every size. */
	padding: 10px 20px;
	border: 1px solid transparent;
	border-radius: var(--tm-radius);
	font-size: var(--tm-fs-sm);
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color var(--tm-speed) var(--tm-ease),
		border-color var(--tm-speed) var(--tm-ease),
		color var(--tm-speed) var(--tm-ease);
}

.tm-btn:disabled,
.tm-btn.is-loading {
	opacity: .6;
	pointer-events: none;
}

.tm-btn--primary {
	background: var(--tm-primary);
	border-color: var(--tm-primary);
	color: #fff;
}

.tm-btn--primary:hover {
	background: var(--tm-primary-dark);
	border-color: var(--tm-primary-dark);
	color: #fff;
}

.tm-btn--dark {
	background: var(--tm-text);
	border-color: var(--tm-text);
	color: #fff;
}

.tm-btn--dark:hover {
	background: #000;
	color: #fff;
}

.tm-btn--ghost {
	background: var(--tm-background);
	border-color: var(--tm-border-strong);
	color: var(--tm-text);
}

.tm-btn--ghost:hover {
	border-color: var(--tm-primary);
	color: var(--tm-primary);
}

.tm-btn--danger {
	background: var(--tm-danger);
	border-color: var(--tm-danger);
	color: #fff;
}

.tm-btn--lg {
	min-height: 52px;
	padding-inline: 26px;
	font-size: var(--tm-fs-body);
}

.tm-btn--sm {
	min-height: 36px;
	padding: 6px 14px;
	font-size: var(--tm-fs-xs);
}

.tm-btn--block {
	display: flex;
	width: 100%;
}

.tm-link-btn {
	background: none;
	border: 0;
	padding: 0;
	color: var(--tm-muted);
	font-size: var(--tm-fs-sm);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.tm-link-btn:hover {
	color: var(--tm-primary);
}

.tm-icon-btn {
	display: inline-grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	background: none;
	border: 0;
	border-radius: var(--tm-radius);
	color: var(--tm-text);
	text-decoration: none;
	transition: background-color var(--tm-speed) var(--tm-ease), color var(--tm-speed) var(--tm-ease);
}

.tm-icon-btn:hover {
	background: var(--tm-surface);
	color: var(--tm-primary);
}

/* -------------------------------------------------------------------------
 * Forms
 * ---------------------------------------------------------------------- */

.tm-input,
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="number"],
input[type="date"],
textarea,
select {
	width: 100%;
	min-height: 44px;
	padding: 10px 13px;
	background: var(--tm-background);
	border: 1px solid var(--tm-border-strong);
	border-radius: var(--tm-radius);
	font-size: var(--tm-fs-sm);
	color: var(--tm-text);
	transition: border-color var(--tm-speed) var(--tm-ease), box-shadow var(--tm-speed) var(--tm-ease);
}

textarea {
	min-height: 120px;
	resize: vertical;
}

.tm-input:focus,
input:focus,
textarea:focus,
select:focus {
	border-color: var(--tm-primary);
	box-shadow: 0 0 0 3px rgba(var(--tm-primary-rgb), .14);
	outline: none;
}

.tm-input::placeholder,
input::placeholder,
textarea::placeholder {
	color: var(--tm-faint);
}

label {
	display: inline-block;
	margin-bottom: 5px;
	font-size: var(--tm-fs-sm);
	font-weight: 500;
}

.tm-form__note {
	font-size: var(--tm-fs-xs);
	color: var(--tm-muted);
}

/* Quantity stepper */

.tm-qty {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--tm-border-strong);
	border-radius: var(--tm-radius);
	overflow: hidden;
	background: var(--tm-background);
}

.tm-qty__btn {
	display: grid;
	place-items: center;
	width: 38px;
	height: 42px;
	background: none;
	border: 0;
	color: var(--tm-muted);
}

.tm-qty__btn:hover {
	background: var(--tm-surface);
	color: var(--tm-text);
}

.tm-qty input.qty,
.tm-qty .tm-qty__input {
	width: 46px;
	min-height: 42px;
	padding: 0;
	border: 0;
	border-radius: 0;
	text-align: center;
	font-weight: 600;
	-moz-appearance: textfield;
}

.tm-qty input.qty::-webkit-outer-spin-button,
.tm-qty input.qty::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.tm-qty input.qty:focus {
	box-shadow: none;
}

.tm-qty--compact .tm-qty__btn {
	width: 28px;
	height: 30px;
}

.tm-qty__value {
	min-width: 30px;
	text-align: center;
	font-size: var(--tm-fs-sm);
	font-weight: 600;
}

/* -------------------------------------------------------------------------
 * Badges & stars
 * ---------------------------------------------------------------------- */

.tm-badge {
	display: inline-flex;
	align-items: center;
	padding: 3px 8px;
	border-radius: var(--tm-radius-sm);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .02em;
	line-height: 1.5;
	white-space: nowrap;
}

.tm-badge--sale {
	background: var(--tm-danger);
	color: #fff;
}

.tm-badge--new {
	background: var(--tm-success);
	color: #fff;
}

.tm-badge--out {
	background: var(--tm-text);
	color: #fff;
}

.tm-badge--accent {
	background: var(--tm-accent);
	color: var(--tm-text);
}

.tm-stars {
	position: relative;
	display: inline-block;
	line-height: 0;
	white-space: nowrap;
	vertical-align: middle;
}

.tm-stars__track,
.tm-stars__fill {
	display: flex;
	gap: 1px;
}

.tm-stars__track {
	color: var(--tm-border-strong);
}

.tm-stars__fill {
	position: absolute;
	inset-block: 0;
	inset-inline-start: 0;
	overflow: hidden;
	color: var(--tm-accent);
}

.tm-stars__fill svg {
	fill: currentColor;
}

.tm-stars__count {
	margin-inline-start: 6px;
	font-size: var(--tm-fs-xs);
	color: var(--tm-muted);
	vertical-align: middle;
}

/* -------------------------------------------------------------------------
 * Section header
 * ---------------------------------------------------------------------- */

.tm-section-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: clamp(20px, 2.5vw, 32px);
}

.tm-section-head--center {
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.tm-section-head__eyebrow {
	margin: 0 0 6px;
	font-size: var(--tm-fs-xs);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .07em;
	color: var(--tm-primary);
}

.tm-section-head__title {
	margin: 0;
}

.tm-section-head__subtitle {
	margin: 6px 0 0;
	color: var(--tm-muted);
	font-size: var(--tm-fs-sm);
	max-width: 60ch;
}

.tm-section-head__link {
	flex: none;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: var(--tm-fs-sm);
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

@media (max-width: 560px) {
	.tm-section-head {
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
	}
}

/* -------------------------------------------------------------------------
 * Thumbnails & placeholders
 * ---------------------------------------------------------------------- */

.tm-thumb {
	position: relative;
	display: block;
	aspect-ratio: var(--tm-ratio, 16 / 10);
	overflow: hidden;
	border-radius: var(--tm-radius);
	background: var(--tm-surface);
}

.tm-thumb__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform var(--tm-speed-slow) var(--tm-ease);
}

.tm-thumb__placeholder {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	color: var(--tm-faint);
	background: var(--tm-surface);
}

/* -------------------------------------------------------------------------
 * Hero
 * ---------------------------------------------------------------------- */

.tm-hero {
	position: relative;
	overflow: hidden;
	background: linear-gradient(135deg, var(--tm-surface-2) 0%, var(--tm-primary-light) 100%);
}

.tm-hero--has-bg::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image: var(--tm-hero-bg);
	background-size: cover;
	background-position: center;
}

.tm-hero--has-bg::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, rgba(255, 255, 255, .94) 0%, rgba(255, 255, 255, .72) 55%, rgba(255, 255, 255, .3) 100%);
}

[dir="rtl"] .tm-hero--has-bg::after {
	background: linear-gradient(270deg, rgba(255, 255, 255, .94) 0%, rgba(255, 255, 255, .72) 55%, rgba(255, 255, 255, .3) 100%);
}

/*
 * The scrim has to change direction when the layout does.
 *
 * Above 900px the hero is two columns and the text sits in the left one, so a
 * horizontal gradient covers exactly where the words are. Below that the
 * columns stack and the text spans the full width — straight through the 30%
 * end of that gradient. On a busy photograph the last two or three words of
 * every line end up sitting on whatever the picture happens to be doing there,
 * which on the demo's owl is a dark eye behind grey body text.
 *
 * Stacked, the text is at the top, so the scrim runs top-to-bottom instead.
 */
@media (max-width: 899px) {
	.tm-hero--has-bg::after,
	[dir="rtl"] .tm-hero--has-bg::after {
		background: linear-gradient(180deg, rgba(255, 255, 255, .95) 0%, rgba(255, 255, 255, .88) 45%, rgba(255, 255, 255, .45) 100%);
	}
}

.tm-hero__inner {
	position: relative;
	z-index: 1;
	display: grid;
	gap: 28px;
	align-items: center;
	padding-block: clamp(34px, 5vw, 68px);
}

@media (min-width: 900px) {
	.tm-hero__inner {
		grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
		gap: 48px;
	}
}

.tm-hero__badge {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin: 0 0 16px;
	padding: 6px 13px;
	background: var(--tm-background);
	border-radius: var(--tm-radius-pill);
	box-shadow: var(--tm-shadow-sm);
	font-size: var(--tm-fs-xs);
	font-weight: 600;
	color: var(--tm-primary);
}

.tm-hero__title {
	margin: 0 0 14px;
	font-size: var(--tm-fs-display);
	max-width: 16ch;
}

.tm-hero__desc {
	margin: 0 0 24px;
	max-width: 52ch;
	font-size: clamp(1rem, .96rem + .2vw, 1.1rem);
	color: var(--tm-muted);
}

.tm-hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.tm-hero__media {
	position: relative;
}

.tm-hero__img {
	width: 100%;
	height: auto;
	object-fit: contain;
	filter: drop-shadow(0 24px 44px rgba(15, 23, 42, .18));
}

@media (max-width: 899px) {
	/* Text first, image below — the copy is what sells, and a tall image
	   above the fold would push the CTA off screen. */
	.tm-hero__media {
		order: 2;
		max-width: 420px;
		margin-inline: auto;
	}

	.tm-hero__text {
		order: 1;
	}
}

/* -------------------------------------------------------------------------
 * Countdown
 * ---------------------------------------------------------------------- */

.tm-countdown {
	margin-bottom: 22px;
}

.tm-countdown__units {
	display: flex;
	gap: 8px;
}

.tm-countdown__unit {
	display: grid;
	gap: 2px;
	justify-items: center;
	min-width: 56px;
	padding: 8px 6px;
	background: var(--tm-background);
	border: 1px solid var(--tm-border);
	border-radius: var(--tm-radius);
	box-shadow: var(--tm-shadow-sm);
}

.tm-countdown__value {
	font-size: 1.35rem;
	font-weight: 700;
	line-height: 1;
	font-variant-numeric: tabular-nums;
	color: var(--tm-danger);
}

.tm-countdown__label {
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var(--tm-muted);
}

/* Without JS the ticker would freeze on a stale value, so the units are
   hidden and the plain end date is shown instead. */
.tm-countdown__units {
	display: none;
}

.js .tm-countdown__units {
	display: flex;
}

.js .tm-countdown__fallback {
	display: none;
}

.tm-countdown__fallback {
	margin: 0;
	font-size: var(--tm-fs-sm);
	font-weight: 600;
	color: var(--tm-danger);
}

.tm-countdown.is-expired .tm-countdown__units {
	opacity: .45;
}

/* -------------------------------------------------------------------------
 * Category tiles
 * ---------------------------------------------------------------------- */

.tm-cat-grid {
	display: grid;
	gap: 14px;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 640px) {
	.tm-cat-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.tm-cat-grid {
		grid-template-columns: repeat(6, minmax(0, 1fr));
	}
}

.tm-cat-card {
	display: grid;
	gap: 10px;
	justify-items: center;
	height: 100%;
	padding: 18px 12px;
	background: var(--tm-background);
	border: 1px solid var(--tm-border);
	border-radius: var(--tm-radius-lg);
	text-align: center;
	text-decoration: none;
	color: var(--tm-text);
	transition: border-color var(--tm-speed) var(--tm-ease), box-shadow var(--tm-speed) var(--tm-ease), transform var(--tm-speed) var(--tm-ease);
}

.tm-cat-card:hover {
	border-color: var(--tm-primary);
	box-shadow: var(--tm-shadow);
	transform: translateY(-2px);
	color: var(--tm-text);
}

.tm-cat-card__media {
	position: relative;
	display: grid;
	place-items: center;
	width: 92px;
	height: 92px;
	padding: 8px;
	border-radius: 50%;
	background: var(--tm-surface-2);
	overflow: hidden;
}

/*
 * `contain`, not `cover`.
 *
 * A category thumbnail is nearly always a product cut-out — a camera on a
 * transparent background, wider than it is tall. Cropping one to fill a
 * circle slices the lens off the front and the bracket off the back, so the
 * tile ends up showing the middle of a camera rather than a camera. Fitting
 * it whole costs a little empty circle at the edges and is the difference
 * between recognising the product and not.
 */
.tm-cat-card__img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.tm-cat-card__body {
	display: grid;
	gap: 2px;
}

.tm-cat-card__name {
	font-size: var(--tm-fs-sm);
	font-weight: 600;
	line-height: 1.3;
}

.tm-cat-card__count {
	font-size: var(--tm-fs-xs);
	color: var(--tm-muted);
}

.tm-cat-card__arrow {
	color: var(--tm-primary);
	opacity: 0;
	transition: opacity var(--tm-speed) var(--tm-ease);
}

.tm-cat-card:hover .tm-cat-card__arrow {
	opacity: 1;
}

/* -------------------------------------------------------------------------
 * Banners
 * ---------------------------------------------------------------------- */

.tm-banner-row {
	display: grid;
	gap: 18px;
	grid-template-columns: 1fr;
}

@media (min-width: 768px) {
	.tm-banner-row--cols-2 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.tm-banner-row--cols-3 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.tm-banner {
	position: relative;
	display: flex;
	align-items: flex-end;
	min-height: 220px;
	overflow: hidden;
	border-radius: var(--tm-radius-lg);
	background: var(--tm-surface);
	isolation: isolate;
}

.tm-banner--lg {
	min-height: 320px;
}

.tm-banner--sm {
	min-height: 170px;
}

.tm-banner__media {
	position: absolute;
	inset: 0;
	z-index: -1;
}

.tm-banner__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform var(--tm-speed-slow) var(--tm-ease);
}

.tm-banner:hover .tm-banner__img {
	transform: scale(1.04);
}

.tm-banner__body {
	position: relative;
	width: 100%;
	padding: 22px;
	color: #fff;
	background: linear-gradient(0deg, rgba(15, 23, 42, .82) 0%, rgba(15, 23, 42, .35) 60%, transparent 100%);
}

.tm-banner--light .tm-banner__body {
	color: var(--tm-text);
	background: linear-gradient(0deg, rgba(255, 255, 255, .92) 0%, rgba(255, 255, 255, .55) 60%, transparent 100%);
}

.tm-banner__eyebrow {
	margin: 0 0 5px;
	font-size: var(--tm-fs-xs);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .07em;
	opacity: .85;
}

.tm-banner__title {
	margin: 0 0 6px;
	font-size: var(--tm-fs-h3);
	color: inherit;
}

.tm-banner__text {
	margin: 0 0 12px;
	font-size: var(--tm-fs-sm);
	opacity: .9;
	max-width: 40ch;
}

.tm-banner__cta {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: var(--tm-fs-sm);
	font-weight: 700;
}

.tm-banner__link {
	position: absolute;
	inset: 0;
}

.tm-banner__link:focus-visible {
	outline-offset: -3px;
}

/* -------------------------------------------------------------------------
 * Benefits
 * ---------------------------------------------------------------------- */

.tm-benefits {
	display: grid;
	gap: 16px;
	grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
	margin: 0;
	padding: clamp(20px, 3vw, 30px);
	list-style: none;
	background: var(--tm-surface-2);
	border-radius: var(--tm-radius-lg);
}

.tm-benefit {
	display: flex;
	gap: 13px;
	align-items: flex-start;
}

.tm-benefit__icon {
	display: grid;
	place-items: center;
	flex: none;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--tm-primary-light);
	color: var(--tm-primary);
}

.tm-benefit__body {
	display: grid;
	gap: 2px;
}

.tm-benefit__title {
	font-size: var(--tm-fs-sm);
	font-weight: 700;
}

.tm-benefit__text {
	font-size: var(--tm-fs-xs);
	color: var(--tm-muted);
	line-height: 1.5;
}

/* -------------------------------------------------------------------------
 * Brands
 * ---------------------------------------------------------------------- */

/*
 * Tracks are sized, not divided.
 *
 * A fixed six-column grid only looks right with six brands in it. A store
 * with two — which is this theme's own demo, and the common case for a
 * dealer — got two cards stranded at the far left of a 1200px row with a
 * thousand pixels of white beside them, reading as a section that failed to
 * load rather than a section with two brands in it.
 *
 * `auto-fit` with a capped track keeps each card a sensible size at any
 * count, and centring means a short strip sits deliberately in the middle
 * instead of hugging one edge.
 */
.tm-brands {
	display: grid;
	gap: 12px;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	justify-content: center;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 640px) {
	.tm-brands {
		grid-template-columns: repeat(auto-fit, minmax(150px, 200px));
	}
}

.tm-brand-card {
	display: grid;
	place-items: center;
	height: 96px;
	padding: 16px;
	background: var(--tm-background);
	border: 1px solid var(--tm-border);
	border-radius: var(--tm-radius);
	text-decoration: none;
	transition: border-color var(--tm-speed) var(--tm-ease), box-shadow var(--tm-speed) var(--tm-ease);
}

.tm-brand-card:hover {
	border-color: var(--tm-primary);
	box-shadow: var(--tm-shadow-sm);
}

/*
 * Logos in their own colours, not greyed out.
 *
 * Desaturating a logo wall is a good trick when there are twenty of them and
 * the point is the *quantity* of names. This strip has two or three, and the
 * point is which brands the shop is authorised to sell — so the mark is the
 * content, and washing it to grey until hover hides the one thing the
 * section exists to say. A touch of opacity keeps it from competing with the
 * products further down the page.
 */
.tm-brand-card__logo {
	/*
	 * Capped on both axes, because logos are not the same shape.
	 *
	 * Matching on height alone makes a wide wordmark look twice the size of
	 * a squarer one: Imou is roughly 4:1 and Uniview roughly 2:1, so at a
	 * shared 52px height Imou came out 218px across and Uniview 104px. Two
	 * limits give each mark the same *box* to fit inside, which lands them
	 * at a similar visual weight however they are proportioned.
	 */
	max-width: 132px;
	max-height: 46px;
	width: auto;
	object-fit: contain;
	opacity: .92;
	transition: opacity var(--tm-speed) var(--tm-ease), transform var(--tm-speed) var(--tm-ease);
}

.tm-brand-card:hover .tm-brand-card__logo {
	opacity: 1;
	transform: scale(1.03);
}

/*
 * The wordmark fallback sits next to real logos, so it has to look like a
 * choice rather than a missing image: same optical weight, same restraint.
 */
.tm-brand-card__name {
	font-size: var(--tm-fs-base);
	font-weight: 700;
	letter-spacing: .01em;
	color: var(--tm-text);
	text-align: center;
}

/* -------------------------------------------------------------------------
 * Reviews
 * ---------------------------------------------------------------------- */

.tm-reviews {
	display: grid;
	gap: 16px;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	margin: 0;
	padding: 0;
	list-style: none;
}

.tm-review {
	display: grid;
	gap: 12px;
	align-content: start;
	padding: 22px;
	background: var(--tm-background);
	border: 1px solid var(--tm-border);
	border-radius: var(--tm-radius-lg);
}

.tm-review__quote {
	margin: 0;
	padding: 0;
	border: 0;
	color: var(--tm-text);
	font-size: var(--tm-fs-sm);
	line-height: 1.6;
}

.tm-review__quote p {
	margin: 0;
}

.tm-review__meta {
	display: grid;
	gap: 2px;
	font-size: var(--tm-fs-xs);
}

.tm-review__author {
	font-weight: 700;
}

.tm-review__product {
	color: var(--tm-muted);
	text-decoration: none;
}

.tm-review__product:hover {
	color: var(--tm-primary);
}

/* -------------------------------------------------------------------------
 * Newsletter
 *
 * The last band on the page, and the last chance to ask for anything. It was
 * a flat slate strip 206px tall with a 14px heading; it is now an ink ground
 * with a brand glow, matching the homepage hero and the builder panel.
 *
 * It lives here rather than in home.css, even though the homepage is where
 * it was redesigned, because this band renders on *every* template — the
 * homepage puts it inside the main element, everywhere else it is a footer
 * band. home.css only loads on the front page, so keeping it there would
 * have shipped two different newsletters: an ink one on the homepage and the
 * old slate one on the shop, the blog and every product page.
 *
 * Consequently it depends on nothing the homepage defines. Every value below
 * is either a global token from base.css or a literal.
 * ---------------------------------------------------------------------- */

.tm-newsletter {
	position: relative;
	background: linear-gradient(155deg, var(--tm-ink) 0%, var(--tm-ink-2) 58%, var(--tm-ink) 100%);
	padding-block: clamp(44px, 5.5vw, 76px);
	overflow: hidden;
	isolation: isolate;
}

.tm-newsletter::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background:
		radial-gradient(55% 80% at 15% 0%, rgba(var(--tm-primary-rgb), .4) 0%, transparent 68%),
		radial-gradient(45% 70% at 92% 100%, rgba(var(--tm-primary-rgb), .2) 0%, transparent 70%);
	pointer-events: none;
}

/* Copy on the left, form on the right, once there is room for two columns. */
.tm-newsletter__inner {
	display: grid;
	gap: 22px;
	align-items: center;
}

@media (min-width: 900px) {
	.tm-newsletter__inner {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		gap: 48px;
	}
}

.tm-newsletter__title {
	color: #fff;
	font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem);
	letter-spacing: -.03em;
	line-height: 1.1;
	margin-bottom: 10px;
}

.tm-newsletter__desc {
	margin: 0;
	max-width: 48ch;
	font-size: clamp(1rem, .96rem + .25vw, 1.08rem);
	color: rgba(226, 232, 240, .76);
}

.tm-newsletter__row {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

/*
 * The form, as one control.
 *
 * An input and a button side by side with an 8px gap between them are two
 * controls that happen to be adjacent. Wrapped in a single pill — the input
 * transparent inside it, the button filling its end — they are one thing you
 * type into and submit, which is what it is.
 *
 * `:has()` is the guard: without support the row keeps the flex layout and
 * the 8px gap it already had, which works fine. Everything the pill needs is
 * inside the `@supports` block.
 */
/* The no-`:has()` fallback: two separate pill controls in a row. The field
   grows, the button does not. */
.tm-newsletter__row .tm-input {
	flex: 1 1 220px;
	border-color: transparent;
	border-radius: var(--tm-radius-pill);
}

.tm-newsletter__row .tm-btn--primary {
	border-radius: var(--tm-radius-pill);
	padding-inline: 26px;
}

@supports selector(:has(*)) {
	.tm-newsletter__row:has(.tm-input) {
		gap: 0;
		/* Inside a single pill the two controls must stay on one line: a
		   wrapped submit button would sit under the field with the pill
		   drawn around both, which reads as a broken control rather than
		   as a stacked one. The field shrinks instead — it has `min-width:
		   0` below, so it can. */
		flex-wrap: nowrap;
		padding: 6px;
		background: rgba(255, 255, 255, .1);
		border: 1px solid rgba(255, 255, 255, .18);
		border-radius: var(--tm-radius-pill);
		-webkit-backdrop-filter: blur(10px);
		backdrop-filter: blur(10px);
		transition: border-color var(--tm-speed) var(--tm-ease);
	}

	.tm-newsletter__row:has(.tm-input:focus-visible) {
		border-color: rgba(255, 255, 255, .5);
	}

	.tm-newsletter__row:has(.tm-input) .tm-input {
		flex: 1 1 200px;
		min-width: 0;
		background: transparent;
		border-color: transparent;
		box-shadow: none;
		color: #fff;
		padding-inline: 18px;
	}

	/* The field absorbs the shrinking; the button keeps its label. */
	.tm-newsletter__row:has(.tm-input) .tm-btn {
		flex: none;
	}

	.tm-newsletter__row:has(.tm-input) .tm-input::placeholder {
		color: rgba(226, 232, 240, .52);
	}

	/* The ring belongs to the pill, not to the input inside it. */
	.tm-newsletter__row:has(.tm-input) .tm-input:focus-visible {
		outline: none;
	}
}

.tm-newsletter__consent {
	margin: 14px 0 0;
	font-size: var(--tm-fs-xs);
	color: rgba(226, 232, 240, .52);
}

/* The AJAX endpoint's reply. The height is reserved so a success or error
   message cannot push the consent line and the band's bottom edge down. */
.tm-newsletter__message {
	margin: 8px 0 0;
	font-size: var(--tm-fs-sm);
	min-height: 1.4em;
}

.tm-newsletter__message.is-error {
	color: #fca5a5;
}

.tm-newsletter__message.is-success {
	color: #86efac;
}

/* -------------------------------------------------------------------------
 * Breadcrumbs, pagination, page heads
 * ---------------------------------------------------------------------- */

.tm-breadcrumbs {
	margin-bottom: 18px;
	font-size: var(--tm-fs-xs);
	color: var(--tm-muted);
}

.tm-breadcrumbs a {
	color: var(--tm-muted);
	text-decoration: none;
}

.tm-breadcrumbs a:hover {
	color: var(--tm-primary);
}

.tm-breadcrumbs__sep {
	margin-inline: 7px;
	color: var(--tm-faint);
}

.tm-page-head {
	margin-bottom: clamp(22px, 3vw, 34px);
}

.tm-page-head__title {
	margin: 0;
}

.tm-page-head__desc {
	margin: 8px 0 0;
	color: var(--tm-muted);
	max-width: 68ch;
}

.tm-page-head__search {
	margin-top: 16px;
	max-width: 520px;
}

.tm-pagination {
	margin-top: clamp(26px, 3vw, 40px);
}

.tm-pagination__list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tm-pagination .page-numbers {
	display: grid;
	place-items: center;
	min-width: 40px;
	height: 40px;
	padding-inline: 10px;
	border: 1px solid var(--tm-border);
	border-radius: var(--tm-radius);
	color: var(--tm-text);
	font-size: var(--tm-fs-sm);
	font-weight: 600;
	text-decoration: none;
	background: var(--tm-background);
}

.tm-pagination .page-numbers:hover {
	border-color: var(--tm-primary);
	color: var(--tm-primary);
}

.tm-pagination .page-numbers.current {
	background: var(--tm-primary);
	border-color: var(--tm-primary);
	color: #fff;
}

.tm-pagination .page-numbers.dots {
	border-color: transparent;
	background: none;
}

/* -------------------------------------------------------------------------
 * Empty states & 404
 * ---------------------------------------------------------------------- */

.tm-empty {
	display: grid;
	gap: 12px;
	justify-items: center;
	max-width: 520px;
	margin-inline: auto;
	padding: clamp(32px, 5vw, 60px) 20px;
	text-align: center;
}

.tm-empty__icon {
	color: var(--tm-faint);
}

.tm-empty__title {
	margin: 0;
	font-size: var(--tm-fs-h3);
}

.tm-empty__text {
	margin: 0;
	color: var(--tm-muted);
}

.tm-empty__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
	width: 100%;
	margin-top: 6px;
}

.tm-404 {
	display: grid;
	gap: 14px;
	justify-items: center;
	max-width: 620px;
	margin-inline: auto;
	padding-block: clamp(30px, 5vw, 60px);
	text-align: center;
}

.tm-404__code {
	margin: 0;
	font-size: clamp(4rem, 12vw, 8rem);
	font-weight: 800;
	line-height: 1;
	letter-spacing: -.04em;
	color: var(--tm-primary-light);
}

.tm-404__title {
	margin: 0;
}

.tm-404__text {
	margin: 0;
	color: var(--tm-muted);
}

.tm-404__search {
	width: 100%;
	max-width: 460px;
}

.tm-404__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
}

/* -------------------------------------------------------------------------
 * Widgets
 * ---------------------------------------------------------------------- */

.tm-widget {
	margin-bottom: 26px;
	padding-bottom: 26px;
	border-bottom: 1px solid var(--tm-border);
}

.tm-widget:last-child {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: 0;
}

.tm-widget__title {
	margin: 0 0 14px;
	font-size: var(--tm-fs-h4);
}

.tm-widget ul {
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 8px;
	font-size: var(--tm-fs-sm);
}

.tm-widget ul ul {
	margin-top: 8px;
	padding-inline-start: 14px;
}

.tm-widget a {
	color: var(--tm-text);
	text-decoration: none;
}

.tm-widget a:hover {
	color: var(--tm-primary);
}

/* -------------------------------------------------------------------------
 * Comments
 * ---------------------------------------------------------------------- */

.tm-comments {
	margin-top: clamp(34px, 4vw, 52px);
	padding-top: clamp(26px, 3vw, 38px);
	border-top: 1px solid var(--tm-border);
}

.tm-comments__list,
.tm-comments__list .children {
	margin: 0;
	padding: 0;
	list-style: none;
}

.tm-comments__list .children {
	margin-top: 18px;
	padding-inline-start: clamp(14px, 3vw, 34px);
	border-inline-start: 2px solid var(--tm-border);
}

.tm-comment {
	margin-bottom: 22px;
}

.tm-comment__meta {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 8px;
}

.tm-comment__avatar {
	border-radius: 50%;
}

.tm-comment__author {
	margin: 0;
	font-weight: 600;
	font-size: var(--tm-fs-sm);
}

.tm-comment__date {
	margin: 0;
	font-size: var(--tm-fs-xs);
	color: var(--tm-muted);
}

.tm-comment__content {
	font-size: var(--tm-fs-sm);
}

.tm-comment__actions {
	display: flex;
	gap: 14px;
	font-size: var(--tm-fs-xs);
}

.tm-comment__pending {
	font-size: var(--tm-fs-xs);
	color: var(--tm-accent);
}

.comment-form {
	display: grid;
	gap: 14px;
	max-width: 640px;
}

.comment-form p {
	margin: 0;
}

/* -------------------------------------------------------------------------
 * Post navigation
 * ---------------------------------------------------------------------- */

.tm-post-nav .nav-links {
	display: grid;
	gap: 14px;
	margin-top: 30px;
}

@media (min-width: 640px) {
	.tm-post-nav .nav-links {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.tm-post-nav a {
	display: grid;
	gap: 4px;
	padding: 16px 18px;
	border: 1px solid var(--tm-border);
	border-radius: var(--tm-radius);
	text-decoration: none;
	color: var(--tm-text);
	transition: border-color var(--tm-speed) var(--tm-ease);
}

.tm-post-nav a:hover {
	border-color: var(--tm-primary);
}

.tm-post-nav .nav-next {
	text-align: end;
}

.tm-post-nav__label {
	font-size: var(--tm-fs-xs);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var(--tm-muted);
}

.tm-post-nav__title {
	font-weight: 600;
	font-size: var(--tm-fs-sm);
}

/* -------------------------------------------------------------------------
 * Surveillance store components
 *
 * The bands the CCTV store adds on top of the base component set: the builder
 * call to action and the brand archive header.
 * ---------------------------------------------------------------------- */

.tm-builder-cta {
	display: grid;
	gap: 28px;
	align-items: center;
	padding: clamp(24px, 4vw, 44px);
	background: linear-gradient(135deg, var(--tm-dark) 0%, #1e293b 100%);
	border-radius: var(--tm-radius-lg);
	color: #fff;
}

@media (min-width: 900px) {
	.tm-builder-cta {
		grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
		gap: 48px;
	}
}

.tm-builder-cta__title {
	margin: 0 0 10px;
	color: #fff;
}

.tm-builder-cta__desc {
	margin: 0 0 22px;
	color: rgba(255, 255, 255, .75);
	max-width: 52ch;
}

.tm-builder-cta__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.tm-builder-cta__actions .tm-btn--ghost {
	background: transparent;
	border-color: rgba(255, 255, 255, .3);
	color: #fff;
}

.tm-builder-cta__actions .tm-btn--ghost:hover {
	border-color: #fff;
	color: #fff;
}

.tm-builder-cta__steps {
	display: grid;
	gap: 14px;
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: tm-step;
}

.tm-builder-cta__step {
	display: grid;
	grid-template-columns: 46px minmax(0, 1fr);
	gap: 14px;
	align-items: start;
	padding: 14px;
	background: rgba(255, 255, 255, .06);
	border-radius: var(--tm-radius);
}

.tm-builder-cta__step-icon {
	display: grid;
	place-items: center;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .1);
	color: #fff;
}

.tm-builder-cta__step-body {
	display: grid;
	gap: 3px;
}

.tm-builder-cta__step-title {
	font-weight: 700;
	font-size: var(--tm-fs-sm);
}

.tm-builder-cta__step-text {
	font-size: var(--tm-fs-xs);
	color: rgba(255, 255, 255, .7);
	line-height: 1.5;
}

/* Brand archive header */

.tm-brand-intro {
	display: grid;
	gap: 16px;
	margin-bottom: clamp(22px, 3vw, 32px);
	padding: clamp(18px, 3vw, 26px);
	background: var(--tm-surface-2);
	border-radius: var(--tm-radius-lg);
}

@media (min-width: 768px) {
	.tm-brand-intro {
		grid-template-columns: 160px minmax(0, 1fr);
		align-items: center;
		column-gap: 28px;
	}

	.tm-brand-intro__cats {
		grid-column: 2;
	}
}

.tm-brand-intro__logo img {
	max-height: 70px;
	width: auto;
	object-fit: contain;
}

.tm-brand-intro__text {
	margin: 0;
	font-size: var(--tm-fs-body);
	color: var(--tm-muted);
	max-width: 68ch;
}

.tm-brand-intro__cats {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tm-brand-intro__cats a {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 6px 12px;
	background: var(--tm-background);
	border: 1px solid var(--tm-border);
	border-radius: var(--tm-radius-pill);
	font-size: var(--tm-fs-xs);
	font-weight: 600;
	color: var(--tm-text);
	text-decoration: none;
}

.tm-brand-intro__cats a:hover {
	border-color: var(--tm-primary);
	color: var(--tm-primary);
}

.tm-brand-intro__count {
	color: var(--tm-faint);
	font-weight: 400;
}

.tm-brand-outro {
	margin-top: clamp(30px, 4vw, 50px);
	padding-top: clamp(24px, 3vw, 36px);
	border-top: 1px solid var(--tm-border);
}

.tm-brand-outro .tm-section {
	padding-block: 0 clamp(28px, 3.5vw, 44px);
}

/* Solutions and services bands reuse the plugin's card styles; these handle
   the section rhythm around them, and the column count. */

.tm-section--solutions .tmc-solutions,
.tm-section--services .products {
	margin-top: 0;
}

/*
 * Three across, not "as many as fit".
 *
 * The plugin sizes this band with `auto-fit, minmax(200px, 1fr)`, which is
 * the right default for a grid of unknown length. On the homepage the length
 * *is* known — the shortcode asks for six — and 200px tracks resolve to five
 * columns at desktop, so six cards land as a row of five and one orphan with
 * four empty cells beside it.
 *
 * Three columns divide six exactly, and the wider card gives the artwork room
 * to be legible instead of a 202px thumbnail.
 */
@media (min-width: 640px) {
	.tm-section--solutions .tmc-solutions {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.tm-section--solutions .tmc-solutions {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* -------------------------------------------------------------------------
 * Hero slider
 *
 * Only present from the second slide onward. A single-slide hero renders the
 * same markup with none of these rules doing anything, which is why the
 * default costs nothing.
 * ---------------------------------------------------------------------- */

.tm-hero-shell {
	position: relative;
}

.tm-hero-shell__controls {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	padding-block: 14px 0;
}

.tm-hero-nav {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	background: var(--tm-background);
	border: 1px solid var(--tm-border-strong);
	border-radius: 50%;
	color: var(--tm-text);
	cursor: pointer;
	transition: border-color var(--tm-speed) var(--tm-ease), color var(--tm-speed) var(--tm-ease);
}

.tm-hero-nav:hover {
	border-color: var(--tm-primary);
	color: var(--tm-primary);
}

.tm-hero-dots {
	display: flex;
	align-items: center;
	gap: 8px;
}

/* A dot is a hit target before it is a decoration: the visible pill is small,
   the button around it is not. */
.tm-hero-dot {
	position: relative;
	width: 28px;
	height: 28px;
	padding: 0;
	background: none;
	border: 0;
	cursor: pointer;
}

.tm-hero-dot::before {
	content: "";
	position: absolute;
	inset: 50% auto auto 50%;
	width: 8px;
	height: 8px;
	background: var(--tm-border-strong);
	border-radius: var(--tm-radius-pill);
	transform: translate(-50%, -50%);
	transition: width var(--tm-speed) var(--tm-ease), background-color var(--tm-speed) var(--tm-ease);
}

.tm-hero-dot.is-active::before {
	width: 22px;
	background: var(--tm-primary);
}

@media (min-width: 900px) {
	/* On a wide screen the arrows sit over the hero rather than under it,
	   which keeps the band from growing a row of chrome. */
	.tm-hero-shell--slider .tm-hero-shell__controls {
		position: absolute;
		inset: auto 0 18px;
		z-index: 2;
	}

	.tm-hero-shell--slider .tm-hero__inner {
		padding-block-end: clamp(48px, 5vw, 76px);
	}
}

/* Build credits in the footer bottom bar. */
.tm-footer__credits {
	margin: 0;
	font-size: var(--tm-fs-xs);
	color: var(--tm-muted);
}

.tm-footer__credits a {
	color: inherit;
	text-decoration: none;
	border-bottom: 1px solid transparent;
	transition: color var(--tm-speed) var(--tm-ease), border-color var(--tm-speed) var(--tm-ease);
}

.tm-footer__credits a:hover {
	color: var(--tm-primary);
	border-bottom-color: currentColor;
}

.tm-footer__credits-sep {
	margin-inline: 8px;
	opacity: .5;
}

/* -------------------------------------------------------------------------
 * Front page polish
 *
 * Small, systematic changes rather than new ornament: a heading that reads as
 * a heading, and bands whose height matches how much is actually in them.
 * ---------------------------------------------------------------------- */

/*
 * An accent rule under every section title.
 *
 * The homepage is fourteen bands deep and every heading was set in the same
 * weight with nothing to anchor it, so scrolling felt like one long column of
 * text with pictures in it. A short rule in the brand colour gives each band a
 * visible start — the cheapest possible way to say "a new thing begins here".
 */
.tm-section-head__title {
	position: relative;
	padding-bottom: 12px;
}

.tm-section-head__title::after {
	content: "";
	position: absolute;
	inset: auto auto 0 0;
	width: 42px;
	height: 3px;
	background: var(--tm-primary);
	border-radius: var(--tm-radius-pill);
}

.tm-section-head--center .tm-section-head__title::after {
	inset: auto 50% 0 auto;
	transform: translateX(50%);
}

/*
 * Short bands should be short.
 *
 * `.tm-section` gives every band the same generous padding, which is right
 * for a grid of eight products and much too much for a strip of two brand
 * logos — that band was three hundred pixels tall to hold ninety-six pixels
 * of content.
 */
.tm-section--brands,
.tm-section--benefits {
	padding-block: clamp(28px, 3.2vw, 44px);
}

/*
 * The trust row now sits directly under the hero, so it carries more weight
 * than it did buried in the middle of the page: a little more air, a divider
 * that separates it from the hero above without shouting.
 */
.tm-section--benefits {
	border-bottom: 1px solid var(--tm-border);
}

.tm-section--benefits .tm-benefit {
	padding: 4px 0;
}

/* -------------------------------------------------------------------------
 * Newsletter — print
 *
 * An ink band with a brand glow costs a great deal of toner and carries no
 * information. It prints as text on white, from whichever template it was
 * rendered on. (The homepage's other dark bands do the same in home.css.)
 * ---------------------------------------------------------------------- */

@media print {
	.tm-newsletter {
		background: none !important;
		box-shadow: none !important;
		color: var(--tm-text) !important;
	}

	.tm-newsletter::before {
		display: none !important;
	}

	.tm-newsletter__title {
		color: var(--tm-text) !important;
	}

	.tm-newsletter__desc {
		color: var(--tm-muted) !important;
	}
}
