﻿/* ==========================================================================
   HEADER.CSS – Header, Navigation, Drawer, Sticky
   ========================================================================== */

/* Haupt-Header-Wrapper
   ========================================================================== */

.site-header {
	position: sticky;
	top: calc(-1 * var(--header-top-height, 70px));
	z-index: 1000;
	width: 100%;
	will-change: transform;
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
}

/* Schicht 1 – Infobar
   ========================================================================== */

.header-infobar {
	background: var(--color-dark-nav);
	padding: 5px 0;
}

.infobar-items {
	display: flex;
	justify-content: space-around;
	align-items: center;
}

.infobar-items span {
	font-size: 12px;
	color: #999;
	letter-spacing: 0.03em;
}

/* Schicht 2 – Standort-Leiste
   ========================================================================== */

.header-standort {
	background: var(--color-standort-bg);
	padding: 6px 0;
}

.standort-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.standort-left {
	display: flex;
	align-items: center;
	gap: 6px;
}

.standort-label {
	font-size: 12px;
	color: #aaa;
	font-weight: 700;
	letter-spacing: 0.08em;
	margin-right: 4px;
}

.standort-btn {
	font-size: 13px;
	padding: 3px 10px;
	border: 1px solid var(--color-border-dark);
	color: #bbb;
	background: transparent;
	cursor: pointer;
	transition: all var(--transition);
	display: inline-block;
}

.standort-btn:hover,
.standort-btn.active {
	background: #555;
	border-color: #555;
	color: var(--color-white);
}

.standort-right {
	display: flex;
	align-items: center;
	gap: 6px;
}

.standort-right a {
	font-size: 12px;
	color: #aaa;
	transition: color var(--transition);
}

.standort-right a:hover {
	color: #aaa;
}

.standort-right span {
	font-size: 12px;
	color: #444;
}

/* Schicht 3 – Logo + Suche + Meta-Navigation
   ========================================================================== */

.header-logo-row {
	background: var(--color-dark);
	padding: 10px 0;
}

.logo-inner {
	display: flex;
	align-items: center;
	gap: 16px;
}

/* Logo */

.logo-link {
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

.logo-img {
	width: 140px;
	height: auto;
	display: block;
}

/* Suchfeld */

.header-search {
	margin-left: auto;
	width: 280px;
	flex-shrink: 0;
}

.search-input-wrap {
	display: flex;
	align-items: center;
	background: #1e1e1e;
	border: 1px solid #333;
	padding: 7px 12px;
	gap: 8px;
}

.search-input-wrap input {
	background: transparent;
	border: none;
	outline: none;
	color: var(--color-text-on-dark);
	font-family: var(--font-main);
	font-size: 14px;
	width: 100%;
}

.search-input-wrap input::placeholder {
	color: #555;
}

.search-icon {
	color: #555;
	flex-shrink: 0;
}

/* Meta-Icons */

.header-meta-icons {
	display: flex;
	align-items: center;
	gap: 18px;
	margin-left: auto;
}

.meta-icon-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3px;
	color: #9a9a9a;
	cursor: pointer;
	transition: color var(--transition);
	position: relative;
}

.meta-icon-item:hover {
	color: var(--color-white);
}

.meta-icon-item svg {
	width: 20px;
	height: 20px;
	stroke: currentColor;
	fill: none;
	stroke-width: 1.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.meta-icon-label {
	font-size: 12px;
	color: #999;
	letter-spacing: 0.03em;
	white-space: nowrap;
}

.cart-badge {
	position: absolute;
	top: -4px;
	right: -8px;
	background: var(--color-red);
	color: var(--color-white);
	font-size: 10px;
	font-weight: 700;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Termin-Buchen Button */

.btn-termin {
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--color-red);
	color: var(--color-white);
	font-family: var(--font-main);
	font-weight: 700;
	font-size: 14px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding: 0 18px;
	height: 52px;
	white-space: nowrap;
	flex-shrink: 0;
	transition: background var(--transition);
}

.btn-termin:hover {
	background: #aa1a1f;
	color: var(--color-white);
}

/* Scroll-Shrink
   ========================================================================== */

.header-sticky-wrap {
	transition: box-shadow 0.3s ease;
}

.header-sticky-wrap.scrolled {
	box-shadow: 0 2px 18px rgba(0, 0, 0, 0.28);
}

.header-sticky-wrap.scrolled .header-logo-row {
	padding: 5px 0;
}

.header-sticky-wrap.scrolled .logo-img {
	width: 108px;
	transition: width 0.3s ease;
}

.header-sticky-wrap.scrolled .btn-termin {
	height: 42px;
	font-size: 13px;
	transition: height 0.3s ease, font-size 0.3s ease;
}

/* Schicht 4 – Hauptnavigation
   ========================================================================== */

.header-mainnav {
	background: var(--color-white);
	border-bottom: 3px solid var(--color-red);
	position: relative;
}

.mainnav {
	display: flex;
	align-items: stretch;
	gap: 0;
	padding: 0;
	margin: 0;
}

.nav-item {
	display: inline-flex;
	align-items: center;
	padding: 12px 16px;
	font-size: 15px;
	font-weight: 700;
	color: var(--color-text-secondary);
	cursor: pointer;
	position: relative;
	transition: color var(--transition);
	white-space: nowrap;
	border-bottom: 3px solid transparent;
	margin-bottom: -3px;
}

.nav-item:hover,
.nav-item.active {
	color: var(--color-black);
	border-bottom-color: var(--color-red);
}

.nav-item.sale {
	color: var(--color-red);
}

.nav-item.sale:hover {
	color: var(--color-red);
	border-bottom-color: var(--color-red);
}

/* Mega-Dropdown
   ========================================================================== */


.mega-dropdown {
	grid-template-columns: repeat(4, 1fr);
	min-width: 760px;
	gap: 0;
	padding: 0 !important;
}

.mega-col {
	padding: 20px 24px;
	border-right: 1px solid #f0f0f0;
}

.mega-col:last-child {
	border-right: none;
}

.mega-col-heading {
	font-size: 13px;
	font-weight: 700;
	color: var(--color-black);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	margin-bottom: 12px;
	padding-bottom: 8px;
	border-bottom: 2px solid var(--color-red);
}

.mega-col a {
	display: block;
	font-size: 15px;
	color: var(--color-text-secondary);
	padding: 5px 0;
	border-bottom: none !important;
	transition: color var(--transition);
}

.mega-col a:hover {
	color: var(--color-red);
}

.mega-col a.mega-link-bold {
	font-weight: 700;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--color-black);
	padding: 5px 0;
}

.mega-col a.mega-link-bold:hover {
	color: var(--color-red);
}

/* Dropdown-Menüs
   ========================================================================== */

.nav-item-wrap.has-dropdown {
	position: relative;
}

.nav-item-wrap.has-dropdown .nav-item {
	padding-right: 22px;
	position: relative;
}

.nav-item-wrap.has-dropdown .nav-item::after {
	content: '';
	display: inline-block;
	width: 0;
	height: 0;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 4px solid currentColor;
	position: absolute;
	right: 8px;
	top: 50%;
	transform: translateY(-50%);
}

.nav-dropdown {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	background: var(--color-white);
	border-top: 3px solid var(--color-red);
	border-bottom: 1px solid #e5e5e5;
	border-left: 1px solid #e5e5e5;
	border-right: 1px solid #e5e5e5;
	padding: 16px 24px;
	min-width: 200px;
	z-index: 999;
	white-space: nowrap;
}

/* Dropdowns werden per JS gesteuert (header.js) */

.nav-dropdown a {
	display: block;
	font-size: 15px;
	color: var(--color-text-secondary);
	padding: 6px 0;
	border-bottom: 1px solid #f0f0f0;
	transition: color var(--transition);
}

.nav-dropdown a:last-child {
	border-bottom: none;
}

.nav-dropdown a:hover {
	color: var(--color-red);
}

/* ==========================================================================
   MOBILE HEADER
   ========================================================================== */

.mobile-header {
	display: none;
}

/* Mobile Infobar */
.mobile-infobar {
	background: var(--color-dark-nav);
	padding: 4px 0;
}

.mobile-infobar-items {
	display: flex;
	justify-content: space-around;
}

.mobile-infobar-items span {
	font-size: 12px;
	color: #999;
}

/* Mobile Standort-Tabs */
.mobile-standort-tabs {
	background: var(--color-standort-bg);
	padding: 6px 0;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.mobile-standort-tabs::-webkit-scrollbar {
	display: none;
}

.mobile-standort-tabs-inner {
	display: flex;
	gap: 6px;
	padding: 0 16px;
	width: max-content;
}

/* Mobile Logo-Zeile */
.mobile-logo-row {
	background: var(--color-dark);
	padding: 10px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.mobile-logo-link {
	display: flex;
	align-items: center;
}

.mobile-logo-img {
	width: 80px;
	height: auto;
	display: block;
}

.mobile-header-right {
	display: flex;
	align-items: center;
	gap: 16px;
}

.mobile-cart-wrap {
	position: relative;
}

.mobile-cart-wrap svg {
	width: 22px;
	height: 22px;
	stroke: #ccc;
	fill: none;
	stroke-width: 1.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.mobile-cart-badge {
	position: absolute;
	top: -4px;
	right: -6px;
	background: var(--color-red);
	color: var(--color-white);
	font-size: 8px;
	font-weight: 700;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.hamburger-btn {
	background: none;
	border: none;
	cursor: pointer;
	padding: 4px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.hamburger-btn span {
	display: block;
	width: 22px;
	height: 2px;
	background: #ccc;
	transition: all var(--transition);
}

/* Mobile Drawer
   ========================================================================== */

.mobile-drawer-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
	z-index: 2000;
}

.mobile-drawer-overlay.open {
	display: block;
}

.mobile-drawer {
	position: fixed;
	top: 0;
	right: 0;
	width: 80%;
	max-width: 360px;
	height: 100vh;
	background: var(--color-dark);
	z-index: 2001;
	transform: translateX(100%);
	transition: transform var(--transition);
	overflow-y: auto;
	display: flex;
	flex-direction: column;
}

.mobile-drawer.open {
	transform: translateX(0);
}

.drawer-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	background: #1e1e1e;
	flex-shrink: 0;
}

.drawer-logo {
	display: flex;
	align-items: center;
}

.drawer-logo-img {
	width: 90px;
	height: auto;
	display: block;
}

.drawer-close {
	background: none;
	border: none;
	color: #aaa;
	font-size: 22px;
	cursor: pointer;
	padding: 4px;
	line-height: 1;
}

.drawer-close:hover {
	color: var(--color-white);
}

.drawer-search {
	padding: 12px 16px;
	border-bottom: 1px solid #333;
}

.drawer-search .search-input-wrap {
	width: 100%;
}

.drawer-standort {
	padding: 10px 16px;
	border-bottom: 1px solid #333;
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}

.drawer-nav {
	flex: 1;
	padding: 8px 0;
}

.drawer-nav-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 16px;
	color: var(--color-text-on-dark);
	font-size: 14px;
	font-weight: 700;
	border-bottom: 1px solid #2a2a2a;
	cursor: pointer;
	transition: color var(--transition);
}

.drawer-nav-item:hover {
	color: var(--color-white);
}

.drawer-nav-item.sale {
	color: var(--color-red);
}

.drawer-nav-item svg {
	width: 16px;
	height: 16px;
	stroke: #555;
	fill: none;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	flex-shrink: 0;
	transition: transform var(--transition);
}

.drawer-nav-item {
	width: 100%;
	background: none;
	border: none;
	text-align: left;
	font-family: var(--font-main);
}

.drawer-accordion-item.open > .drawer-nav-item svg {
	transform: rotate(90deg);
}

.drawer-sub-menu {
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.3s ease;
	background: #1a1a1a;
}

.drawer-accordion-item.open > .drawer-sub-menu {
	max-height: 600px;
}

.drawer-sub-link {
	display: block;
	padding: 10px 16px 10px 24px;
	color: #aaa;
	font-size: 14px;
	border-bottom: 1px solid #222;
	transition: color var(--transition);
}

.drawer-sub-link:hover {
	color: var(--color-white);
}

.drawer-sub-heading {
	display: block;
	padding: 10px 16px 6px 24px;
	color: #999;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.drawer-divider {
	border: none;
	border-top: 1px solid #333;
	margin: 4px 0;
}

.drawer-secondary {
	padding: 8px 16px;
}

.drawer-secondary a {
	display: block;
	font-size: 12px;
	color: #777;
	padding: 6px 0;
}

.drawer-secondary a:hover {
	color: #aaa;
}

.drawer-footer {
	padding: 16px;
	border-top: 1px solid #333;
	flex-shrink: 0;
}

.drawer-footer .btn-primary-red {
	width: 100%;
	text-align: center;
}

/* Sticky Bottom Bar (Mobile)
   ========================================================================== */

.sticky-bottom-bar {
	display: none;
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	background: var(--color-dark);
	border-top: 1px solid #333;
	z-index: 900;
	padding: 6px 0 8px;
}

.sticky-bottom-bar-inner {
	display: flex;
	align-items: flex-end;
	justify-content: space-around;
}

.bottom-bar-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3px;
	color: #777;
	font-size: 9px;
	cursor: pointer;
	transition: color var(--transition);
	padding: 0 8px;
	position: relative;
}

.bottom-bar-item svg {
	width: 22px;
	height: 22px;
	stroke: currentColor;
	fill: none;
	stroke-width: 1.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.bottom-bar-item:hover {
	color: var(--color-white);
}

.bottom-bar-item.cta {
	color: var(--color-white);
	margin-top: -12px;
}

.bottom-bar-cta-circle {
	width: 50px;
	height: 50px;
	background: var(--color-red);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 3px solid var(--color-dark);
}

.bottom-bar-cta-circle svg {
	width: 22px;
	height: 22px;
}

.bottom-bar-cart-badge {
	position: absolute;
	top: -2px;
	right: 2px;
	background: var(--color-red);
	color: var(--color-white);
	font-size: 8px;
	font-weight: 700;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* ==========================================================================
   RESPONSIVE – Breakpoint 768px
   ========================================================================== */

@media (max-width: 768px) {
	.desktop-header {
		display: none;
	}

	.mobile-header {
		display: block;
	}

	.sticky-bottom-bar {
		display: block;
	}

	body {
		padding-bottom: 70px;
	}
}

@media (min-width: 769px) {
	.mobile-drawer-overlay,
	.mobile-drawer,
	.sticky-bottom-bar {
		display: none !important;
	}
}
