/*
 * Modern design layer for the Backhoe child theme.
 * Loaded only when BACKHOE_CHILD_MODERN is true (functions.php); the body then
 * carries .bh-modern. Same black / red identity, with a cleaner header, title
 * banners, footer, buttons and cards.
 */

:root {
	--bh-red: var(--primary-color, #ff0000);
	--bh-red-dark: #d10000;
	--bh-black: #0d0d0d;
	--bh-charcoal: #151515;
	--bh-text-on-dark: rgba(255, 255, 255, 0.72);
	--bh-rule-on-dark: rgba(255, 255, 255, 0.1);
	--bh-radius: 4px;
	--bh-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

.bh-wrap {
	max-width: 1350px;
	margin: 0 auto;
	padding: 0 24px;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.bh-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 48px;
	padding: 0 26px;
	border: 2px solid var(--bh-red);
	border-radius: var(--bh-radius);
	background: var(--bh-red);
	color: #fff !important;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1;
	text-transform: uppercase;
	text-decoration: none !important;
	transition: background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.2s var(--bh-ease), box-shadow 0.2s;
}

.bh-btn:hover,
.bh-btn:focus-visible {
	border-color: var(--bh-red-dark);
	background: var(--bh-red-dark);
	transform: translateY(-1px);
	box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.bh-btn--light {
	border-color: #fff;
	background: #fff;
	color: var(--bh-red) !important;
}

.bh-btn--light:hover,
.bh-btn--light:focus-visible {
	border-color: #fff;
	background: #f2f2f2;
}

.bh-btn--outline-light {
	border-color: rgba(255, 255, 255, 0.85);
	background: transparent;
}

.bh-btn--outline-light:hover,
.bh-btn--outline-light:focus-visible {
	border-color: #fff;
	background: rgba(255, 255, 255, 0.12);
}

/* Existing theme and shop buttons: same corners and motion. */
body.bh-modern .wd-btn,
body.bh-modern .woocommerce .button,
body.bh-modern .woocommerce a.button,
body.bh-modern .bh-view-details,
body.bh-modern input[type="submit"],
body.bh-modern .wpcf7-submit {
	border-radius: var(--bh-radius) !important;
	transition: background-color 0.2s, transform 0.2s var(--bh-ease), box-shadow 0.2s !important;
}

body.bh-modern .wd-btn:hover,
body.bh-modern .woocommerce a.button:hover,
body.bh-modern input[type="submit"]:hover,
body.bh-modern .wpcf7-submit:hover {
	transform: translateY(-1px);
	box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

body.bh-modern .bh-inv__cat,
body.bh-modern .bh-inv__brand,
body.bh-modern .bh-inv__type,
body.bh-modern .bh-unit__actions a,
body.bh-modern .bh-pdp a[class*="btn"] {
	border-radius: var(--bh-radius);
}

a:focus-visible,
button:focus-visible {
	outline: 2px solid var(--bh-red);
	outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Desktop header
   -------------------------------------------------------------------------- */
@media screen and (min-width: 64em) {
	/* Slim top strip: LinkedIn + hours/email on the left, careers on the right. */
	body.bh-modern .top-header {
		font-size: 13px;
	}

	body.bh-modern .top-header .__top-header-left {
		display: flex;
		align-items: center;
		gap: 18px;
		padding: 7px 0;
	}

	body.bh-modern .top-header .__top-header-left .social-media {
		margin: 0 0 0 20px;
	}

	body.bh-modern .top-header .__top-header-left .social-media li:empty,
	body.bh-modern .top-header .__top-header-left .social-media a[href=""] {
		display: none;
	}

	body.bh-modern .bh-topinfo {
		color: rgba(255, 255, 255, 0.7);
		white-space: nowrap;
	}

	body.bh-modern .bh-topinfo a {
		color: rgba(255, 255, 255, 0.7);
		text-decoration: none;
	}

	body.bh-modern .bh-topinfo a:hover {
		color: #fff;
	}

	body.bh-modern .top-header .__top-header-right {
		padding: 7px 0;
	}

	body.bh-modern .top-header .__top-header-right p {
		margin: 0;
		font-size: 13px;
	}

	/* Header over the banner: a soft dark fade instead of a flat tint. */
	body.bh-modern header.l-header {
		background: linear-gradient(to bottom, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.15) 75%, rgba(0, 0, 0, 0));
	}

	body.bh-modern .site-desktop-title {
		display: flex;
		align-items: center;
		gap: 24px;
	}

	body.bh-modern .logo-wrapper img {
		transition: height 0.3s var(--bh-ease);
	}

	/* Phone block: icon + two tidy lines. */
	body.bh-modern .header_phone {
		display: grid;
		grid-template-columns: 40px auto;
		grid-template-rows: auto auto;
		column-gap: 12px;
		align-content: center;
		height: auto !important;
		padding-left: 24px;
		border-left: 1px solid rgba(255, 255, 255, 0.18);
	}

	body.bh-modern .header_phone::before {
		content: "";
		grid-row: 1 / 3;
		align-self: center;
		width: 40px;
		height: 40px;
		border-radius: 50%;
		background: var(--bh-red) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M6.6 10.8a15.1 15.1 0 0 0 6.6 6.6l2.2-2.2a1 1 0 0 1 1-.25 11.4 11.4 0 0 0 3.6.57 1 1 0 0 1 1 1V20a1 1 0 0 1-1 1A17 17 0 0 1 3 4a1 1 0 0 1 1-1h3.5a1 1 0 0 1 1 1c0 1.25.2 2.45.57 3.6a1 1 0 0 1-.25 1z'/%3E%3C/svg%3E") center / 18px no-repeat;
	}

	body.bh-modern .header_phone p {
		margin: 0;
		font-size: 12px;
		letter-spacing: 0.04em;
		text-transform: uppercase;
		white-space: nowrap;
		color: rgba(255, 255, 255, 0.7);
	}

	body.bh-modern .header_phone strong {
		font-size: 19px;
		line-height: 1.2;
		white-space: nowrap;
	}

	/* Menu: red underline that slides in on hover and marks the current page. */
	body.bh-modern #menu-primary-menu > li > a {
		position: relative;
	}

	body.bh-modern #menu-primary-menu > li > a::before {
		content: "";
		position: absolute;
		left: 19px;
		right: 19px;
		bottom: 4px;
		height: 2px;
		background: var(--bh-red);
		transform: scaleX(0);
		transform-origin: left;
		transition: transform 0.25s var(--bh-ease);
	}

	body.bh-modern #menu-primary-menu > li:hover > a::before,
	body.bh-modern #menu-primary-menu > li > a:focus-visible::before,
	body.bh-modern #menu-primary-menu > li.current-menu-item > a::before,
	body.bh-modern #menu-primary-menu > li.current-menu-ancestor > a::before {
		transform: scaleX(1);
	}

	/* Dropdowns: dark cards with a red top edge. */
	body.bh-modern #menu-primary-menu .submenu {
		padding: 8px 0 !important;
		border-top: 3px solid var(--bh-red);
		border-radius: 0 0 8px 8px !important;
		background: var(--bh-charcoal) !important;
		box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35) !important;
	}

	body.bh-modern #menu-primary-menu .submenu a {
		padding: 10px 28px 10px 24px !important;
		font-size: 15px !important;
		transition: background-color 0.15s, color 0.15s, padding-left 0.2s var(--bh-ease);
	}

	body.bh-modern #menu-primary-menu .submenu a:hover {
		padding-left: 30px !important;
		background: rgba(255, 255, 255, 0.05);
		color: var(--bh-red) !important;
	}

	body.bh-modern .header-cta a {
		border-radius: var(--bh-radius) !important;
		letter-spacing: 0.06em;
	}

	/* Compact sticky header once the page is scrolled (body.bh-scrolled from modern.js). */
	body.bh-modern.bh-scrolled header.l-header .top-bar-container {
		position: fixed !important;
		top: 0 !important;
		left: 0;
		right: 0;
		width: 100%;
		padding: 0 !important;
		background: rgba(13, 13, 13, 0.97) !important;
		box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
		transform: none !important;
		animation: bh-slide-down 0.35s var(--bh-ease);
	}

	body.bh-modern.admin-bar.bh-scrolled header.l-header .top-bar-container {
		top: 32px !important;
	}

	body.bh-modern.bh-scrolled .logo-wrapper img {
		height: 64px !important;
		width: auto !important;
	}

	body.bh-modern.bh-scrolled .top-bar-left,
	body.bh-modern.bh-scrolled .site-desktop-title,
	body.bh-modern.bh-scrolled .logo-wrapper {
		height: auto !important;
	}

	body.bh-modern.bh-scrolled .site-navigation.top-bar {
		padding-top: 10px;
		padding-bottom: 10px;
	}
}

@keyframes bh-slide-down {
	from {
		transform: translateY(-100%);
	}
	to {
		transform: none;
	}
}

/* --------------------------------------------------------------------------
   Page title banners
   -------------------------------------------------------------------------- */
body.bh-modern .titlebar {
	position: relative;
	background-size: cover;
	background-position: center;
}

body.bh-modern .titlebar::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.3) 45%, rgba(0, 0, 0, 0.78) 100%);
	pointer-events: none;
}

body.bh-modern .titlebar > .row {
	position: relative;
	z-index: 1;
}

body.bh-modern .titlebar #page-title {
	margin-bottom: 8px;
	letter-spacing: 0.01em;
	text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}

body.bh-modern .titlebar .breadcrumbs {
	display: flex !important;
	justify-content: center;
	flex-wrap: wrap;
	gap: 0;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 13px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

body.bh-modern .titlebar .breadcrumbs li {
	display: flex;
	align-items: center;
	color: rgba(255, 255, 255, 0.85);
}

body.bh-modern .titlebar .breadcrumbs li::after {
	content: none !important;
}

body.bh-modern .titlebar .breadcrumbs li + li::before {
	content: "/";
	margin: 0 10px;
	color: var(--bh-red);
}

body.bh-modern .titlebar .breadcrumbs a {
	color: rgba(255, 255, 255, 0.7) !important;
	text-decoration: none;
}

body.bh-modern .titlebar .breadcrumbs a:hover {
	color: #fff !important;
}

body.bh-modern .titlebar .breadcrumbs strong {
	font-weight: 600;
}

@media screen and (min-width: 64em) {
	/* Shorter banner: room for the header, then the title. */
	body.bh-modern .titlebar {
		padding: 196px 0 52px !important;
	}

	body.bh-modern .titlebar #page-title {
		font-size: 52px;
	}
}

/* --------------------------------------------------------------------------
   Homepage hero (text placed by modern.js)
   -------------------------------------------------------------------------- */
body.bh-modern .bh-hero-host {
	position: relative;
	overflow: hidden;
}

body.bh-modern .bh-hero-host::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(90deg, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.72) 36%, rgba(0, 0, 0, 0.12) 60%, rgba(0, 0, 0, 0) 100%);
	pointer-events: none;
}

.bh-hero {
	position: absolute;
	z-index: 2;
	top: calc(50% + 60px);
	left: max(24px, calc((100% - 1350px) / 2 + 24px));
	width: min(500px, 40%);
	transform: translateY(-50%);
	color: #fff;
}

.bh-hero__eyebrow {
	margin: 0 0 12px;
	color: var(--bh-red);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.bh-hero__title {
	margin: 0 0 14px;
	color: #fff;
	font-size: clamp(34px, 3.6vw, 54px);
	font-weight: 800;
	line-height: 1.05;
	text-transform: uppercase;
	text-wrap: balance;
}

.bh-hero__text {
	max-width: 46ch;
	margin: 0 0 24px;
	color: rgba(255, 255, 255, 0.85);
	font-size: 17px;
	line-height: 1.6;
}

.bh-hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

@media screen and (max-width: 63.9375em) {
	/* Tablet: the builder gives the banner row no height here, so size it for the text. */
	body.bh-modern .bh-hero-host {
		min-height: 460px;
		background-size: cover !important;
		background-position: center !important;
	}

	body.bh-modern .bh-hero-host::before {
		background: linear-gradient(90deg, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.7) 55%, rgba(0, 0, 0, 0.45) 100%);
	}

	.bh-hero {
		top: calc(50% + 30px);
		width: min(460px, 70%);
	}

	.bh-hero__text {
		font-size: 15px;
	}
}

/* --------------------------------------------------------------------------
   Headings, cards and spacing
   -------------------------------------------------------------------------- */
/* The large outlined words behind section headings: quieter. */
@media screen and (min-width: 64em) {
	body.bh-modern .wd-heading .title_a::after {
		opacity: 0.07;
		transform: scale(1.5);
	}
}

body.bh-modern .wd-heading .title_a {
	letter-spacing: -0.005em;
}

body.bh-modern .main p,
body.bh-modern .l-main p {
	line-height: 1.7;
}

/* Product grids (homepage Featured Offers, related products). */
body.bh-modern ul.products li.product {
	border-radius: 6px;
	transition: transform 0.25s var(--bh-ease), box-shadow 0.25s;
}

body.bh-modern ul.products li.product:hover {
	transform: translateY(-4px);
	box-shadow: 0 16px 32px rgba(0, 0, 0, 0.12);
}

body.bh-modern ul.products li.product .product-image-wrapper {
	border-radius: 6px 6px 0 0;
}

body.bh-modern ul.products li.product .product-image-wrapper img {
	transition: transform 0.6s var(--bh-ease) !important;
}

body.bh-modern ul.products li.product:hover .product-image-wrapper img {
	transform: scale(1.04);
}

/* Inventory rows and brand tiles. */
body.bh-modern .bh-unit {
	transition: box-shadow 0.25s, transform 0.25s var(--bh-ease);
}

body.bh-modern .bh-unit:hover {
	box-shadow: 0 14px 30px rgba(0, 0, 0, 0.1);
}

body.bh-modern .bh-inv__brand {
	transition: border-color 0.15s, box-shadow 0.15s, transform 0.2s var(--bh-ease);
}

body.bh-modern .bh-inv__brand:hover {
	transform: translateY(-2px);
}

/* Scroll reveal (modern.js adds .bh-reveal only to sections below the fold). */
.bh-reveal {
	opacity: 0;
	transform: translateY(24px);
	transition: opacity 0.7s var(--bh-ease), transform 0.7s var(--bh-ease);
}

.bh-reveal.bh-in {
	opacity: 1;
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	.bh-reveal {
		opacity: 1;
		transform: none;
		transition: none;
	}

	body.bh-modern.bh-scrolled header.l-header .top-bar-container {
		animation: none;
	}
}

/* --------------------------------------------------------------------------
   Call-to-action band + footer (child footer.php)
   -------------------------------------------------------------------------- */
.bh-cta-band {
	background: linear-gradient(120deg, var(--bh-red) 0%, #c00000 100%);
	color: #fff;
}

.bh-cta-band__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 20px 40px;
	padding-top: 36px;
	padding-bottom: 36px;
}

.bh-cta-band h2 {
	margin: 0 0 4px;
	text-transform: none !important;
	color: #fff;
	font-size: clamp(22px, 2.4vw, 30px);
	font-weight: 800;
	line-height: 1.2;
}

.bh-cta-band p {
	margin: 0;
	color: rgba(255, 255, 255, 0.88);
	font-size: 16px;
}

.bh-cta-band__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.bh-footer {
	background: var(--bh-black);
	color: var(--bh-text-on-dark);
	font-size: 15px;
	line-height: 1.6;
}

.bh-footer__grid {
	display: grid;
	grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
	gap: 48px;
	padding-top: 64px;
	padding-bottom: 48px;
}

.bh-footer__grid > * {
	min-width: 0;
}

.bh-footer__logo img {
	display: block;
	width: 170px;
	height: auto;
	margin: 0 0 18px;
}

.bh-footer__brand p {
	margin: 0 0 12px;
	max-width: 38ch;
}

.bh-footer__dealer {
	color: #fff;
	font-weight: 600;
}

.bh-footer h3 {
	position: relative;
	margin: 0 0 20px;
	padding-bottom: 12px;
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.bh-footer h3::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 28px;
	height: 2px;
	background: var(--bh-red);
}

.bh-footer a {
	color: var(--bh-text-on-dark);
	text-decoration: none;
	transition: color 0.15s;
}

.bh-footer a:hover {
	color: #fff;
}

.bh-footer__links {
	display: grid;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.bh-footer__location {
	display: grid;
	gap: 2px;
	margin-bottom: 18px;
}

.bh-footer__location strong {
	color: #fff;
}

.bh-footer__location a {
	color: var(--bh-red);
	font-weight: 600;
}

.bh-footer__location a:hover {
	color: #fff;
}

.bh-footer__contact {
	display: grid;
	gap: 12px;
	margin: 0 0 22px;
	padding: 0;
	list-style: none;
}

.bh-footer__contact span {
	display: block;
	color: rgba(255, 255, 255, 0.45);
	font-size: 12px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.bh-footer__contact a {
	overflow-wrap: anywhere;
}

.bh-footer__social {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 10px 16px;
	border: 1px solid var(--bh-rule-on-dark);
	border-radius: var(--bh-radius);
	font-size: 14px;
	font-weight: 600;
}

.bh-footer__social:hover {
	border-color: var(--bh-red);
}

.bh-footer__social i {
	color: var(--bh-red);
	font-size: 18px;
}

.bh-footer__bar {
	border-top: 1px solid var(--bh-rule-on-dark);
	font-size: 13px;
	color: rgba(255, 255, 255, 0.5);
}

.bh-footer__bar .bh-wrap {
	padding-top: 18px;
	padding-bottom: 18px;
}

@media screen and (max-width: 63.9375em) {
	.bh-footer__grid {
		grid-template-columns: 1fr 1fr;
		gap: 36px 32px;
		padding-top: 44px;
		padding-bottom: 32px;
	}
}

@media screen and (max-width: 40em) {
	.bh-wrap {
		padding: 0 20px;
	}

	.bh-cta-band__inner {
		padding-top: 28px;
		padding-bottom: 28px;
	}

	.bh-cta-band h2 {
		font-size: 21px;
	}

	.bh-cta-band p {
		font-size: 14px;
	}

	.bh-cta-band__actions {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 10px;
		width: 100%;
	}

	.bh-cta-band__actions .bh-btn {
		min-height: 44px;
		padding: 0 10px;
		font-size: 13px;
		letter-spacing: 0.03em;
	}

	/* Phone footer: logo, both locations side by side, contact. Quick links are in the menu. */
	.bh-footer {
		font-size: 14px;
	}

	.bh-footer__grid {
		grid-template-columns: 1fr 1fr;
		gap: 24px 20px;
		padding-top: 28px;
		padding-bottom: 20px;
	}

	.bh-footer__brand,
	.bh-footer__col:last-child {
		grid-column: 1 / -1;
	}

	.bh-footer__grid > nav.bh-footer__col {
		display: none;
	}

	.bh-footer__brand p:not(.bh-footer__dealer) {
		display: none;
	}

	.bh-footer__dealer {
		margin: 0 !important;
		font-size: 14px;
	}

	.bh-footer__logo img {
		width: 120px;
		margin-bottom: 10px;
	}

	/* Locations: the column's two blocks become the two grid cells. */
	.bh-footer__col:nth-child(3) {
		display: contents;
	}

	.bh-footer__col:nth-child(3) h3 {
		grid-column: 1 / -1;
		margin-bottom: -8px;
	}

	.bh-footer__location {
		margin: 0;
	}

	.bh-footer h3 {
		margin-bottom: 14px;
		padding-bottom: 8px;
		font-size: 13px;
	}

	.bh-footer__contact {
		grid-template-columns: 1fr 1fr;
		gap: 10px 20px;
		margin-bottom: 16px;
	}

	.bh-footer__contact li:nth-child(2) {
		grid-column: 1 / -1;
		order: 3;
	}

	.bh-footer__bar {
		text-align: center;
	}
}
