/* ==========================================================================
   Gulvmax Campaign Landing Page — outlet style
   Product cards use the theme's own WooCommerce loop styling — this file
   styles the hero, category tiles, toolbar and loader.
   Tweak the brand colors here:
   ========================================================================== */
.gmxc-campaign {
	--gmxc-hero-bg: #333e48;     /* dark banner background */
	--gmxc-hero-text: #ffffff;   /* banner text color */
	--gmxc-accent: #f0a833;      /* banner button/badge */
	--gmxc-ink: #111111;         /* near-black text */
	--gmxc-muted: #64707d;
	--gmxc-tile-bg: #f2f2f2;
	--gmxc-border: #e2e2e2;

	/* No own max-width — follow the page/theme container width so the
	   campaign page matches the rest of the site (e.g. archive pages). */
	margin: 0;
	max-width: none;
	width: 100%;
	padding: 0 0 64px;
	color: var(--gmxc-ink);
}

/* --------------------------------------------------------------------------
   Hero — dark campaign banner: big text left, optional image right
   -------------------------------------------------------------------------- */
.gmxc-hero {
	position: relative;
	background: var(--gmxc-hero-bg);
	margin: 16px 0 26px;
	padding: 48px 48px 40px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 40px;
}

.gmxc-hero-inner {
	max-width: 660px;
}

.gmxc-hero-title {
	margin: 0 0 6px;
	font-size: clamp(2rem, 4.5vw, 3.2rem);
	font-weight: 800;
	line-height: 1.05;
	letter-spacing: 0.01em;
	text-transform: uppercase;
	color: var(--gmxc-hero-text);
}

.gmxc-hero-subtitle {
	margin: 0;
	font-size: clamp(1.05rem, 2vw, 1.55rem);
	font-weight: 300;
	line-height: 1.35;
	color: var(--gmxc-hero-text);
	opacity: 0.95;
}

/* Small bold counter, bottom right of the banner — no box */
.gmxc-hero-total {
	position: absolute;
	right: 24px;
	bottom: 14px;
	margin: 0;
	font-size: 0.82rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: var(--gmxc-hero-text);
	opacity: 0.85;
}

.gmxc-hero-total strong {
	font-weight: 800;
	color: inherit;
}

.gmxc-hero-note {
	margin: 36px 0 0;
	font-size: 0.82rem;
	color: var(--gmxc-hero-text);
	opacity: 0.55;
}

/* Right column: image + optional button */
.gmxc-hero-media {
	flex: 0 0 auto;
	max-width: 320px;
	text-align: center;
}

.gmxc-hero-media img {
	display: block;
	max-width: 100%;
	max-height: 240px;
	width: auto;
	height: auto;
	margin: 0 auto;
	box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
}

.gmxc-hero-btn {
	display: inline-block;
	margin-top: -16px;
	position: relative;
	z-index: 1;
	background: var(--gmxc-accent);
	color: #1d2733;
	font-size: 0.95rem;
	font-weight: 700;
	padding: 11px 24px;
	text-decoration: none;
	transition: filter 0.15s ease;
}

.gmxc-hero-btn:hover {
	filter: brightness(1.08);
	color: #1d2733;
}

.gmxc-hero-media .gmxc-hero-btn:only-child {
	margin-top: 0;
}

@media (max-width: 860px) {
	.gmxc-hero {
		flex-direction: column;
		align-items: flex-start;
		padding-bottom: 48px;
	}
	.gmxc-hero-media {
		align-self: center;
	}
	.gmxc-hero-total {
		right: 16px;
		bottom: 12px;
	}
}

/* Countdown (optional) */
.gmxc-countdown {
	display: flex;
	gap: 10px;
	margin-top: 24px;
}

.gmxc-countdown-item {
	min-width: 62px;
	padding: 10px 8px;
	text-align: center;
	background: rgba(255, 255, 255, 0.12);
	border: 1px solid rgba(255, 255, 255, 0.18);
	color: var(--gmxc-hero-text);
}

.gmxc-countdown-item span {
	display: block;
	font-size: 1.4rem;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
}

.gmxc-countdown-item small {
	display: block;
	margin-top: 2px;
	font-size: 0.65rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: rgba(255, 255, 255, 0.7);
}

/* --------------------------------------------------------------------------
   Category tiles
   -------------------------------------------------------------------------- */
.gmxc-cats {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 30px;
}

.gmxc-cat {
	appearance: none;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 52px;
	padding: 14px 22px;
	border: 0;
	background: var(--gmxc-tile-bg);
	color: var(--gmxc-ink);
	font-size: 0.88rem;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.02em;
	text-align: center;
	text-transform: uppercase;
	transition: background 0.15s ease, color 0.15s ease;
}

.gmxc-cat:hover {
	background: #e7e7e7;
}

.gmxc-cat.is-active {
	background: var(--gmxc-ink);
	color: #fff;
}

.gmxc-cat-back {
	background: #fff;
	border: 1px solid var(--gmxc-border);
	text-transform: none;
}

.gmxc-cat-back:hover {
	background: #fff;
	border-color: var(--gmxc-ink);
}

/* --------------------------------------------------------------------------
   Toolbar: article count left, sort dropdown right
   -------------------------------------------------------------------------- */
.gmxc-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	margin: 0 0 26px;
}

.gmxc-toolbar-left {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 22px;
}

.gmxc-count {
	font-size: 0.95rem;
	color: var(--gmxc-ink);
}

.gmxc-count-num {
	font-weight: 700;
}

/* Sort dropdown — same style as the archive pages' sort control */
.gmxc-toolbar-right {
	display: flex;
	align-items: center;
	gap: 10px;
}

.gmxc-sort {
	position: relative;
}

.gmxc-sort-btn {
	appearance: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 10px;
	height: 40px;
	padding: 0 12px 0 14px;
	background: #ffffff;
	border: 1px solid #ddd8ce;
	border-radius: 0;
	color: #000000;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	line-height: 1;
	white-space: nowrap;
}

.gmxc-sort-btn:hover {
	border-color: #b8b2a6;
	background: #ffffff;
	color: #000000;
}

.gmxc-sort-ic {
	width: 16px;
	height: 16px;
	flex: 0 0 auto;
}

.gmxc-sort-chev {
	width: 14px;
	height: 14px;
	flex: 0 0 auto;
	transition: transform 0.15s ease;
}

.gmxc-sort-btn[aria-expanded="true"] .gmxc-sort-chev {
	transform: rotate(180deg);
}

.gmxc-sort-menu {
	position: absolute;
	top: calc(100% + 4px);
	right: 0;
	z-index: 50;
	min-width: 100%;
	margin: 0;
	padding: 4px 0;
	list-style: none;
	background: #ffffff;
	border: 1px solid #ddd8ce;
	box-shadow: 0 10px 30px rgba(20, 19, 16, 0.16);
}

.gmxc-sort-menu[hidden] {
	display: none;
}

.gmxc-sort-option {
	cursor: pointer;
	padding: 11px 18px;
	margin: 0;
	font-size: 14px;
	line-height: 1.3;
	color: #3e3a33;
	white-space: nowrap;
}

.gmxc-sort-option:hover {
	background: #f2f0eb;
}

.gmxc-sort-option.is-selected {
	background: #f2f0eb;
	font-weight: 700;
	color: #000000;
}

/* Mobile/tablet: category tiles become a horizontal swipe row (XXL style)
   with an always-visible scroll indicator instead of a long stacked list.
   (The indicator is a custom element — native scrollbars stay hidden on
   iOS until you scroll, so they can't be relied on as a hint.) */
.gmxc-cats-bar {
	display: none;
	position: relative;
	height: 4px;
	background: #e9e9e9;
	border-radius: 2px;
	margin: 0 0 26px;
	overflow: hidden;
}

.gmxc-cats-thumb {
	height: 100%;
	width: 30%;
	background: var(--gmxc-ink);
	border-radius: 2px;
}

@media (max-width: 849.98px) {
	.gmxc-cats {
		flex-wrap: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scroll-snap-type: x proximity;
		margin-bottom: 10px;
		scrollbar-width: none;
	}
	.gmxc-cats::-webkit-scrollbar {
		display: none;
	}
	.gmxc-cats-bar {
		display: block;
	}
	.gmxc-cat {
		flex: 0 0 auto;
		scroll-snap-align: start;
		min-height: 56px;
		padding: 16px 22px;
		font-size: 0.95rem;
		white-space: nowrap;
	}
}

@media (max-width: 640px) {
	.gmxc-hero {
		padding: 36px 20px 44px;
	}
	.gmxc-toolbar {
		flex-direction: column;
		align-items: stretch;
	}
	.gmxc-toolbar-right {
		justify-content: space-between;
	}
	.gmxc-sort,
	.gmxc-sort-btn {
		width: 100%;
	}
}

/* --------------------------------------------------------------------------
   Loader + empty state
   -------------------------------------------------------------------------- */
.gmxc-loader {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 36px 0 8px;
	color: var(--gmxc-muted);
	font-size: 0.95rem;
}

.gmxc-loader[hidden] {
	display: none;
}

.gmxc-spinner {
	width: 22px;
	height: 22px;
	border-radius: 50%;
	border: 3px solid #e2e6ea;
	border-top-color: var(--gmxc-ink);
	animation: gmxc-spin 0.8s linear infinite;
}

@keyframes gmxc-spin {
	to { transform: rotate(360deg); }
}

.gmxc-sentinel {
	height: 1px;
}

.gmxc-empty {
	text-align: center;
	padding: 48px 16px;
	font-size: 1.1rem;
	color: var(--gmxc-muted);
}

.gmxc-empty[hidden] {
	display: none;
}

@media (prefers-reduced-motion: reduce) {
	.gmxc-spinner {
		animation: none;
	}
}

/* --------------------------------------------------------------------------
/* --------------------------------------------------------------------------
   Front page focus cards: [gulvmax_frontfokus]
   Dark navy cards, orange display price in Anton (bundled font)
   -------------------------------------------------------------------------- */
@font-face {
	font-family: 'GMXC Anton';
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url('../fonts/anton-latin.woff2') format('woff2');
}

.gmxc-ff {
	--gmxc-ff-cols: 4;
	--gmxc-ff-gap: 20px;
	--gmxc-ff-bg: #0f1a26;      /* dark navy card */
	--gmxc-ff-accent: #e86a2b;  /* orange */

	display: flex;
	flex-wrap: wrap;
	gap: var(--gmxc-ff-gap);
	margin: 0 auto;
	justify-content: flex-start;
}

/* Alignment options: [gulvmax_frontfokus juster="hoyre|senter"] */
.gmxc-ff--hoyre { justify-content: flex-end; }
.gmxc-ff--senter { justify-content: center; }

/* Visibility options: [gulvmax_frontfokus vis="mobil|desktop"]
   Breakpoint matches Flatsome's tablet/desktop split (850px). */
@media (min-width: 850px) {
	.gmxc-ff--kun-mobil { display: none; }
}

@media (max-width: 849.98px) {
	.gmxc-ff--kun-desktop { display: none; }
}

/* Override the card width directly in media queries — the column count is
   set as an inline style on the container, which would win over a var
   override here. */
@media (max-width: 1024px) {
	.gmxc-ff .gmxc-ff-card {
		flex-basis: calc( ( 100% - var(--gmxc-ff-gap) ) / 2 );
	}
}

@media (max-width: 560px) {
	.gmxc-ff .gmxc-ff-card {
		flex-basis: 100%;
	}
}

.gmxc-ff-card {
	position: relative;
	display: flex;
	border-radius: var(--gmxc-ff-radius, 0);
	flex-direction: column;
	flex: 0 1 calc( ( 100% - ( var(--gmxc-ff-cols) - 1 ) * var(--gmxc-ff-gap) ) / var(--gmxc-ff-cols) );
	background: var(--gmxc-ff-bg);
	padding: 0;
	text-decoration: none;
	overflow: hidden;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gmxc-ff-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 14px 30px rgba(15, 26, 38, 0.35);
}

/* Optional text overlaid top left: orange rounded label */
.gmxc-ff-label {
	position: absolute;
	top: 16px;
	left: 16px;
	z-index: 2;
	background: var(--gmxc-ff-accent);
	color: var(--gmxc-ff-accent-text, #fff);
	font-size: 0.76rem;
	font-weight: 800;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	padding: 8px 14px;
	border-radius: var(--gmxc-ff-radius-el, 6px);
}

.gmxc-ff-media {
	display: block;
}

.gmxc-ff-media img {
	display: block;
	width: 100%;
	height: 250px;
	object-fit: contain;
	padding: 56px 20px 0;
	box-sizing: border-box;
}

/* Info block at the bottom */
.gmxc-ff-info {
	display: block;
	padding: 18px 20px 22px;
	margin-top: auto;
}

.gmxc-ff-name {
	display: block;
	font-size: clamp(1.2rem, 1.6vw, 1.55rem);
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: -0.02em;
	color: var(--gmxc-ff-text, #ffffff);
	margin-bottom: 12px;
}

/* FØR + SPAR row — own row above the price so nothing overlaps */
.gmxc-ff-sub {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 10px;
}

.gmxc-ff-before {
	color: var(--gmxc-ff-text, #ffffff);
	font-size: 0.95rem;
	font-weight: 800;
	letter-spacing: 0.06em;
	white-space: nowrap;
}

.gmxc-ff-save {
	display: inline-block;
	background: var(--gmxc-ff-accent);
	color: var(--gmxc-ff-accent-text, #ffffff);
	font-size: 0.88rem;
	font-weight: 800;
	letter-spacing: 0.06em;
	line-height: 1;
	padding: 7px 12px;
	border-radius: var(--gmxc-ff-radius-el, 6px);
	white-space: nowrap;
}

/* Big display price in Anton with unit behind (e.g. KR/M²) */
.gmxc-ff-now {
	display: flex;
	align-items: baseline;
	gap: 10px;
	font-family: 'GMXC Anton', 'Arial Narrow', sans-serif;
	font-size: clamp(2.5rem, 3.85vw, 3.9rem);
	font-weight: 400;
	line-height: 0.9;
	letter-spacing: -0.01em;
	color: var(--gmxc-ff-accent);
}

.gmxc-ff-unit {
	font-size: clamp(0.8rem, 1.1vw, 1.05rem);
	letter-spacing: 0.1em;
}

/* Fill variant: [gulvmax_frontfokus bilde="fyll"] — image covers the frame,
   info sits on a dark gradient at the bottom */
.gmxc-ff--fyll .gmxc-ff-card {
	aspect-ratio: 4 / 5;
}

.gmxc-ff--fyll .gmxc-ff-media {
	position: absolute;
	inset: 0;
}

.gmxc-ff--fyll .gmxc-ff-media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	padding: 0;
}

.gmxc-ff--fyll .gmxc-ff-info {
	position: relative;
	z-index: 1;
	background: linear-gradient(180deg, rgba(var(--gmxc-ff-grad, 15, 26, 38), 0) 0%, rgba(var(--gmxc-ff-grad, 15, 26, 38), 0.88) 40%, rgba(var(--gmxc-ff-grad, 15, 26, 38), 0.96) 100%);
	padding-top: 56px;
}

/* Hover focus (fyll variant): the overlay glides away and the photo zooms
   gently so the product image gets full focus. Hover-capable devices only. */
.gmxc-ff--fyll .gmxc-ff-media img {
	transition: transform 0.5s ease;
}

.gmxc-ff--fyll .gmxc-ff-info,
.gmxc-ff--fyll .gmxc-ff-label {
	transition: opacity 0.3s ease, transform 0.3s ease;
}

@media (hover: hover) {
	.gmxc-ff--fyll .gmxc-ff-card:hover .gmxc-ff-media img {
		transform: scale(1.06);
	}
	.gmxc-ff--fyll .gmxc-ff-card:hover .gmxc-ff-info {
		opacity: 0;
		transform: translateY(14px);
	}
	.gmxc-ff--fyll .gmxc-ff-card:hover .gmxc-ff-label {
		opacity: 0;
		transform: translateY(-8px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.gmxc-ff--fyll .gmxc-ff-media img,
	.gmxc-ff--fyll .gmxc-ff-info,
	.gmxc-ff--fyll .gmxc-ff-label {
		transition: none;
	}
}
