/**
 * Temiz Wear Header Navigation Stylesheet
 *
 * Mobile-first sticky header with hamburger drawer menu, category bar,
 * and full-screen product search overlay. Premium minimal design.
 *
 * @package TemizWear
 * @since   1.0.0
 */

/* ==========================================================================
   1. Header Foundation
   ========================================================================== */

.site-header {
	position: sticky;
	top: 0;
	width: 100%;
	z-index: 1020;
	background-color: var(--tw-color-base);
	border-bottom: 1px solid transparent;
	color: var(--tw-color-primary);
	overflow: hidden;
	transition: background-color 220ms ease-out,
	            border-color 220ms ease-out,
	            box-shadow 220ms ease-out;
}

.site-header.is-scrolled {
	background-color: var(--tw-color-base);
	border-bottom-color: var(--tw-color-border);
	box-shadow: 0 1px 3px rgba(46, 26, 36, 0.08);
}

.site-header__main {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	width: 100%;
	height: 64px;
	padding: 0 18px;
	box-sizing: border-box;
	gap: 8px;
	min-width: 0;
}

/* ==========================================================================
   2. Header Control Buttons Reset
   ========================================================================== */

.menu-toggle,
.search-toggle,
.mobile-drawer__close,
.search-overlay__close {
	appearance: none;
	-webkit-appearance: none;
	border: 0;
	background: transparent;
	box-shadow: none;
	border-radius: 8px;
	padding: 0;
	margin: 0;
	color: var(--tw-color-primary);
	font-family: inherit;
	font-size: inherit;
	font-weight: inherit;
	line-height: 1;
	cursor: pointer;
	display: inline-grid;
	place-items: center;
	min-width: 44px;
	min-height: 44px;
	width: 44px;
	height: 44px;
	flex-shrink: 0;
	transition: background-color 180ms ease-out,
	            color 180ms ease-out;
}

.menu-toggle:hover,
.search-toggle:hover,
.mobile-drawer__close:hover,
.search-overlay__close:hover {
	background-color: rgba(168, 130, 61, 0.08);
	color: var(--tw-color-primary);
}

.menu-toggle:focus-visible,
.search-toggle:focus-visible,
.mobile-drawer__close:focus-visible,
.search-overlay__close:focus-visible {
	outline: 2px solid var(--tw-color-accent);
	outline-offset: 2px;
	background-color: rgba(168, 130, 61, 0.05);
}

/* Hamburger icon */

.menu-toggle {
	justify-self: start;
}

.menu-toggle__icon {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	width: 28px;
	height: 22px;
	pointer-events: none;
}

.menu-toggle__line {
	display: block;
	width: 100%;
	height: 2px;
	background-color: currentColor;
	border-radius: 999px;
	transition: transform 200ms ease-out,
	            opacity 200ms ease-out;
}

/* Search icon */

.search-toggle {
	justify-self: end;
}

.search-toggle__icon {
	display: block;
	width: 27px;
	height: 27px;
	pointer-events: none;
}

/* ==========================================================================
   3. Branding (Logo)
   ========================================================================== */

.site-branding {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
	line-height: 0;
	max-width: clamp(140px, 42vw, 190px);
}

.custom-logo-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
	line-height: 0;
	text-decoration: none;
}

.custom-logo-link:hover {
	text-decoration: none;
}

.custom-logo {
	display: block;
	width: auto;
	height: clamp(34px, 8vw, 44px);
	max-width: min(42vw, 180px);
	object-fit: contain;
}

.site-title {
	color: var(--tw-color-primary);
	text-decoration: none;
	font-size: clamp(1.05rem, 4.4vw, 1.35rem);
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	letter-spacing: -0.01em;
}

.site-title:hover,
.site-title:focus {
	text-decoration: none;
}

/* ==========================================================================
   4. Category Bar
   ========================================================================== */

.category-bar {
	width: 100%;
	height: 47px;
	background-color: var(--tw-color-base);
	border-bottom: 1px solid var(--tw-color-border);
	overflow: hidden;
	box-sizing: border-box;
}

.category-bar__list {
	list-style: none;
	margin: 0;
	padding: 0 8px;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	align-items: stretch;
	height: 100%;
	width: 100%;
}

.category-bar__item {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
	text-align: center;
	height: 100%;
	margin: 0;
	position: relative;
}

.category-bar__link {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	padding: 0 4px;
	color: var(--tw-color-micro-accent);
	text-decoration: none;
	font-size: clamp(0.72rem, 2.8vw, 0.84rem);
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: color 180ms ease-out;
}

.category-bar__link:hover,
.category-bar__item.is-active .category-bar__link,
.category-bar__link[aria-current="page"] {
	color: var(--tw-color-primary);
	font-weight: 700;
	text-decoration: none;
}

.category-bar__item.is-active .category-bar__link::after,
.category-bar__link[aria-current="page"]::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 50%;
	transform: translateX(-50%);
	width: 58%;
	height: 2px;
	background-color: var(--tw-color-accent);
	border-radius: 999px;
}

.category-bar__link:focus-visible {
	outline: 2px solid var(--tw-color-accent);
	outline-offset: -2px;
}

/* ==========================================================================
   5. Mobile Drawer
   ========================================================================== */

.mobile-drawer {
	position: fixed;
	inset: 0;
	z-index: 1200;
	overflow: hidden;
}

.mobile-drawer[hidden] {
	display: none;
}

.mobile-drawer:not([hidden]) {
	display: block;
}

.mobile-drawer__overlay {
	position: absolute;
	inset: 0;
	background-color: rgba(28, 28, 26, 0.48);
	opacity: 0;
	transition: opacity 240ms ease-out;
	cursor: pointer;
}

.mobile-drawer.is-open .mobile-drawer__overlay {
	opacity: 1;
}

.mobile-drawer__panel {
	position: absolute;
	inset-block: 0;
	inset-inline-start: 0;
	width: min(86vw, 390px);
	max-width: 390px;
	height: 100vh;
	height: 100dvh;
	background-color: var(--tw-color-white);
	color: var(--tw-color-text);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transform: translateX(-100%);
	transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: 12px 0 32px rgba(46, 26, 36, 0.16);
	padding-bottom: env(safe-area-inset-bottom);
	box-sizing: border-box;
}

.mobile-drawer.is-open .mobile-drawer__panel {
	transform: translateX(0);
}

/* Drawer header */

.mobile-drawer__header {
	min-height: 108px;
	padding: 20px 22px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	border-bottom: 1px solid var(--tw-color-border);
	background-color: var(--tw-color-white);
	flex-shrink: 0;
	box-sizing: border-box;
}

.mobile-drawer__branding {
	display: flex;
	align-items: center;
	min-width: 0;
	max-width: calc(100% - 60px);
	line-height: 0;
}

.mobile-drawer__branding .custom-logo {
	height: clamp(40px, 9vw, 48px);
	max-width: 190px;
	width: auto;
	object-fit: contain;
	display: block;
}

.mobile-drawer__site-title {
	color: var(--tw-color-primary);
	text-decoration: none;
	font-size: clamp(1.1rem, 4.6vw, 1.4rem);
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	letter-spacing: -0.01em;
}

.mobile-drawer__site-title:hover {
	text-decoration: none;
}

.mobile-drawer__close {
	flex-shrink: 0;
}

.mobile-drawer__close-icon {
	width: 24px;
	height: 24px;
	pointer-events: none;
}

/* Drawer nav / tabs */

.mobile-drawer__nav {
	display: flex;
	flex-direction: column;
	min-height: 0;
	flex: 1;
	overflow: hidden;
}

.mobile-drawer__tabs {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	min-height: 64px;
	border-bottom: 1px solid var(--tw-color-border);
	background-color: var(--tw-color-white);
	flex-shrink: 0;
	box-sizing: border-box;
}

.mobile-drawer__tab {
	appearance: none;
	-webkit-appearance: none;
	border: 0;
	background: transparent;
	box-shadow: none;
	border-radius: 0;
	margin: 0;
	padding: 0 4px;
	position: relative;
	color: var(--tw-color-micro-accent);
	font-family: inherit;
	font-size: clamp(0.68rem, 2.6vw, 0.8rem);
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-align: center;
	cursor: pointer;
	min-width: 0;
	min-height: 44px;
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1.15;
	transition: color 180ms ease-out;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mobile-drawer__tab:hover,
.mobile-drawer__tab.is-active,
.mobile-drawer__tab[aria-selected="true"] {
	color: var(--tw-color-primary);
	font-weight: 700;
}

.mobile-drawer__tab.is-active::after,
.mobile-drawer__tab[aria-selected="true"]::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 50%;
	transform: translateX(-50%);
	width: 50%;
	height: 2px;
	background-color: var(--tw-color-accent);
	border-radius: 999px;
}

.mobile-drawer__tab:focus-visible {
	outline: 2px solid var(--tw-color-accent);
	outline-offset: -2px;
}

/* Drawer panels */

.mobile-drawer__panels {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	background-color: var(--tw-color-white);
	padding-bottom: env(safe-area-inset-bottom);
	box-sizing: border-box;
}

.mobile-drawer__panels::-webkit-scrollbar {
	width: 4px;
}

.mobile-drawer__panels::-webkit-scrollbar-track {
	background: transparent;
}

.mobile-drawer__panels::-webkit-scrollbar-thumb {
	background: rgba(46, 26, 36, 0.2);
	border-radius: 2px;
}

.mobile-drawer__panel-content {
	width: 100%;
	margin: 0;
	padding: 0;
}

.mobile-drawer__panel-content[hidden] {
	display: none;
}

.mobile-drawer__panel-content:not([hidden]),
.mobile-drawer__panel-content.is-active {
	display: block;
}

.mobile-drawer__submenu {
	list-style: none;
	margin: 0;
	padding: 0;
}

.mobile-drawer__submenu-item {
	margin: 0;
	border-bottom: 1px solid var(--tw-color-border);
}

.mobile-drawer__submenu-link,
.mobile-drawer__category-link {
	position: relative;
	display: flex;
	align-items: center;
	min-height: 78px;
	padding: 0 48px 0 26px;
	color: var(--tw-color-text);
	background-color: var(--tw-color-white);
	text-decoration: none;
	font-size: clamp(1.1rem, 4.2vw, 1.3rem);
	font-weight: 500;
	line-height: 1.3;
	word-break: break-word;
	transition: background-color 180ms ease-out,
	            color 180ms ease-out;
}

.mobile-drawer__submenu-link:hover,
.mobile-drawer__category-link:hover,
.mobile-drawer__submenu-link:focus,
.mobile-drawer__category-link:focus {
	text-decoration: none;
}

.mobile-drawer__submenu-link::after,
.mobile-drawer__category-link::after {
	content: '';
	position: absolute;
	right: 26px;
	top: 50%;
	transform: translateY(-50%) rotate(45deg);
	width: 8px;
	height: 8px;
	border: solid var(--tw-color-accent);
	border-width: 2px 2px 0 0;
	flex-shrink: 0;
}

.mobile-drawer__submenu-link:hover,
.mobile-drawer__category-link:hover {
	background-color: rgba(245, 239, 227, 0.6);
	color: var(--tw-color-primary);
}

.mobile-drawer__submenu-link:focus-visible,
.mobile-drawer__category-link:focus-visible {
	outline: 2px solid var(--tw-color-accent);
	outline-offset: -2px;
}

/* Drawer footer */

.mobile-drawer__footer {
	margin-top: auto;
	padding: 16px 22px;
	padding-bottom: calc(16px + env(safe-area-inset-bottom));
	border-top: 1px solid var(--tw-color-border);
	background-color: rgba(245, 239, 227, 0.5);
	flex-shrink: 0;
	box-sizing: border-box;
}

.mobile-drawer__footer-link {
	display: flex;
	align-items: center;
	gap: 14px;
	min-height: 52px;
	padding: 0 8px;
	color: var(--tw-color-text);
	text-decoration: none;
	font-size: 1rem;
	font-weight: 500;
	border-radius: 8px;
	transition: background-color 180ms ease-out,
	            color 180ms ease-out;
	margin-bottom: 4px;
}

.mobile-drawer__footer-link:hover,
.mobile-drawer__footer-link:focus {
	text-decoration: none;
}

.mobile-drawer__footer-link:last-child {
	margin-bottom: 0;
}

.mobile-drawer__footer-link:hover {
	background-color: rgba(245, 239, 227, 1);
	color: var(--tw-color-primary);
}

.mobile-drawer__footer-link:focus-visible {
	outline: 2px solid var(--tw-color-accent);
	outline-offset: 2px;
}

.mobile-drawer__footer-link svg {
	width: 20px;
	height: 20px;
	color: var(--tw-color-primary);
	flex-shrink: 0;
}

/* ==========================================================================
   6. Full-Screen Search Overlay
   ========================================================================== */

.search-overlay {
	position: fixed;
	inset: 0;
	z-index: 1300;
	overflow: hidden;
}

.search-overlay[hidden] {
	display: none;
}

.search-overlay:not([hidden]) {
	display: block;
}

.search-overlay__backdrop {
	position: absolute;
	inset: 0;
	background-color: rgba(46, 26, 36, 0.4);
	opacity: 0;
	transition: opacity 220ms ease-out;
	cursor: pointer;
}

.search-overlay.is-open .search-overlay__backdrop {
	opacity: 1;
}

.search-overlay__content {
	position: relative;
	z-index: 1;
	width: 100%;
	min-height: 100vh;
	min-height: 100dvh;
	background-color: var(--tw-color-base);
	display: flex;
	flex-direction: column;
	opacity: 0;
	transform: translateY(-8px);
	transition: opacity 220ms ease-out,
	            transform 220ms ease-out;
	padding-bottom: env(safe-area-inset-bottom);
	box-sizing: border-box;
}

.search-overlay.is-open .search-overlay__content {
	opacity: 1;
	transform: translateY(0);
}

.search-overlay__header {
	min-height: 66px;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	padding: 12px 18px;
	border-bottom: 1px solid var(--tw-color-border);
	background-color: var(--tw-color-base);
	flex-shrink: 0;
	box-sizing: border-box;
}

.search-overlay__title {
	font-size: 1rem;
	margin: 0;
}

.search-overlay__close {
	flex-shrink: 0;
}

.search-overlay__close-icon {
	width: 24px;
	height: 24px;
	pointer-events: none;
}

.search-overlay__form {
	width: min(100%, 720px);
	margin: 0 auto;
	padding: clamp(28px, 7vw, 60px) 20px 24px;
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	box-sizing: border-box;
	min-width: 0;
}

.search-overlay__input-wrapper {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: stretch;
	gap: 8px;
	padding: 6px;
	border: 1px solid var(--tw-color-border);
	border-radius: 12px;
	background-color: var(--tw-color-white);
	box-shadow: 0 8px 24px rgba(46, 26, 36, 0.05);
	min-height: 52px;
	transition: border-color 180ms ease-out,
	            box-shadow 180ms ease-out;
	box-sizing: border-box;
}

.search-overlay__input-wrapper:focus-within {
	border-color: var(--tw-color-accent);
	box-shadow: 0 8px 24px rgba(168, 130, 61, 0.12);
}

.search-overlay__input {
	grid-column: 1;
	width: 100%;
	min-width: 0;
	min-height: 40px;
	border: 0;
	outline: 0;
	background: transparent;
	color: var(--tw-color-text);
	font-size: clamp(1rem, 3.6vw, 1.05rem);
	font-family: inherit;
	font-weight: 400;
	padding: 0 12px;
	line-height: 1.5;
	-webkit-appearance: none;
	appearance: none;
	box-sizing: border-box;
}

.search-overlay__input::placeholder {
	color: #B0A89D;
}

.search-overlay__input::-webkit-search-decoration,
.search-overlay__input::-webkit-search-cancel-button,
.search-overlay__input::-webkit-search-results-button,
.search-overlay__input::-webkit-search-results-decoration {
	-webkit-appearance: none;
	appearance: none;
}

.search-overlay__submit {
	grid-column: 2;
	appearance: none;
	-webkit-appearance: none;
	border: 1px solid var(--tw-color-accent);
	background-color: var(--tw-color-accent);
	color: var(--tw-color-white);
	min-height: 44px;
	padding: 0 18px;
	border-radius: 8px;
	font-size: 0.95rem;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
	white-space: nowrap;
	flex-shrink: 0;
	transition: background-color 180ms ease-out,
	            border-color 180ms ease-out,
	            transform 100ms ease-out;
	line-height: 1;
	box-sizing: border-box;
}

.search-overlay__submit:hover {
	background-color: var(--tw-color-primary);
	border-color: var(--tw-color-primary);
}

.search-overlay__submit:active {
	transform: scale(0.98);
}

.search-overlay__submit:focus-visible {
	outline: 2px solid var(--tw-color-primary);
	outline-offset: 2px;
}

/* ==========================================================================
   7. Body Scroll Lock
   ========================================================================== */

html.is-locked,
body.is-locked {
	overflow: hidden;
	overscroll-behavior: none;
}

/* ==========================================================================
   8. Responsive Adjustments
   ========================================================================== */

@media (max-width: 359px) {
	.site-header__main {
		padding: 0 14px;
	}

	.mobile-drawer__panel {
		width: min(90vw, 390px);
	}
}

@media (min-width: 480px) {
	.site-header__main {
		padding: 0 22px;
	}

	.category-bar__link {
		font-size: 14px;
		padding: 0 6px;
	}

	.mobile-drawer__header {
		min-height: 122px;
		padding: 28px 32px;
	}

	.mobile-drawer__branding .custom-logo {
		height: 48px;
	}

	.mobile-drawer__submenu-link,
	.mobile-drawer__category-link {
		min-height: 88px;
		padding: 0 48px 0 36px;
		font-size: 1.4rem;
	}

	.search-overlay__form {
		padding: 44px 24px 24px;
	}

	.search-overlay__input-wrapper {
		min-height: 56px;
	}
}

@media (min-width: 768px) {
	.site-header__main {
		padding: 0 32px;
	}

	.custom-logo {
		height: clamp(36px, 6vw, 44px);
	}

	.mobile-drawer__panel {
		width: min(70vw, 410px);
		max-width: 410px;
	}

	.mobile-drawer__branding .custom-logo {
		height: 52px;
		max-width: 200px;
	}
}

@media (min-width: 1024px) {
	.site-header__main {
		padding: 0 40px;
	}
}

/* ==========================================================================
   9. Reduced Motion Support
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	.site-header,
	.category-bar__link,
	.menu-toggle__line,
	.mobile-drawer__overlay,
	.mobile-drawer__panel,
	.mobile-drawer__tab,
	.mobile-drawer__submenu-link,
	.mobile-drawer__category-link,
	.mobile-drawer__footer-link,
	.search-overlay__backdrop,
	.search-overlay__content,
	.search-overlay__input-wrapper,
	.search-overlay__submit {
		transition-duration: 0.01ms;
		animation-duration: 0.01ms;
	}
}