/*
 * Apex Events — additions.css
 * Request a Quote / Contact / Careers content, the header "Request a Quote" button, the red
 * "Request a Quote" links in the side menu and Services blocks, the floating WhatsApp button and
 * the enquiry popup. Markup: includes/site-additions.php. Behaviour: assets/js/additions.js.
 *
 * Follows the existing inner pages: white background, 48px side padding (20px on phones),
 * thin large headings, red uppercase eyebrows, pill buttons, dark rounded panels.
 */

/* ---------- Header: "Request a Quote" as a red pill ---------- */

html body .elementor-location-header .apex-header-quote-link a,
body.apex-header-light .elementor-location-header:not(:has(details[open])) .apex-header-quote-link a {
	display: inline-block;
	padding: 10px 20px;
	border-radius: 40px;
	background: var(--brand-red, #E22128);
	color: #ffffff !important;
	font-size: 13px;
	letter-spacing: 1px;
	line-height: 1.2;
	white-space: nowrap;
	box-shadow: 0 8px 20px -12px rgba(226, 33, 40, .55);
	transition: transform .3s ease, box-shadow .3s ease, background-color .3s ease;
}

html body .elementor-location-header .apex-header-quote-link a:hover,
body.apex-header-light .elementor-location-header:not(:has(details[open])) .apex-header-quote-link a:hover {
	color: #ffffff !important;
	transform: translateY(-1px);
	box-shadow: 0 12px 28px -12px rgba(226, 33, 40, .8);
}

/* Behind the open side menu it would show through the glass as a red blur: fade it out. */
html body .elementor-location-header:has(details[open]) .apex-header-quote-link {
	opacity: 0;
	pointer-events: none;
}

html body .elementor-location-header .apex-header-quote-link {
	transition: opacity .3s ease;
}

/* Phones: Elementor hides it; show a compact version so the quote button is always in the header. */
@media (max-width: 767px) {
	html body .elementor-location-header .apex-header-quote-link {
		display: block !important;
	}

	html body .elementor-location-header .apex-header-quote-link a,
	body.apex-header-light .elementor-location-header:not(:has(details[open])) .apex-header-quote-link a {
		padding: 8px 12px;
		font-size: 10px;
		letter-spacing: .6px;
	}
}

/* Very narrow phones: make room by hiding the word "Menu" (the three-line icon stays). */
@media (max-width: 389px) {
	html body .elementor-location-header .apex-menu-label {
		display: none !important;
	}
}

/* ---------- Side menu: red "Request a Quote", more links ---------- */

html body .elementor-location-header .apex-menu-links > .apex-menu-quote,
html body .elementor-location-header .apex-menu-links > .apex-menu-quote a {
	color: var(--brand-red, #E22128) !important;
}

/* Highlighted as a rounded red outline; fills red on hover. */
html body .elementor-location-header .apex-menu-links > .apex-menu-quote {
	margin-top: 18px !important;
}

html body .elementor-location-header .apex-menu-links > .apex-menu-quote a {
	display: inline-block;
	padding: 14px 30px 16px;
	font-size: 30px;
	letter-spacing: -.3px;
	white-space: nowrap;
	border: 1px solid var(--brand-red, #E22128);
	border-radius: 999px;
	background: rgba(226, 33, 40, .08);
	box-shadow: 0 0 40px -10px rgba(226, 33, 40, .6);
	line-height: 1;
	transition: background-color .3s ease, color .3s ease, box-shadow .3s ease;
}

html body .elementor-location-header .apex-menu-links > .apex-menu-quote a:hover,
html body .elementor-location-header .apex-menu-links > .apex-menu-quote a:focus-visible {
	background: var(--brand-red, #E22128);
	color: #ffffff !important;
	box-shadow: 0 12px 40px -10px rgba(226, 33, 40, .9);
}

html body .elementor-location-header .apex-menu-links > :nth-child(7) { animation-delay: .47s; }
html body .elementor-location-header .apex-menu-links > :nth-child(8) { animation-delay: .52s; }

/* Eight links: slightly smaller on shorter screens, and the panel scrolls if it ever runs out of room. */
html body .elementor-location-header .apex-menu-panel {
	overflow-y: auto;
	overscroll-behavior: contain;
}

@media (min-width: 768px) and (max-height: 820px) {
	html body .elementor-location-header .apex-menu-links > * {
		font-size: 48px !important;
	}
}

@media (max-width: 767px) {
	html body .elementor-location-header .apex-menu-links > * {
		font-size: 36px !important;
	}
}

@media (max-width: 767px) {
	html body .elementor-location-header .apex-menu-links > .apex-menu-quote a {
		padding: 12px 24px 13px;
		font-size: 24px;
	}
}

/* ---------- Services blocks: "Request a Quote" button ---------- */

html body .elementor .apex-service-quote {
	align-self: flex-start;
	margin-top: 16px;
	background: var(--brand-red, #E22128) !important;
	border-color: var(--brand-red, #E22128) !important;
	color: #ffffff !important;
	box-shadow: 0 12px 32px -14px rgba(226, 33, 40, .8);
	transition: transform .3s ease, box-shadow .3s ease, background-color .3s ease;
}

html body .elementor .apex-service-quote:hover {
	background: #000000 !important;
	border-color: #000000 !important;
	transform: translateY(-2px);
}

/* ---------- Shared: eyebrow labels and buttons ---------- */

.apex-enquiry .apex-eyebrow,
.apex-enquiry-popup .apex-eyebrow {
	margin: 0 0 16px;
	padding: 0;
	color: var(--brand-red, #E22128);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 3px;
	line-height: 1.5;
	text-transform: uppercase;
}

.apex-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 15px 30px;
	border: 1px solid transparent;
	border-radius: 40px;
	font: inherit;
	font-size: 14px;
	font-weight: 400;
	letter-spacing: 1px;
	line-height: 1.4;
	text-transform: uppercase;
	text-decoration: none;
	cursor: pointer;
	transition: transform .3s ease, box-shadow .3s ease, background-color .3s ease, color .3s ease, border-color .3s ease;
}

.apex-btn:hover,
.apex-btn:focus-visible {
	transform: translateY(-2px);
	text-decoration: none;
}

.apex-btn-red,
.apex-btn-red:visited {
	background: var(--brand-red, #E22128);
	border-color: var(--brand-red, #E22128);
	color: #ffffff;
	box-shadow: 0 12px 40px -12px rgba(226, 33, 40, .8);
}

.apex-btn-red:hover,
.apex-btn-red:focus-visible {
	color: #ffffff;
	box-shadow: 0 16px 50px -12px rgba(226, 33, 40, .95);
}

.apex-btn-outline,
.apex-btn-outline:visited {
	background: rgba(255, 255, 255, .05);
	border-color: rgba(255, 255, 255, .25);
	color: #ffffff;
}

.apex-btn-outline:hover,
.apex-btn-outline:focus-visible {
	background: #ffffff;
	color: #000000;
}

.apex-btn-block {
	width: 100%;
}

.apex-btn .apex-wa-icon {
	width: 20px;
	height: 20px;
	flex: 0 0 auto;
}

.apex-btn:focus-visible,
.apex-wa-float:focus-visible,
.apex-enquiry-popup-close:focus-visible {
	outline: 2px solid var(--brand-red, #E22128);
	outline-offset: 3px;
}

/* ---------- Page layout (Request a Quote, Contact, Careers) ---------- */

.apex-enquiry {
	padding: 48px 48px 120px;
	border-top: 1px solid rgba(0, 0, 0, .12);
	color: #111111;
	font-size: 16px;
	line-height: 1.6;
}

.apex-enquiry-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(280px, 400px);
	gap: 80px;
	align-items: start;
}

/* ---------- Forms ---------- */

.apex-form {
	margin: 0;
}

.apex-form fieldset {
	margin: 0 0 48px;
	padding: 0;
	border: 0;
	min-width: 0;
}

.apex-form legend {
	padding: 0;
}

.apex-form-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: 40px;
	row-gap: 32px;
	align-items: end; /* Underlines in a row line up even when one label wraps to two lines. */
}

.apex-field {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
}

.apex-field-wide {
	grid-column: 1 / -1;
}

.apex-field label {
	color: #000000;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 2px;
	line-height: 1.5;
	text-transform: uppercase;
}

.apex-field-optional {
	color: rgba(0, 0, 0, .45);
	font-weight: 400;
	letter-spacing: 1px;
	text-transform: none;
}

.apex-field input,
.apex-field select,
.apex-field textarea {
	width: 100%;
	margin: 0;
	padding: 12px 0;
	border: 0;
	border-bottom: 1px solid rgba(0, 0, 0, .2);
	border-radius: 0;
	background: transparent;
	color: #111111;
	font: inherit;
	font-size: 18px;
	line-height: 1.5;
	box-shadow: none;
	outline: none;
	transition: border-color .25s ease;
	-webkit-appearance: none;
	appearance: none;
}

.apex-field select {
	padding-right: 28px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23111' stroke-width='1.5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 4px center;
	cursor: pointer;
}

.apex-field select:invalid {
	color: rgba(0, 0, 0, .45);
}

.apex-field select option {
	color: #111111;
}

.apex-field textarea {
	min-height: 0;
	height: auto;
	resize: none;
	overflow: hidden; /* Grows with the text (additions.js), so no inner scrollbar. */
}

.apex-field input::placeholder,
.apex-field textarea::placeholder {
	color: rgba(0, 0, 0, .35);
}

.apex-field input:focus,
.apex-field select:focus,
.apex-field textarea:focus {
	border-bottom-color: var(--brand-red, #E22128);
	box-shadow: 0 1px 0 0 var(--brand-red, #E22128);
}

.apex-field.is-invalid input,
.apex-field.is-invalid select,
.apex-field.is-invalid textarea {
	border-bottom-color: var(--brand-red, #E22128);
}

.apex-field-error {
	margin-top: -2px;
	min-height: 0;
	color: var(--brand-red, #E22128);
	font-size: 13px;
	line-height: 1.4;
}

.apex-field-error:empty {
	display: none;
}

.apex-form > .apex-eyebrow {
	margin-bottom: 24px;
}

.apex-form-grid + .apex-form-actions {
	margin-top: 48px;
}

.apex-form-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px 28px;
}

.apex-form-note {
	flex: 1 1 240px;
	margin: 0;
	color: rgba(0, 0, 0, .55);
	font-size: 14px;
	line-height: 1.5;
}

.apex-form-status {
	margin-top: 28px;
	padding: 20px 24px;
	border-left: 2px solid var(--brand-red, #E22128);
	background: rgba(0, 0, 0, .03);
	font-size: 15px;
}

.apex-form-status p {
	margin: 0;
}

.apex-form-status a {
	color: var(--brand-red, #E22128);
	text-decoration: underline;
}

/* ---------- Side panel (dark, like the Services photo panels) ---------- */

.apex-enquiry-aside {
	position: sticky;
	top: 140px;
	padding: 40px 36px;
	border-radius: 24px;
	background: #0e0e10;
	color: rgba(255, 255, 255, .78);
	box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .45);
	overflow: hidden;
	isolation: isolate;
}

/* Faint red glow, as in the footer. */
.apex-enquiry-aside::before {
	content: '';
	position: absolute;
	z-index: -1;
	right: -40%;
	top: -40%;
	width: 120%;
	aspect-ratio: 1;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(226, 33, 40, .18), transparent 65%);
	pointer-events: none;
}

.apex-enquiry-aside .apex-eyebrow + * {
	margin-bottom: 36px;
}

.apex-enquiry-aside > :last-child {
	margin-bottom: 0;
}

.apex-steps {
	margin: 0 0 36px;
	padding: 0;
	list-style: none;
	counter-reset: apex-step;
}

.apex-steps li {
	position: relative;
	padding: 14px 0 14px 44px;
	border-top: 1px solid rgba(255, 255, 255, .12);
	font-size: 15px;
	line-height: 1.5;
	counter-increment: apex-step;
}

.apex-steps li::before {
	content: counter(apex-step, decimal-leading-zero);
	position: absolute;
	left: 0;
	top: 14px;
	color: var(--brand-red, #E22128);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 1px;
}

.apex-contact-list {
	margin: 0 0 36px;
	padding: 0;
	list-style: none;
}

.apex-contact-list li {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 14px 0;
	border-top: 1px solid rgba(255, 255, 255, .12);
}

.apex-contact-label {
	color: rgba(255, 255, 255, .5);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 2px;
	text-transform: uppercase;
}

.apex-contact-list a,
.apex-contact-list span:not(.apex-contact-label) {
	color: #ffffff;
	font-size: 18px;
	font-weight: 300;
	text-decoration: none;
	overflow-wrap: anywhere;
	transition: color .25s ease;
}

.apex-contact-list a:hover {
	color: var(--brand-red, #E22128);
}

.apex-address {
	margin: 0 0 36px;
	color: #ffffff;
	font-size: 16px;
	font-style: normal;
	font-weight: 300;
	line-height: 1.6;
}

.apex-aside-cta {
	padding-top: 28px;
	border-top: 1px solid rgba(255, 255, 255, .12);
}

.apex-aside-cta p {
	margin: 0 0 16px;
	color: #ffffff;
	font-size: 16px;
}

.apex-recruit-card .apex-form-note {
	color: rgba(255, 255, 255, .55);
}

/* ---------- Careers: how to apply (left) and recruitment card (right), side by side ---------- */

.apex-enquiry-careers {
	padding-top: 64px;
}

.apex-careers-row {
	display: flex;
	justify-content: space-around; /* Text and card spread evenly across the page. */
	align-items: flex-start;
	gap: 64px;
}

.apex-careers-row > .apex-careers-text {
	flex: 0 1 640px;
	min-width: 0;
}

.apex-careers-row > .apex-recruit-card {
	flex: 0 0 420px;
}

.apex-careers-title {
	margin: 0 0 24px;
	color: #000000;
	font-size: 48px;
	font-weight: 100;
	letter-spacing: -1.5px;
	line-height: 1.05;
}

.apex-careers-text > p:not(.apex-eyebrow) {
	max-width: 720px;
	margin: 0 0 24px;
	color: #111111;
	font-size: 18px;
	line-height: 1.7;
}

.apex-careers-text > .apex-careers-include {
	margin: 32px 0 0;
	color: #000000;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 3px;
	line-height: 1.5;
	text-transform: uppercase;
}

.apex-careers-list {
	max-width: 720px;
	margin: 12px 0 0;
	padding: 12px 0 0;
	list-style: none;
	border-top: 1px solid rgba(0, 0, 0, .12);
}

.apex-careers-list li {
	padding: 4px 0;
	color: #111111;
	font-size: 16px;
	line-height: 1.7;
}

/* Card sits level with the "How to apply" heading. */
.apex-enquiry-careers .apex-recruit-card {
	position: relative;
	top: auto;
	padding: 36px;
}

.apex-recruit-card .apex-contact-list {
	margin-bottom: 28px;
}

.apex-recruit-card .apex-form-note {
	margin: 14px 0 0;
	font-size: 13px;
}

/* ---------- Floating WhatsApp button ---------- */

.apex-wa-float {
	position: fixed;
	z-index: 9990;
	right: max(24px, env(safe-area-inset-right));
	bottom: max(24px, env(safe-area-inset-bottom));
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--brand-red, #E22128);
	color: #ffffff;
	box-shadow: 0 12px 32px -10px rgba(226, 33, 40, .75), 0 4px 14px rgba(0, 0, 0, .18);
	text-decoration: none;
	transition: transform .3s ease, box-shadow .3s ease, opacity .3s ease;
	-webkit-tap-highlight-color: transparent;
}

.apex-wa-float:hover {
	color: #ffffff;
	transform: translateY(-2px);
	box-shadow: 0 16px 40px -10px rgba(226, 33, 40, .9), 0 4px 14px rgba(0, 0, 0, .2);
}

.apex-wa-float .apex-wa-icon {
	width: 28px;
	height: 28px;
}

/* "Chat with us" label slides out on hover (mouse only). */
.apex-wa-float-label {
	position: absolute;
	right: calc(100% + 12px);
	top: 50%;
	padding: 8px 14px;
	border-radius: 40px;
	background: rgba(14, 14, 16, .82);
	-webkit-backdrop-filter: blur(16px);
	backdrop-filter: blur(16px);
	color: #ffffff;
	font-size: 12px;
	letter-spacing: 1px;
	text-transform: uppercase;
	white-space: nowrap;
	opacity: 0;
	transform: translate(8px, -50%);
	transition: opacity .25s ease, transform .25s ease;
	pointer-events: none;
}

@media (hover: hover) {
	.apex-wa-float:hover .apex-wa-float-label {
		opacity: 1;
		transform: translate(0, -50%);
	}
}

/* Home hero: the round Play/Pause button sits bottom-right too; move it left of the WhatsApp button. */
html body .elementor .apex-hero-video-controls {
	right: 104px !important;
}

@media (max-width: 767px) {
	html body .elementor .apex-hero-video-controls {
		right: 84px !important;
	}
}

/* Hidden while the side menu is open, so it never sits on top of the panel. */
body:has(.elementor-location-header details[open]) .apex-wa-float,
body:has(.elementor-location-header details[open]) .apex-enquiry-popup {
	opacity: 0;
	pointer-events: none;
}

/* ---------- Enquiry popup (after 20 seconds) ---------- */

@keyframes apex-popup-in {
	from { opacity: 0; transform: translate3d(0, 20px, 0); }
	to { opacity: 1; transform: none; }
}

.apex-enquiry-popup {
	position: fixed;
	z-index: 9991;
	right: max(24px, env(safe-area-inset-right));
	bottom: calc(max(24px, env(safe-area-inset-bottom)) + 72px);
	width: 340px;
	max-width: calc(100vw - 32px);
	padding: 28px 28px 30px;
	border: 1px solid rgba(255, 255, 255, .12);
	border-radius: 20px;
	background: rgba(14, 14, 16, .86);
	-webkit-backdrop-filter: blur(28px) saturate(160%);
	backdrop-filter: blur(28px) saturate(160%);
	box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .55);
	color: rgba(255, 255, 255, .78);
	font-size: 15px;
	line-height: 1.55;
	transition: opacity .3s ease;
	animation: apex-popup-in .5s cubic-bezier(.2, .7, .2, 1) both;
}

.apex-enquiry-popup[hidden] {
	display: none;
}

.apex-enquiry-popup.is-closing {
	opacity: 0;
	transform: translate3d(0, 12px, 0);
	transition: opacity .25s ease, transform .25s ease;
}

.apex-enquiry-popup .apex-eyebrow {
	margin-bottom: 10px;
	font-size: 11px;
}

.apex-enquiry-popup-title {
	margin: 0 0 8px;
	color: #ffffff;
	font-size: 30px;
	font-weight: 300;
	letter-spacing: -.8px;
	line-height: 1.1;
}

.apex-enquiry-popup-text {
	margin: 0 0 22px;
}

.apex-enquiry-popup .apex-btn {
	padding: 13px 24px;
	font-size: 13px;
}

.apex-enquiry-popup-close {
	position: absolute;
	top: 12px;
	right: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: rgba(255, 255, 255, .7);
	cursor: pointer;
	transition: background-color .25s ease, color .25s ease;
}

.apex-enquiry-popup-close:hover {
	background: rgba(255, 255, 255, .1);
	color: #ffffff;
}

.apex-enquiry-popup-close svg {
	width: 18px;
	height: 18px;
}

/* ---------- Tablet ---------- */

@media (max-width: 1024px) {
	.apex-enquiry-grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 56px;
	}

	.apex-enquiry-aside {
		position: static;
	}

	.apex-careers-row {
		flex-direction: column;
		align-items: stretch;
		gap: 40px;
	}

	.apex-careers-row > .apex-careers-text,
	.apex-careers-row > .apex-recruit-card {
		flex: 0 0 auto;
	}

	.apex-enquiry-careers .apex-recruit-card {
		position: static;
		max-width: 520px;
	}
}

/* ---------- Phones ---------- */

@media (max-width: 767px) {
	.apex-enquiry {
		padding: 36px 20px 88px;
	}

	.apex-form-grid {
		grid-template-columns: minmax(0, 1fr);
		row-gap: 24px;
	}

	.apex-form fieldset {
		margin-bottom: 40px;
	}

	.apex-field input,
	.apex-field select,
	.apex-field textarea {
		font-size: 16px; /* 16px stops iPhones zooming in on focus. */
	}

	.apex-form-actions .apex-btn {
		width: 100%;
	}

	.apex-enquiry-aside {
		padding: 32px 24px;
		border-radius: 20px;
	}

	.apex-enquiry-careers {
		padding-top: 40px;
	}

	.apex-careers-title {
		font-size: 36px;
		letter-spacing: -1px;
	}

	.apex-enquiry-careers .apex-recruit-card {
		padding: 28px 24px;
	}

	.apex-careers-text > p {
		font-size: 17px;
	}

	.apex-wa-float {
		right: max(16px, env(safe-area-inset-right));
		bottom: max(16px, env(safe-area-inset-bottom));
		width: 52px;
		height: 52px;
	}

	.apex-wa-float .apex-wa-icon {
		width: 26px;
		height: 26px;
	}

	.apex-enquiry-popup {
		left: 16px;
		right: 16px;
		bottom: calc(max(16px, env(safe-area-inset-bottom)) + 64px);
		width: auto;
		max-width: none;
		padding: 24px 22px 24px;
	}

	.apex-enquiry-popup-title {
		font-size: 26px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.apex-enquiry-popup,
	.apex-btn,
	.apex-wa-float {
		animation: none;
		transition: none;
	}
}
