/*
 * Legacy pages: the pages that are still built with Elementor and drawn inside this theme.
 *
 * Loaded only on those pages (functions.php). Their content sits in main#main.cc-main.cc-legacy, and Elementor's
 * site-wide kit class (elementor-kit-NNN) sits on that same element, so every rule here is scoped to .cc-legacy and
 * cannot touch the header, the footer or a page this theme draws itself. Colour, type, space and focus come from
 * tokens.css only.
 *
 * Why this file exists. The kit's global rules (.elementor-kit-NNN a, button, .elementor-button) are more specific
 * than the single class each page uses for its own links and buttons, so they win:
 *   - every link turned blue (#006AFF) on hover, including the text of orange buttons;
 *   - a button link kept the kit's grey (#999999) and lost the white its page gave it;
 *   - every <button> got a green glow on hover and focus, and its own hover colours;
 * several pages set white text on the orange action colour (2.8 to 1, under the 4.5 to 1 minimum); the ThePlus
 * buttons swipe hot pink (#ff214f) on hover and hide their label; and the old widgets draw blue and orange glows.
 * Elements that need the page's own !important beaten are written with the #main prefix.
 *
 * Writing note: "none" is written without a space after the colon (box-shadow:none) because the chrome check in
 * tools/theme/check_tokens.mjs reads "box-shadow: none" as a shadow.
 */

/* ------------------------------------------------------------------ 0. base */

.cc-legacy {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* ------------------------------------------------------------------ 1. links */

/* The kit's blue (#006AFF) is one variable, and the kit paints every link hover and every button that has no colour of its
   own with it. Pointing the variable at the action colour fixes all of them at the root, whatever order the stylesheets
   load in (an id and a class on the same element as the kit's single class). */
#main.cc-legacy {
	--e-global-color-d49ac81: var(--cc-color-action);
}

/* A link that is not a button lights up in the action colour on hover, never the kit's blue. */
.cc-legacy a:hover {
	color: var(--cc-color-action);
}

/* ------------------------------------------------------------------ 2. buttons */

/* One shape for the call to action buttons the pages draw: the orange primary and the outline secondary, in the
   same type and size as the buttons on the Home page. The pages gave them a pill, 4px corners, Poppins and a glow.
   The managed IT price cards (.pricing-btn), the Elementor button widget and the ThePlus buttons share it. */
#main.cc-legacy :is(a.cc-btn-solid, a.cc-btn-pill, :is(a, button).cc-btn, a.btn-primary, a.btn-secondary, a.cc-btn-outline, a.elementor-button, .pt_plus_button a.button-link-wrap):not(.cc-wiz-panel-cta *) {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--cc-space-xs);
	box-sizing: border-box;
	min-height: var(--cc-target-min);
	margin: 0;
	padding: 0.65rem 1.6rem;
	border: 2px solid transparent;
	border-radius: var(--cc-radius-s);
	font-family: var(--cc-font-body);
	font-size: var(--cc-font-size-s);
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0.14em;
	text-align: center;
	text-decoration: none;
	text-transform: uppercase;
	white-space: normal;
	text-wrap: balance;
	box-shadow:none;
	cursor: pointer;
}

/* Primary: ink on the action orange. The pages had white (2.8 to 1) and the kit's grey link colour (1 to 1). */
#main.cc-legacy :is(a.cc-btn-solid, a.cc-btn-pill, :is(a, button).cc-btn, a.btn-primary, .pricing-card.popular .pricing-btn, .pt_plus_button a.button-link-wrap):not(.cc-btn-outline, .pricing-card:not(.popular) .pricing-btn, .cc-wiz-panel-cta *) {
	background-color: var(--cc-color-action);
	background-image: none;
	border-color: var(--cc-color-action);
	color: var(--cc-color-action-ink) !important;
}

#main.cc-legacy :is(a.cc-btn-solid, a.cc-btn-pill, :is(a, button).cc-btn, a.btn-primary, .pricing-card.popular .pricing-btn, .pt_plus_button a.button-link-wrap):not(.cc-btn-outline, .pricing-card:not(.popular) .pricing-btn, .cc-wiz-panel-cta *):is(:hover, :focus-visible) {
	background-color: var(--cc-color-action-hover);
	border-color: var(--cc-color-action-hover);
	color: var(--cc-color-action-ink) !important;
	box-shadow:none;
}

/* Secondary: an outline that fills white on hover, the same as the theme's own secondary button. */
#main.cc-legacy :is(a.cc-btn-outline, a.btn-secondary, .pricing-card:not(.popular) .pricing-btn) {
	background-color: transparent;
	border-color: var(--cc-color-secondary);
	color: var(--cc-color-white) !important;
}

#main.cc-legacy :is(a.cc-btn-outline, a.btn-secondary, .pricing-card:not(.popular) .pricing-btn):is(:hover, :focus-visible) {
	background-color: var(--cc-color-white);
	border-color: var(--cc-color-white);
	color: var(--cc-color-canvas) !important;
	box-shadow:none;
}

/* A button that carries its colour in its own style attribute: the managed IT "Get compliant" button (cyan, off brand)
   and the Contact us link in the Complete package page's closing block (white on orange). Both become the primary. */
#main.cc-legacy :is(a.cc-btn[style*="--color-cyan"], .elementor-widget-html a[style*="background-color"]:not([class])) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-height: var(--cc-target-min);
	padding: 0.65rem 1.6rem !important;
	border-radius: var(--cc-radius-s) !important;
	background-color: var(--cc-color-action) !important;
	color: var(--cc-color-action-ink) !important;
	font-family: var(--cc-font-body) !important;
	font-size: var(--cc-font-size-s) !important;
	font-weight: 600 !important;
	letter-spacing: 0.14em;
	line-height: 1.2;
	text-decoration: none !important;
	text-transform: uppercase;
}

#main.cc-legacy :is(a.cc-btn[style*="--color-cyan"], .elementor-widget-html a[style*="background-color"]:not([class])):is(:hover, :focus-visible) {
	background-color: var(--cc-color-action-hover) !important;
}

/* The Elementor button widget. Its labels sit in a wrapper that holds an optional icon: one line, level. */
#main.cc-legacy a.elementor-button .elementor-button-content-wrapper {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--cc-space-xs);
}

#main.cc-legacy a.elementor-button .elementor-button-icon {
	display: flex;
	align-items: center;
	line-height: 1;
}

#main.cc-legacy a.elementor-button,
#main.cc-legacy a.elementor-button:is(:hover, :focus) {
	box-shadow:none;
}

#main.cc-legacy a.elementor-button:is(:hover, :focus-visible) {
	background-color: var(--cc-color-action-hover);
	border-color: var(--cc-color-action-hover);
	color: var(--cc-color-action-ink);
}

/* A button with an icon is a label chip (the Our services list: Internet, Phones, Antivirus...). It was orange text on
   a grey tile (4 to 1); the tile is the raised surface, the label white and the icon keeps the orange. */
#main.cc-legacy a.elementor-button:has(.elementor-button-icon):not(:hover, :focus-visible) {
	background-color: var(--cc-color-raised);
	border-color: var(--cc-color-line);
	color: var(--cc-color-white);
}

#main.cc-legacy a.elementor-button:has(.elementor-button-icon):not(:hover, :focus-visible) .elementor-button-icon {
	color: var(--cc-color-action);
}

/* The one Elementor button that is orange with the kit's white label (Our services, "Contact us"): ink, like the rest. */
#main.cc-legacy [data-id="27ab575"] a.elementor-button:not(:hover, :focus-visible) {
	color: var(--cc-color-action-ink);
}

/* ThePlus buttons (Our range "Talk to an expert", Our services "Learn more"). Their hover swipes a hot pink layer
   (::before, #ff214f) over the button and slides the label out, leaving a bare chevron. No layers, no pink: the same
   fill change as the other buttons, label always in view. The arrow that follows the label stays, level with it. */
#main.cc-legacy .pt_plus_button a.button-link-wrap {
	overflow: visible;
	transition: background-color var(--cc-transition-fast) ease, border-color var(--cc-transition-fast) ease, color var(--cc-transition-fast) ease;
}

#main.cc-legacy .pt_plus_button a.button-link-wrap::before,
#main.cc-legacy .pt_plus_button a.button-link-wrap::after {
	content: none;
	display: none;
}

#main.cc-legacy .pt_plus_button a.button-link-wrap > span {
	display: inline-flex;
	align-items: center;
	gap: var(--cc-space-xs);
	padding: 0;
	opacity: 1;
	transform: none;
	transition: none;
}

#main.cc-legacy .pt_plus_button a.button-link-wrap:hover > span {
	opacity: 1;
	transform: none;
}

#main.cc-legacy .pt_plus_button a.button-link-wrap > i.btn-icon {
	display: none;
}

#main.cc-legacy .pt_plus_button a.button-link-wrap .btn-icon {
	position: static;
	display: inline-flex;
	align-items: center;
	width: auto;
	height: auto;
	margin: 0;
	transform: none;
	color: inherit;
}

#main.cc-legacy .pt_plus_button a.button-link-wrap i {
	padding: 0;
	vertical-align: middle;
}

/* The shop's add to cart button in a product grid (the Our range page). It kept the kit's grey link colour on the orange
   (1 to 1) and sat at a different height under each product. Each product is now a column: picture, name and price,
   then the button along the bottom edge, the full width of its card, on one line. */
#main.cc-legacy ul.products {
	align-items: stretch;
}

/* WooCommerce's small-screen rule (48% wide, floated left) beat the grid on phones and tablets and left each product
   a narrow strip in its column. The grid sets the width. */
#main.cc-legacy ul.products li.product {
	display: flex;
	flex-direction: column;
	float: none;
	width: auto;
	margin: 0;
}

.cc-legacy ul.products li.product .woocommerce-LoopProduct-link {
	flex: 1 0 auto;
}

#main.cc-legacy ul.products li.product a.button {
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 100%;
	min-height: var(--cc-target-min);
	margin-top: var(--cc-space-s);
	padding: 0.65rem var(--cc-space-s);
	border: 2px solid var(--cc-color-action);
	border-radius: var(--cc-radius-s);
	background-color: var(--cc-color-action);
	color: var(--cc-color-action-ink) !important;
	font-size: var(--cc-font-size-xs);
	font-weight: 600;
	letter-spacing: 0.12em;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	text-transform: uppercase;
	white-space: nowrap;
	box-shadow:none;
}

#main.cc-legacy ul.products li.product a.button:is(:hover, :focus-visible) {
	background-color: var(--cc-color-action-hover);
	border-color: var(--cc-color-action-hover);
	color: var(--cc-color-action-ink) !important;
}

/* After adding, WooCommerce puts a "View cart" link under the button. */
.cc-legacy ul.products li.product a.added_to_cart {
	display: block;
	margin-top: var(--cc-space-xs);
	color: var(--cc-color-white);
	font-size: var(--cc-font-size-s);
	text-align: center;
	text-decoration: underline;
	text-underline-offset: 0.25em;
}

/* The controls inside the phone page's builder (and any like them): no glow in any state, and a 44px target. */
#main.cc-legacy button,
#main.cc-legacy button:hover,
#main.cc-legacy button:focus,
#main.cc-legacy button:focus-visible {
	box-shadow:none;
}

#main.cc-legacy button:not(.cc-wiz-switch) {
	min-height: var(--cc-target-min);
}

/* A selected choice and the small primary buttons: ink on the action orange (the pages had white, 2.8 to 1). */
#main.cc-legacy :is(button.cc-hs-add:not(.is-added), button.cc-hs-addon-btn.is-added) {
	background-color: var(--cc-color-action) !important;
	border: 1px solid var(--cc-color-action) !important;
	border-radius: var(--cc-radius-s);
	color: var(--cc-color-action-ink) !important;
}

#main.cc-legacy :is(button.cc-hs-add:not(.is-added)):hover:not(:disabled) {
	background-color: var(--cc-color-action-hover) !important;
	border-color: var(--cc-color-action-hover) !important;
}

#main.cc-legacy :is(button.cc-hs-add):focus-visible {
	outline: var(--cc-focus-width) solid var(--cc-color-focus);
	outline-offset: var(--cc-focus-offset);
}

/* The phone page's builder controls (switch, Open hours / After hours, Simulate a call, quote button) are styled by
   assets/css/pages/business-phone-systems.css, which owns them. */

/* A file field's own button (the quote form): the browser's white button looked pasted on. An outline, the same as the
   secondary buttons. */
#main.cc-legacy input[type="file"] {
	color: var(--cc-color-secondary);
	font-family: var(--cc-font-body);
	font-size: var(--cc-font-size-s);
}

#main.cc-legacy input[type="file"]::file-selector-button {
	min-height: 36px;
	margin-right: var(--cc-space-s);
	padding: 0.4rem 1rem;
	border: 2px solid var(--cc-color-secondary);
	border-radius: var(--cc-radius-s);
	background-color: transparent;
	color: var(--cc-color-white);
	font-family: var(--cc-font-body);
	font-size: var(--cc-font-size-xs);
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color var(--cc-transition-fast) ease, color var(--cc-transition-fast) ease;
}

#main.cc-legacy input[type="file"]:is(:hover, :focus-visible)::file-selector-button {
	background-color: var(--cc-color-white);
	color: var(--cc-color-canvas);
}

/* The shop search (Our range). The field had no border and the button was the plugin's pale grey square, 1200px away
   from its field. Now one control: a bordered field and an orange button joined to it, a readable width. */
.cc-legacy .aws-container .aws-search-form {
	max-width: 40rem;
}

#main.cc-legacy .aws-container .aws-search-field {
	box-sizing: border-box;
	min-height: var(--cc-target-min);
	border: 1px solid var(--cc-color-line-strong);
	border-right-width: 0;
	border-radius: var(--cc-radius-s) 0 0 var(--cc-radius-s);
	background-color: var(--cc-color-canvas);
	color: var(--cc-color-white);
	font-family: var(--cc-font-body);
	font-size: var(--cc-font-size-s);
}

#main.cc-legacy .aws-container .aws-search-field::placeholder {
	color: var(--cc-color-line-strong);
	opacity: 1;
}

#main.cc-legacy .aws-container .aws-search-field:focus-visible {
	outline: var(--cc-focus-width) solid var(--cc-color-focus);
	outline-offset: calc(-1 * var(--cc-focus-width));
}

#main.cc-legacy .aws-container .aws-search-btn {
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: var(--cc-target-min);
	min-height: var(--cc-target-min);
	border: 2px solid var(--cc-color-action);
	border-radius: 0 var(--cc-radius-s) var(--cc-radius-s) 0;
	background-color: var(--cc-color-action);
	cursor: pointer;
}

#main.cc-legacy .aws-container .aws-search-btn:hover {
	background-color: var(--cc-color-action-hover);
	border-color: var(--cc-color-action-hover);
}

#main.cc-legacy .aws-container .aws-search-btn_icon {
	display: flex;
	align-items: center;
	justify-content: center;
}

#main.cc-legacy .aws-container .aws-search-btn svg {
	width: 24px;
	height: 24px;
	fill: var(--cc-color-action-ink);
}

/* ------------------------------------------------------------------ 3. glow */

/* The old widgets drew a blue or orange glow above their cards and soft halos behind their headings. This site has none:
   flat surfaces, a hairline edge. Only Elementor's own elements are reset; a page's own markup keeps its styling. */
#main.cc-legacy :is(.elementor-element, .elementor-widget-container) {
	box-shadow:none;
}

#main.cc-legacy :is(.elementor-heading-title, .elementor-headline-text-wrapper, .elementor-headline-dynamic-text, .elementor-icon-box-title, .elementor-cta__title) {
	text-shadow:none;
}

/* ------------------------------------------------------------------ 4. icon tiles */

/* An icon tile is a span named ...-ic that holds one svg. Each page asked for display:flex centring on it, but a rule
   for the span's own parent (.cc-diag-node span { display: block }) is more specific and turned it into a block, so the
   icon sat in the top corner of its tile. */
.cc-legacy [class$="-ic"] {
	display: flex;
	align-items: center;
	justify-content: center;
}

.cc-legacy [class$="-ic"] > svg {
	display: block;
	flex: none;
}

/* The handset-and-waves artwork (the "Calls" tiles) sits 2 to 3px high and 1 to 1.5px right inside its own 20px frame. */
.cc-legacy :is(.cc-out-ic, .cc-feat-ic):has(> svg > path[d^="M7.6 8.9"]) > svg {
	margin: 4px 0 0 -2px;
}

/* Optical centring in the "One Business Phone System" diagram and the feature tiles. Two of the drawings are not balanced
   inside their own box: the cloud's ink sits 2.5px above the middle of its 24 unit frame and the wifi arcs 1.8px below the
   middle of theirs. Each is nudged by the measured amount so the picture, not the box, sits in the centre of the tile. */
.cc-legacy .cc-diag-ic > svg:has(> path[d^="M7 17a4.2"]) {
	translate: 0 2.5px;
}

.cc-legacy [class$="-ic"] > svg:has(> circle[cy="15.5"]) {
	translate: 0 -1.8px;
}

/* Any other inline svg used as an icon sits on the text baseline, which leaves a few pixels of empty line space under
   it: a tile that wraps only an icon (the Complete package cards) came out 5px taller than wide and the icon rode high. */
.cc-legacy svg {
	vertical-align: middle;
}

/* An Elementor icon list with items that run to two lines centred the bullet between the lines. The bullet belongs
   level with the first line: the item aligns to the top and the icon's box is one line tall. */
.cc-legacy .elementor-icon-list-item {
	--icon-vertical-align: flex-start;
}

.cc-legacy .elementor-icon-list-icon {
	align-items: center;
	min-height: 1lh;
}
