/**
 * GIREMRUS corporate header — Stage 2A (.girem-block-header namespace only).
 */

/* Defensive fallback only — the real fix is whb_generate_header() being
   overridden in inc/theme/header-corporate.php so the native WoodMart
   header markup no longer renders on corporate-header pages at all. This
   rule stays as a safety net in case some other code path still emits it. */
body.giremrus-corporate-header .whb-header,
body.giremrus-corporate-header .whb-sticky-prepared,
body.giremrus-corporate-header .wd-header-main-nav {
	display: none !important;
}

.girem-block-header {
	--girem-block-header-h: var(--girem-header-height, 78px);
	--girem-block-header-shell: var(--girem-header-shell, 1440px);
	--girem-block-header-border: var(--girem-header-border, #eceff5);
	--girem-block-header-cta: var(--girem-header-cta, #5b3df5);
	--girem-block-header-cta-hover: var(--girem-header-cta-hover, #5236dd);
	font-family: var(--girem-header-font, "Inter", system-ui, sans-serif);
}

.girem-block-header__bar {
	position: sticky;
	top: 0;
	z-index: var(--girem-z-header, 300);
	height: var(--girem-block-header-h);
	background: #fff;
	border-bottom: 1px solid var(--girem-block-header-border);
	transition: box-shadow 0.2s ease;
}

.girem-block-header.is-scrolled .girem-block-header__bar {
	box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
}

.girem-block-header__shell {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	width: min(var(--girem-block-header-shell), calc(100% - 48px));
	height: var(--girem-block-header-h);
	margin: 0 auto;
}

.girem-block-header__logo {
	flex: 0 0 auto;
	display: block;
	width: var(--girem-logo-width, 162px);
	max-width: var(--girem-logo-width, 162px);
	line-height: 0;
}

.girem-block-header__logo img {
	display: block;
	width: var(--girem-logo-width, 162px);
	height: var(--girem-logo-height, 48px);
	max-width: 100%;
	object-fit: contain;
	object-position: left center;
}

.girem-block-header__nav {
	display: none;
	align-items: center;
	justify-content: center;
	gap: 8px;
	flex: 1 1 auto;
	min-width: 0;
}

.girem-block-header__nav-link {
	display: inline-flex;
	align-items: center;
	min-height: 38px;
	padding: 8px 20px;
	color: #1f2937;
	font-size: var(--girem-header-nav-size, 15px);
	font-weight: 600;
	line-height: 1.25;
	text-decoration: none;
	border-radius: 8px;
	white-space: nowrap;
	transition: color 0.15s ease, background-color 0.15s ease;
}

.girem-block-header__nav-link:hover {
	color: var(--girem-block-header-cta);
	background: rgba(91, 61, 245, 0.06);
}

.girem-block-header__nav-link:focus-visible {
	outline: 2px solid var(--girem-block-header-cta);
	outline-offset: 2px;
}

.girem-block-header__actions {
	display: none;
	align-items: center;
	gap: 14px;
	flex: 0 0 auto;
}

.girem-block-header__contact {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 1px;
}

.girem-block-header__phone {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: #111827;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.15;
	text-decoration: none;
	white-space: nowrap;
	transition: color 0.15s ease;
}

.girem-block-header__phone:hover {
	color: var(--girem-block-header-cta);
}

.girem-block-header__hours {
	color: #6b7280;
	font-size: 11px;
	font-weight: 500;
	line-height: 1.2;
	white-space: nowrap;
}

/* Catalog button — reset browser button styles, keep nav-link look */
button.girem-block-header__nav-link {
	background: none;
	border: none;
	cursor: pointer;
	font-family: inherit;
	font-size: inherit;
}

.girem-block-header__nav-link--catalog {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px 8px 12px;
	background: #f3f4f6;
	border: 1px solid #e5e7eb;
}

.girem-block-header__nav-link--catalog:hover {
	background: #eef2ff;
	border-color: rgba(91, 61, 245, 0.2);
}

/* Chevron rotates when mega is open */
.girem-block-header__nav-link--catalog[aria-expanded="true"] .girem-block-header__nav-chevron svg {
	transform: rotate(180deg);
}
.girem-block-header__nav-chevron svg {
	transition: transform 0.18s ease;
}

.girem-block-header__nav-icon,
.girem-block-header__nav-chevron {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	opacity: 0.85;
}

.girem-block-header__phone-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	opacity: 0.8;
}

.girem-block-header__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 54px;
	padding: 0 30px;
	border-radius: 10px;
	background: linear-gradient(180deg, #5b3df5 0%, #4a2fe0 100%);
	color: #fff !important;
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none !important;
	white-space: nowrap;
	box-shadow: 0 8px 22px rgba(91, 61, 245, 0.28);
	transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.girem-block-header__cta:hover {
	background: var(--girem-block-header-cta-hover);
	box-shadow: 0 12px 28px rgba(91, 61, 245, 0.34);
	transform: translateY(-1px);
}

.girem-block-header__cta:focus-visible {
	outline: 2px solid var(--girem-block-header-cta);
	outline-offset: 2px;
}

.girem-block-header__burger {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	margin-left: auto;
	padding: 0;
	border: 1px solid var(--girem-block-header-border);
	border-radius: 10px;
	background: #fff;
	cursor: pointer;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.girem-block-header__burger span {
	display: block;
	width: 18px;
	height: 2px;
	margin: 0 auto;
	background: #111827;
	border-radius: 2px;
	transition: transform 0.15s ease, opacity 0.15s ease;
}

.girem-block-header__burger:hover {
	border-color: rgba(91, 61, 245, 0.25);
}

.girem-block-header__burger:focus-visible {
	outline: 2px solid var(--girem-block-header-cta);
	outline-offset: 2px;
}

.girem-block-header__drawer {
	position: fixed;
	inset: 0;
	z-index: calc(var(--girem-z-header, 300) + 1);
	background: rgba(15, 23, 42, 0.45);
}

.girem-block-header__drawer[hidden] {
	display: none;
}

.girem-block-header__drawer-inner {
	position: absolute;
	top: 0;
	right: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
	width: min(320px, 100%);
	height: 100%;
	padding: 20px 20px 24px;
	background: #fff;
	box-shadow: -8px 0 32px rgba(15, 23, 42, 0.12);
	overflow-y: auto;
}

.girem-block-header__drawer-link {
	display: block;
	padding: 14px 12px;
	color: #1f2937;
	font-size: 16px;
	font-weight: 600;
	text-decoration: none;
	border-radius: 8px;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.girem-block-header__drawer-link:hover {
	color: var(--girem-block-header-cta);
	background: rgba(91, 61, 245, 0.06);
}

.girem-block-header__drawer-contact {
	margin-top: 12px;
	padding: 12px;
	border-top: 1px solid var(--girem-block-header-border);
}

.girem-block-header__cta--drawer {
	width: 100%;
	margin-top: 16px;
}

body.girem-block-header-nav-open {
	overflow: hidden;
}

@media (min-width: 1100px) {
	.girem-block-header__nav,
	.girem-block-header__actions {
		display: flex;
	}

	.girem-block-header__burger {
		display: none;
	}
}

@media (max-width: 1099px) {
	.girem-block-header__shell {
		width: min(var(--girem-block-header-shell), calc(100% - 32px));
		gap: 12px;
	}

	.girem-block-header__burger {
		order: 1;
		display: flex;
		margin-left: 0;
	}

	.girem-block-header__logo {
		order: 2;
		flex: 1 1 auto;
		width: var(--girem-logo-max-width-tablet, 148px);
		max-width: var(--girem-logo-max-width-tablet, 148px);
	}

	.girem-block-header__logo img {
		width: var(--girem-logo-max-width-tablet, 148px);
		height: var(--girem-logo-height-tablet, 44px);
	}

	.girem-block-header__actions {
		order: 3;
		display: flex;
		margin-left: 0;
	}

	.girem-block-header__contact {
		display: none;
	}

	.girem-block-header__actions .girem-block-header__cta {
		display: inline-flex;
	}
}

@media (max-width: 767px) {
	.girem-block-header__shell {
		width: calc(100% - 24px);
	}

	.girem-block-header__logo {
		width: var(--girem-logo-max-width-mobile, 135px);
		max-width: var(--girem-logo-max-width-mobile, 135px);
	}

	.girem-block-header__logo img {
		width: var(--girem-logo-max-width-mobile, 135px);
		height: var(--girem-logo-height-mobile, 40px);
	}

	.girem-block-header__actions .girem-block-header__cta {
		display: inline-flex;
		min-height: 40px;
		padding: 0 14px;
		font-size: 13px;
	}
}

@media (min-width: 768px) and (max-width: 1099px) {
	.girem-block-header__actions .girem-block-header__cta {
		display: inline-flex;
	}
}
