/**
 * Navbar — "Sakin cam"
 * Mevcut cam krem header'ın rafine hali: 3 bölgeli hizalama (logo · menü · aksiyon),
 * scroll'da küçülme, "Tedaviler" için cam dropdown, mobilde accordion.
 * theme.css'ten SONRA yüklenir; eş özgüllükte bu dosya kazanır.
 */

.hd-site-header {
	transition:
		min-height .28s cubic-bezier(.22, 1, .36, 1),
		background-color .28s ease,
		box-shadow .28s ease,
		border-color .28s ease;
}

/* Scroll edildiğinde: küçülür ve şeffaflaşır (yoğun blur okunabilirliği korur) */
.hd-site-header.hd-scrolled {
	min-height: 58px;
	background: rgba(251, 247, 239, .48);
	border-bottom-color: rgba(23, 43, 47, .08);
	-webkit-backdrop-filter: blur(22px) saturate(1.4);
	backdrop-filter: blur(22px) saturate(1.4);
	box-shadow: 0 10px 30px -24px rgba(23, 43, 47, .4);
}

.hd-logo-image {
	transition: max-height .28s cubic-bezier(.22, 1, .36, 1);
}
.hd-site-header.hd-scrolled .hd-logo-image {
	max-height: 38px;
}

/* Bulunulan sayfa: alt çizgi dolu kalır */
.hd-primary-nav .hd-menu .current-menu-item > a,
.hd-primary-nav .hd-menu .current-menu-parent > a,
.hd-primary-nav .hd-menu .current-menu-ancestor > a,
.hd-primary-nav .hd-menu .current_page_item > a {
	color: var(--hd-reef);
}
.hd-primary-nav .hd-menu .current-menu-item > a::after,
.hd-primary-nav .hd-menu .current-menu-parent > a::after,
.hd-primary-nav .hd-menu .current-menu-ancestor > a::after {
	transform: scaleX(1);
}

/* ======================= Masaüstü ======================= */
@media (min-width: 981px) {
	.hd-site-header {
		display: grid;
		grid-template-columns: 1fr auto 1fr;
		gap: 28px;
	}
	.hd-brand { justify-self: start; }
	.hd-primary-nav { justify-self: center; }
	.hd-header-actions { justify-self: end; }

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

	.hd-submenu-toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 18px;
		height: 18px;
		margin-left: 2px;
		padding: 0;
		border: 0;
		background: none;
		color: currentColor;
		cursor: pointer;
		vertical-align: middle;
	}
	.hd-submenu-caret {
		width: 11px;
		height: 8px;
		transition: transform .2s ease;
	}
	.hd-menu .menu-item-has-children:hover .hd-submenu-caret,
	.hd-menu .menu-item-has-children:focus-within .hd-submenu-caret {
		transform: rotate(180deg);
	}
	.hd-menu .menu-item-has-children:hover > a,
	.hd-menu .menu-item-has-children:focus-within > a {
		color: var(--hd-reef);
	}

	.hd-sub-menu {
		position: absolute;
		top: calc(100% + 14px);
		left: 50%;
		transform: translateX(-50%) translateY(6px);
		min-width: 246px;
		margin: 0;
		padding: 10px;
		list-style: none;
		background: rgba(255, 253, 248, .97);
		-webkit-backdrop-filter: blur(20px);
		backdrop-filter: blur(20px);
		border: 1px solid var(--hd-line);
		border-left: 2px solid var(--hd-rose);
		border-radius: 14px;
		box-shadow: 0 26px 60px -26px rgba(23, 43, 47, .5);
		opacity: 0;
		visibility: hidden;
		transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s;
		z-index: 60;
	}
	/* fare boşluğu geçebilsin diye görünmez köprü */
	.hd-sub-menu::before {
		content: "";
		position: absolute;
		left: 0;
		right: 0;
		top: -16px;
		height: 16px;
	}
	.hd-menu .menu-item-has-children:hover > .hd-sub-menu,
	.hd-menu .menu-item-has-children:focus-within > .hd-sub-menu,
	.hd-menu .menu-item-has-children.is-open > .hd-sub-menu {
		opacity: 1;
		visibility: visible;
		transform: translateX(-50%) translateY(0);
		transition: opacity .16s ease, transform .16s ease;
	}

	.hd-sub-menu li { margin: 0; }
	.hd-sub-menu a {
		display: block;
		padding: 9px 13px;
		border-radius: 9px;
		color: var(--hd-soft-ink);
		font-size: 14.5px;
		font-weight: 600;
		line-height: 1.35;
		transition: background-color .16s ease, color .16s ease;
	}
	.hd-sub-menu a::after { display: none; }
	.hd-sub-menu a:hover,
	.hd-sub-menu a:focus-visible {
		background: rgba(31, 104, 109, .08);
		color: var(--hd-reef);
	}
	.hd-sub-menu .current-menu-item > a {
		color: var(--hd-reef);
		background: rgba(31, 104, 109, .06);
	}
	.hd-sub-menu .hd-submenu-all {
		margin-top: 6px;
		padding-top: 6px;
		border-top: 1px solid var(--hd-line);
	}
	.hd-sub-menu .hd-submenu-all a {
		color: var(--hd-reef);
		font-weight: 700;
	}

	/* ---- Tedaviler: kategorili mega panel ---- */
	.hd-treatments-menu.hd-has-mega > .hd-sub-menu {
		width: min(780px, calc(100vw - 48px));
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 4px 18px;
		padding: 18px 20px;
		align-items: start;
	}
	.hd-mega-col > a {
		display: block;
		padding: 4px 6px 8px;
		margin-bottom: 2px;
		border-bottom: 1px solid var(--hd-line);
		color: var(--hd-ink);
		font-family: var(--hd-heading-font, Fraunces, Georgia, serif);
		font-size: 15px;
		font-weight: 600;
		letter-spacing: .005em;
	}
	.hd-mega-col > a::after { display: none; }
	.hd-mega-col > a:hover,
	.hd-mega-col > a:focus-visible { color: var(--hd-reef); background: none; }

	.hd-treatments-menu.hd-has-mega .hd-mega-col { position: static; }

	/* Kategori alt listeleri panelin İÇİNDE akışta dursun; görünürlüğü panelden
	   MİRAS ALSINLAR (kendi opacity/visibility vermiyoruz — panel kapalıyken
	   liste de kapalı, LiteSpeed CSS'i yeniden sıralasa bile). */
	.hd-treatments-menu.hd-has-mega .hd-mega-list {
		position: static;
		display: block;
		min-width: 0;
		margin: 4px 0 14px;
		padding: 0;
		background: none;
		border: 0;
		box-shadow: none;
		transform: none;
		transition: none;
		opacity: 1;          /* base .hd-sub-menu opacity:0'ı ez (panel açılınca liste de görünsün) */
		visibility: inherit; /* AMA görünürlüğü panelden MİRAS al — panel gizliyse liste de gizli
		                        (LiteSpeed CSS'i yeniden sıralasa bile açık kalmaz) */
	}
	.hd-mega-list::before { display: none; }
	.hd-mega-list a {
		padding: 6px 6px;
		font-size: 13.5px;
		font-weight: 500;
	}

	.hd-mega-all {
		grid-column: 1 / -1;
		margin-top: 2px;
		padding-top: 12px;
		border-top: 1px solid var(--hd-line);
	}
	.hd-mega-all a {
		color: var(--hd-reef);
		font-weight: 700;
	}
}

/* ======================= Mobil (<=980px) ======================= */
@media (max-width: 980px) {
	/* Hamburger'ı net görünür kıl (krem üstünde kaybolmasın) */
	.hd-site-header .hd-nav-toggle {
		display: flex !important;
		border-color: rgba(23, 43, 47, .16);
		background: var(--hd-milk);
	}
	.hd-nav-toggle-bar {
		background: var(--hd-reef);
	}

	.hd-submenu-toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 40px;
		height: 40px;
		margin-left: auto;
		border: 1px solid var(--hd-line);
		border-radius: 9px;
		background: var(--hd-milk);
		color: var(--hd-reef);
		cursor: pointer;
		flex: 0 0 auto;
	}
	.hd-submenu-caret {
		width: 13px;
		height: 9px;
		transition: transform .2s ease;
	}
	.hd-submenu-toggle[aria-expanded="true"] .hd-submenu-caret {
		transform: rotate(180deg);
	}

	.hd-mobile-panel .hd-menu .menu-item-has-children {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		width: 100%;
	}
	.hd-mobile-panel .hd-menu .menu-item-has-children > a {
		flex: 1;
		min-width: 0;
	}

	.hd-mobile-panel .hd-sub-menu {
		flex-basis: 100%;
		list-style: none;
		margin: 12px 0 2px;
		padding: 4px 0 4px 16px;
		border-left: 2px solid var(--hd-rose);
		display: none;
	}
	.hd-mobile-panel .hd-menu .menu-item-has-children.is-open > .hd-sub-menu {
		display: block;
	}
	.hd-mobile-panel .hd-sub-menu li { margin: 0; }
	.hd-mobile-panel .hd-sub-menu a {
		display: block;
		padding: 9px 0;
		font-size: 15px;
		font-weight: 600;
		color: var(--hd-soft-ink);
	}
	.hd-mobile-panel .hd-sub-menu a::after { display: none; }
	.hd-mobile-panel .hd-sub-menu .hd-submenu-all a {
		color: var(--hd-reef);
		font-weight: 700;
	}

	/* Mega menü — mobilde kategoriler alt başlık, tedaviler girintili liste */
	.hd-mobile-panel .hd-treatments-menu.hd-has-mega.is-open > .hd-sub-menu {
		display: block;
	}
	.hd-mobile-panel .hd-mega-col {
		display: block;
		width: 100%;
	}
	.hd-mobile-panel .hd-mega-col > a {
		margin-top: 10px;
		color: var(--hd-ink);
		font-family: var(--hd-heading-font, Fraunces, Georgia, serif);
		font-weight: 600;
	}
	.hd-mobile-panel .hd-mega-list {
		display: block;
		margin: 2px 0 4px;
		padding: 0 0 0 12px;
		border-left: 1px solid var(--hd-line);
	}
	.hd-mobile-panel .hd-mega-all {
		margin-top: 10px;
		padding-top: 10px;
		border-top: 1px solid var(--hd-line);
	}
}

@media (prefers-reduced-motion: reduce) {
	.hd-site-header,
	.hd-sub-menu,
	.hd-submenu-caret,
	.hd-logo-image {
		transition: none !important;
	}
}
