/**
 * Responsive components.
 *
 * Hand-written component classes, loaded after dist/output.css. That file is
 * generated from src/input.css by the Tailwind build and must not be edited by
 * hand, so shared layout rules live here instead: written once, reused by name,
 * so a fix lands in one place rather than being sprinkled through the markup.
 *
 * Nothing in here uses !important. If a rule needs it, the markup is wrong.
 */

/* ---------------------------------------------------------------------------
 * Header mega menu
 *
 * A dropdown used to hang off its own nav item: `relative` on the item and
 * `left-0` on the panel. The mega panel is up to 1000px wide, so an item right
 * of centre pushed it past the window. Measured on the live page:
 *
 *     viewport   panel                       document width
 *     1024       x 639 → 1631 (607 out)      1630
 *     1280       (270 out)                   1550
 *     1440       x 521 → 1521 (81 out)       1520
 *     1920       fits                        1920
 *
 * `overflow-x: hidden` on <body> did not contain it, because the scroller is
 * <html> — the page still measured wider than the screen, and the panel itself
 * opened half off the edge on any laptop or iPad in landscape.
 *
 * The panel now hangs off the nav ROW instead, so it spans the container and
 * cannot leave it at any width. A new mega item needs no new CSS: give the row
 * .wax-nav-row and the item the three classes below.
 * ------------------------------------------------------------------------ */

/* The row is the positioning context every mega panel measures itself from. */
.wax-nav-row {
	position: relative;
}

/* Static on purpose: the panel must skip the item and find the row. */
.wax-nav-mega {
	position: static;
}

/* Spans the row, so the panel can never start past the container's edge. */
.wax-nav-mega__drop {
	left: 0;
	right: 0;
}

/* Full width of the row until the row is wider than the panel's own maximum. */
.wax-nav-mega__panel {
	width: min(1000px, 100%);
	margin-inline: auto;
}

/* ---------------------------------------------------------------------------
 * Header contact widget + icon buttons
 *
 * Moved here from a 2.6 KB inline <style> in header.php, which shipped inside
 * the markup of every page on the site. Same rules, one change: the widget now
 * appears at 1280 rather than 1024.
 *
 * It is `flex: none`, and the CTA group beside it is `shrink-0`, so neither can
 * give way. At 1024 the row has 526px to spend and its children ask for 836 —
 * the "Get Instant Quote" button ended up at x 1031→1191, 167px past the
 * window, which is the whole of what was left of the page's overflow once the
 * mega menu was fixed. From 1280 there is room for all of it, so that is where
 * the widget starts; below it the header keeps the logo, the search, the chat
 * and WhatsApp buttons and the CTA, and the phone and email stay one tap away
 * in the mobile drawer and the footer.
 * ------------------------------------------------------------------------ */

.wax-cw {
	display: none;
}

@media (min-width: 1280px) {
	.wax-cw {
		display: flex;
		align-items: center;
		gap: .25rem;
		flex: none;
		padding: .375rem .5rem;
		border: 1px solid rgb(var(--wax-border));
		border-radius: .85rem;
		background: rgb(var(--wax-surface));
		box-shadow: var(--wax-shadow-lite);
	}
}

.wax-cw__item {
	display: flex;
	align-items: center;
	gap: .6rem;
	padding: .35rem .55rem;
	border-radius: .6rem;
	text-decoration: none;
	transition: background-color .2s ease;
}

.wax-cw__item:hover {
	background: rgb(var(--wax-btn) / 0.12);
}

.wax-cw__ico {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 2.35rem;
	height: 2.35rem;
	border-radius: 9999px;
	background: rgb(var(--wax-btn) / 0.18);
	color: rgb(var(--wax-btn));
	transition: background-color .2s ease, color .2s ease;
	animation: wax-cw-icon-pulse 1.8s ease-in-out infinite;
}

.wax-cw__item:nth-child(3) .wax-cw__ico {
	animation-delay: .35s;
}

.wax-cw__item:hover .wax-cw__ico {
	background: rgb(var(--wax-btn));
	color: #fff;
	animation-duration: .9s;
}

.wax-cw__ico svg {
	width: 1.1rem;
	height: 1.1rem;
}

.wax-cw__txt {
	display: flex;
	flex-direction: column;
	line-height: 1.2;
	white-space: nowrap;
}

.wax-cw__label {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .045em;
	text-transform: uppercase;
	color: rgb(var(--wax-muted));
}

.wax-cw__value {
	font-size: 14px;
	font-weight: 700;
	color: rgb(var(--wax-heading));
	transition: color .2s ease;
}

.wax-cw__item:hover .wax-cw__value {
	color: rgb(var(--wax-btn));
}

.wax-cw__sep {
	align-self: stretch;
	width: 1px;
	margin: .35rem .1rem;
	background: rgb(var(--wax-border));
}

@keyframes wax-cw-icon-pulse {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.08); }
}

.wax-hdr-icon {
	position: relative;
}

.wax-hdr-icon__pulse {
	position: absolute;
	inset: 0;
	border-radius: .5rem;
	background: currentColor;
	opacity: .22;
	animation: wax-hdr-icon-ring 2s ease-out infinite;
	pointer-events: none;
}

.wax-wa-btn.wax-hdr-icon .wax-hdr-icon__pulse {
	background: #25d366;
}

#open-tawk-chat.wax-hdr-icon .wax-hdr-icon__pulse {
	background: rgb(var(--wax-btn));
}

@keyframes wax-hdr-icon-ring {
	0% { transform: scale(1); opacity: .28; }
	70% { transform: scale(1.55); opacity: 0; }
	100% { transform: scale(1.55); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.wax-cw__ico { animation: none; }
	.wax-hdr-icon__pulse { animation: none; display: none; }
}

/* ---------------------------------------------------------------------------
 * Wide tables inside editor prose
 *
 * The SEO block on the home page holds a five-column table with a 640px
 * min-width, sitting in a 341px-wide box on a phone. The box is the scroller
 * for the whole block, so reading the table dragged every paragraph around it
 * sideways as well.
 *
 * The table gets its own scroller instead: it stops forcing its width on the
 * text, and only the table moves when you push it.
 * ------------------------------------------------------------------------ */

/* Matches the specificity of the rule in output.css that sets the 640px
 * min-width, and loads after it, so neither side needs !important. The width
 * moves onto the table's own boxes: the columns stay as wide as they were,
 * inside a scroller that no longer drags the paragraphs with it. */
.description-content .description-text-wrapper table,
.prose-seo table {
	display: block;
	min-width: 0;
	max-width: 100%;
	overflow-x: auto;
}

.description-content .description-text-wrapper table > *,
.prose-seo table > * {
	min-width: 640px;
}
