/*
 * Design Refresh v2 content pages (area C1; v2/page.php, template-parts/v2/pages/*), both audiences.
 *
 * The export styles only the copy it drew (".article-copy p", ".policy-sections h2/p"), and its
 * functional pages linked out. This file styles what the live site puts in their place, in the
 * design's vocabulary (#ed001e, #141414 panels, #424242 lines, Inter/Barlow): WordPress content
 * (.hitek-v2-prose: legal text, articles, generic pages), the password form, the embedded HITEK
 * services (.hitek-v2-embed: warranty center, transfer, dealer application, installer locator), the
 * search form and Contact Form 7. Loaded after the design stylesheets; selectors start with .hwr2.
 */

/* ---- WordPress content ---- */
.hwr2 .hitek-v2-prose {
	max-width: 860px;
	margin: 0 0 48px;
	color: #d4d4d4;
	font-size: 16px;
	line-height: 1.8;
	overflow-wrap: anywhere;
}

/* Articles keep the export's 760px column (site.css / information.css) in both shells. */
.hwr2 .article-copy.hitek-v2-prose {
	max-width: 760px;
	margin-inline: auto;
}

.hwr2 .hitek-v2-prose > :first-child {
	margin-top: 0;
}

.hwr2 .hitek-v2-prose :is(p, ul, ol, blockquote, figure, table, pre, .wp-block-image, .wp-block-embed) {
	margin: 0 0 1.25em;
}

.hwr2 .article-copy.hitek-v2-prose p {
	color: #c9c9c9;
	font-size: 17px;
	line-height: 1.95;
}

/* The export's article text steps down to 15px at 700px and below (site.css). */
@media (max-width: 700px) {
	.hwr2 .article-copy.hitek-v2-prose p {
		font-size: 15px;
	}
}

.hwr2 .hitek-v2-prose :is(h1, h2, h3, h4, h5, h6) {
	margin: 1.8em 0 0.6em;
	color: #fff;
	line-height: 1.2;
}

.hwr2 .hitek-v2-prose h1,
.hwr2 .hitek-v2-prose h2 {
	font-size: clamp(24px, 2.6vw, 32px);
}

.hwr2 .hitek-v2-prose h3 {
	font-size: 20px;
}

.hwr2 .hitek-v2-prose :is(h4, h5, h6) {
	font-size: 16px;
	letter-spacing: 0;
}

.hwr2 .hitek-v2-prose a {
	color: #fff;
	text-decoration: underline;
	text-decoration-color: #ed001e;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.hwr2 .hitek-v2-prose a:hover {
	color: #ed001e;
}

/* An <a> without href in the content is not a link (hitek_v2_pages_dead_links() links bare email addresses):
   it reads as the text around it instead of a link that does nothing. */
.hwr2 .hitek-v2-prose a:not([href]),
.hwr2 .hitek-v2-prose a:not([href]):hover {
	color: inherit;
	text-decoration: none;
}

.hwr2 .hitek-v2-prose :is(ul, ol) {
	padding-left: 1.4em;
}

.hwr2 .hitek-v2-prose ul {
	list-style: disc;
}

.hwr2 .hitek-v2-prose ol {
	list-style: decimal;
}

.hwr2 .hitek-v2-prose li {
	margin: 0.35em 0;
}

.hwr2 .hitek-v2-prose li::marker {
	color: #ed001e;
}

.hwr2 .hitek-v2-prose :is(strong, b) {
	color: #fff;
	font-weight: 700;
}

.hwr2 .hitek-v2-prose :is(hr, .wp-block-separator) {
	margin: 2em 0;
	border: 0;
	border-top: 1px solid #303030;
}

.hwr2 .hitek-v2-prose blockquote {
	padding: 4px 0 4px 20px;
	border-left: 2px solid #ed001e;
	color: #e5e5e5;
}

.hwr2 .hitek-v2-prose :is(img, video) {
	max-width: 100%;
	height: auto;
}

.hwr2 .hitek-v2-prose :is(iframe, embed, object) {
	max-width: 100%;
}

.hwr2 .hitek-v2-prose figcaption {
	margin-top: 8px;
	color: #9a9a9a;
	font-size: 13px;
}

/* Tables scroll inside their own box, never the page. */
.hwr2 .hitek-v2-prose table {
	display: block;
	max-width: 100%;
	overflow-x: auto;
	border-collapse: collapse;
	font-size: 14px;
}

.hwr2 .hitek-v2-prose :is(th, td) {
	padding: 10px 12px;
	border: 1px solid #303030;
	text-align: left;
	vertical-align: top;
}

.hwr2 .hitek-v2-prose th {
	background: #141414;
	color: #fff;
}

.hwr2 .hitek-v2-prose pre {
	max-width: 100%;
	overflow-x: auto;
	padding: 14px;
	background: #141414;
	border: 1px solid #303030;
}

.hwr2 .hitek-v2-prose .wp-block-button__link,
.hwr2 .hitek-v2-prose .button {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 10px 20px;
	border-radius: 3px;
	background: #ed001e;
	color: #fff;
	font-weight: 700;
	text-decoration: none;
}

/* The export's article image (max-height 500px, 35px below it), as a block. */
.hwr2 .article-image {
	display: block;
	width: 100%;
	height: auto;
	max-height: 500px;
	margin: 0 auto 35px;
	object-fit: cover;
}

/* WooCommerce order tracking result (order number, date, status): the account pages' look, not the
   browser's yellow highlight. */
.hwr2 .hitek-v2-prose mark {
	background: none;
	color: #fff;
	font-weight: 600;
}

/* ---- Forms in content: WordPress password form, WooCommerce order tracking, Contact Form 7. ---- */
.hwr2 :is(.hitek-v2-prose, .hitek-v2-password, .hitek-v2-form) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]), select, textarea) {
	box-sizing: border-box;
	width: 100%;
	max-width: 560px;
	min-height: 46px;
	padding: 12px 14px;
	border: 1px solid #4c4c4c;
	border-radius: 3px;
	background: #151515;
	color: #fff;
	font: inherit;
	font-size: 15px;
}

.hwr2 :is(.hitek-v2-prose, .hitek-v2-password, .hitek-v2-form) textarea {
	max-width: 100%;
	min-height: 140px;
}

.hwr2 :is(.hitek-v2-prose, .hitek-v2-password, .hitek-v2-form) label {
	display: block;
	margin-bottom: 6px;
	color: #ddd;
	font-size: 13px;
	font-weight: 600;
}

.hwr2 :is(.hitek-v2-prose, .hitek-v2-password, .hitek-v2-form) :is(button, input[type="submit"], input[type="button"]) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	padding: 12px 22px;
	border: 1px solid #ed001e;
	border-radius: 3px;
	background: #ed001e;
	color: #fff;
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
}

.hwr2 :is(.hitek-v2-prose, .hitek-v2-password, .hitek-v2-form) :is(button, input[type="submit"]):hover {
	filter: brightness(1.1);
}

.hwr2 .hitek-v2-password {
	max-width: 640px;
	margin: 0 0 56px;
	padding: 28px;
	border: 1px solid #424242;
	border-top: 2px solid #ed001e;
	background: #141414;
}

.hwr2 .hitek-v2-password p {
	margin: 0 0 16px;
	color: #d4d4d4;
	font-size: 15px;
	line-height: 1.7;
}

.hwr2 .hitek-v2-password .post-password-form p:last-child {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 12px;
	margin: 0;
}

.hwr2 .hitek-v2-password .post-password-form label {
	flex: 1 1 260px;
	margin: 0;
}

.hwr2 .hitek-v2-password .post-password-form label input {
	margin-top: 6px;
}

.hwr2 .hitek-v2-form {
	max-width: 760px;
	padding: 28px;
	border: 1px solid #424242;
	background: #141414;
}

.hwr2 .hitek-v2-form p {
	margin: 0 0 16px;
}

.hwr2 .hitek-v2-form .wpcf7-not-valid-tip {
	margin-top: 6px;
	color: #ff8a8a;
	font-size: 13px;
}

.hwr2 .hitek-v2-form .wpcf7-response-output {
	margin: 16px 0 0;
	padding: 12px 14px;
	border: 1px solid #555;
	color: #ddd;
	font-size: 14px;
}

.hwr2 .hitek-v2-contact-form {
	margin-block: 56px;
}

.hwr2 .hitek-v2-contact-form .hitek-v2-form {
	margin-inline: auto;
}

/* ---- Embedded HITEK services (slots) ---- */
.hwr2 .hitek-v2-embed {
	margin: 40px 0 48px;
	border: 1px solid #424242;
	border-top: 2px solid #ed001e;
	background: #0d0d0d;
}

.hwr2 .hitek-v2-embed .hitek-warranty-embed {
	padding: 0;
	background: transparent;
}

.hwr2 .hitek-v2-embed .hitek-warranty-embed > div {
	max-width: none;
	padding: 0;
}

.hwr2 .hitek-v2-embed__frame {
	display: block;
	width: 1px;
	min-width: 100%;
	max-width: 100%;
	border: 0;
}

.hwr2 .hitek-v2-embed--registration .hitek-v2-embed__frame {
	min-height: 900px;
}

.hwr2 .hitek-v2-embed__intro {
	padding: 26px 28px 18px;
	border-bottom: 1px solid #262626;
}

.hwr2 .hitek-v2-embed__intro h2 {
	margin: 4px 0 6px;
	color: #fff;
	font-size: clamp(24px, 2.6vw, 34px);
	line-height: 1.15;
}

.hwr2 .hitek-v2-embed__intro p:not(.eyebrow) {
	margin: 0;
	color: #c9c9c9;
	font-size: 15px;
}

/* The locator fills the screen under the sticky header, as the live page does (min 600px). */
.hwr2 .hitek-v2-embed--locator .hitek-v2-embed__frame {
	height: calc(100dvh - 190px);
	min-height: 600px;
}

@media (max-width: 767px) {
	.hwr2 .hitek-v2-embed__intro {
		padding: 22px 18px 14px;
	}

	/* The phone header (with the product bar) is about 170px tall: the frame fits below it. */
	.hwr2 .hitek-v2-embed--locator .hitek-v2-embed__frame {
		height: calc(100dvh - 190px);
		min-height: 560px;
	}

	.hwr2 .hitek-v2-password,
	.hwr2 .hitek-v2-form {
		padding: 20px 16px;
	}
}

/* ---- Search form (search results, 404) and empty states ---- */
.hwr2 .hitek-v2-search {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	max-width: 760px;
	margin: 0 0 36px;
}

.hwr2 .hitek-v2-search .search-input {
	flex: 1 1 260px;
	min-width: 0;
	font-size: 14px;
}

.hwr2 .hitek-v2-search .btn {
	min-height: 46px;
}

.hwr2 .hitek-v2-empty {
	margin: 10px 0 56px;
	color: #c9c9c9;
}

.hwr2 .hitek-v2-empty p {
	margin: 0 0 18px;
}

.hwr2 .news-card .image-fallback {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 170px;
	padding: 20px;
	background: #111;
	text-align: center;
}

/*
 * WooCommerce notices above a page (v2/page.php, hitek_v2_pages_notices(): an add-to-cart link opened on a
 * content page): in the page's column, the theme's notice look (dist/style.css). Consumer chrome: the
 * information pages' 1216px column (100% - 32px on phones and tablets), also above the full-width layouts
 * (home, /automotive/, /ppf-ultra/). Dealer shell: the margins of the workspace's [data-hwr-main] column
 * (site.css: 24px, 16px at 1000px and below).
 */
.hwr2 .hitek-v2-page-notices {
	box-sizing: border-box;
	width: min(1216px, calc(100% - 32px));
	margin: 24px auto 0;
}

.hwr2 .portal-workspace .hitek-v2-page-notices {
	width: calc(100% - 48px);
	margin-inline: 24px;
}

@media (max-width: 1000px) {
	.hwr2 .portal-workspace .hitek-v2-page-notices {
		width: calc(100% - 32px);
		margin-inline: 16px;
	}
}

/* Phones: the success notice's flex row squeezed the product name and the sentence into narrow columns
   beside "View cart"; the sentence flows as text, the button goes below it. */
@media (max-width: 767px) {
	.hwr2 .hitek-v2-page-notices :is(.woocommerce-message, .woocommerce-info) {
		display: block;
	}

	.hwr2 .hitek-v2-page-notices :is(.woocommerce-message, .woocommerce-info)::before {
		display: inline-block;
		margin-right: 8px;
		vertical-align: -0.3em;
	}

	.hwr2 .hitek-v2-page-notices :is(.woocommerce-message, .woocommerce-info) .button {
		display: table;
		margin: 12px 0 0;
	}
}

/* Site map lists: tap-friendly rows (44px, spec §8a). */
.hwr2 .all-route-list a {
	display: flex;
	align-items: center;
	min-height: 44px;
}

/* Compact pager (search results): the left-out runs of pages. */
.hwr2 .hitek-v2-pager {
	flex-wrap: wrap;
	align-items: center;
}

.hwr2 .hitek-v2-pager__gap {
	padding: 0 4px;
	color: #8a8a8a;
	font-size: 12px;
}

/* Phones: on a middle page the pager shows five boxes and two gaps ("01 … 08 09 10 … 17"); with the design's
   12px 20px padding (54-57px boxes) they needed 374px and the last box wrapped onto a second row at 375 and
   390. The boxes narrow to 44px (still 45px tall), so the row takes 317px. */
@media (max-width: 480px) {
	.hwr2 .pagination.hitek-v2-pager a {
		box-sizing: border-box;
		min-width: 44px;
		padding-inline: 0;
		text-align: center;
	}
}

/*
 * Touch targets (spec §8a: 44x44 where the design allows) on phones and on touch screens of any width
 * (pointer: coarse, e.g. a 768px tablet; with a mouse the look stays as designed). The export draws its chips,
 * tabs and filters 27-42px tall: news category links (/news/, /category/*), FAQ filters, the /ppf/ and
 * /architectural/ collection chips, the application pages' view modes. Both audiences (dealer news, FAQ and
 * /commercial/ use the same markup inside the dealer shell). The news links keep their underline under the
 * text; the extra height goes above it.
 */
@media (max-width: 767px), (pointer: coarse) {
	body.hitek-v2 .hwr2 nav.format-links a {
		display: inline-flex;
		align-items: flex-end;
		min-height: 44px;
		box-sizing: border-box;
	}

	/* The dealer site map's product directory: 44px rows (the export's are 42px). */
	body.hitek-v2 .hwr2 .site-map-grid a {
		display: flex;
		align-items: center;
		min-height: 44px;
		box-sizing: border-box;
	}

	body.hitek-v2 .hwr2 .faq-filters button,
	body.hitek-v2 .hwr2 nav.catalog-collections button,
	body.hitek-v2 .hwr2 .view-modes button {
		min-width: 44px;
		min-height: 44px;
	}

	/* /coatings/ department jumps (links, 40px in the export) and the PPF visualizer's finish buttons
	   (43px: /ppf-ultra/, the PPF tab of /window-film-visualizer/) grow to 44px. */
	body.hitek-v2 .hwr2 nav.catalog-collections a,
	body.hitek-v2 .hwr2 [data-vehicle-visualizer] .vv-choices button {
		min-height: 44px;
		box-sizing: border-box;
	}

	/*
	 * Text links and disclosures the design draws 15-40px tall keep their look and spacing and get an
	 * invisible hit area at least 44px high (and wide), centred on them (::before; none of them draws one, and
	 * none is positioned otherwise): breadcrumbs, standalone text links (/care/ "Find your product
	 * instructions", "Back to coverage guide", "← All dealer news", "Find a HITEK installer ↗", the
	 * visualizer's "Specifications & warranty", /paint-protection-film/ "HITEK PPF Spectrum · 24 colors →"),
	 * the /contact-us/ phone and email links, the "Need help?" email link of the warranty pages, the
	 * visualizer links ("View film & performance →", "Open full visualizer ↗", "Window film FAQ ↗"), the
	 * glass selector's and roll planner's disclosures and the USGS map link, the links of the glass selector's
	 * film cards ("View film details →", "Calculate rolls for this film →"), the roll planner's "Catalog sizes and
	 * sources" disclosure and its catalog links (list rows 62px apart), the product links of the /warranty/
	 * comparison table (rows are 76px tall) and of the architectural "Compare the lineup at a glance" table, the
	 * product names of the order details on /order-tracking/ (below), links that are a content heading
	 * (/commercial-inner/), block links that wrap one (`<a style="display: block"><h3>NAME</h3></a>`: the nine
	 * installer names of /hitek-dealers/, 22px tall; the address link below each, with the logo, is taller; both
	 * chromes show that page, so none of this is scoped to the consumer one) and the home page's "Learn more
	 * about …" lines. The hit area sits above neighbouring captions (z-index 1: the hero's "Illustrative installed
	 * finish" note took the bottom of "Find a HITEK installer ↗" at 390px). Links inside running text are left as
	 * they are.
	 */
	body.hitek-v2 .hwr2 [data-hwr-main] :is(.breadcrumb a, a.text-link, a.vv-link, .visualizer-learning a, .contact-inline a[href^="mailto:"], details.glass-source > summary, details.roll-method > summary, details.glass-elevation-help > summary, details.glass-elevation-help > a, .glass-film-card > a, details.roll-source > summary, .roll-source-list li > a, .coverage-table-wrap :is(th, td) > a, .spec-table :is(th, td) > a, .current-contact-grid p > a, .spectrum-category-link > a, .hitek-v2-prose .product-name > a, .hitek-v2-prose :is(h2, h3, h4, h5, h6) > a, .hitek-v2-prose a:has(> :is(h2, h3, h4, h5, h6)), a.underline.text-hitek-white) {
		position: relative;
	}

	body.hitek-v2 .hwr2 [data-hwr-main] :is(.breadcrumb a, a.text-link, a.vv-link, .visualizer-learning a, .contact-inline a[href^="mailto:"], details.glass-source > summary, details.roll-method > summary, details.glass-elevation-help > summary, details.glass-elevation-help > a, .glass-film-card > a, details.roll-source > summary, .roll-source-list li > a, .coverage-table-wrap :is(th, td) > a, .spec-table :is(th, td) > a, .current-contact-grid p > a, .spectrum-category-link > a, .hitek-v2-prose .product-name > a, .hitek-v2-prose :is(h2, h3, h4, h5, h6) > a, .hitek-v2-prose a:has(> :is(h2, h3, h4, h5, h6)), a.underline.text-hitek-white)::before {
		content: "";
		position: absolute;
		z-index: 1;
		top: 50%;
		left: 50%;
		width: max(100%, 44px);
		height: max(100%, 44px);
		transform: translate(-50%, -50%);
	}

	/* A film card's "Calculate rolls for this film →" is a block with a top rule and 12px of padding above its
	   text, 19px below "View film details →": its hit area starts at its top edge (44px down from there, inside
	   the card's 20px padding) instead of reaching up into the band of the link above. */
	body.hitek-v2 .hwr2 [data-hwr-main] article.glass-film-card > a.glass-plan-rolls::before {
		top: 0;
		transform: translateX(-50%);
	}

	/* The inline ones among them are each the only content of their line, cell or heading: as one box (an
	   inline link's ::before sits on its first line) the hit area also covers a name that wraps onto two
	   lines ("Exterior Silver Reflective ↗", the dealer contact page's email at 768px, a long catalog roll). */
	body.hitek-v2 .hwr2 [data-hwr-main] :is(.contact-inline a[href^="mailto:"], details.glass-elevation-help > a, .roll-source-list li > a, .coverage-table-wrap :is(th, td) > a, .spec-table :is(th, td) > a, .current-contact-grid p > a, .hitek-v2-prose :is(h2, h3, h4, h5, h6) > a, a.underline.text-hitek-white) {
		display: inline-block;
	}

	/*
	 * /order-tracking/ (WooCommerce's tracking result in the page's .hitek-v2-prose): a product name is an inline
	 * link followed by "× qty" and the item meta, and a long one wraps. As D4 does on order received and view
	 * order (account.css, R2-5): 14px of vertical padding gives every line of the name its own 45px band
	 * (vertical padding of an inline box does not move the lines; a band reaches 10px past its 25px line, which
	 * the cells' 10px padding holds, so it stays in its row), and the ::before above keeps a one-line name at
	 * least 44px wide. The padding goes while the link has keyboard focus, so the focus ring stays around the
	 * text. The tracking form's own fields and button are 46px already.
	 */
	body.hitek-v2 .hwr2 [data-hwr-main] .hitek-v2-prose .product-name > a {
		padding-block: 14px;
	}

	body.hitek-v2 .hwr2 [data-hwr-main] .hitek-v2-prose .product-name > a:focus-visible {
		padding-block: 0;
	}

	/*
	 * A link alone on a line of WordPress content (a post's call to action such as "Explore HITEK CRM", a source
	 * URL; hitek_v2_pages_link_lines(): p.hitek-v2-link-line > span.hitek-v2-link-line__box): the span is one box
	 * around the line's content (inline-block: a link that wraps is covered on every line, and the punctuation
	 * after it stays where it was) and the link's ::before fills it, at least 44px high and wide.
	 */
	body.hitek-v2 .hwr2 [data-hwr-main] .hitek-v2-prose .hitek-v2-link-line > .hitek-v2-link-line__box {
		position: relative;
		display: inline-block;
	}

	body.hitek-v2 .hwr2 [data-hwr-main] .hitek-v2-prose .hitek-v2-link-line > .hitek-v2-link-line__box a {
		position: static;
	}

	body.hitek-v2 .hwr2 [data-hwr-main] .hitek-v2-prose .hitek-v2-link-line > .hitek-v2-link-line__box a::before {
		content: "";
		position: absolute;
		z-index: 1;
		top: 50%;
		left: 50%;
		width: max(100%, 44px);
		height: max(100%, 44px);
		transform: translate(-50%, -50%);
	}

	/* The notices above the page (outside [data-hwr-main]): "Sign in" and the dealer's "View cart" button,
	   as on the gates (product-visitor.css). */
	body.hitek-v2 .hwr2 .hitek-v2-page-notices a {
		position: relative;
	}

	body.hitek-v2 .hwr2 .hitek-v2-page-notices a::before {
		content: "";
		position: absolute;
		z-index: 1;
		top: 50%;
		left: 50%;
		width: max(100%, 44px);
		height: max(100%, 44px);
		transform: translate(-50%, -50%);
	}
}

/* ---- Phones: iOS zooms into form fields under 16px. ---- */
@media (max-width: 767px) {
	body.hitek-v2 .hwr2 :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]):not([type="image"]), select, textarea) {
		font-size: 16px;
	}
}
