/* 4beinte Sesongtema – forsiden */

.b4-season {
	--b4-bg1: #222;
	--b4-bg2: #444;
	--b4-text: #fff;
	--b4-accent: #fc0;
	--b4-on-accent: #111;
	--b4-fx: var(--b4-accent);
	position: relative;
	overflow: hidden;
	isolation: isolate;
	margin: 0 0 1.75rem;
	border-radius: 14px;
	color: var(--b4-text);
	background: linear-gradient(120deg, var(--b4-bg1), var(--b4-bg2));
}

.b4-season *,
.b4-season *::before,
.b4-season *::after { box-sizing: border-box; }

/* Tidsfrist-stripe øverst */
.b4-strip {
	position: relative;
	z-index: 2;
	padding: .5rem 1rem;
	text-align: center;
	font-size: .875rem;
	font-weight: 600;
	letter-spacing: .01em;
	background: rgba(0, 0, 0, .3);
	color: var(--b4-text);
}

.b4-hero__inner {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
	align-items: center;
	gap: 1.5rem;
	min-height: 340px;
	padding: clamp(1.25rem, 4vw, 3rem);
}

.b4-noart .b4-hero__inner { grid-template-columns: 1fr; }

.b4-eyebrow {
	margin: 0 0 .5rem;
	font-size: .8125rem;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--b4-accent);
}

.b4-headline {
	margin: 0 0 .75rem;
	font-size: clamp(1.75rem, 4.2vw, 3rem);
	line-height: 1.08;
	font-weight: 800;
	color: var(--b4-text);
	text-wrap: balance;
}

.b4-sub {
	margin: 0 0 1.25rem;
	max-width: 34em;
	font-size: clamp(1rem, 1.6vw, 1.15rem);
	line-height: 1.5;
	color: var(--b4-text);
	opacity: .92;
}

.b4-btn,
.b4-btn:visited {
	display: inline-block;
	padding: .8rem 1.5rem;
	border-radius: 999px;
	font-weight: 700;
	text-decoration: none;
	background: var(--b4-accent);
	color: var(--b4-on-accent);
	box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
	transition: transform .15s ease, box-shadow .15s ease;
}
.b4-btn:hover,
.b4-btn:focus-visible {
	transform: translateY(-2px);
	box-shadow: 0 8px 20px rgba(0, 0, 0, .3);
	color: var(--b4-on-accent);
}
.b4-btn:focus-visible { outline: 3px solid var(--b4-text); outline-offset: 3px; }

/* Bilde: frittstående (gjennomsiktig bakgrunn) */
.b4-hero__art { position: relative; display: flex; justify-content: center; align-items: flex-end; min-width: 0; }
.b4-mode-cutout .b4-hero__art::before {
	content: "";
	position: absolute;
	inset: 6% 2% 0;
	z-index: -1;
	background: radial-gradient(closest-side, var(--b4-accent), transparent);
	opacity: .26;
	filter: blur(24px);
}
.b4-hero__art picture { display: contents; }
.b4-mode-cutout .b4-art__img {
	display: block;
	width: auto;
	max-width: 100%;
	max-height: calc(420px * var(--b4-zoom, 1));
	height: auto;
	filter: drop-shadow(0 14px 22px rgba(0, 0, 0, .4));
}

/* Hero: maskoten skaleres opp og beskjæres av rammen (rammen vokser ikke).
   Standard 125 % av rammehøyden; «Bildestørrelse» i temaet justerer dette. */
.b4-layout-hero.b4-mode-cutout .b4-hero__inner { min-height: 500px; }
.b4-layout-hero.b4-mode-cutout .b4-hero__art { align-self: stretch; }
.b4-layout-hero.b4-mode-cutout .b4-art__img {
	position: absolute;
	left: 50%;
	bottom: -12%;
	transform: translateX(-50%);
	height: calc(125% * var(--b4-zoom, 1));
	max-height: none;
	max-width: none;
	width: auto;
}

/* Bilde: fyller høyre side (bilde med egen bakgrunn) */
.b4-mode-fill .b4-hero__inner { padding-block: 0; padding-right: 0; }
.b4-mode-fill .b4-hero__copy { padding-block: clamp(1.25rem, 4vw, 3rem); }
.b4-mode-fill .b4-hero__art { align-self: stretch; }
.b4-mode-fill .b4-art__img { display: block; width: 100%; height: 100%; min-height: 280px; object-fit: cover; }

/* Slank banner (dager uten tilbud) */
.b4-layout-banner .b4-hero__inner {
	min-height: 0;
	grid-template-columns: 1fr auto;
	padding: .9rem clamp(1rem, 3vw, 2rem);
}
.b4-layout-banner .b4-headline { margin: 0 0 .25rem; font-size: clamp(1.15rem, 2.4vw, 1.6rem); }
.b4-layout-banner .b4-sub { margin: 0 0 .6rem; font-size: 1rem; }
.b4-layout-banner .b4-btn { padding: .5rem 1.1rem; font-size: .95rem; }
.b4-layout-banner .b4-mode-cutout .b4-art__img,
.b4-layout-banner.b4-mode-cutout .b4-art__img { max-height: calc(132px * var(--b4-zoom, 1)); }
.b4-layout-banner.b4-mode-fill .b4-art__img { min-height: 0; max-height: 130px; }

@media (max-width: 720px) {
	.b4-hero__inner { grid-template-columns: 1fr; min-height: 0; gap: 1rem; text-align: left; }
	.b4-mode-cutout .b4-art__img { max-height: calc(312px * var(--b4-zoom, 1)); }
	.b4-layout-hero.b4-mode-cutout .b4-hero__inner { min-height: 0; }
	.b4-layout-hero.b4-mode-cutout .b4-hero__art { height: 340px; }
	.b4-layout-hero.b4-mode-cutout .b4-art__img { height: calc(100% * var(--b4-zoom, 1)); bottom: -6%; }
	.b4-mode-fill .b4-hero__inner { padding: 0; }
	.b4-mode-fill .b4-hero__copy { padding: 1.25rem; }
	.b4-mode-fill .b4-art__img { min-height: 0; max-height: 280px; }
	.b4-layout-banner .b4-hero__inner { grid-template-columns: 1fr; }
	.b4-layout-banner.b4-mode-cutout .b4-art__img { max-height: calc(108px * var(--b4-zoom, 1)); }
}

/* ---------- Effekter (kun innenfor toppen, aldri over knapper) ---------- */

.b4-fx { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }

.b4-p {
	position: absolute;
	display: block;
	left: var(--x, 50%);
	top: 0;
	opacity: var(--o, .85);
	animation-duration: var(--d, 10s);
	animation-delay: var(--delay, 0s);
	animation-iteration-count: infinite;
	animation-timing-function: linear;
	will-change: transform;
}

.b4-fx-snow .b4-p {
	top: -12px;
	width: var(--s);
	height: var(--s);
	border-radius: 50%;
	background: var(--b4-fx);
	animation-name: b4-fall;
}
.b4-fx-confetti .b4-p {
	top: -20px;
	width: var(--s);
	height: calc(var(--s) * 1.7);
	animation-name: b4-confetti;
}
.b4-fx-hearts .b4-p {
	top: auto;
	bottom: -30px;
	font-size: var(--s);
	line-height: 1;
	color: var(--b4-fx);
	animation-name: b4-rise;
}
.b4-fx-sparkle .b4-p {
	top: var(--y, 50%);
	font-size: var(--s);
	line-height: 1;
	color: var(--b4-fx);
	animation-name: b4-twinkle;
	animation-timing-function: ease-in-out;
}

@keyframes b4-fall {
	from { transform: translate3d(0, 0, 0); }
	to   { transform: translate3d(var(--dx, 0), var(--fall, 420px), 0); }
}
@keyframes b4-confetti {
	from { transform: translate3d(0, 0, 0) rotate(0deg); }
	to   { transform: translate3d(var(--dx, 0), var(--fall, 420px), 0) rotate(var(--rot, 720deg)); }
}
@keyframes b4-rise {
	0%   { transform: translate3d(0, 0, 0); opacity: 0; }
	15%  { opacity: var(--o, .85); }
	100% { transform: translate3d(var(--dx, 0), calc(var(--fall, 420px) * -1), 0); opacity: 0; }
}
@keyframes b4-twinkle {
	0%, 100% { transform: scale(.4); opacity: .1; }
	50%      { transform: scale(1); opacity: var(--o, .9); }
}

/* Flaggermus */
.b4-bat {
	position: absolute;
	left: -80px;
	top: var(--y, 20%);
	animation: b4-fly var(--d, 14s) linear var(--delay, 0s) infinite;
	will-change: transform;
}
.b4-bat i {
	display: block;
	width: var(--s, 34px);
	height: calc(var(--s, 34px) * .55);
	background: var(--b4-fx);
	opacity: .6;
	-webkit-mask: var(--b4-bat) center / contain no-repeat;
	mask: var(--b4-bat) center / contain no-repeat;
	animation: b4-flap .28s ease-in-out infinite alternate;
}
.b4-season {
	--b4-bat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 32'%3E%3Cpath d='M32 5c-1.6 0-2.7 2-3.1 4.2C26.300 7.200 22.600 6 18.500 6.200 13.800 6.500 8.800 8.800 3 14.500c3.600-.8 6.600-.3 8.800 1.300-3.300 1.800-5.200 4.700-6.200 9 3.300-2.500 6.700-3.400 10-2.700-1.100 3-.9 5.600.9 7.800 1.400-3.400 3.800-5.500 7.400-6.300C25.600 26 28.200 29 32 31c3.800-2 6.400-5 8.100-7.400 3.600.8 6 2.900 7.400 6.300 1.800-2.200 2-4.800.9-7.800 3.300-.7 6.700.2 10 2.700-1-4.300-2.900-7.200-6.200-9 2.200-1.600 5.200-2.100 8.800-1.300C55.200 8.800 50.200 6.500 45.500 6.200 41.400 6 37.700 7.200 35.100 9.200 34.700 7 33.600 5 32 5z'/%3E%3C/svg%3E");
}
@keyframes b4-fly {
	from { transform: translate3d(0, 0, 0); }
	to   { transform: translate3d(calc(var(--w, 1200px) + 160px), var(--dy, -40px), 0); }
}
@keyframes b4-flap {
	from { transform: scaleY(1); }
	to   { transform: scaleY(.55); }
}

/* Solstråler (kun CSS) */
.b4-fx-sun .b4-fx::before {
	content: "";
	position: absolute;
	right: -18%;
	top: -75%;
	width: 85%;
	aspect-ratio: 1;
	background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .28) 0 7deg, transparent 7deg 18deg);
	-webkit-mask: radial-gradient(circle, #000 0, transparent 68%);
	mask: radial-gradient(circle, #000 0, transparent 68%);
	animation: b4-spin 140s linear infinite;
}
@keyframes b4-spin { to { transform: rotate(360deg); } }

/* Pauser når utenfor skjermen */
.b4-season.b4-paused .b4-p,
.b4-season.b4-paused .b4-bat,
.b4-season.b4-paused .b4-bat i,
.b4-season.b4-paused .b4-fx::before { animation-play-state: paused; }

@media (prefers-reduced-motion: reduce) {
	.b4-fx { display: none; }
	.b4-btn { transition: none; }
}

/* ---------- Produktstripe ---------- */

.b4-products { margin: 0 0 2rem; }
.b4-products__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	margin: 0 0 1rem;
	padding-bottom: .5rem;
	border-bottom: 3px solid var(--b4-accent, currentColor);
}
.b4-products__title { margin: 0; font-size: clamp(1.25rem, 2.4vw, 1.6rem); }
.b4-products__more { font-weight: 600; white-space: nowrap; }

/* ---------- Forhåndsvisning ---------- */

.b4-preview-flag {
	position: fixed;
	left: 12px;
	bottom: 12px;
	z-index: 99999;
	max-width: calc(100vw - 24px);
	padding: .55rem .85rem;
	border-radius: 8px;
	font: 600 13px/1.35 system-ui, sans-serif;
	background: #111;
	color: #fff;
	box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
}
.b4-preview-flag a { color: #ffd166; margin-left: .5rem; }
