/*
 * Venice base styles: design tokens and the components shared by every page
 * (header, footer, buttons, forms).
 *
 * Page-specific styles live in home.css and shop.css.
 * Breakpoints: 1024 (nav collapses), 768 (tablet), 560 (phone).
 */

/* ------------------------------------------------------------------ tokens */

:root {
	/* palette (from the design) */
	--c-navy: #04123e;
	--c-deep: #263e77;
	--c-royal: #23408b;
	--c-mid: #3456a5;
	--c-blue: #4c7cee;
	--c-action: #3f6ae0; /* brand blue, tuned so white text passes AA (4.8:1) */
	--c-link: #2f56c4;   /* blue text on white / grey (5.3:1+) */
	--c-yellow: #ffde00;
	--c-grey: #e6eaf0;
	--c-ink: #0c0f10;
	--c-muted: #475569;
	--c-line: #d3d9e4;
	--c-white: #fff;
	--c-error: #b42318;

	/* type */
	--font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
	--fs-xs: 0.75rem;
	--fs-sm: 0.875rem;
	--fs-md: 1rem;
	--fs-lg: 1.125rem;
	--fs-h3: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
	--fs-h2: clamp(1.625rem, 1.15rem + 1.7vw, 2.5rem);
	--fs-h1: clamp(1.875rem, 1.2rem + 2.6vw, 3.25rem);

	/* layout */
	--container: 1240px;
	--gutter: clamp(16px, 4vw, 40px);
	--section-y: clamp(48px, 6.5vw, 96px);
	--header-h: 72px;

	/* shape: pills for actions, 12px inputs/cards, 24-28px panels */
	--r-sm: 12px;
	--r-md: 16px;
	--r-lg: 24px;
	--r-xl: 28px;
	--r-pill: 999px;

	--shadow-sm: 0 1px 2px rgba(4, 18, 62, 0.06), 0 4px 14px rgba(4, 18, 62, 0.06);
	--shadow-md: 0 10px 30px rgba(4, 18, 62, 0.14);
	--ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 1024px) {
	:root {
		--header-h: 64px;
	}
}

/* ------------------------------------------------------------------- base */

body {
	font-family: var(--font);
	color: var(--c-ink);
	-webkit-font-smoothing: antialiased;
}

.vn-main {
	background: #fff;
	font-family: var(--font);
	color: var(--c-ink);
	line-height: 1.6;
	font-size: var(--fs-md);
}

/* :where() keeps this reset at the lowest specificity, so component rules (e.g. .vn-card__title)
   can set their own margins without needing a .vn-main prefix */
.vn-main :where(h1, h2, h3, h4, p, ul, ol, dl, dd, figure) {
	margin: 0;
	padding: 0;
}

/* avoid one-word last lines in running text (falls back to normal wrapping where unsupported) */
.vn-main :where(p, li) {
	text-wrap: pretty;
}

.vn-main h1,
.vn-main h2,
.vn-main h3 {
	font-family: var(--font);
	color: var(--c-navy);
	text-wrap: balance;
}

.vn-main img {
	max-width: 100%;
	height: auto;
}

.vn-container {
	width: 100%;
	max-width: calc(var(--container) + var(--gutter) * 2);
	margin-inline: auto;
	padding-inline: var(--gutter);
	box-sizing: border-box;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.vn-skip {
	position: absolute;
	left: 16px;
	top: -100px;
	z-index: 300;
	padding: 10px 16px;
	border-radius: var(--r-sm);
	background: var(--c-yellow);
	color: var(--c-navy);
	font-weight: 700;
	text-decoration: none;
}

.vn-skip:focus {
	top: 12px;
}

:where(a, button, input, textarea, select, summary):focus-visible {
	outline: 3px solid var(--c-link);
	outline-offset: 2px;
}

.vn-header :where(a, button, input):focus-visible,
.vn-footer :where(a, button):focus-visible,
.vn-on-dark :where(a, button, input):focus-visible {
	outline-color: var(--c-yellow);
}

/* small caps label above a heading */
.vn-label {
	margin: 0;
	font-size: var(--fs-xs);
	line-height: 1.4;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--c-link);
}

.vn-label--yellow {
	color: var(--c-yellow);
}

.vn-label--blue {
	color: var(--c-link);
}

.vn-ico {
	display: block;
	width: 1.5rem;
	height: 1.5rem;
	flex: none;
}

/* ---------------------------------------------------------------- buttons */

.vn-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	box-sizing: border-box;
	min-height: 44px;
	padding: 0 24px;
	border: 2px solid transparent;
	border-radius: var(--r-pill);
	font-family: var(--font);
	font-size: var(--fs-sm);
	line-height: 1;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.vn-btn:active {
	transform: translateY(1px) scale(0.99);
}

.vn-btn--accent {
	background: var(--c-yellow);
	color: var(--c-deep);
}

.vn-btn--accent:hover {
	background: #fff;
	color: var(--c-deep);
}

.vn-btn--primary {
	background: var(--c-action);
	color: #fff;
}

.vn-btn--primary:hover {
	background: var(--c-navy);
	color: #fff;
}

.vn-btn--ghost {
	border-color: #fff;
	background: rgba(4, 18, 62, 0.55);
	color: #fff;
}

.vn-btn--ghost:hover {
	background: #fff;
	color: var(--c-deep);
}

.vn-btn--lg {
	min-height: 48px;
	padding: 0 28px;
	font-size: var(--fs-sm);
}

.vn-btn--sm {
	min-height: 40px;
	padding: 0 18px;
	font-size: var(--fs-xs);
}

@media (pointer: coarse) {
	.vn-btn--sm {
		min-height: 44px;
	}
}

/* Theme Builder layouts that only hold one of our shortcodes */
.et_pb_section.vn-tb {
	padding: 0;
}

.et_pb_row.vn-tb {
	width: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

.vn-tb .et_pb_column,
.vn-tb .et_pb_module {
	margin: 0 !important;
}

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

/* The Theme Builder wraps layouts in <header class="et-l--header">. */
header.et-l--header {
	position: sticky;
	top: 0;
	z-index: 100;
}

body.admin-bar header.et-l--header {
	top: 32px;
}

.vn-header {
	background: var(--c-navy);
	color: #fff;
	font-family: var(--font);
}

.vn-header__bar {
	display: flex;
	align-items: center;
	gap: 20px;
	height: var(--header-h);
	position: relative;
}

.vn-logo {
	flex: none;
	display: block;
	line-height: 0;
}

.vn-logo img {
	display: block;
	width: clamp(120px, 11vw, 156px);
	height: auto;
}

/* Divi gives every <ul> bottom padding; the header lists must not inherit it */
.vn-header ul,
.vn-footer ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.vn-nav {
	display: flex;
	align-items: center;
	gap: 16px;
	height: var(--header-h);
	margin-left: auto;
}

.vn-nav__list {
	display: flex;
	align-items: stretch;
	gap: 2px;
	height: 100%;
}

.vn-nav__list li {
	position: relative;
	margin: 0;
	padding: 0;
	list-style: none;
}

.vn-nav__list > li {
	display: flex;
	align-items: center;
}

.vn-nav__list a {
	display: flex;
	align-items: center;
	box-sizing: border-box;
	min-height: 44px;
	padding: 0 12px;
	color: #fff;
	font-size: var(--fs-sm);
	line-height: 1.2;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	text-decoration: none;
	transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.vn-nav__sub-toggle {
	display: none;
}

@media (min-width: 1025px) {
	.vn-nav__toggle {
		display: none;
	}

	/* top level: links fill the header height, the indicator sits on its bottom edge */
	.vn-nav__list > li > a {
		position: relative;
		height: 100%;
	}

	.vn-nav__list > li > a::after {
		content: '';
		position: absolute;
		left: 12px;
		right: 12px;
		bottom: 0;
		height: 3px;
		border-radius: 3px 3px 0 0;
		background: var(--c-yellow);
		transform: scaleX(0);
		transition: transform 0.2s var(--ease);
	}

	.vn-nav__list > li:hover > a,
	.vn-nav__list > li:focus-within > a,
	.vn-nav__list > li.is-open > a {
		color: var(--c-yellow);
	}

	.vn-nav__list > li:hover > a::after,
	.vn-nav__list > li:focus-within > a::after,
	.vn-nav__list > li.is-open > a::after,
	.vn-nav__list > li.current-menu-item > a::after,
	.vn-nav__list > li.current-menu-ancestor > a::after {
		transform: scaleX(1);
	}

	/* chevron: shows which items open a menu (button, so touch laptops can open it too) */
	.vn-nav__list > li.menu-item-has-children > a {
		padding-right: 4px;
	}

	.vn-nav__list > li.menu-item-has-children > a::after {
		right: 32px;
	}

	.vn-nav__sub-toggle {
		display: grid;
		place-items: center;
		align-self: stretch;
		width: 32px;
		padding: 0 8px 0 0;
		border: 0;
		background: none;
		color: #fff;
		cursor: pointer;
		transition: color 0.2s var(--ease);
	}

	.vn-nav__sub-toggle .vn-ico {
		width: 18px;
		height: 18px;
		transition: transform 0.2s var(--ease);
	}

	.vn-nav__list > li:hover > .vn-nav__sub-toggle,
	.vn-nav__list > li:focus-within > .vn-nav__sub-toggle,
	.vn-nav__list > li.is-open > .vn-nav__sub-toggle {
		color: var(--c-yellow);
	}

	.vn-nav__list > li:hover > .vn-nav__sub-toggle .vn-ico,
	.vn-nav__list > li.is-open > .vn-nav__sub-toggle .vn-ico {
		transform: rotate(180deg);
	}

	/* drop-down panel: category groups in columns, centred under the header */
	.vn-nav__list > li.menu-item-has-children {
		position: static;
	}

	.vn-nav__list > li > .sub-menu {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		z-index: 10;
		display: none;
		grid-template-columns: repeat(4, minmax(0, 1fr));
		column-gap: 32px;
		row-gap: 2px;
		box-sizing: border-box;
		width: min(960px, calc(100% - 2 * var(--gutter)));
		margin: 0 auto;
		padding: 22px 26px 24px;
		background: #fff;
		border-top: 3px solid var(--c-yellow);
		border-radius: 0 0 var(--r-md) var(--r-md);
		box-shadow: 0 18px 40px rgba(4, 18, 62, 0.24);
	}

	.vn-nav__list > li:hover > .sub-menu,
	.vn-nav__list > li:focus-within > .sub-menu,
	.vn-nav__list > li.is-open > .sub-menu {
		display: grid;
	}

	.vn-nav__list .sub-menu a {
		min-height: 38px;
		padding: 0 10px;
		border-radius: 8px;
		color: var(--c-ink);
		font-size: var(--fs-sm);
		font-weight: 500;
		letter-spacing: 0;
		text-transform: none;
		white-space: nowrap;
	}

	.vn-nav__list .sub-menu a:hover,
	.vn-nav__list .sub-menu a:focus-visible {
		background: var(--c-grey);
		color: var(--c-link);
	}

	/* group headings (Valves, Fittings ...): bold, with a rule underneath */
	.vn-nav__list > li > .sub-menu > li > a {
		min-height: 40px;
		margin-bottom: 2px;
		padding: 0 10px;
		border-radius: 0;
		border-bottom: 2px solid var(--c-grey);
		color: var(--c-navy);
		font-size: var(--fs-md);
		font-weight: 800;
		letter-spacing: 0.01em;
	}

	.vn-nav__list > li > .sub-menu > li > a:hover,
	.vn-nav__list > li > .sub-menu > li > a:focus-visible {
		border-bottom-color: var(--c-yellow);
		background: none;
		color: var(--c-link);
	}

	.vn-nav__list .sub-menu .sub-menu {
		display: block;
		padding: 0;
	}

	/* "All products": a full-width row on top */
	.vn-nav__list > li > .sub-menu > li:first-child:not(.menu-item-has-children) {
		grid-column: 1 / -1;
		margin-bottom: 8px;
	}

	.vn-nav__list > li > .sub-menu > li:first-child:not(.menu-item-has-children) > a {
		border-bottom: 0;
		margin-bottom: 0;
		padding: 0 10px;
		background: var(--c-grey);
		border-radius: 8px;
		color: var(--c-link);
		font-size: var(--fs-sm);
		font-weight: 700;
		letter-spacing: 0.04em;
		text-transform: uppercase;
	}

	.vn-nav__list > li > .sub-menu > li:first-child:not(.menu-item-has-children) > a::after {
		content: '\2192';
		margin-left: 8px;
	}
}

/* tools: product search */
.vn-tools {
	display: flex;
	align-items: center;
	gap: 4px;
}

.vn-tools__btn {
	position: relative;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: var(--r-sm);
	background: none;
	color: #fff;
	cursor: pointer;
	transition: color 0.2s var(--ease);
}

.vn-tools__btn:hover {
	color: var(--c-yellow);
}

.vn-tools__btn .vn-ico {
	width: 24px;
	height: 24px;
}

.vn-tools__search {
	position: absolute;
	top: calc(100% + 8px);
	right: var(--gutter);
	z-index: 20;
	display: flex;
	gap: 8px;
	width: min(400px, calc(100vw - 2 * var(--gutter)));
	padding: 10px;
	box-sizing: border-box;
	border-radius: var(--r-md);
	background: #fff;
	box-shadow: var(--shadow-md);
}

.vn-tools__search[hidden] {
	display: none;
}

.vn-tools__search input[type='search'] {
	flex: 1;
	min-width: 0;
	min-height: 44px;
	padding: 0 16px;
	border: 2px solid transparent;
	border-radius: var(--r-pill);
	background: var(--c-grey);
	color: var(--c-ink);
	font-family: var(--font);
	font-size: var(--fs-md);
}

.vn-tools__search input[type='search']:focus {
	outline: none;
	border-color: var(--c-link);
	background: #fff;
}

/* collapsed navigation (tablet / phone / touch laptops) */
@media (max-width: 1024px) {
	.vn-tools {
		margin-left: auto;
	}

	.vn-nav__toggle {
		display: grid;
		place-items: center;
		width: 44px;
		height: 44px;
		padding: 0;
		border: 0;
		border-radius: var(--r-sm);
		background: none;
		color: #fff;
		cursor: pointer;
	}

	.vn-nav__toggle .vn-nav__toggle-close,
	.vn-header.is-open .vn-nav__toggle .vn-nav__toggle-open {
		display: none;
	}

	.vn-header.is-open .vn-nav__toggle .vn-nav__toggle-close {
		display: block;
	}

	.vn-nav {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		display: none;
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
		height: auto;
		max-height: calc(100dvh - var(--header-h));
		overflow-y: auto;
		margin: 0;
		padding: 8px var(--gutter) 24px;
		background: var(--c-navy);
		border-top: 1px solid rgba(255, 255, 255, 0.12);
		box-shadow: var(--shadow-md);
	}

	.vn-header.is-open .vn-nav {
		display: flex;
	}

	.vn-nav__list {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		height: auto;
	}

	.vn-nav__list > li {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	}

	.vn-nav__list > li > a {
		flex: 1;
		min-height: 52px;
		padding: 0 4px;
		font-size: var(--fs-md);
	}

	.vn-nav__list > li.current-menu-item > a,
	.vn-nav__list > li.current-menu-ancestor > a {
		color: var(--c-yellow);
	}

	.vn-nav__sub-toggle {
		display: grid;
		place-items: center;
		width: 48px;
		height: 48px;
		padding: 0;
		border: 0;
		background: none;
		color: #fff;
		cursor: pointer;
	}

	.vn-nav__sub-toggle .vn-ico {
		width: 22px;
		height: 22px;
		transition: transform 0.2s var(--ease);
	}

	li.is-open > .vn-nav__sub-toggle .vn-ico {
		transform: rotate(180deg);
	}

	.vn-nav__list .sub-menu {
		display: none;
		flex-basis: 100%;
		margin: 0;
		padding: 0 0 12px 12px;
		list-style: none;
	}

	li.is-open > .sub-menu,
	li.is-open > .sub-menu .sub-menu {
		display: block;
	}

	.vn-nav__list .sub-menu a {
		min-height: 44px;
		padding: 0 4px;
		color: rgba(255, 255, 255, 0.86);
		font-size: var(--fs-sm);
		font-weight: 500;
		text-transform: none;
		letter-spacing: 0;
	}

	/* group headings stay bold */
	.vn-nav__list > li > .sub-menu > li > a {
		margin-top: 6px;
		color: #fff;
		font-size: var(--fs-md);
		font-weight: 800;
	}

	.vn-nav__list > li > .sub-menu > li:first-child:not(.menu-item-has-children) > a {
		margin-top: 0;
		color: var(--c-yellow);
		font-size: var(--fs-sm);
		font-weight: 700;
		letter-spacing: 0.04em;
		text-transform: uppercase;
	}

	.vn-nav__list .sub-menu .sub-menu {
		padding: 0 0 4px 12px;
	}

}

@media (max-width: 400px) {
	.vn-tools__btn {
		width: 40px;
	}
}

/* ----------------------------------------------------------------- footer */

.vn-footer {
	background: #fff;
	font-family: var(--font);
	border-top: 1px solid var(--c-line);
}

.vn-footer__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px 32px;
	padding-block: 20px;
}

.vn-footer__logo {
	display: block;
	line-height: 0;
}

.vn-footer__logo img {
	display: block;
	width: clamp(110px, 10vw, 140px);
	height: auto;
}

.vn-footer__copy {
	margin: 0;
	color: var(--c-ink);
	font-size: var(--fs-sm);
	line-height: 1.5;
	font-weight: 500;
	text-align: right;
}

@media (max-width: 640px) {
	.vn-footer__bar {
		flex-direction: column;
		padding-block: 24px;
	}

	.vn-footer__copy {
		text-align: center;
	}
}

/* ------------------------------------------------------------------ forms */

.vn-form {
	display: grid;
	gap: 14px;
	font-family: var(--font);
}

.vn-field label {
	display: block;
	margin-bottom: 6px;
	color: var(--c-navy);
	font-size: var(--fs-sm);
	font-weight: 600;
}

.vn-field__req {
	color: var(--c-error);
}

.vn-field input,
.vn-field textarea {
	display: block;
	width: 100%;
	box-sizing: border-box;
	min-height: 48px;
	padding: 12px 16px;
	border: 2px solid transparent;
	border-radius: var(--r-sm);
	background: var(--c-grey);
	color: var(--c-ink);
	font-family: var(--font);
	font-size: var(--fs-md);
	line-height: 1.4;
	transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.vn-field textarea {
	min-height: 112px;
	resize: vertical;
}

.vn-field input:focus,
.vn-field textarea:focus {
	outline: none;
	border-color: var(--c-link);
	background: #fff;
}

.vn-field.has-error input,
.vn-field.has-error textarea {
	border-color: var(--c-error);
	background: #fff;
}

.vn-field__error,
.vn-form__alert {
	margin: 6px 0 0;
	color: var(--c-error);
	font-size: var(--fs-sm);
	font-weight: 600;
}

.vn-form__alert {
	padding: 12px 14px;
	border-radius: var(--r-sm);
	background: #fef3f2;
}

.vn-form__submit {
	justify-self: start;
	margin-top: 4px;
	min-width: 180px;
}

.vn-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
