/**
 * Craftex Header Navigation External Widget Styles
 * Follows Craftlex Design System (#D8D7CC neutral surface, #3E3F3F charcoal, 0px radius)
 */

/* ==========================================================================
   Complete Isolation & Reset of WP / Elementor Default Button & Link Styles
   ========================================================================== */
.craftex-header-nav button,
.craftex-header-nav a,
.craftex-offcanvas button,
.craftex-offcanvas a,
.craftex-offcanvas-backdrop {
	background: transparent;
	border: none;
	outline: none;
	box-shadow: none;
	text-decoration: none;
	text-shadow: none;
	padding: 0;
	margin: 0;
	font: inherit;
	color: inherit;
	line-height: inherit;
	border-radius: 0;
	filter: none;
	appearance: none;
	-webkit-appearance: none;
	-webkit-tap-highlight-color: transparent;
	box-sizing: border-box;
}

.craftex-header-nav button:hover,
.craftex-header-nav button:focus,
.craftex-header-nav button:active,
.craftex-header-nav a:hover,
.craftex-header-nav a:focus,
.craftex-header-nav a:active,
.craftex-offcanvas button:hover,
.craftex-offcanvas button:focus,
.craftex-offcanvas button:active,
.craftex-offcanvas a:hover,
.craftex-offcanvas a:focus,
.craftex-offcanvas a:active {
	background: transparent;
	border: none;
	outline: none;
	box-shadow: none;
	text-decoration: none;
	filter: none;
}

/* ==========================================================================
   Header Main Bar
   ========================================================================== */
.craftex-header-nav {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	width: 100%;
	height: 72px;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 40px;
	box-sizing: border-box;
	will-change: transform, opacity;
	transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
		opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
		background-color 0.3s ease,
		color 0.3s ease;
	background-color: transparent;
	user-select: none;
}

/* Hide floating header bar when an offcanvas drawer is open */
.craftex-header-nav.is-drawer-open {
	opacity: 0 !important;
	pointer-events: none !important;
}

/* Elementor Editor Preview Compatibility */
body.elementor-editor-active .craftex-header-nav {
	position: relative !important;
	top: auto !important;
	left: auto !important;
	background-color: #2b2b2b !important;
	color: #FFFFFF !important;
	border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
	min-height: 72px;
	z-index: 100 !important;
}

body.elementor-editor-active .craftex-header-nav .craftex-header-nav__btn,
body.elementor-editor-active .craftex-header-nav .craftex-header-nav__logo-text {
	color: #FFFFFF !important;
}

/* Smart Auto-Hide Class */
.craftex-header-nav.is-header-hidden {
	transform: translate3d(0, -100%, 0);
}

/* ==========================================================================
   Scrolled Surface State & Dynamic Word/Logo Color Transition
   ========================================================================== */
.craftex-header-nav.is-scrolled {
	background-color: #FFFFFF;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border-bottom: 1px solid rgba(62, 63, 63, 0.1);
	box-shadow: none;
}

.craftex-header-nav.is-scrolled .craftex-header-nav__btn,
.craftex-header-nav.is-scrolled .craftex-header-nav__btn span,
.craftex-header-nav.is-scrolled .craftex-header-nav__logo-text {
	color: #3E3F3F;
}

/* Scrolled — Light Text Skin (Transits from White text to Dark Charcoal text on White background) */
.craftex-header-nav.is-scrolled.craftex-header--skin-light-text {
	background-color: #FFFFFF;
	color: #3E3F3F;
	border-bottom: unset !important;
}

.craftex-header-nav.is-scrolled.craftex-header--skin-light-text .craftex-header-nav__logo-img--light {
	display: none !important;
}

.craftex-header-nav.is-scrolled.craftex-header--skin-light-text .craftex-header-nav__logo-img--dark {
	display: block !important;
}

.craftex-header-nav.is-scrolled.craftex-header--skin-light-text .craftex-header-nav__btn,
.craftex-header-nav.is-scrolled.craftex-header--skin-light-text .craftex-header-nav__btn span,
.craftex-header-nav.is-scrolled.craftex-header--skin-light-text .craftex-header-nav__logo-text {
	color: #3E3F3F;
}

/* Scrolled — Dark Text Skin */
.craftex-header-nav.is-scrolled.craftex-header--skin-dark-text {
	background-color: #FFFFFF;
	color: #3E3F3F;
	border-bottom: 1px solid rgba(62, 63, 63, 0.1);
}

.craftex-header-nav.is-scrolled.craftex-header--skin-dark-text .craftex-header-nav__logo-img--light {
	display: none !important;
}

.craftex-header-nav.is-scrolled.craftex-header--skin-dark-text .craftex-header-nav__logo-img--dark {
	display: block !important;
}

.craftex-header-nav.is-scrolled.craftex-header--skin-dark-text .craftex-header-nav__btn,
.craftex-header-nav.is-scrolled.craftex-header--skin-dark-text .craftex-header-nav__btn span,
.craftex-header-nav.is-scrolled.craftex-header--skin-dark-text .craftex-header-nav__logo-text {
	color: #3E3F3F;
}

/* ==========================================================================
   Non-Scrolled Initial Skin State (Transparent Top Bar)
   ========================================================================== */
/* Light Skin (White Text on Dark Hero/Section) */
.craftex-header-nav.craftex-header--skin-light-text:not(.is-scrolled) {
	color: #FFFFFF;
}

.craftex-header-nav.craftex-header--skin-light-text:not(.is-scrolled) .craftex-header-nav__logo-img--dark {
	display: none !important;
}

.craftex-header-nav.craftex-header--skin-light-text:not(.is-scrolled) .craftex-header-nav__logo-img--light {
	display: block !important;
}

.craftex-header-nav.craftex-header--skin-light-text:not(.is-scrolled) .craftex-header-nav__btn,
.craftex-header-nav.craftex-header--skin-light-text:not(.is-scrolled) .craftex-header-nav__btn span,
.craftex-header-nav.craftex-header--skin-light-text:not(.is-scrolled) .craftex-header-nav__logo-text {
	color: #FFFFFF;
}

/* Dark Skin (Dark Charcoal Text on Light Surface/Section) */
.craftex-header-nav.craftex-header--skin-dark-text:not(.is-scrolled) {
	color: #3E3F3F;
}

.craftex-header-nav.craftex-header--skin-dark-text:not(.is-scrolled) .craftex-header-nav__logo-img--light {
	display: none !important;
}

.craftex-header-nav.craftex-header--skin-dark-text:not(.is-scrolled) .craftex-header-nav__logo-img--dark {
	display: block !important;
}

.craftex-header-nav.craftex-header--skin-dark-text:not(.is-scrolled) .craftex-header-nav__btn,
.craftex-header-nav.craftex-header--skin-dark-text:not(.is-scrolled) .craftex-header-nav__btn span,
.craftex-header-nav.craftex-header--skin-dark-text:not(.is-scrolled) .craftex-header-nav__logo-text {
	color: #3E3F3F;
}

/* Nav Item Buttons */
.craftex-header-nav__btn {
	cursor: pointer;
	padding: 8px 12px;
	font-family: "OCRBLetterpressMW01-Regular", "OCR B Std", "Courier New", monospace;
	font-size: 13px;
	font-weight: 400;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	transition: opacity 0.25s ease, color 0.3s ease;
	display: flex;
	align-items: center;
	gap: 6px;
	color: inherit;
}

.craftex-header-nav__btn span {
	font-size: inherit;
	font-family: inherit;
	font-weight: inherit;
	letter-spacing: inherit;
	line-height: inherit;
}

.craftex-header-nav__btn:hover {
	opacity: 0.72;
}

.craftex-header-nav__btn:focus-visible {
	outline: 1px solid #1D82EA;
}

/* Center Logo */
.craftex-header-nav__logo {
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	display: inline-flex;
	align-items: center;
	justify-content: space-between;
	text-decoration: none;
	color: inherit;
}

.craftex-header-nav__logo-text {
	font-family: "Aeoniktrial", "Helvetica Neue", Arial, sans-serif;
	font-size: 26px;
	font-weight: 300;
	letter-spacing: -0.02em;
	color: inherit;
	line-height: 1;
}

.craftex-header-nav__logo-img {
	height: auto;
	max-height: 28px;
	width: auto;
	max-width: 100%;
	object-fit: contain;
	display: block;
}

/* ==========================================================================
   Offcanvas Backdrop (Luxurious Smooth Cinematic Fade)
   ========================================================================== */
.craftex-offcanvas-backdrop {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	width: 100vw;
	height: 100vh;
	height: 100dvh;
	background-color: rgba(20, 20, 20, 0.45);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	z-index: 10000;
	opacity: 0;
	visibility: hidden;
	will-change: opacity, visibility;
	transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
		visibility 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.craftex-offcanvas-backdrop.is-active {
	opacity: 1;
	visibility: visible;
}

/* ==========================================================================
   Offcanvas Base Drawer (Hardware-Accelerated Cinematic Smooth Ease-In/Out)
   ========================================================================== */
.craftex-offcanvas {
	position: fixed;
	top: 0;
	bottom: 0;
	height: 100vh;
	height: 100dvh;
	background-color: #D8D7CC;
	color: #3E3F3F;
	z-index: 10001;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	overflow-y: auto;
	overflow-x: hidden;
	-webkit-overflow-scrolling: touch;
	will-change: transform;
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
	transition: transform 0.95s cubic-bezier(0.22, 1, 0.36, 1);
	box-shadow: 0 0 50px rgba(0, 0, 0, 0.18);
}

/* Left Drawer (Materials) */
.craftex-offcanvas--left {
	left: 0;
	width: 68vw;
	max-width: 960px;
	transform: translate3d(-100%, 0, 0);
}

.craftex-offcanvas--left.is-active {
	transform: translate3d(0, 0, 0);
}

/* Right Drawer (Menu) */
.craftex-offcanvas--right {
	right: 0;
	width: 32vw;
	min-width: 340px;
	max-width: 480px;
	transform: translate3d(100%, 0, 0);
	overflow: visible;
}

.craftex-offcanvas--right.is-active {
	transform: translate3d(0, 0, 0);
}

/* Hide drawer logo and header placeholder in both offcanvas drawers */
.craftex-offcanvas__screen-logo,
.craftex-offcanvas__header-spacer {
	display: none !important;
}

/* Drawer Top Bar */
.craftex-offcanvas__header {
	position: relative;
	height: 72px;
	display: flex;
	align-items: center;
	flex-shrink: 0;
	border-bottom: 0;
	box-sizing: border-box;
}

/* Materials Drawer Header - Aligned to Left with 72px side padding (matching editorial intro) */
.craftex-offcanvas--left .craftex-offcanvas__header {
	justify-content: flex-start;
	padding: 0 72px;
}

/* Menu Drawer Header - Aligned to Right */
.craftex-offcanvas--right .craftex-offcanvas__header {
	justify-content: flex-end;
	padding: 0 40px;
}

.craftex-offcanvas__header.has-border {
	border-bottom: 1px solid rgba(62, 63, 63, 0.08);
}

.craftex-offcanvas .craftex-offcanvas__close-btn {
	cursor: pointer;
	padding: 8px 0;
	color: #3E3F3F !important;
	font-size: 20px;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: transparent !important;
	border: 0 !important;
	outline: none;
	transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.craftex-offcanvas .craftex-offcanvas__close-btn i,
.craftex-offcanvas .craftex-offcanvas__close-btn svg {
	color: #3E3F3F !important;
	fill: currentColor;
	stroke: currentColor;
}

.craftex-offcanvas .craftex-offcanvas__close-btn:hover {
	opacity: 0.6;
	transform: scale(1.06);
	background: transparent !important;
	color: #3E3F3F !important;
}

.craftex-offcanvas .craftex-offcanvas__close-btn:focus,
.craftex-offcanvas .craftex-offcanvas__close-btn:active {
	background: transparent !important;
	color: #3E3F3F !important;
	box-shadow: none !important;
	outline: none;
}

.craftex-offcanvas .craftex-offcanvas__close-btn:focus-visible {
	background: transparent !important;
	color: #3E3F3F !important;
	box-shadow: none !important;
	outline: 2px solid #1D82EA !important;
	outline-offset: 3px;
	opacity: 1;
}

.craftex-offcanvas__close-btn svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
	stroke: currentColor;
	stroke-width: 1.5;
}

/* Drawer Body — Materials Side Padding: 72px (matching editorial intro widget) */
.craftex-offcanvas--left .craftex-offcanvas__body {
	padding: 40px 72px 72px 72px;
	flex-grow: 1;
	box-sizing: border-box;
	overflow-x: hidden;
	overflow-y: auto;
}

/* Drawer Body — Menu Drawer Padding */
.craftex-offcanvas--right .craftex-offcanvas__body {
	padding: 40px;
	flex-grow: 1;
	box-sizing: border-box;
	overflow-x: hidden;
	overflow-y: auto;
	display: flex;
	align-items: flex-start;
}

.craftex-offcanvas__body.is-vertically-centered {
	display: flex;
	align-items: center;
}

.craftex-offcanvas__body.is-vertically-centered .craftex-materials-grid {
	width: 100%;
}

.craftex-offcanvas--right .craftex-offcanvas__body.is-vertically-centered>* {
	width: 100%;
}

.craftex-offcanvas--right .craftex-offcanvas__body>* {
	width: 100%;
}

/* Smooth Cinematic Staggered Content Entrance */
.craftex-offcanvas__body>* {
	opacity: 0;
	transform: translate3d(0, 20px, 0);
	will-change: opacity, transform;
	transition: opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1),
		transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
	transition-delay: 0s;
}

.craftex-offcanvas.is-active .craftex-offcanvas__body>* {
	opacity: 1;
	transform: translate3d(0, 0, 0);
	transition-delay: 0.22s;
}

/* ==========================================================================
   Materials Offcanvas Content Layout (Built-in Repeater)
   ========================================================================== */
.craftex-materials-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 90px;
	align-items: stretch;
}

.craftex-material-card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	width: 220px;
}

.craftex-material-card__brand-header {
	width: 100%;
	padding-bottom: 12px;
	border-bottom: 1px solid rgba(62, 63, 63, 0.3);
	margin-bottom: 16px;
	display: flex;
	align-items: center;
	min-height: 36px;
}

.craftex-material-card__brand-logo {
	max-height: 32px;
	width: auto;
	object-fit: contain;
}

.craftex-material-card__brand-title {
	font-family: "Aeoniktrial", "Helvetica Neue", Arial, sans-serif;
	font-size: 20px;
	font-weight: 400;
	margin: 0;
	color: #3E3F3F;
}

.craftex-material-card__list {
	list-style: none;
	padding: 0;
	margin: 0 0 24px 0;
	display: flex;
	flex: 1 1 0;
	flex-direction: column;
	gap: 8px;
	width: 100%;
}

.craftex-material-card__item {
	font-family: "Aeoniktrial", "Helvetica Neue", Arial, sans-serif;
	font-size: 14px;
	font-weight: 300;
	color: rgba(62, 63, 63, 1);
	line-height: 1.4;
}

.craftex-offcanvas .craftex-material-card__browse-btn,
.craftex-material-card__browse-btn {
	display: inline-flex;
	width: 216px;
	max-width: 100%;
	min-height: 44px;
	align-items: center;
	justify-content: center;
	gap: 16px;
	padding: 8px 16px;
	border-width: 1px;
	border-style: solid;
	border-color: #3E3F3F;
	background: transparent;
	color: #3E3F3F;
	font-family: "OCRBLetterpressMW01-Regular", "OCR B Std", "Courier New", monospace;
	font-size: 11px;
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: 0.14em;
	text-align: center;
	text-transform: uppercase;
	transition: color 240ms cubic-bezier(0.22, 1, 0.36, 1), background-color 240ms cubic-bezier(0.22, 1, 0.36, 1), border-color 240ms cubic-bezier(0.22, 1, 0.36, 1);
	margin-top: auto;
	cursor: pointer;
}

.craftex-offcanvas .craftex-material-card__browse-btn:hover,
.craftex-offcanvas .craftex-material-card__browse-btn:focus-visible {
	background-color: #3E3F3F;
	color: #FFFFFF;
	border-color: #3E3F3F;
}

.craftex-offcanvas .craftex-material-card__browse-btn:focus-visible {
	outline: 2px solid #1D82EA;
	outline-offset: 3px;
}

.craftex-material-card__browse-btn svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.craftex-material-card__browse-btn i {
	font-size: inherit;
	line-height: 1;
}

.craftex-material-card__browse-btn .craftex-editorial-intro__cta-icon {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.craftex-material-card__browse-btn:hover .craftex-editorial-intro__cta-icon--right,
.craftex-material-card__browse-btn:focus-visible .craftex-editorial-intro__cta-icon--right {
	transform: translate3d(3px, -3px, 0);
}

/* ==========================================================================
   Menu Offcanvas Content Layout (Built-in Repeater & WP Nav Menu)
   ========================================================================== */
.craftex-menu-list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.craftex-menu-item__link {
	display: block;
	font-family: "OCRBLetterpressMW01-Regular", "OCR B Std", "Courier New", monospace;
	font-size: 14px;
	font-weight: 400;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	color: #3E3F3F !important;
	padding: 8px 0;
	transition: color 0.2s ease, opacity 0.2s ease;
	cursor: pointer;
}

.craftex-menu-item__link:hover,
.craftex-menu-item__link:focus-visible {
	color: #1D82EA !important;
	opacity: 0.85;
}

/* Native WP Nav Menu Integration Styling */
.craftex-offcanvas__wp-menu {
	width: 100%;
}

.craftex-offcanvas__wp-menu ul {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.craftex-offcanvas__wp-menu a {
	font-family: "OCRBLetterpressMW01-Regular", "OCR B Std", "Courier New", monospace;
	font-size: 14px;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	color: #3E3F3F !important;
	padding: 6px 0;
	display: inline-block;
	transition: color 0.2s ease;
}

.craftex-offcanvas__wp-menu a:hover,
.craftex-offcanvas__wp-menu a:focus-visible {
	color: #1D82EA !important;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 1024px) {
	.craftex-offcanvas--left .craftex-offcanvas__header {
		padding: 0 40px;
		height: 64px;
	}

	.craftex-offcanvas--left .craftex-offcanvas__body {
		padding: 32px 40px 64px 40px;
	}
}

@media (max-width: 900px) {
	.craftex-header-nav {
		padding: 0 20px;
		height: 64px;
	}

	.craftex-offcanvas__header {
		height: 64px;
	}

	.craftex-offcanvas--right .craftex-offcanvas__header {
		padding: 0 24px;
	}

	.craftex-offcanvas--right .craftex-offcanvas__body {
		padding: 24px;
	}

	.craftex-offcanvas--left {
		width: 90vw;
		max-width: 100%;
	}

	.craftex-offcanvas--right {
		width: 85vw;
		min-width: 280px;
	}

	.craftex-materials-grid {
		gap: 32px;
	}

	.craftex-material-card {
		width: 100%;
	}
}

@media (max-width: 767px) {
	.craftex-offcanvas--left .craftex-offcanvas__header {
		padding: 0 20px;
		height: 64px;
	}

	.craftex-offcanvas--left .craftex-offcanvas__body {
		padding: 24px 20px 56px 20px;
	}
}

@media (max-width: 600px) {

	.craftex-offcanvas--left,
	.craftex-offcanvas--right {
		width: 100vw;
	}

	.craftex-offcanvas--right .craftex-offcanvas__header {
		padding: 0 20px;
	}

	.craftex-offcanvas--right .craftex-offcanvas__body {
		padding: 20px;
	}
}