/* ==========================================================================
   CubeWorldUSA custom header (replaces Elementor/HFE header)
   ========================================================================== */

:root {
	--cwu-blue: #0010a1;
	--cwu-red: #df2e26;
	--cwu-text: #333333;
	--cwu-header-h-pad: 24px;
}

.cwu-header {
	background: #ffffff;
	border-bottom: 1px solid #eaeaea;
	position: relative;
	z-index: 100;
}

/* Top gradient ribbon - visible on all breakpoints, wraps on narrow screens */
.cwu-header__ribbon {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px 20px;
	background: linear-gradient(180deg, #0414a4 0%, #df2e26 71%);
	padding: 10px 16px;
	color: #ffffff;
}

.cwu-header__ribbon-text {
	flex: 1 1 100%;
	order: 1;
	text-align: center;
	font-size: 12px;
	font-weight: 500;
	line-height: 1.3;
}

.cwu-header__ribbon-link {
	order: 2;
	display: flex;
	align-items: center;
	gap: 6px;
	color: #ffffff;
	text-decoration: none;
	font-weight: 600;
	font-size: 13px;
	white-space: nowrap;
}

.cwu-header__ribbon-link i {
	font-size: 18px;
}

.cwu-header__search {
	order: 2;
	display: flex;
	align-items: center;
}

.cwu-header__search-input {
	width: 0;
	opacity: 0;
	border: 0;
	border-radius: 4px 0 0 4px;
	padding: 0;
	transition: width 0.2s ease, opacity 0.2s ease, padding 0.2s ease;
}

.cwu-header__search.is-open .cwu-header__search-input {
	width: 120px;
	opacity: 1;
	padding: 6px 10px;
}

@media (min-width: 992px) {
	.cwu-header__search.is-open .cwu-header__search-input {
		width: 180px;
	}
}

.cwu-header__search-btn {
	background: transparent;
	border: 0;
	color: #ffffff;
	font-size: 16px;
	cursor: pointer;
	padding: 4px;
}

.cwu-header__row {
	max-width: 1400px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	padding: 0 var(--cwu-header-h-pad);
}

.cwu-header__row--main {
	justify-content: space-between;
	gap: 16px;
	padding-top: 8px;
	padding-bottom: 8px;
}

.cwu-header__logo {
	flex: 0 0 auto;
}

.cwu-header__logo img {
	display: block;
	height: auto !important;
	width: clamp(90px, 10vw, 160px) !important;
	max-width: none !important;
	aspect-ratio: 500 / 239;
	object-fit: contain;
}

.cwu-header__site-name {
	font-size: 22px;
	font-weight: 700;
	color: var(--cwu-text);
	text-decoration: none;
}

/* Desktop nav */
.cwu-header__nav {
	display: none;
	flex: 1 1 auto;
	min-width: 0;
}

.cwu-menu {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 4px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.cwu-menu li {
	position: relative;
}

.cwu-menu a {
	display: block;
	padding: 10px 12px;
	color: var(--cwu-text);
	text-decoration: none;
	font-weight: 600;
	font-size: 15px;
	white-space: nowrap;
}

.cwu-menu a:hover,
.cwu-menu a:focus {
	color: var(--cwu-blue);
}

.cwu-menu .sub-menu {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 240px;
	background: #ffffff;
	border: 1px solid #eaeaea;
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
	list-style: none;
	margin: 0;
	padding: 8px 0;
	z-index: 10;
}

.cwu-menu li:hover > .sub-menu,
.cwu-menu li:focus-within > .sub-menu {
	display: block;
}

.cwu-menu .sub-menu a {
	white-space: normal;
	padding: 8px 16px;
	font-size: 14px;
	font-weight: 500;
}

/* Mobile toggle button */
.cwu-header__toggle {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	cursor: pointer;
}

.cwu-header__toggle-bar {
	display: block;
	height: 3px;
	width: 100%;
	background: var(--cwu-blue);
	border-radius: 2px;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.cwu-header.is-menu-open .cwu-header__toggle-bar:nth-child(1) {
	transform: translateY(8px) rotate(45deg);
}
.cwu-header.is-menu-open .cwu-header__toggle-bar:nth-child(2) {
	opacity: 0;
}
.cwu-header.is-menu-open .cwu-header__toggle-bar:nth-child(3) {
	transform: translateY(-8px) rotate(-45deg);
}

/* Corner block: logo | nav | corner, all in the main row (desktop) */
.cwu-header__corner {
	display: none;
	flex: 0 0 auto;
	align-items: center;
	gap: 14px;
}

.cwu-header__call-btn {
	background: var(--cwu-blue);
	color: #ffffff;
	text-decoration: none;
	font-weight: 700;
	font-size: 13px;
	padding: 8px 14px;
	border-radius: 4px;
	white-space: nowrap;
}

.cwu-header__phone {
	color: var(--cwu-red);
	font-weight: 700;
	text-decoration: none;
	font-size: 14px;
	white-space: nowrap;
}

.cwu-header__cart {
	position: relative;
	display: inline-flex;
	color: var(--cwu-blue);
	text-decoration: none;
}

/* Mobile-only corner cluster: cart + phone icon + hamburger */
.cwu-header__mobile-actions {
	display: flex;
	align-items: center;
	gap: 14px;
	flex: 0 0 auto;
}

.cwu-header__phone-icon {
	color: var(--cwu-blue);
	font-size: 18px;
	display: inline-flex;
}

.cwu-header__cart-count {
	position: absolute;
	top: -8px;
	right: -10px;
	background: var(--cwu-red);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	border-radius: 50%;
	min-width: 16px;
	height: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2px;
}

/* Mobile nav panel (collapsed by default) */
.cwu-header__mobile-nav {
	display: none;
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.25s ease;
}

.cwu-header.is-menu-open .cwu-header__mobile-nav {
	display: block;
	max-height: 80vh;
	overflow-y: auto;
}

.cwu-menu--mobile {
	display: block;
	list-style: none;
	margin: 0;
	padding: 0;
	border-top: 1px solid #eaeaea;
}

.cwu-menu--mobile li {
	border-bottom: 1px solid #eaeaea;
}

.cwu-menu--mobile > li > a {
	padding: 14px var(--cwu-header-h-pad);
}

.cwu-menu--mobile a {
	display: block;
	color: var(--cwu-text);
	text-decoration: none;
	font-weight: 600;
}

.cwu-menu--mobile .sub-menu {
	display: none;
	list-style: none;
	margin: 0;
	padding: 0 0 8px var(--cwu-header-h-pad);
	background: #fafafa;
}

.cwu-menu--mobile .sub-menu a {
	padding: 10px 8px;
	font-weight: 500;
	font-size: 14px;
}

.cwu-menu--mobile .menu-item-has-children {
	position: relative;
}

.cwu-menu--mobile .cwu-submenu-toggle {
	position: absolute;
	top: 0;
	right: 0;
	width: 48px;
	height: 48px;
	background: transparent;
	border: 0;
	cursor: pointer;
	font-size: 18px;
	color: var(--cwu-text);
}

.cwu-menu--mobile .menu-item-has-children.is-open > .sub-menu {
	display: block;
}

.cwu-menu--mobile .menu-item-has-children.is-open > .cwu-submenu-toggle {
	transform: rotate(180deg);
}

/* ==========================================================================
   Desktop breakpoint
   ========================================================================== */
/* Mobile (default): nav/corner hidden, hamburger cluster shown */
.cwu-header__nav,
.cwu-header__corner {
	display: none;
}

@media (min-width: 992px) {
	.cwu-header__ribbon {
		flex-wrap: nowrap;
		padding: 10px 24px;
	}

	.cwu-header__ribbon-text {
		flex: 1 1 auto;
		order: 0;
		text-align: left;
		font-size: 13px;
	}

	.cwu-header__ribbon-link {
		font-size: 15px;
	}

	.cwu-header__ribbon-link i {
		font-size: 22px;
	}

	.cwu-header__nav {
		display: flex;
	}

	.cwu-header__corner {
		display: flex;
	}

	.cwu-header__toggle,
	.cwu-header__mobile-nav,
	.cwu-header__mobile-actions {
		display: none !important;
	}
}
