/* Compatibility bridge for Builder releases older than 1.4.2. */

.gw-builder-section {
	padding: clamp(56px, 9vw, 112px) 20px;
}

.gw-builder-section--soft {
	background: var(--gw-soft);
}

.gw-builder-container {
	width: min(1180px, 100%);
	margin: 0 auto;
}

.gw-builder-grid {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	gap: 24px;
}

.gw-builder-hero-copy {
	grid-column: span 7;
	align-self: center;
}

.gw-builder-hero-panel {
	grid-column: span 5;
	align-self: stretch;
	padding: 28px;
	border: 1px solid var(--gw-line);
	border-radius: var(--gw-radius);
	background: var(--gw-paper);
	box-shadow: var(--gw-shadow);
}

.gw-builder-eyebrow {
	margin: 0 0 14px;
	color: var(--gw-accent);
	font-size: 13px;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.gw-builder-heading {
	max-width: 860px;
	margin: 0;
	font-size: clamp(42px, 7vw, 84px);
	line-height: 0.96;
	letter-spacing: 0;
}

.gw-builder-text {
	max-width: 680px;
	margin: 22px 0 0;
	color: var(--gw-muted);
	font-size: 18px;
}

.gw-builder-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 30px;
}

.gw-builder-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	padding: var(--gw-btn-pad-y, 0) var(--gw-btn-pad-x, 18px);
	border: 1px solid var(--gw-ink);
	border-radius: var(--gw-btn-radius, 6px);
	background: var(--gw-ink);
	color: #ffffff;
	font-weight: var(--gw-btn-weight, 750);
	text-decoration: none;
}

.gw-builder-button--secondary {
	background: transparent;
	color: var(--gw-ink);
}

.gw-builder-card {
	padding: 22px;
	border: 1px solid var(--gw-line);
	border-radius: var(--gw-radius);
	background: var(--gw-paper);
}

.gw-builder-card h3 {
	margin: 0 0 10px;
	font-size: 20px;
}

.gw-builder-card p {
	margin: 0;
	color: var(--gw-muted);
}

.gw-builder-card-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 18px;
	margin-top: 36px;
}

.gw-builder-columns {
	display: grid;
	gap: 24px;
}

.gw-builder-columns--two {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gw-builder-columns--three {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gw-builder-column {
	min-width: 0;
}

.gw-builder-image {
	margin: 24px 0 0;
}

.gw-builder-image img {
	width: 100%;
	border-radius: var(--gw-radius);
}

.gw-builder-image figcaption {
	margin-top: 8px;
	color: var(--gw-muted);
	font-size: 14px;
}

.gw-builder-list {
	margin: 22px 0 0;
	padding-left: 24px;
	color: var(--gw-ink);
	font-size: 18px;
}

.gw-builder-list li + li {
	margin-top: 8px;
}

.gw-builder-divider {
	border: 0;
	border-top: 1px solid var(--gw-line);
}

.gw-builder-spacer {
	display: block;
}


@media (max-width: 760px) {
	.gw-builder-grid,
	.gw-builder-card-grid,
	.gw-builder-columns--two,
	.gw-builder-columns--three {
		grid-template-columns: 1fr;
	}

	.gw-builder-hero-copy,
	.gw-builder-hero-panel {
		grid-column: auto;
	}
}
/* Explicit floating navigation must clear the fixed WordPress admin bar. */
body.admin-bar .gw-floating-nav {
	margin-top: 32px;
}
@media screen and (max-width: 782px) {
	body.admin-bar .gw-floating-nav {
		margin-top: 46px;
	}
}
/* ============================================================
   Product single-template hero — stack the 2-column grid on
   narrow screens (the grid template columns are inline so the
   override needs !important).
   ============================================================ */
@media (max-width: 980px) {
	.gpt-hero-2col {
		grid-template-columns: 1fr !important;
	}
}
/* ============================================================
   Mobile navigation — hamburger for the floating header pill.
   The horizontal pill (logo / <nav> links / <div> action buttons)
   overflows on phones; below 768px collapse the links + buttons
   behind a toggle (frontend.js adds .gw-nav-open).
   ============================================================ */
.gw-nav-toggle {
	display: none;
}

@media (max-width: 767px) {
	.gw-floating-nav {
		flex-wrap: wrap !important;
	}

	.gw-nav-toggle {
		display: inline-flex;
		flex-direction: column;
		justify-content: center;
		gap: 5px;
		width: 44px;
		height: 44px;
		margin-left: auto;
		padding: 11px;
		border: 0;
		border-radius: 12px;
		background: transparent;
		cursor: pointer;
	}

	.gw-nav-toggle span {
		display: block;
		width: 22px;
		height: 2px;
		border-radius: 2px;
		background: var(--gw-ink);
		transition: transform 0.2s ease, opacity 0.2s ease;
	}

	.gw-nav-open .gw-nav-toggle span:nth-child(1) {
		transform: translateY(7px) rotate(45deg);
	}

	.gw-nav-open .gw-nav-toggle span:nth-child(2) {
		opacity: 0;
	}

	.gw-nav-open .gw-nav-toggle span:nth-child(3) {
		transform: translateY(-7px) rotate(-45deg);
	}

	/* Hide the links + action buttons until the toggle opens. */
	.gw-floating-nav > nav,
	.gw-floating-nav > div {
		display: none !important;
	}

	.gw-floating-nav.gw-nav-open > nav {
		display: flex !important;
		flex-basis: 100%;
		width: 100%;
		margin-top: 14px;
	}

	.gw-floating-nav.gw-nav-open > nav .gotoweb-menu {
		flex-direction: column !important;
		align-items: stretch !important;
		width: 100%;
		gap: 2px;
	}

	.gw-floating-nav.gw-nav-open > nav .gotoweb-menu li {
		width: 100%;
	}

	.gw-floating-nav.gw-nav-open > nav .gotoweb-menu a {
		display: block;
		padding: 11px 12px;
		border-radius: 10px;
	}

	.gw-floating-nav.gw-nav-open > nav .gotoweb-menu a:hover {
		background: var(--gw-soft);
	}

	.gw-floating-nav.gw-nav-open > div {
		display: flex !important;
		flex-basis: 100%;
		width: 100%;
		justify-content: stretch;
		gap: 8px;
		margin-top: 10px;
	}

	.gw-floating-nav.gw-nav-open > div > a {
		flex: 1;
		justify-content: center;
	}
}

/* ============================================================
   Mobile typography — cap oversized builder headings so they
   never overflow the viewport. Some heroes (MultilineHeading)
   carry a fixed ~83px inline font-size that doesn't shrink on
   its own; !important beats the inline value. Scales smoothly
   from phone to the 768px breakpoint.
   ============================================================ */
@media (max-width: 767px) {
	/* Heading sizes are handled by the builder's fluid type (clamp + cqw) — no
	   per-breakpoint cap needed here. */
	.gw-site-main h1,
	.gw-site-main h2,
	.gw-site-main h3,
	.gw-site-main p,
	.gw-site-main li,
	.gw-site-main span,
	.gw-site-main a {
		overflow-wrap: break-word;
	}

	/* The CSS compiler moves inline flex styles into gcb classes and the responsive
	   engine emits flex-direction inside @media (gwr) rules, so the old [style*=…]
	   guards matched nothing on the front. Target the Tailwind tokens that survive
	   on the class attribute instead (the compiler keeps the original utilities).

	   1) A base `flex-row` strip (button pairs, badges, social/tag/stat rows) wraps
	      instead of overflowing. Targeting the `flex-row` token keeps marquees safe
	      (their tracks use `gw-marquee-track`, not `flex-row`, so they keep scrolling
	      on one line). */
	.gw-site-main .flex-row {
		flex-wrap: wrap;
	}

	/* 2) When a `flex-col @md:flex-row` row stacks back to a column on the phone its
	      children keep `items-start` (align-items:flex-start) and size to their
	      content — wider than the screen. Stretch them to the column… */
	.gw-site-main .items-start {
		align-items: stretch;
	}

	/* …and hard-cap every flex / grid child so nothing content-sizes past the
	   viewport (marquee tracks scroll on purpose — leave them be). This is what
	   restores correct mobile width for compiled builder layouts. */
	.gw-site-main .flex-col > *:not(.gw-marquee-track),
	.gw-site-main [class*="grid-cols"] > * {
		max-width: 100% !important;
		min-width: 0;
	}

	/* The platform marquee scrolls one wide track (its width + animation come from a
	   compiled gcb class). Pin it so no mobile guard above can shrink or wrap it. */
	.gw-site-main .gw-marquee-track {
		max-width: none !important;
		flex-wrap: nowrap !important;
	}

	/* The global header & footer are builder-rendered too (.gotoweb-craft-template,
	   siblings of .gw-site-main), so the same structural guards must reach them —
	   otherwise e.g. the footer's social/link rows overflow the phone. */
	.gotoweb-craft-template :is(h1, h2, h3, h4, p, li, span, a) {
		overflow-wrap: break-word;
	}
	.gotoweb-craft-template .flex-row {
		flex-wrap: wrap;
	}
	.gotoweb-craft-template .items-start {
		align-items: stretch;
	}
	.gotoweb-craft-template .flex-col > *,
	.gotoweb-craft-template [class*="grid-cols"] > * {
		max-width: 100% !important;
		min-width: 0;
	}

	/* Loop/card grids carry display:grid via the `.grid` token but bake their column
	   count into a compiled class with no responsive collapse, so on a phone the
	   cards crush to an unreadable width (a 3-col grid → ~90px cards). Force every
	   builder grid to a single column — the safe phone default — and let items
	   shrink. (StatsGrid &co. set display:grid inline, no token, so they're untouched
	   and keep their own layout.) */
	:is(.gw-site-main, .gotoweb-craft-template) .grid {
		grid-template-columns: 1fr !important;
	}
	:is(.gw-site-main, .gotoweb-craft-template) .grid > * {
		min-width: 0;
	}

	/* The search widget's filter-tab strip is a class-less inline-flex row (its flex
	   comes from a compiled style — no token to hook). Select it structurally — a flex
	   row of buttons with no text input — and wrap it on phones instead of letting the
	   tabs run off the screen. */
	.gw-site-main .gw-search-shell-wrap div:has(> button):not(:has(input)) {
		flex-wrap: wrap;
	}

	/* Media never forces horizontal scroll. */
	.gw-site-main img,
	.gw-site-main svg,
	.gw-site-main video {
		max-width: 100%;
	}

	.gw-site-main img,
	.gw-site-main svg,
	.gw-site-main video:not(.mb-background-video) {
		height: auto;
	}

	.gw-site-main video.mb-background-video {
		height: 100%;
		object-fit: cover;
	}

	/* Final safety net: no element may cause a horizontal scrollbar (the floating
	   header is position:fixed, so it's anchored to the viewport, not clipped). */
	.gw-site-main {
		overflow-x: clip;
	}
}

@media (max-width: 767px) {
	html,
	body {
		overflow-x: clip;
		max-width: 100%;
	}
}

/* ============================================================
   SETTINGS S4 — plugin-rendered front-end components.
   Three widgets emitted by monteby-builder: a top promo bar,
   a bottom cookie-consent card, and a social icon row. Class
   names + getter names are a fixed contract — match exactly.
   Mobile-safe: no horizontal overflow at 390px.
   ============================================================ */

/* ---- (a) PROMO / announcement bar — full-width top strip ---- */
.gw-promo-bar {
	position: relative;
	width: 100%;
	background: var(--gw-promo-bg, #0b3b38);
	color: var(--gw-promo-fg, #fff);
	font-size: 13px;
	line-height: 1.35;
}

.gw-promo-bar__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 6px 12px;
	max-width: 1200px;
	margin: 0 auto;
	/* Right padding clears the absolute close button so text never tucks under it. */
	padding: 9px 44px;
	text-align: center;
}

.gw-promo-bar__text {
	font-weight: 500;
}

.gw-promo-bar__link {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.16);
	color: inherit;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
	transition: background 0.2s ease;
}

.gw-promo-bar__link:hover,
.gw-promo-bar__link:focus-visible {
	background: rgba(255, 255, 255, 0.28);
}

.gw-promo-bar__close {
	position: absolute;
	top: 50%;
	right: 8px;
	transform: translateY(-50%);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 24px;
	min-height: 24px;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	opacity: 0.7;
	transition: opacity 0.2s ease;
}

.gw-promo-bar__close:hover,
.gw-promo-bar__close:focus-visible {
	opacity: 1;
}

/* Floating-header offset when the promo bar is present. The header pill is
   position:fixed with an inline top:12px; like the admin-bar rule above we use
   margin-top to push it down (offsets a fixed element without fighting the
   inline top). --gw-promo-h (default 40px) is the bar's height. */
body.gw-has-promo .gw-floating-nav {
	margin-top: var(--gw-promo-h, 40px);
}

/* Logged-in: stack admin bar (32px) + promo bar. */
body.gw-has-promo.admin-bar .gw-floating-nav {
	margin-top: calc(32px + var(--gw-promo-h, 40px));
}

@media screen and (max-width: 782px) {
	body.gw-has-promo.admin-bar .gw-floating-nav {
		margin-top: calc(46px + var(--gw-promo-h, 40px));
	}
}

/* Top-anchored fixed triggers (cart corner-tr/-tl, back-to-top) must clear the
   bar too, or they hide behind it. */
body.gw-has-promo .gotoweb-cart--corner-tr .gw-cart-trigger,
body.gw-has-promo .gotoweb-cart--corner-tl .gw-cart-trigger,
body.gw-has-promo .gw-to-top,
body.gw-has-promo .gw-back-to-top {
	top: calc(var(--gwc-float-gap, 22px) + var(--gw-promo-h, 40px));
}

/* ---- (b) COOKIE consent bar — fixed bottom card ---- */
.gw-cookie-bar {
	position: fixed;
	right: 16px;
	bottom: 16px;
	left: auto;
	z-index: 9998;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 16px;
	width: min(520px, calc(100% - 32px));
	padding: 16px 18px;
	background: var(--gw-paper, #fff);
	border: 1px solid var(--gw-line);
	border-radius: var(--gw-radius, 14px);
	box-shadow: 0 18px 50px rgba(16, 17, 20, 0.18);
	color: var(--gw-ink);
}

/* The plugin toggles the [hidden] attribute — this MUST win over display:flex. */
.gw-cookie-bar[hidden] {
	display: none;
}

.gw-cookie-bar__text {
	flex: 1 1 220px;
	min-width: 0;
	margin: 0;
	font-size: 14px;
	line-height: 1.5;
	color: var(--gw-ink);
}

.gw-cookie-bar__policy {
	color: var(--gw-accent);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.gw-cookie-bar__policy:hover,
.gw-cookie-bar__policy:focus-visible {
	color: var(--gw-accent-strong, var(--gw-accent));
}

.gw-cookie-bar__accept {
	flex: 0 0 auto;
	padding: 10px 18px;
	border: 0;
	border-radius: var(--gw-btn-radius, var(--gw-radius, 10px));
	background: var(--gw-accent, #ff4d1a);
	color: #fff;
	font-weight: 700;
	font-size: 14px;
	cursor: pointer;
	transition: background 0.2s ease;
}

.gw-cookie-bar__accept:hover,
.gw-cookie-bar__accept:focus-visible {
	background: var(--gw-accent-strong, #e03c0d);
}

/* Stack text above button, full width, on phones. */
@media (max-width: 480px) {
	.gw-cookie-bar {
		flex-direction: column;
		align-items: stretch;
		right: 12px;
		bottom: 12px;
		left: 12px;
		width: auto;
	}

	.gw-cookie-bar__accept {
		width: 100%;
	}
}

/* ---- (c) SOCIAL icon row ---- */
.gw-social {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.gw-social li {
	margin: 0;
}

.gw-social__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	/* Readable on light AND dark (teal) footers; invert on hover. Override
	   --gw-social-fg locally if a surface needs a different resting color. */
	color: var(--gw-social-fg, currentColor);
	background: rgba(127, 127, 127, 0.16);
	text-decoration: none;
	transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.gw-social__link:hover,
.gw-social__link:focus-visible {
	background: var(--gw-accent, #ff4d1a);
	color: #fff;
	transform: translateY(-1px);
}

.gw-social__link svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

/* ── Form fields — global tokens from Ustawienia → Formularze ─────────── */
/* Low specificity (:where/:is) so builder-widget inline styles & WooCommerce
   keep their own look; this styles generic/native inputs in content areas. */
:where(.gw-site-main, .gw-wc) :is(input, textarea, select):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]) {
	border: 1px solid var(--gw-form-border, #dfe3ea);
	border-radius: var(--gw-form-radius, 10px);
	background-color: var(--gw-form-bg, #ffffff);
}
:where(.gw-site-main, .gw-wc) :is(input, textarea, select):focus {
	outline: none;
	border-color: var(--gw-accent, #ff4d1a);
}
