/*
Theme Name:   APEX Smart Home
Theme URI:    https://www.getapexsmart.com/
Description:  Child theme of Hello Elementor for APEX Smart Home. Adds the site header, menus, footer and Contact Form 7 styles, so the site works with free Elementor.
Author:       Gamal Eldien Mokhtar
Author URI:   https://gamaleldiengamal.com
Template:     hello-elementor
Version:      1.6.6
Requires at least: 6.0
Requires PHP: 7.4
License:      GNU General Public License v3 or later
License URI:  https://www.gnu.org/licenses/gpl-3.0.html
Text Domain:  apex-child
*/

/* ==========================================================================
   1. Tokens
   ========================================================================== */
:root {
	--apx-red: #D81E2A;
	--apx-red-hover: #E63946;
	--apx-black: #000000;
	--apx-ink: #111114;
	--apx-card: #1A1A1A;
	--apx-grey: #666666;
	--apx-line: rgba(255, 255, 255, 0.2);
	--apx-white: #FFFFFF;
	--apx-muted: #B8B5AD;
	--apx-font-head: "Cinzel", "Times New Roman", serif;
	--apx-font-body: "Montserrat", Arial, sans-serif;
	--apx-max: 1440px;
	--apx-pad: 40px;
	--apx-header-h: 111px;
}

/* ==========================================================================
   2. Base
   ========================================================================== */
html { scroll-behavior: smooth; }

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

body {
	margin: 0;
	background: var(--apx-black);
	color: var(--apx-white);
	font-family: var(--apx-font-body);
	font-size: 16px;
	line-height: 1.8;
}

a { color: var(--apx-white); }
a:hover, a:focus { color: var(--apx-red); }

h1, h2, h3, h4, h5, h6 {
	font-family: var(--apx-font-head);
	font-weight: 600;
	color: var(--apx-white);
}

/* Plain pages and posts (not built with Elementor) */
.site-main:not(.elementor) { color: var(--apx-white); }
.page-header .entry-title,
.site-main .entry-title { color: var(--apx-white); }

.apx-skip {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 1000;
	background: var(--apx-red);
	color: var(--apx-white);
	padding: 10px 16px;
}
.apx-skip:focus { left: 10px; top: 10px; color: var(--apx-white); }

.apx-container {
	max-width: var(--apx-max);
	margin: 0 auto;
	padding-left: var(--apx-pad);
	padding-right: var(--apx-pad);
}

/* Buttons used in header and footer */
.apx-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 15px 26px;
	border-radius: 25px;
	background: var(--apx-red);
	color: var(--apx-white);
	font-family: var(--apx-font-body);
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.5px;
	line-height: 1.2;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
	transition: background 0.25s ease;
}
.apx-btn:hover,
.apx-btn:focus { background: var(--apx-red-hover); color: var(--apx-white); }

/* ==========================================================================
   3. Header
   ========================================================================== */
.apx-header {
	position: sticky;
	top: 0;
	z-index: 999;
	background: var(--apx-black);
	border-bottom: 1px solid var(--apx-line);
	transition: box-shadow 0.25s ease;
}
.admin-bar .apx-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .apx-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .apx-header { top: 0; } }

.apx-header.is-scrolled { box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6); }

/* See-through header over the hero photo (pages with .apx-overlay-header) */
.apx-overlay-header .apx-header {
	position: fixed;
	left: 0;
	right: 0;
	background: transparent;
	border-bottom-color: transparent;
	transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.apx-overlay-header .apx-header.is-scrolled,
.apx-overlay-header.apx-nav-open .apx-header {
	background: var(--apx-black);
	border-bottom-color: var(--apx-line);
}
.apx-overlay-header .apx-header.is-scrolled { box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6); }
/* Keep the blog post hero text clear of the floating header */
.apx-overlay-header .apx-post-hero { padding-top: calc(var(--apx-header-h) + 60px); }
@media (max-width: 1024px) { .apx-overlay-header .apx-post-hero { padding-top: calc(var(--apx-header-h) + 50px); } }
@media (max-width: 767px) { .apx-overlay-header .apx-post-hero { padding-top: calc(var(--apx-header-h) + 40px); } }

.apx-header__inner {
	display: flex;
	align-items: center;
	gap: 30px;
	min-height: var(--apx-header-h);
	max-width: var(--apx-max);
	margin: 0 auto;
	padding: 10px var(--apx-pad);
}

.apx-logo { flex-shrink: 0; display: flex; align-items: center; text-decoration: none; }
.apx-logo img,
.apx-logo .custom-logo { display: block; width: auto; max-height: 91px; max-width: 160px; }
.apx-logo__text {
	font-family: var(--apx-font-head);
	font-size: 22px;
	font-weight: 700;
	color: var(--apx-white);
	text-decoration: none;
	text-transform: uppercase;
	line-height: 1.1;
}
.apx-logo:hover .apx-logo__text { color: var(--apx-white); }

.apx-header__cta { display: flex; align-items: center; gap: 20px; margin-left: auto; }
.apx-header__cta .apx-btn { padding: 16px 18px; letter-spacing: 0; }

.apx-call {
	display: flex;
	flex-direction: column;
	text-align: right;
	text-decoration: none;
	line-height: 1.35;
}
.apx-call__label { font-size: 14px; color: var(--apx-white); }
.apx-call__number { font-size: 14px; font-weight: 700; color: var(--apx-white); }
.apx-call:hover .apx-call__number { color: var(--apx-red); }

/* ---------- Desktop nav ---------- */
.apx-nav { flex: 1 1 auto; display: flex; justify-content: center; }

.apx-menu,
.apx-menu ul { list-style: none; margin: 0; padding: 0; }

.apx-menu { display: flex; align-items: center; gap: 0; }

.apx-menu > li { position: relative; }

.apx-menu a {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 10px 13px;
	font-family: var(--apx-font-body);
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.39px;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--apx-white);
	line-height: 1.3;
}

/* Red underline on hover (like the old site) */
.apx-menu > li > a { position: relative; }
.apx-menu > li > a::after {
	content: "";
	position: absolute;
	left: 13px;
	right: 13px;
	bottom: 4px;
	height: 2px;
	background: var(--apx-red);
	transform: scaleX(0);
	transition: transform 0.25s ease;
}
.apx-menu > li:hover > a::after,
.apx-menu > li > a:focus::after,
.apx-menu > .current-menu-item > a::after,
.apx-menu > .current-menu-ancestor > a::after { transform: scaleX(1); }

.apx-menu .menu-item-has-children > a::before {
	content: "";
	order: 2;
	width: 6px;
	height: 6px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg) translateY(-2px);
}

/* Dropdown */
.apx-menu .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 240px;
	padding: 8px 0;
	background: #F6F6F6;
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
	z-index: 20;
}
.apx-menu li:hover > .sub-menu,
.apx-menu li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}
.apx-menu .sub-menu a {
	color: var(--apx-black);
	padding: 10px 20px;
	white-space: nowrap;
}
.apx-menu .sub-menu a:hover,
.apx-menu .sub-menu a:focus,
.apx-menu .sub-menu .current-menu-item > a { background: var(--apx-red); color: var(--apx-white); }
.apx-menu .sub-menu .sub-menu { top: -8px; left: 100%; }

.apx-menu .apx-only-mobile { display: none; }

/* Sub-menu toggle button (added by JS, used on mobile) */
.apx-sub-toggle { display: none; }

/* ---------- Burger ---------- */
.apx-burger {
	display: none;
	width: 44px;
	height: 44px;
	margin-left: auto;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--apx-red);
	cursor: pointer;
	position: relative;
}
.apx-burger:hover, .apx-burger:focus { background: transparent; color: var(--apx-white); }
.apx-burger span,
.apx-burger span::before,
.apx-burger span::after {
	position: absolute;
	left: 7px;
	width: 30px;
	height: 2px;
	background: currentColor;
	transition: transform 0.25s ease, top 0.25s ease, opacity 0.2s ease;
}
.apx-burger span { top: 21px; }
.apx-burger span::before { content: ""; left: 0; top: -9px; }
.apx-burger span::after { content: ""; left: 0; top: 9px; }

.apx-nav-open .apx-burger span { background: transparent; }
.apx-nav-open .apx-burger span::before { top: 0; transform: rotate(45deg); }
.apx-nav-open .apx-burger span::after { top: 0; transform: rotate(-45deg); }

.apx-drawer-overlay { display: none; }
.apx-drawer-extra { display: none; }

/* ---------- Tablet and mobile header ---------- */
@media (max-width: 1100px) {
	.apx-menu a { padding: 10px 8px; font-size: 12px; }
	.apx-menu > li > a::after { left: 8px; right: 8px; }
	.apx-header__inner { gap: 16px; }
}

@media (max-width: 1024px) {
	:root { --apx-pad: 20px; --apx-header-h: 86px; }
	.apx-logo img, .apx-logo .custom-logo { max-height: 66px; }

	.apx-burger { display: block; }
	.apx-header__cta { margin-left: auto; }
	.apx-header__cta + .apx-burger { margin-left: 0; }
	.apx-call { display: none; }

	.apx-nav {
		position: fixed;
		top: 0;
		left: 0;
		bottom: 0;
		width: min(85vw, 360px);
		display: block;
		padding: 90px 0 30px;
		background: var(--apx-black);
		border-right: 1px solid var(--apx-line);
		overflow-y: auto;
		transform: translateX(-100%);
		transition: transform 0.3s ease;
		z-index: 1001;
	}
	.admin-bar .apx-nav { top: 46px; }
	.apx-nav-open .apx-nav { transform: translateX(0); }

	.apx-drawer-overlay {
		display: block;
		position: fixed;
		inset: 0;
		background: rgba(0, 0, 0, 0.6);
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.3s ease, visibility 0.3s;
		z-index: 1000;
	}
	.apx-nav-open .apx-drawer-overlay { opacity: 1; visibility: visible; }

	.apx-burger { z-index: 1002; }
	body.apx-nav-open { overflow: hidden; }

	.apx-menu { flex-direction: column; align-items: stretch; gap: 0; }
	.apx-menu .apx-only-mobile { display: block; }
	.apx-menu li { position: relative; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
	.apx-menu a { padding: 14px 24px; font-size: 14px; font-weight: 600; }
	.apx-menu > li > a::after { display: none; }
	.apx-menu .menu-item-has-children > a { padding-right: 60px; }
	.apx-menu .menu-item-has-children > a::before { display: none; }
	.apx-menu .current-menu-item > a { color: var(--apx-red); }

	.apx-sub-toggle {
		display: flex;
		align-items: center;
		justify-content: center;
		position: absolute;
		top: 0;
		right: 0;
		width: 52px;
		height: 48px;
		padding: 0;
		border: 0;
		border-left: 1px solid rgba(255, 255, 255, 0.08);
		border-radius: 0;
		background: transparent;
		color: var(--apx-white);
		cursor: pointer;
	}
	.apx-sub-toggle:hover, .apx-sub-toggle:focus { background: transparent; color: var(--apx-red); }
	.apx-sub-toggle::before {
		content: "";
		width: 8px;
		height: 8px;
		border-right: 2px solid currentColor;
		border-bottom: 2px solid currentColor;
		transform: rotate(45deg) translateY(-2px);
		transition: transform 0.2s ease;
	}
	.is-open > .apx-sub-toggle::before { transform: rotate(-135deg) translateY(-2px); }

	.apx-menu .sub-menu {
		position: static;
		min-width: 0;
		padding: 0;
		background: var(--apx-ink);
		box-shadow: none;
		opacity: 1;
		visibility: visible;
		transform: none;
		display: none;
	}
	.apx-menu li:hover > .sub-menu,
	.apx-menu li:focus-within > .sub-menu { transform: none; }
	.apx-menu .is-open > .sub-menu { display: block; }
	.apx-menu .sub-menu a { color: var(--apx-white); padding-left: 40px; font-weight: 500; white-space: normal; }
	.apx-menu .sub-menu .sub-menu a { padding-left: 56px; }

	.apx-drawer-extra {
		display: flex;
		flex-direction: column;
		gap: 16px;
		padding: 24px;
	}
	.apx-drawer-extra .apx-call { display: flex; text-align: left; }
	.apx-drawer-extra .apx-call__number { font-size: 18px; }
	.apx-drawer-extra .apx-btn { width: 100%; }
}

.apx-call-icon { display: none; }
@media (max-width: 600px) {
	.apx-header__cta .apx-btn { display: none; }
	.apx-call-icon {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		color: var(--apx-red);
	}
	.apx-call-icon:hover, .apx-call-icon:focus { color: var(--apx-white); }
}

/* ==========================================================================
   4. Footer
   ========================================================================== */
.apx-footer {
	border-top: 1px solid var(--apx-grey);
	background: var(--apx-black);
	color: var(--apx-white);
	font-family: var(--apx-font-body);
	font-size: 14px;
	line-height: 1.8;
}

.apx-footer__main {
	display: grid;
	grid-template-columns: 1.3fr 1fr 1fr 1fr;
	gap: 40px;
	padding-top: 60px;
	padding-bottom: 40px;
}

.apx-footer__title {
	margin: 0 0 20px;
	font-family: var(--apx-font-body);
	font-size: 20px;
	font-weight: 700;
	letter-spacing: 0;
	text-transform: uppercase;
	line-height: 1.2;
	color: var(--apx-white);
}

.apx-footer__logo { display: inline-block; margin-bottom: 16px; text-decoration: none; }
.apx-footer__logo img,
.apx-footer__logo .custom-logo { display: block; width: auto; max-width: 140px; max-height: 120px; }
.apx-footer__about { margin: 0; max-width: 320px; }

.apx-footer__menu { list-style: none; margin: 0; padding: 0; }
.apx-footer__menu li { margin: 0 0 10px; }
.apx-footer__menu .sub-menu { display: none; }
.apx-footer__menu a,
.apx-footer__contact a { color: var(--apx-white); text-decoration: none; transition: color 0.2s ease; }
.apx-footer__menu a:hover,
.apx-footer__contact a:hover { color: var(--apx-red); }

.apx-footer__contact p { margin: 0 0 16px; }
.apx-footer__contact .apx-strong { font-weight: 700; }

.apx-footer__bottom {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	padding-top: 20px;
	padding-bottom: 20px;
	font-size: 13px;
}
.apx-footer__bottom-wrap { border-top: 1px solid var(--apx-grey); }
.apx-footer__bottom p { margin: 0; }

.apx-social { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.apx-social a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	color: var(--apx-white);
	font-size: 15px;
	text-decoration: none;
	transition: color 0.2s ease, background 0.2s ease;
}
.apx-social a:hover, .apx-social a:focus { color: var(--apx-red); }
.apx-social svg { width: 16px; height: 16px; fill: currentColor; }

@media (max-width: 1024px) {
	.apx-footer__main { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 767px) {
	.apx-footer__main { grid-template-columns: 1fr; gap: 32px; padding-top: 50px; }
	.apx-footer__bottom { flex-direction: column; align-items: flex-start; }
}

/* ==========================================================================
   5. Contact Form 7
   ========================================================================== */
.apx-cf7 { font-family: var(--apx-font-body); color: var(--apx-white); }

.apx-cf7__row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin-bottom: 16px;
}
.apx-cf7__field { margin-bottom: 16px; }
.apx-cf7__row .apx-cf7__field { margin-bottom: 0; }

.apx-cf7 label {
	display: block;
	margin-bottom: 6px;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
	color: var(--apx-white);
}
.apx-cf7 label .apx-req { color: var(--apx-red); }

.apx-cf7 .wpcf7-form-control-wrap { display: block; }

.apx-cf7 input[type="text"],
.apx-cf7 input[type="email"],
.apx-cf7 input[type="tel"],
.apx-cf7 select,
.apx-cf7 textarea {
	display: block;
	width: 100%;
	min-height: 46px;
	padding: 10px 14px;
	border: 1px solid var(--apx-white);
	border-radius: 4px;
	background: var(--apx-white);
	color: var(--apx-black);
	font-family: var(--apx-font-body);
	font-size: 15px;
	line-height: 1.5;
	box-shadow: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.apx-cf7 textarea { height: 80px; min-height: 80px; resize: vertical; }
.apx-cf7 select {
	appearance: none;
	-webkit-appearance: none;
	padding-right: 40px;
	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='%23000' stroke-width='2'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
}
.apx-cf7 ::placeholder { color: #8a8a8a; opacity: 1; }

.apx-cf7 input:focus,
.apx-cf7 select:focus,
.apx-cf7 textarea:focus {
	outline: none;
	border-color: var(--apx-red);
	box-shadow: 0 0 0 3px rgba(216, 30, 42, 0.35);
}

.apx-cf7 .wpcf7-submit,
.apx-cf7 input[type="submit"] {
	display: block;
	width: 100%;
	min-height: 48px;
	margin-top: 8px;
	padding: 14px 20px;
	border: 0;
	border-radius: 5px;
	background: var(--apx-red);
	color: var(--apx-white);
	font-family: var(--apx-font-body);
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	cursor: pointer;
	transition: background 0.25s ease;
}
.apx-cf7 .wpcf7-submit:hover,
.apx-cf7 .wpcf7-submit:focus { background: var(--apx-red-hover); }
.apx-cf7 .wpcf7-submit:disabled { opacity: 0.6; cursor: wait; }

/* Spinner sits under the button */
.apx-cf7 .wpcf7-spinner { display: block; margin: 12px auto 0; }

/* Errors and messages */
.apx-cf7 .wpcf7-not-valid { border-color: var(--apx-red) !important; }
.apx-cf7 .wpcf7-not-valid-tip { margin-top: 6px; font-size: 13px; color: #FF6B74; }
.wpcf7 form .wpcf7-response-output {
	margin: 16px 0 0;
	padding: 12px 16px;
	border-radius: 4px;
	font-family: var(--apx-font-body);
	font-size: 14px;
	color: var(--apx-white);
}
.wpcf7 form.sent .wpcf7-response-output { border-color: #2EAD5B; background: rgba(46, 173, 91, 0.12); }
.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.unaccepted .wpcf7-response-output,
.wpcf7 form.failed .wpcf7-response-output,
.wpcf7 form.spam .wpcf7-response-output { border-color: var(--apx-red); background: rgba(216, 30, 42, 0.12); }

@media (max-width: 767px) {
	.apx-cf7__row { grid-template-columns: 1fr; }
}

/* ==========================================================================
   6. Elementor content
   ========================================================================== */
/* Links inside page text: white, no underline, red on hover (like the old site) */
.elementor-widget-text-editor a,
.elementor-widget-heading a { text-decoration: none; }
.elementor-widget-text-editor a:hover,
.elementor-widget-heading a:hover { color: var(--apx-red); }

/* Lists inside page text */
.elementor-widget-text-editor ul,
.elementor-widget-text-editor ol { margin: 0 0 0.9rem; padding-left: 1.4em; }
.elementor-widget-text-editor li { margin-bottom: 4px; }

/* Icons converted from the old site */
.apx-graphic svg { display: block; width: 100%; height: 100%; }

/* FAQ accordions */
.apx-faq .elementor-accordion-item { margin-bottom: 8px; overflow: hidden; }
.apx-faq .elementor-accordion-item + .elementor-accordion-item { border-top-width: inherit; }

/* Latest posts: [apx_latest_posts] */
.apx-posts {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
}
.apx-post {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--apx-grey);
	border-radius: 12px;
	overflow: hidden;
	background: var(--apx-black);
	transition: border-color 0.25s ease;
}
.apx-post:hover { border-color: var(--apx-red); }
.apx-post__img { position: relative; display: block; flex: 0 0 auto; aspect-ratio: 16 / 10; overflow: hidden; background: var(--apx-card); }
.apx-post__img img,
.elementor .apx-post__img img { position: absolute; inset: 0; display: block; width: 100%; max-width: none; height: 100%; object-fit: cover; object-position: center; }
.apx-post__body { display: flex; flex: 1 1 auto; flex-direction: column; gap: 10px; padding: 20px 20px 24px; }
.apx-post__title { margin: 0; font-family: var(--apx-font-body); font-size: 17px; font-weight: 700; line-height: 1.4; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; min-height: 2.8em; }
.apx-post__title a { color: var(--apx-white); text-decoration: none; }
.apx-post__title a:hover { color: var(--apx-red); }
.apx-post__excerpt { margin: 0; font-size: 15px; line-height: 1.7; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.apx-post__date { margin-top: auto; padding-top: 4px; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: #AAAAAA; }
@media (max-width: 1024px) { .apx-posts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) { .apx-posts { grid-template-columns: 1fr; } }

/* ==========================================================================
   7. Elementor helpers
   ========================================================================== */
/* Stop horizontal scroll from wide sections on small screens */
html, body { overflow-x: clip; }
.elementor-widget-text-editor p:last-child { margin-bottom: 0; }
/* Buttons keep their set width, but grow when their text needs more room (never squeeze or wrap the label). */
.elementor-widget-button.elementor-widget__width-initial {
	min-width: fit-content;
	max-width: 100% !important;
}
.elementor-widget-button .elementor-button { white-space: nowrap; }
.elementor-widget-button .elementor-button-text { white-space: nowrap; }

/* Linked images: let "width 100%" fill the widget (Elementor makes the link inline-block). */
.elementor-element.elementor-widget-image > a,
.elementor-element.elementor-widget-image .elementor-widget-container > a { display: block; }

/* ==========================================================================
   8. Google reviews (native Elementor sections)
   ========================================================================== */
.apx-review .apx-review__head { width: 100%; }
.apx-review__who.e-con { --width: auto; flex: 1 1 0; min-width: 0; }
.apx-review__avatar .elementor-heading-title {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--apx-red);
	letter-spacing: 0.5px;
}
.apx-review__name .elementor-heading-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apx-review__body p { margin: 0 0 0.8em; }
.apx-review__body p:last-child { margin-bottom: 0; }
.apx-review__text.is-clamped:not(.is-open) .apx-review__body {
	max-height: 9.6em;
	overflow: hidden;
	-webkit-mask-image: linear-gradient(#000 60%, transparent);
	mask-image: linear-gradient(#000 60%, transparent);
}
.apx-review__more {
	margin-top: 8px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--apx-white);
	font-family: var(--apx-font-body);
	font-size: 13px;
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}
.apx-review__more:hover, .apx-review__more:focus { background: none; color: var(--apx-red); }
.apx-reviews-grid .apx-review.apx-is-hidden { display: none; }
.apx-reviews-more { display: flex; justify-content: center; width: 100%; }
.apx-reviews-more .apx-btn { border: 0; cursor: pointer; }

/* ==========================================================================
   9. Blog post: hero, content and related posts
   ========================================================================== */
body:not([class*="elementor-page-"]) .site-main.apx-single,
.site-main.apx-single { max-width: none; width: 100%; margin: 0; padding: 0; }

.apx-post-hero {
	position: relative;
	display: flex;
	align-items: center;
	min-height: 674px;
	padding: 80px var(--apx-pad);
	background-color: var(--apx-black);
	background-position: center;
	background-size: cover;
	color: var(--apx-white);
}
.apx-post-hero::before { content: ""; position: absolute; inset: 0; background: #000; opacity: 0.8; }
.apx-post-hero__inner { position: relative; width: 100%; max-width: calc(var(--apx-max) - 2 * var(--apx-pad)); margin: 0 auto; }
.apx-post-hero__eyebrow {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 20px;
	font-size: 12px;
	letter-spacing: 2.5px;
	text-transform: uppercase;
}
.apx-post-hero__eyebrow span { width: 24px; height: 2px; background: var(--apx-white); flex-shrink: 0; }
.apx-post-hero__title {
	max-width: 1080px;
	margin: 0 0 20px;
	font-family: var(--apx-font-head);
	font-size: 45px;
	font-weight: 400;
	line-height: 1.1;
	color: var(--apx-white);
}
.apx-post-hero__date { display: block; margin-bottom: 32px; font-size: 16px; }
.apx-post-hero__btns { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 28px; }
.apx-post-hero__btns .apx-btn { min-width: 180px; padding: 17px 20px; }
.apx-btn--ghost { background: transparent; box-shadow: inset 0 0 0 1px var(--apx-white); }
.apx-btn--ghost:hover, .apx-btn--ghost:focus { background: var(--apx-white); color: var(--apx-black); }
.apx-post-hero__rating { margin: 0 0 16px; font-size: 15px; }
.apx-post-hero__rating span { color: #FDBB21; letter-spacing: 1px; }
.apx-post-hero__badges { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; padding: 0; list-style: none; }
.apx-post-hero__badges li {
	padding: 5px 20px;
	border: 1px solid #999999;
	border-radius: 100px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.8;
	text-transform: uppercase;
}

.apx-single__content {
	max-width: var(--apx-max);
	margin: 0 auto;
	padding: 80px var(--apx-pad);
	font-size: 16px;
	line-height: 1.8;
	color: var(--apx-white);
}
.apx-single__content > *:first-child { margin-top: 0; }
.apx-single__content h2 { margin: 30px 0 6px; font-family: var(--apx-font-head); font-size: 36px; font-weight: 600; line-height: 1.8; }
.apx-single__content > h2:first-child { display: none; } /* hidden on the old site too */
.apx-single__content figure img, .apx-single__content > p img { max-width: min(100%, 900px); }
.apx-single__content h3 { margin: 1.4em 0 0.5em; font-family: var(--apx-font-head); font-size: 20px; font-weight: 600; line-height: 1.3; }
.apx-single__content h4 { margin: 1.2em 0 0.5em; font-size: 17px; font-weight: 700; }
.apx-single__content p { margin: 0 0 1.2em; }
.apx-single__content ul, .apx-single__content ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.apx-single__content li { margin-bottom: 0.3em; }
.apx-single__content a { color: var(--apx-white); text-decoration: underline; text-underline-offset: 3px; }
.apx-single__content a:hover { color: var(--apx-red); }
.apx-single__content figure { margin: 0 0 2em; }
.apx-single__content img { display: block; max-width: 100%; height: auto; }
.apx-single__content table { width: 100%; margin: 0 0 1.5em; border-collapse: collapse; }
.apx-single__content th, .apx-single__content td { padding: 10px 12px; border: 1px solid var(--apx-line); text-align: left; }

/* Blog FAQ (the wp details blocks at the end of each post), like the old site */
.apx-single__content h2:has(+ .wp-block-details) { color: var(--apx-red); }
.apx-single__content .wp-block-details { margin: 0 0 24px; }
.apx-single__content .wp-block-details:last-of-type { margin-bottom: 0; }
.apx-single__content .wp-block-details summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 16px;
	background: #F2F2F2;
	color: var(--apx-red);
	font-family: var(--apx-font-body);
	font-size: 22px;
	font-weight: 700;
	line-height: 1.3;
	list-style: none;
	cursor: pointer;
}
.apx-single__content .wp-block-details summary::-webkit-details-marker { display: none; }
.apx-single__content .wp-block-details summary::after {
	content: "";
	flex: 0 0 32px;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: #000000 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23E3E3E3' d='M7.4 8.6 12 13.2l4.6-4.6L18 10l-6 6-6-6z'/%3E%3C/svg%3E") center / 20px no-repeat;
	transition: transform .2s ease;
}
.apx-single__content .wp-block-details[open] summary::after { transform: rotate(180deg); }
.apx-single__content .wp-block-details summary:focus-visible { outline: 2px solid var(--apx-red); outline-offset: 2px; }
.apx-single__content .wp-block-details > *:not(summary) { margin: 0; padding: 16px 16px 4px; }

/* Older / Newer post links */
.apx-post-nav { display: flex; justify-content: space-between; gap: 20px; margin-top: 50px; }
.apx-single__content .apx-post-nav a { color: var(--apx-white); text-decoration: none; }
.apx-single__content .apx-post-nav a:hover { color: var(--apx-red); }

/* Share row between two lines */
.apx-share {
	display: flex;
	justify-content: center;
	gap: 6px;
	padding: 20px;
	border-top: 1px solid var(--apx-line);
	border-bottom: 1px solid var(--apx-line);
}
.apx-share__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: #FFFFFF;
	color: #000000;
	transition: background-color .2s ease, color .2s ease;
}
.apx-share__link:hover, .apx-share__link:focus-visible { background: var(--apx-red); color: #FFFFFF; }

.apx-related {
	max-width: var(--apx-max);
	margin: 0 auto;
	padding: 60px var(--apx-pad) 80px;
	border-top: 1px solid var(--apx-line);
}
.apx-related__title { margin: 0 0 24px; font-family: var(--apx-font-head); font-size: 40px; font-weight: 600; color: var(--apx-white); }

@media (max-width: 1024px) {
	.apx-post-hero { min-height: 560px; padding: 60px 30px; }
	.apx-post-hero__title { font-size: 36px; }
	.apx-single__content { padding: 60px 30px; }
	.apx-related { padding: 50px 30px 60px; }
	.apx-single__content h2 { font-size: 30px; }
}
@media (max-width: 767px) {
	.apx-post-hero { min-height: 0; padding: 50px 20px; }
	.apx-post-hero__title { font-size: 28px; }
	.apx-post-hero__btns { gap: 12px; }
	.apx-post-hero__btns .apx-btn { min-width: 0; flex: 1 1 160px; }
	.apx-single__content { padding: 40px 30px; font-size: 15px; line-height: 1.8; }
	.apx-related { padding: 40px 20px 50px; }
	.apx-single__content h2 { font-size: 24px; }
	.apx-single__content .wp-block-details summary { font-size: 17px; padding: 14px; }
	.apx-related__title { font-size: 30px; }
}

/* ==========================================================================
   10. 404 and search pages
   ========================================================================== */
body:not([class*="elementor-page-"]) .site-main.apx-404,
body:not([class*="elementor-page-"]) .site-main.apx-search,
.site-main.apx-404,
.site-main.apx-search { max-width: none; width: 100%; margin: 0; padding: 0; }
.apx-404 {
	display: flex;
	align-items: center;
	min-height: 60vh;
	padding: 100px var(--apx-pad) !important;
	text-align: center;
}
.apx-404__inner { width: 100%; max-width: 720px; margin: 0 auto; }
.apx-404__code {
	margin: 0;
	font-family: var(--apx-font-head);
	font-size: 120px;
	font-weight: 700;
	line-height: 1;
	color: var(--apx-red);
}
.apx-404__title { margin: 10px 0 16px; font-family: var(--apx-font-head); font-size: 40px; font-weight: 600; color: var(--apx-white); }
.apx-404__text { margin: 0 0 32px; font-size: 16px; line-height: 1.7; color: var(--apx-white); }
.apx-404__btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin-bottom: 24px; }
.apx-404__btns .apx-btn { min-width: 180px; }
.apx-404__phone { margin: 0 0 28px; font-size: 15px; }
.apx-404__phone a { font-weight: 700; color: var(--apx-white); }
.apx-404__phone a:hover { color: var(--apx-red); }

.search-form { display: flex; gap: 8px; max-width: 480px; margin: 0 auto; }
.search-form label { flex: 1; }
.search-form .search-field {
	width: 100%;
	padding: 12px 16px;
	border: 1px solid var(--apx-grey);
	border-radius: 25px;
	background: var(--apx-card);
	color: var(--apx-white);
	font-family: var(--apx-font-body);
	font-size: 15px;
}
.search-form .search-field:focus { border-color: var(--apx-red); outline: none; }
.search-form .search-submit {
	padding: 12px 22px;
	border: 0;
	border-radius: 25px;
	background: var(--apx-red);
	color: var(--apx-white);
	font-family: var(--apx-font-body);
	font-size: 14px;
	font-weight: 700;
	text-transform: uppercase;
	cursor: pointer;
}
.search-form .search-submit:hover, .search-form .search-submit:focus { background: var(--apx-red-hover); }

.apx-search__inner { max-width: var(--apx-max); margin: 0 auto; padding: 80px var(--apx-pad); }
.apx-search__title { margin: 0 0 24px; font-family: var(--apx-font-head); font-size: 36px; font-weight: 600; color: var(--apx-white); }
.apx-search .search-form { margin: 0 0 40px; }
.apx-search__none { font-size: 16px; }
.apx-search__pages { margin-top: 40px; }
.apx-search__pages .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.apx-search__pages .page-numbers { padding: 8px 14px; border: 1px solid var(--apx-grey); border-radius: 6px; color: var(--apx-white); text-decoration: none; }
.apx-search__pages .page-numbers.current, .apx-search__pages .page-numbers:hover { border-color: var(--apx-red); color: var(--apx-red); }

@media (max-width: 767px) {
	.apx-404 { padding: 70px 20px !important; }
	.apx-404__code { font-size: 90px; }
	.apx-404__title { font-size: 30px; }
	.apx-404__btns .apx-btn { flex: 1 1 160px; min-width: 0; }
	.search-form { flex-direction: column; }
	.apx-search__inner { padding: 50px 20px; }
	.apx-search__title { font-size: 28px; }
}

/* ==========================================================================
   10. Tabs (Products "Three Systems", How-to Guides) - match the old site:
       a bordered bar of equal tabs, red active tab, bordered panel below.
   ========================================================================== */
.elementor-widget-n-tabs .e-n-tabs { gap: 0 !important; }
.elementor-widget-n-tabs .e-n-tabs-heading {
	display: flex !important;
	flex-wrap: nowrap !important;
	gap: 0 !important;
	padding: 8px;
	border: 1px solid #666666;
}
.elementor-widget-n-tabs .e-n-tabs-heading > .e-n-tab-title {
	flex: 1 1 0 !important;
	min-width: 0;
	min-height: 65px;
	margin: 0 !important;
	padding: 0 12px !important;
	display: flex;
	align-items: center;
	justify-content: center !important;
	text-align: center;
	background: transparent !important;
	border: 0 !important;
	border-radius: 0 !important;
	color: #FFFFFF !important;
	font-family: var(--apx-font-head);
	font-size: 16px;
	font-weight: 400;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color 0.2s ease;
}
.elementor-widget-n-tabs .e-n-tabs-heading > .e-n-tab-title .e-n-tab-title-text {
	color: inherit !important;
	font: inherit !important;
	white-space: normal;
}
.elementor-widget-n-tabs .e-n-tabs-heading > .e-n-tab-title[aria-selected="true"] { background: var(--apx-red) !important; }
.elementor-widget-n-tabs .e-n-tabs-heading > .e-n-tab-title:not([aria-selected="true"]):hover,
.elementor-widget-n-tabs .e-n-tabs-heading > .e-n-tab-title:not([aria-selected="true"]):focus-visible { background: rgba(255, 255, 255, 0.08) !important; }
.elementor-widget-n-tabs .e-n-tabs-content > .e-con {
	border: 1px solid #666666;
	border-top: 0;
}
@media (max-width: 767px) {
	.elementor-widget-n-tabs .e-n-tabs-heading > .e-n-tab-title {
		min-height: 53px;
		padding: 0 6px !important;
		font-size: 13px;
	}
	/* Four or more tabs: two per row so long names fit. */
	.elementor-widget-n-tabs .e-n-tabs-heading:has(> .e-n-tab-title:nth-child(4)) { flex-wrap: wrap !important; }
	.elementor-widget-n-tabs .e-n-tabs-heading:has(> .e-n-tab-title:nth-child(4)) > .e-n-tab-title { flex: 1 1 50% !important; }
}

/* Service area pages: checkmark lists like the old site */
/* List markers like the old site: checks (.apx-check) and arrows (.apx-arrow) */
.apx-check ul,
.apx-arrow ul { list-style: none; margin-left: 0; padding-left: 0; }
.apx-check ul li::before { content: "\2713"; display: inline-block; width: 16px; margin-right: 8px; color: #FFFFFF; }
.apx-arrow ul li::before { content: "\279E"; display: inline-block; width: 15px; margin-right: 7.5px; color: #FFFFFF; }

/* Check icons in a thin red rounded box (old "why choose" lists) */
.apx-graphic:has(path[d^="m38.461 78.539"]) {
	width: 40px !important;
	height: 40px !important;
	border: 0.8px solid #D81E2A;
	border-radius: 25%;
}
.elementor-widget-html:has(.apx-graphic path[d^="m38.461 78.539"]) { width: 40px; }

/* Photos that crop (cover) keep the top of the picture, like the old site */
.elementor-widget-image img { object-position: 50% 0%; }

/* FAQ accordions like the old site: separate boxes, round red icon */
.apx-faq .elementor-accordion .elementor-accordion-item { margin-bottom: 8px; }
.apx-faq .elementor-accordion .elementor-accordion-item:last-child { margin-bottom: 0; }
.apx-faq .elementor-accordion .elementor-tab-title {
	display: flex;
	flex-direction: row-reverse;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}
.apx-faq .elementor-accordion .elementor-tab-title .elementor-accordion-title { flex: 1 1 auto; }
.apx-faq .elementor-accordion .elementor-accordion-icon {
	float: none !important;
	flex: 0 0 32px;
	width: 32px !important;
	height: 32px;
	margin: 0 !important;
	padding: 0 !important;
	border-radius: 50%;
	background: #D81E2A;
	display: flex !important;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
}
.apx-faq--light .elementor-accordion .elementor-accordion-icon { background: #000000; }
.apx-faq .elementor-accordion .elementor-tab-title .elementor-accordion-icon svg {
	display: block;
	width: 14px !important;
	height: 14px !important;
	margin: 0 !important;
	fill: #FFFFFF !important;
}
.apx-faq .elementor-accordion .elementor-tab-title .elementor-accordion-icon .elementor-accordion-icon-closed,
.apx-faq .elementor-accordion .elementor-tab-title .elementor-accordion-icon .elementor-accordion-icon-opened {
	align-items: center;
	justify-content: center;
	width: 14px;
	height: 14px;
	line-height: 0;
	font-size: 0;
}
.apx-faq .elementor-accordion .elementor-tab-title:not(.elementor-active) .elementor-accordion-icon-closed,
.apx-faq .elementor-accordion .elementor-tab-title.elementor-active .elementor-accordion-icon-opened { display: flex !important; }
.apx-faq .elementor-accordion .elementor-tab-title.elementor-active .elementor-accordion-icon-closed,
.apx-faq .elementor-accordion .elementor-tab-title:not(.elementor-active) .elementor-accordion-icon-opened { display: none !important; }

/* Our Team grid on phones: narrower cards, shorter photos, centered names (like the old site) */
@media (max-width: 767px) {
	.elementor-element-796e6dcd { padding-left: 10px !important; padding-right: 10px !important; row-gap: 12px !important; }
	.elementor-element-796e6dcd > .e-con img { height: 250px !important; }
	.elementor-element-796e6dcd > .e-con .elementor-heading-title { text-align: center !important; }
	.elementor-element-796e6dcd > .e-con .elementor-widget-heading:first-child .elementor-heading-title { font-size: 20px !important; }
}

/* Service Areas page: full-width map like the old site */
.elementor-element-d43100d { align-self: stretch; width: 100%; }
.elementor-element-d43100d iframe { display: block; width: 100%; height: 450px; }

/* Blog page numbers (like the old blog page) */
.apx-pagination { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 30px; }
.apx-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 32px;
	height: 32px;
	padding: 0 4px;
	border-radius: 50%;
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
	color: #FFFFFF;
	text-decoration: none;
}
.apx-pagination .page-numbers.current { background: #D81E2A; }
.apx-pagination a.page-numbers:hover { color: #D81E2A; }
.apx-pagination .prev, .apx-pagination .next { font-size: 22px; font-weight: 400; }
