/*
 * The affiliate feed page. Shared by the sites (custom-gtrader providers/shared/affiliates): each sets its button colours
 * and font as CSS variables (features.php affiliates_style, printed by affiliates.php): --gt-btn-bg, --gt-btn-fg,
 * --gt-btn-hover, --gt-btn-font, --gt-btn-radius. The fallbacks are Montana's (its theme's own button).
 */
/* The ranked affiliate list (affiliates.php). Frame colours follow the page's white boxes. */

.gt-aff {
	margin: 0 4px 20px;
	padding: 16px;
	background: #fff;
	border-radius: 4px;
}

.gt-aff__bar {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	margin-bottom: 12px;
}

.gt-aff__search {
	flex: 1 1 220px;
	min-width: 0;
	padding: 8px 10px;
	font-size: 16px;
	border: 1px solid #cecece;
	border-radius: 4px;
}

.gt-aff__sort {
	padding: 8px;
	font-size: 16px;
	border: 1px solid #cecece;
	border-radius: 4px;
	background: #fff;
}

.gt-aff__deals-only {
	display: inline-flex;
	gap: 6px;
	align-items: center;
	font-size: 15px;
	white-space: nowrap;
	cursor: pointer;
}

.gt-aff__cats {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 10px;
}

.gt-aff__cat {
	padding: 4px 10px;
	font-size: 13px;
	line-height: 1.6;
	color: #333;
	background: #f0f0ee;
	border: 1px solid #dad9d3;
	border-radius: 999px;
	cursor: pointer;
}

.gt-aff__cat span {
	color: #888;
}

.gt-aff__cat--on {
	color: var(--gt-btn-fg, #f3f1ec);
	background: var(--gt-btn-bg, #1a1a1a);
	border-color: var(--gt-btn-bg, #1a1a1a);
}

.gt-aff__cat--on span {
	color: #bdbab2;
}

.gt-aff__count {
	margin: 0 0 8px;
	font-size: 13px;
	color: #777;
}

/* A grid of cards: at most 3 columns, fewer as the page narrows (a column is never under 260px); 1 on a phone. */
.gt-aff__list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(max(260px, calc((100% - 24px) / 3)), 1fr));
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.gt-aff__item {
	display: flex;
	flex-direction: column;
	min-width: 0;
	border: 1px solid #e4e4e0;
	border-radius: 6px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
	transition: box-shadow 0.15s, border-color 0.15s;
}

.gt-aff__item:hover,
.gt-aff__item:focus-within {
	border-color: #cfcfc8;
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.gt-aff__item[hidden] {
	display: none;
}

.gt-aff__link {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 10px;
	padding: 14px 12px 12px;
	color: inherit;
	text-align: center;
	text-decoration: none;
}

.gt-aff__link:hover .gt-aff__name,
.gt-aff__link:focus-visible .gt-aff__name {
	text-decoration: underline;
}

/* Logos come in every size and shape (125-600px wide): each fits a fixed box. */
.gt-aff__logo {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 64px;
}

.gt-aff__logo img {
	max-width: 100%;
	max-height: 64px;
	width: auto;
	height: auto;
	object-fit: contain;
}

.gt-aff__text {
	display: flex;
	flex-direction: column;
	gap: 6px;
	align-items: center;
	min-width: 0;
}

.gt-aff__name {
	font-size: 16px;
	font-weight: bold;
	line-height: 1.25;
	overflow-wrap: anywhere;
}

.gt-aff__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	align-items: center;
	justify-content: center;
}

.gt-aff__tag {
	font-size: 12px;
	color: #777;
}

.gt-aff__badge {
	padding: 1px 7px;
	font-size: 11px;
	font-weight: bold;
	text-transform: uppercase;
	border-radius: 3px;
}

.gt-aff__badge--popular {
	color: #7a4a00;
	background: #ffe7b3;
}

.gt-aff__badge--deal {
	color: #fff;
	background: #b3261e;
}

/* The deals sit at the card's foot, under a hairline. */
.gt-aff__deals {
	margin: 0;
	padding: 8px 12px 10px;
	list-style: none;
	font-size: 13px;
	line-height: 1.35;
	border-top: 1px dashed #e0e0da;
}

.gt-aff__deals li {
	display: flex;
	flex-wrap: wrap;
	gap: 2px 8px;
	padding: 3px 0;
	overflow-wrap: anywhere;
}

.gt-aff__code code {
	padding: 0 5px;
	font-weight: bold;
	background: #f3f3f0;
	border: 1px dashed #bbb;
	border-radius: 3px;
}

.gt-aff__ends {
	color: #888;
}


@media (max-width: 600px) {
	.gt-aff {
		padding: 10px;
	}

	/* One column on a phone; each card a row, the logo on the left, to keep the list short. */
	.gt-aff__list {
		grid-template-columns: minmax(0, 1fr);
		gap: 8px;
	}

	.gt-aff__link {
		flex-direction: row;
		align-items: center;
		gap: 12px;
		padding: 10px;
		text-align: left;
	}

	.gt-aff__logo {
		flex: 0 0 72px;
		height: 44px;
	}

	.gt-aff__logo img {
		max-height: 44px;
	}

	.gt-aff__text,
	.gt-aff__meta {
		align-items: flex-start;
		justify-content: flex-start;
	}

	.gt-aff__name {
		font-size: 15px;
	}

	.gt-aff__deals {
		padding: 6px 10px 8px 94px;
		font-size: 12px;
	}

	/* One row that scrolls sideways: 28 chips would fill the screen. */
	.gt-aff__cats {
		flex-wrap: nowrap;
		overflow-x: auto;
		margin-right: -10px;
		padding-bottom: 4px;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}

	.gt-aff__cats::-webkit-scrollbar {
		display: none;
	}

	.gt-aff__cat {
		flex: 0 0 auto;
		white-space: nowrap;
	}
}

/* ---------- Tabs: Merchants / Products (custom-gtrader#22) ---------- */

.gt-aff-tabs {
	display: flex;
	gap: 4px;
	margin: 0 4px;
	padding: 0 4px;
	border-bottom: 1px solid #dad9d3;
}

.gt-aff-tab {
	padding: 10px 18px;
	font-size: 16px;
	font-weight: bold;
	color: #555;
	background: #ecebe6;
	border: 1px solid #dad9d3;
	border-bottom: 0;
	border-radius: 6px 6px 0 0;
	cursor: pointer;
	margin-bottom: -1px;
}

.gt-aff-tab--on {
	color: #222;
	background: #fff;
	border-bottom: 1px solid #fff;
}

.gt-aff-tabs + .gt-prod,
.gt-aff-tabs ~ .gt-aff {
	border-top-left-radius: 0;
}

/* ---------- Products ---------- */

.gt-prod {
	margin: 0 4px 20px;
	padding: 16px;
	background: #fff;
	border-radius: 4px;
}

.gt-prod[hidden],
.gt-aff[hidden] {
	display: none;
}

.gt-prod__bar {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	margin: 0 0 12px;
}

.gt-prod__search {
	flex: 1 1 240px;
	min-width: 0;
	padding: 8px 10px;
	font-size: 16px;
	border: 1px solid #cecece;
	border-radius: 4px;
}


.gt-prod__sort {
	padding: 8px;
	font-size: 16px;
	border: 1px solid #cecece;
	border-radius: 4px;
	background: #fff;
}

.gt-prod__sale {
	display: inline-flex;
	gap: 6px;
	align-items: center;
	font-size: 15px;
	white-space: nowrap;
	cursor: pointer;
}

.gt-prod__hint {
	margin: 4px 0 12px;
	font-size: 14px;
	color: #666;
	line-height: 2;
}

.gt-prod__hint[hidden] {
	display: none;
}

.gt-prod__try {
	margin: 0 2px;
	padding: 2px 10px;
	font-size: 13px;
	color: #333;
	background: #f0f0ee;
	border: 1px solid #dad9d3;
	border-radius: 999px;
	cursor: pointer;
}

.gt-prod__status {
	margin: 0 0 10px;
	font-size: 13px;
	color: #777;
}

.gt-prod--busy .gt-prod__list {
	opacity: 0.4;
}

.gt-prod__list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(max(260px, calc((100% - 24px) / 3)), 1fr));
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.gt-prod__item {
	display: flex;
	min-width: 0;
	border: 1px solid #e4e4e0;
	border-radius: 6px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
	transition: box-shadow 0.15s, border-color 0.15s;
}

.gt-prod__item:hover,
.gt-prod__item:focus-within {
	border-color: #cfcfc8;
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.gt-prod__link {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 10px;
	padding: 12px;
	color: inherit;
	text-decoration: none;
}

.gt-prod__link:hover .gt-prod__name,
.gt-prod__link:focus-visible .gt-prod__name {
	text-decoration: underline;
}

.gt-prod__pic {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 160px;
	background: #fafaf8;
	border-radius: 4px;
}

.gt-prod__pic img {
	max-width: 100%;
	max-height: 150px;
	width: auto;
	height: auto;
	object-fit: contain;
}

.gt-prod__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.gt-prod__brand {
	font-size: 12px;
	color: #888;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.gt-prod__name {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: 15px;
	font-weight: bold;
	line-height: 1.3;
	overflow-wrap: anywhere;
}

.gt-prod__price {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 8px;
	align-items: baseline;
	margin-top: auto;
	padding-top: 4px;
	font-size: 17px;
}

.gt-prod__now--sale {
	color: #b3261e;
}

.gt-prod__price s {
	font-size: 13px;
	color: #999;
}

.gt-prod__off {
	padding: 0 6px;
	font-size: 11px;
	font-weight: bold;
	color: #fff;
	background: #b3261e;
	border-radius: 3px;
}

.gt-prod__shop {
	font-size: 12px;
	color: #777;
}




@media (max-width: 600px) {
	.gt-prod {
		padding: 10px;
	}

	.gt-aff-tab {
		flex: 1 1 0;
		padding: 10px 8px;
	}

	/* One column on a phone; each card a row, the picture on the left. */
	.gt-prod__list {
		grid-template-columns: minmax(0, 1fr);
		gap: 8px;
	}

	.gt-prod__link {
		display: grid;
		grid-template-columns: 96px minmax(0, 1fr);
		grid-template-rows: auto auto;
		gap: 8px 12px;
		padding: 10px;
	}

	.gt-prod__pic {
		grid-row: 1 / span 2;
		height: 96px;
	}

	.gt-prod__pic img {
		max-height: 92px;
	}

	.gt-prod__name {
		font-size: 14px;
	}

}

/* The introduction above the tabs: normal text, not the theme's 22px bold banner. */
.gt-aff-intro {
	margin: 0 4px 16px;
	padding: 14px 18px;
	font-size: 15px;
	line-height: 1.5;
	color: #444;
	background: #fff;
	border-radius: 4px;
}

.gt-aff-intro a {
	font-weight: bold;
}

/* ---------- Buttons: the theme's own button (Matt/client, 2026-12-02: "make all buttons the same as my buttons") ---------- */
/* Its look, read from the classifieds' "Filter Results": var(--gt-btn-bg, #1a1a1a), var(--gt-btn-fg, #f3f1ec) text, Montserrat 700 16px uppercase,
   0.75px letter spacing, 2px corners, steel blue on hover. Every button here sets its own text colour, so the theme's
   off-white button text can never land on a light background again (the blank "Show more"). */
.gt-prod__go,
.gt-prod__buy,
.gt-prod__more,
.gt-aff__reset {
	display: inline-block;
	padding: 13.5px 14px 12.5px;
	font-family: var(--gt-btn-font, Montserrat, "Helvetica Neue", sans-serif);
	font-size: 16px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.75px;
	text-align: center;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--gt-btn-fg, #f3f1ec);
	background: var(--gt-btn-bg, #1a1a1a);
	border: 0;
	border-radius: var(--gt-btn-radius, 2px);
	cursor: pointer;
	transition: background-color 0.15s;
}

.gt-prod__go:hover,
.gt-prod__go:focus-visible,
.gt-prod__more:hover,
.gt-prod__more:focus-visible,
.gt-aff__reset:hover,
.gt-aff__reset:focus-visible,
.gt-prod__link:hover .gt-prod__buy,
.gt-prod__link:focus-visible .gt-prod__buy {
	color: var(--gt-btn-fg, #f3f1ec);
	background: var(--gt-btn-hover, steelblue);
}

.gt-prod__go:focus-visible,
.gt-prod__more:focus-visible,
.gt-aff__reset:focus-visible {
	outline: 1px dotted var(--gt-btn-bg, #1a1a1a);
	outline-offset: 2px;
}

.gt-prod__buy {
	display: block;
}

.gt-prod__more {
	display: block;
	margin: 16px auto 0;
	min-width: 200px;
}

.gt-prod__more[hidden] {
	display: none;
}

.gt-aff__reset {
	margin-left: 8px;
	padding: 9px 12px 8px;
	font-size: 14px;
}

/* Toggles and chips are buttons to the browser, so the theme styles them too: give them their own colours. */
.gt-aff__cat,
.gt-prod__try,
.gt-aff-tab {
	letter-spacing: 0.75px;
}

.gt-aff__cat:hover,
.gt-prod__try:hover {
	border-color: var(--gt-btn-bg, #1a1a1a);
}

@media (max-width: 600px) {
	.gt-prod__go {
		padding: 11px 14px 10px;
	}

	.gt-prod__buy {
		grid-column: 2;
		padding: 10px 12px 9px;
		font-size: 14px;
	}
}

/* Products: the deals heading, the end-of-list note and the infinite scroll's marker. */
.gt-prod__heading {
	margin: 4px 0 10px;
	font-size: 18px;
	font-weight: bold;
	color: #333;
	text-transform: none;
}

.gt-prod__heading[hidden],
.gt-prod__end[hidden] {
	display: none;
}

.gt-prod__end {
	margin: 16px 0 0;
	font-size: 13px;
	text-align: center;
	color: #888;
}

.gt-prod__sentinel {
	height: 1px;
}

/* The (x) inside each search box: shown while it has text; the browser's own clear icon is hidden so there is one. */
.gt-field {
	position: relative;
	display: flex;
	flex: 1 1 240px;
	min-width: 0;
}

.gt-field input {
	flex: 1 1 auto;
	width: 100%;
	padding-right: 40px !important;
}

.gt-field input::-webkit-search-cancel-button {
	-webkit-appearance: none;
	appearance: none;
	display: none;
}

.gt-clear {
	position: absolute;
	top: 50%;
	right: 6px;
	width: 30px;
	height: 30px;
	margin-top: -15px;
	padding: 0;
	font-family: Arial, sans-serif;
	font-size: 22px;
	font-weight: normal;
	line-height: 30px;
	letter-spacing: 0;
	text-align: center;
	text-transform: none;
	color: #666;
	background: transparent;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
}

.gt-clear:hover,
.gt-clear:focus-visible {
	color: var(--gt-btn-bg, #1a1a1a);
	background: #e8e7e2;
}

.gt-clear[hidden] {
	display: none;
}

/* Categories: the 5 biggest, a "..." pill for the rest (open while one of the rest is chosen). */
.gt-aff__cats:not(.gt-aff__cats--open) .gt-aff__cat--small,
.gt-aff__cats--open .gt-aff__cat-more {
	display: none;
}

.gt-aff__cat-more {
	min-width: 44px;
	font-size: 15px;
	line-height: 1.3;
	letter-spacing: 1px;
}

/* The copy link button, at the far end of the tab bar. */
.gt-aff-share {
	align-self: center;
	margin: 0 0 4px auto;
	padding: 7px 12px 6px;
	font-family: var(--gt-btn-font, Montserrat, "Helvetica Neue", sans-serif);
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.75px;
	text-transform: uppercase;
	color: var(--gt-btn-bg, #1a1a1a);
	background: transparent;
	border: 1px solid var(--gt-btn-bg, #1a1a1a);
	border-radius: var(--gt-btn-radius, 2px);
	cursor: pointer;
}

.gt-aff-share:hover,
.gt-aff-share:focus-visible,
.gt-aff-share--done {
	color: var(--gt-btn-fg, #f3f1ec);
	background: var(--gt-btn-hover, steelblue);
	border-color: var(--gt-btn-hover, steelblue);
}

@media (max-width: 600px) {
	.gt-aff-share {
		padding: 6px 8px 5px;
		font-size: 12px;
	}
}

/* The intro: one line, cut with an ellipsis; More / Less opens and closes it. */
/* Everything sits on the first line's box (1.5 x 15px): the theme's STOP icon (#affiliatefeed::before on Montana), the text
   and More are centred on it, collapsed or open. */
.gt-aff-intro {
	--gt-intro-line: 22.5px;
	display: flex;
	gap: 10px;
	align-items: flex-start;
	line-height: var(--gt-intro-line);
}

.gt-aff-intro::before {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	height: var(--gt-intro-line);
	line-height: 0;
}

.gt-aff-intro__text {
	flex: 1 1 auto;
	min-width: 0;
	display: -webkit-box;
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.gt-aff-intro--open .gt-aff-intro__text {
	display: block;
	-webkit-line-clamp: unset;
	overflow: visible;
}

.gt-aff-intro__more {
	flex: 0 0 auto;
	padding: 0;
	font-family: inherit;
	font-size: 14px;
	line-height: var(--gt-intro-line);
	font-weight: bold;
	text-transform: none;
	letter-spacing: 0;
	color: var(--gt-btn-bg, #1a1a1a);
	background: none;
	border: 0;
	text-decoration: underline;
	cursor: pointer;
}

.gt-aff-intro__more:hover,
.gt-aff-intro__more:focus-visible {
	color: var(--gt-btn-hover, steelblue);
	background: none;
}

.gt-aff-intro__more[hidden] {
	display: none;
}

/* Firearms Friendly's theme (Gecko) turns a focused or pressed submit button bright blue (#2962ff), and Search keeps focus
   after a click; the page's own colours win here. */
.gt-prod form.gt-prod__bar button.gt-prod__go {
	color: var(--gt-btn-fg, #f3f1ec);
	background: var(--gt-btn-bg, #1a1a1a);
	border: 0;
	border-radius: var(--gt-btn-radius, 2px);
	box-shadow: none;
}

.gt-prod form.gt-prod__bar button.gt-prod__go:focus,
.gt-prod form.gt-prod__bar button.gt-prod__go:active {
	color: var(--gt-btn-fg, #f3f1ec);
	background: var(--gt-btn-bg, #1a1a1a);
	box-shadow: none;
	outline: 0;
}

.gt-prod form.gt-prod__bar button.gt-prod__go:hover,
.gt-prod form.gt-prod__bar button.gt-prod__go:focus-visible {
	color: var(--gt-btn-fg, #f3f1ec);
	background: var(--gt-btn-hover, steelblue);
}

.gt-prod form.gt-prod__bar button.gt-prod__go:focus-visible {
	outline: 1px dotted var(--gt-btn-bg, #1a1a1a);
	outline-offset: 2px;
}
