/**
 * DinnerlyHub - Header Layout
 * Sticky header with accent bar, animated logo, and desktop/mobile nav.
 */

/* Scoped reset */
.dh-header *,
.dh-header *::before,
.dh-header *::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

/* ==========================================================================
   HEADER - Main Container
   ========================================================================== */

.dh-header {
	position: sticky;
	top: 0;
	z-index: 9999;
	width: 100%;
	background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(255,255,255,0.95) 100%);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	box-shadow: 0 1px 0 var(--dh-green-border);
	font-family: var(--dh-font);
	transition: box-shadow var(--dh-ease);
}

.dh-header.is-scrolled {
	box-shadow: var(--dh-shadow-md);
}

/* Top accent bar */
.dh-header__accent {
	height: 3px;
	background: linear-gradient(90deg, var(--dh-green) 0%, var(--dh-orange) 50%, var(--dh-green) 100%);
	background-size: 200% 100%;
	animation: headerAccentShift 8s ease-in-out infinite;
}

@keyframes headerAccentShift {
	0%, 100% { background-position: 0% 0; }
	50% { background-position: 100% 0; }
}

.dh-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	max-width: var(--dh-max-width);
	margin: 0 auto;
	padding: 0 24px;
	height: var(--dh-header-h);
	gap: 24px;
}

/* ==========================================================================
   LOGO - With animated ring
   ========================================================================== */

.dh-logo {
	display: flex;
	align-items: center;
	gap: 12px;
	text-decoration: none;
	flex-shrink: 0;
	position: relative;
}

.dh-logo__icon-wrap {
	position: relative;
	width: 44px;
	height: 44px;
}

.dh-logo__icon {
	width: 44px;
	height: 44px;
	transition: transform 0.3s ease;
}

.dh-logo img.custom-logo.dh-logo__icon {
	width: 44px;
	height: 44px;
	max-width: 44px;
	object-fit: contain;
	display: block;
}

.dh-logo:hover .dh-logo__icon {
	transform: rotate(-5deg) scale(1.05);
}

/* Animated ring around logo */
.dh-logo__ring {
	position: absolute;
	inset: -4px;
	border: 2px dashed var(--dh-green-border);
	border-radius: 50%;
	opacity: 0;
	transition: opacity 0.3s ease, transform 0.5s ease;
}

.dh-logo:hover .dh-logo__ring {
	opacity: 1;
	animation: logoRingSpin 8s linear infinite;
}

@keyframes logoRingSpin {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}

.dh-logo__text {
	display: flex;
	flex-direction: column;
}

.dh-logo__name {
	font-size: 1.35rem;
	font-weight: 700;
	font-family: var(--dh-font-heading, 'Poppins', sans-serif);
	color: var(--dh-green);
	letter-spacing: -0.5px;
	line-height: 1.1;
}

.dh-logo__tagline {
	font-size: 0.7rem;
	color: var(--dh-text-muted);
	letter-spacing: 0.5px;
}

.dh-logo:focus-visible {
	outline: 2px solid var(--dh-green);
	outline-offset: 4px;
	border-radius: var(--dh-radius-sm);
}

/* Custom uploaded logo */
.dh-logo__custom {
	height: 48px;
	width: auto;
	max-width: 200px;
	object-fit: contain;
	display: block;
	transition: transform 0.3s ease;
}

.dh-logo:hover .dh-logo__custom {
	transform: scale(1.03);
}

/* ==========================================================================
   DESKTOP NAV
   ========================================================================== */

.dh-nav {
	display: flex;
	align-items: center;
	margin-left: auto;
}

.dh-nav__list {
	display: flex;
	align-items: center;
	gap: 4px;
	list-style: none;
}

.dh-nav__item {
	position: relative;
}

.dh-nav__link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 16px;
	font-size: 0.9rem;
	font-weight: 600;
	font-family: var(--dh-font-heading, 'Poppins', sans-serif);
	color: var(--dh-text);
	text-decoration: none;
	border-radius: var(--dh-radius-md);
	white-space: nowrap;
	position: relative;
	transition: color var(--dh-ease), background var(--dh-ease);
}

.dh-nav__link-icon {
	width: 16px;
	height: 16px;
	opacity: 0.6;
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.dh-nav__link:hover .dh-nav__link-icon {
	opacity: 1;
	transform: translateY(-1px);
}

/* Animated underline dot */
.dh-nav__link::after {
	content: '';
	position: absolute;
	bottom: 6px;
	left: 50%;
	width: 4px;
	height: 4px;
	background: var(--dh-orange);
	border-radius: 50%;
	transform: translateX(-50%) scale(0);
	transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dh-nav__link:hover {
	color: var(--dh-green);
	background: var(--dh-green-subtle);
}

.dh-nav__link:hover::after {
	transform: translateX(-50%) scale(1);
}

.dh-nav__link[aria-current="page"] {
	color: var(--dh-green);
	background: var(--dh-green-subtle);
}

.dh-nav__link[aria-current="page"]::after {
	transform: translateX(-50%) scale(1);
}

.dh-nav__link:focus-visible {
	outline: 2px solid var(--dh-green);
	outline-offset: 2px;
}

/* Nav Divider */
.dh-nav__divider {
	width: 1px;
	height: 28px;
	background: linear-gradient(180deg, transparent 0%, var(--dh-green-border) 50%, transparent 100%);
	margin: 0 8px;
}

/* Nav separator (legacy support) */
.dh-nav__separator {
	width: 1px;
	height: 28px;
	background: linear-gradient(180deg, transparent 0%, var(--dh-green-border) 50%, transparent 100%);
	flex-shrink: 0;
	margin: 0 8px;
}

/* Search Button */
.dh-nav__search {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	background: var(--dh-green-subtle);
	border: none;
	border-radius: 50%;
	color: var(--dh-green);
	cursor: pointer;
	transition: all 0.3s ease;
}

.dh-nav__search:hover {
	background: var(--dh-green);
	color: var(--dh-white);
	transform: scale(1.05);
}

.dh-nav__search:focus-visible {
	outline: 2px solid var(--dh-green);
	outline-offset: 3px;
}

/* ==========================================================================
   CTA BUTTON - Gradient Orange
   ========================================================================== */

.dh-nav__cta,
.dh-nav__link--cta {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 24px;
	background: linear-gradient(135deg, var(--dh-orange) 0%, var(--dh-orange-dark) 100%);
	color: var(--dh-white) !important;
	font-size: 0.9rem;
	font-weight: 700;
	font-family: var(--dh-font-heading, 'Poppins', sans-serif);
	border-radius: var(--dh-radius-pill);
	text-decoration: none;
	box-shadow: 0 4px 16px rgba(242, 101, 34, 0.35);
	transition: all 0.3s ease;
	position: relative;
	overflow: hidden;
}

.dh-nav__cta::before,
.dh-nav__link--cta::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.dh-nav__cta:hover,
.dh-nav__link--cta:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(242, 101, 34, 0.45);
	color: var(--dh-orange) !important;
	border: 1px solid var(--dh-orange);
	
}

.dh-nav__cta:hover::before,
.dh-nav__link--cta:hover::before {
	opacity: 1;
}

.dh-nav__cta::after,
.dh-nav__link--cta::after {
	display: none;
}

.dh-nav__cta-icon {
	width: 16px;
	height: 16px;
	transition: transform 0.3s ease;
}

.dh-nav__cta:hover .dh-nav__cta-icon {
	transform: translateX(3px);
}

.dh-nav__cta:focus-visible,
.dh-nav__link--cta:focus-visible {
	outline: 2px solid var(--dh-orange);
	outline-offset: 3px;
}

/* About button - outlined green pill (legacy support) */
.dh-nav__link--about {
	border: 2px solid var(--dh-green);
	color: var(--dh-green) !important;
	padding: 10px 20px;
	border-radius: var(--dh-radius-pill);
	font-weight: 700;
	background: transparent;
	transition: background var(--dh-ease), color var(--dh-ease),
	            transform var(--dh-ease), box-shadow var(--dh-ease);
}

.dh-nav__link--about::after {
	display: none;
}

.dh-nav__link--about:hover {
	background: var(--dh-green);
	color: var(--dh-white) !important;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(74, 124, 89, 0.30);
}

.dh-nav__link--about[aria-current="page"] {
	background: var(--dh-green);
	color: var(--dh-white) !important;
}

/* ==========================================================================
   HAMBURGER BUTTON
   ========================================================================== */

.dh-burger {
	display: none;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 5px;
	width: 44px;
	height: 44px;
	padding: 8px;
	background: var(--dh-green-subtle);
	border: none;
	border-radius: var(--dh-radius-md);
	cursor: pointer;
	flex-shrink: 0;
	transition: background 0.3s ease;
}

.dh-burger:hover {
	background: var(--dh-green);
}

.dh-burger:hover .dh-burger__bar {
	background: var(--dh-white);
}

.dh-burger:focus-visible {
	outline: 2px solid var(--dh-green);
	outline-offset: 3px;
}

.dh-burger__bar {
	display: block;
	width: 20px;
	height: 2px;
	background: var(--dh-green);
	border-radius: 2px;
	transition: all 0.3s ease;
}

/* Animated X */
.dh-burger[aria-expanded="true"] .dh-burger__bar:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
	background: var(--dh-green);
}

.dh-burger[aria-expanded="true"] .dh-burger__bar:nth-child(2) {
	opacity: 0;
	transform: scaleX(0);
}

.dh-burger[aria-expanded="true"] .dh-burger__bar:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
	background: var(--dh-green);
}

/* ==========================================================================
   MOBILE MENU
   ========================================================================== */

.dh-mobile-menu {
	display: block;
	background: var(--dh-white);
	border-top: 1px solid var(--dh-green-border);
	height: 0;
	overflow: hidden;
	opacity: 0;
	transform: translateY(-6px);
	pointer-events: none;
	transition: opacity var(--dh-ease), transform var(--dh-ease);
}

.dh-mobile-menu.is-open {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
	overflow: visible;
}

.dh-mobile-menu__list {
	list-style: none;
	padding: 10px 16px 18px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.dh-mobile-menu__link {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 16px;
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--dh-text);
	text-decoration: none;
	border-radius: var(--dh-radius-sm);
	transition: color var(--dh-ease), background var(--dh-ease);
}

.dh-mobile-menu__link:hover,
.dh-mobile-menu__link[aria-current="page"] {
	color: var(--dh-green);
	background: var(--dh-green-subtle);
}

.dh-mobile-menu__link:focus-visible {
	outline: 2px solid var(--dh-green);
	outline-offset: 3px;
	border-radius: var(--dh-radius-sm);
}

.dh-mobile-menu__divider {
	height: 1px;
	background: var(--dh-green-border);
	margin: 6px 16px;
}

/* Mobile About button */
.dh-mobile-menu__link--about {
	border: 2px solid var(--dh-green);
	color: var(--dh-green) !important;
	border-radius: var(--dh-radius-pill);
	justify-content: center;
	margin-top: 4px;
}

.dh-mobile-menu__link--about:hover,
.dh-mobile-menu__link--about[aria-current="page"] {
	background: var(--dh-green);
	color: var(--dh-white) !important;
}

/* Mobile CTA button */
.dh-mobile-menu__link--cta {
	background: linear-gradient(135deg, var(--dh-orange) 0%, var(--dh-orange-dark) 100%);
	color: var(--dh-white) !important;
	border-radius: var(--dh-radius-pill);
	justify-content: center;
	margin-top: 4px;
	box-shadow: 0 2px 10px rgba(242, 101, 34, 0.25);
}

.dh-mobile-menu__link--cta:hover {
	background: linear-gradient(135deg, var(--dh-orange-dark) 0%, var(--dh-orange-dark) 100%);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 960px) {
	.dh-nav {
		display: none;
	}

	.dh-burger {
		display: flex;
	}
}

@media (max-width: 768px) {
	.dh-header__inner {
		padding: 0 20px;
	}
}

@media (max-width: 540px) {
	.dh-header__inner {
		padding: 0 16px;
	}

	.dh-logo__tagline {
		display: none;
	}

	.dh-logo__name {
		font-size: 1.1rem;
	}

	.dh-logo__icon-wrap {
		width: 38px;
		height: 38px;
	}

	.dh-logo__icon {
		width: 38px;
		height: 38px;
	}

	.dh-logo img.custom-logo.dh-logo__icon {
		width: 38px;
		height: 38px;
		max-width: 38px;
	}

	.dh-logo__custom {
		height: 40px;
		max-width: 160px;
	}
}
