﻿/**
 * Header, announcement, search, drawer
 * @package Elmaslar
 */

.announcement-bar {
	position: relative;
	z-index: 1001;
	height: var(--elmaslar-announcement-height);
	background-color: var(--elmaslar-color-deep-red);
	color: var(--elmaslar-color-white);
	transition:
		height 0.3s var(--elmaslar-ease),
		opacity 0.3s var(--elmaslar-ease),
		transform 0.3s var(--elmaslar-ease);
}

.announcement-bar.is-hidden {
	display: none;
}

.announcement-bar.is-closing {
	opacity: 0;
	transform: translateY(-100%);
}

.announcement-bar__inner {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	height: 100%;
	padding-block: 0;
}

.announcement-bar__message {
	margin: 0;
	font-size: 0.875rem;
	font-weight: 500;
	text-align: center;
	line-height: 1.3;
}

.announcement-bar__actions {
	display: inline-flex;
	align-items: center;
	gap: 0.75rem;
	flex-shrink: 0;
}

.announcement-bar__link {
	color: var(--elmaslar-color-gold);
	font-size: 0.8125rem;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
	white-space: nowrap;
}

.announcement-bar__link:hover,
.announcement-bar__link:focus-visible {
	color: var(--elmaslar-color-white);
}

.announcement-bar__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.75rem;
	height: 1.75rem;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: var(--elmaslar-color-white);
	font-size: 1.25rem;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.2s var(--elmaslar-ease);
}

.announcement-bar__close:hover,
.announcement-bar__close:focus-visible {
	background: rgba(255, 255, 255, 0.22);
}

/* -------------------------------------------------------------------------
   Header
   ------------------------------------------------------------------------- */

.site-header {
	position: sticky;
	top: 0;
	z-index: 1000;
	height: var(--elmaslar-header-height);
	background-color: transparent;
	border-bottom: 1px solid transparent;
	transition:
		height 0.35s var(--elmaslar-ease),
		background-color 0.35s var(--elmaslar-ease),
		border-color 0.35s var(--elmaslar-ease),
		box-shadow 0.35s var(--elmaslar-ease),
		backdrop-filter 0.35s var(--elmaslar-ease);
}

.site-header.is-scrolled {
	height: var(--elmaslar-header-height-scrolled);
	background-color: rgba(255, 255, 255, 0.96);
	border-bottom-color: var(--elmaslar-color-border);
	box-shadow: var(--elmaslar-shadow-header);
	backdrop-filter: blur(12px);
}

body:not(.home) .site-header {
	background-color: rgba(255, 255, 255, 0.96);
	border-bottom-color: var(--elmaslar-color-border);
}

.site-header__inner {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 1.5rem;
	height: 100%;
}

.site-branding {
	justify-self: start;
}

.site-logo img,
.site-logo--theme img,
.custom-logo-link img {
	display: block;
	width: auto;
	max-height: 65px;
	transition: max-height 0.35s var(--elmaslar-ease);
}

.site-header.is-scrolled .site-logo img,
.site-header.is-scrolled .site-logo--theme img,
.site-header.is-scrolled .custom-logo-link img {
	max-height: 55px;
}

.site-title {
	margin: 0;
	font-family: var(--elmaslar-font-display);
	font-size: 1.5rem;
	font-weight: 600;
}

.site-title a {
	color: inherit;
	text-decoration: none;
}

.main-navigation {
	justify-self: center;
}

.primary-menu {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.25rem 2rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.primary-menu a {
	position: relative;
	color: var(--elmaslar-color-charcoal);
	font-size: 0.9375rem;
	font-weight: 500;
	text-decoration: none;
	padding-block: 0.25rem;
	transition: color 0.25s var(--elmaslar-ease);
}

.primary-menu a::after {
	content: "";
	position: absolute;
	inset-inline: 0;
	bottom: -4px;
	height: 2px;
	background-color: var(--elmaslar-color-gold);
	transform: scaleX(0);
	transform-origin: center;
	transition: transform 0.25s var(--elmaslar-ease);
}

.primary-menu a:hover,
.primary-menu a:focus-visible,
.primary-menu .current-menu-item > a,
.primary-menu .current_page_item > a {
	color: var(--elmaslar-color-deep-red);
}

.primary-menu a:hover::after,
.primary-menu a:focus-visible::after,
.primary-menu .current-menu-item > a::after,
.primary-menu .current_page_item > a::after {
	transform: scaleX(1);
}

.header-actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 0.5rem;
}

.header-actions__btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: transparent;
	color: var(--elmaslar-color-charcoal);
	text-decoration: none;
	cursor: pointer;
	transition:
		background-color 0.25s var(--elmaslar-ease),
		color 0.25s var(--elmaslar-ease),
		transform 0.25s var(--elmaslar-ease);
}

.header-actions__btn:hover,
.header-actions__btn:focus-visible {
	background-color: rgba(139, 26, 26, 0.08);
	color: var(--elmaslar-color-deep-red);
	text-decoration: none;
	transform: translateY(-1px);
}

.header-actions__btn:disabled {
	opacity: 0.45;
	cursor: not-allowed;
	transform: none;
}

.header-actions__icon {
	display: block;
}

.header-actions__badge {
	position: absolute;
	top: 0.25rem;
	inset-inline-end: 0.25rem;
	min-width: 1.125rem;
	height: 1.125rem;
	padding-inline: 0.25rem;
	border-radius: 999px;
	background-color: var(--elmaslar-color-deep-red);
	color: var(--elmaslar-color-white);
	font-size: 0.6875rem;
	font-weight: 700;
	line-height: 1.125rem;
	text-align: center;
}

.header-actions__badge--empty {
	display: none;
}

.header-actions__btn--cart {
	overflow: hidden;
}

.header-actions__cart-sr {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

.lang-switcher {
	display: inline-flex;
	align-items: center;
	gap: 0.125rem;
	padding: 0.125rem;
	border: 1px solid var(--elmaslar-color-border);
	border-radius: 999px;
	background-color: rgba(255, 255, 255, 0.6);
}

.lang-switcher__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2rem;
	padding: 0.25rem 0.5rem;
	border: none;
	border-radius: 999px;
	background: transparent;
	color: var(--elmaslar-color-muted);
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.lang-switcher__btn:hover,
.lang-switcher__btn:focus-visible {
	color: var(--elmaslar-color-deep-red);
	outline: none;
}

.lang-switcher__btn.is-active {
	background-color: var(--elmaslar-color-deep-red);
	color: var(--elmaslar-color-white);
}

.lang-switcher--fallback .lang-switcher__btn:not(.is-active) {
	opacity: 0.85;
}

.menu-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 1px solid var(--elmaslar-color-border);
	border-radius: 4px;
	background: rgba(255, 255, 255, 0.85);
	color: var(--elmaslar-color-charcoal);
	cursor: pointer;
	transition: background-color 0.25s var(--elmaslar-ease);
}

.menu-toggle:hover,
.menu-toggle:focus-visible {
	background-color: var(--elmaslar-color-beige);
}

.menu-toggle__icon {
	display: block;
	width: 1.25rem;
	height: 2px;
	background: currentColor;
	position: relative;
	transition: background-color 0.25s var(--elmaslar-ease);
}

.menu-toggle__icon::before,
.menu-toggle__icon::after {
	content: "";
	position: absolute;
	inset-inline-start: 0;
	width: 100%;
	height: 2px;
	background: currentColor;
	transition: transform 0.25s var(--elmaslar-ease);
}

.menu-toggle__icon::before {
	top: -6px;
}

.menu-toggle__icon::after {
	top: 6px;
}

.menu-toggle.is-active .menu-toggle__icon {
	background: transparent;
}

.menu-toggle.is-active .menu-toggle__icon::before {
	top: 0;
	transform: rotate(45deg);
}

.menu-toggle.is-active .menu-toggle__icon::after {
	top: 0;
	transform: rotate(-45deg);
}

/* -------------------------------------------------------------------------
   Search overlay
   ------------------------------------------------------------------------- */

.search-overlay[hidden] {
	display: none;
}

.search-overlay {
	position: fixed;
	inset: 0;
	z-index: 1100;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 6rem 1.5rem 1.5rem;
}

.search-overlay.is-open {
	animation: elmaslarFadeIn 0.3s var(--elmaslar-ease);
}

.search-overlay__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(26, 26, 26, 0.55);
	backdrop-filter: blur(4px);
}

.search-overlay__panel {
	position: relative;
	width: min(100%, 640px);
	padding: 2rem;
	border-radius: 8px;
	background: var(--elmaslar-color-white);
	box-shadow: 0 24px 64px rgba(26, 26, 26, 0.18);
	animation: elmaslarSlideUp 0.35s var(--elmaslar-ease);
}

.search-overlay__close {
	position: absolute;
	top: 0.75rem;
	inset-inline-end: 0.75rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	border: none;
	border-radius: 50%;
	background: transparent;
	color: var(--elmaslar-color-charcoal);
	font-size: 1.75rem;
	cursor: pointer;
}

.search-overlay__close:hover,
.search-overlay__close:focus-visible {
	background: var(--elmaslar-color-beige);
}

.search-overlay__label {
	display: block;
	margin-bottom: 0.75rem;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--elmaslar-color-muted);
}

.search-overlay__form {
	display: grid;
	gap: 1rem;
}

.search-overlay__field {
	width: 100%;
	padding: 0.875rem 1rem;
	border: 1px solid var(--elmaslar-color-border);
	border-radius: 4px;
	font: inherit;
}

.search-overlay__field:focus-visible {
	outline: 2px solid var(--elmaslar-color-gold);
	outline-offset: 2px;
	border-color: var(--elmaslar-color-gold);
}

.search-overlay__submit {
	width: 100%;
}

/* -------------------------------------------------------------------------
   Mobile drawer
   ------------------------------------------------------------------------- */

.mobile-drawer {
	position: fixed;
	inset: 0;
	z-index: 1050;
	pointer-events: none;
}

.mobile-drawer.is-open {
	pointer-events: auto;
}

.mobile-drawer__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(26, 26, 26, 0.45);
	opacity: 0;
	transition: opacity 0.35s var(--elmaslar-ease);
}

.mobile-drawer.is-open .mobile-drawer__backdrop {
	opacity: 1;
}

.mobile-drawer__panel {
	position: absolute;
	top: 0;
	bottom: 0;
	inset-inline-end: 0;
	width: min(100%, 320px);
	padding: 1.5rem;
	background: var(--elmaslar-color-white);
	box-shadow: -8px 0 32px rgba(26, 26, 26, 0.12);
	transform: translateX(100%);
	transition: transform 0.35s var(--elmaslar-ease);
	overflow-y: auto;
}

[dir="rtl"] .mobile-drawer__panel {
	transform: translateX(-100%);
	box-shadow: 8px 0 32px rgba(26, 26, 26, 0.12);
}

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

.mobile-drawer__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 1.5rem;
	padding-bottom: 1rem;
	border-bottom: 1px solid var(--elmaslar-color-border);
}

.mobile-drawer__title {
	font-family: var(--elmaslar-font-display);
	font-size: 1.25rem;
	font-weight: 600;
}

.mobile-drawer__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	border: none;
	border-radius: 50%;
	background: transparent;
	font-size: 1.75rem;
	cursor: pointer;
}

.mobile-drawer__close:hover,
.mobile-drawer__close:focus-visible {
	background: var(--elmaslar-color-beige);
}

.mobile-menu {
	list-style: none;
	margin: 0;
	padding: 0;
}

.mobile-menu li + li {
	border-top: 1px solid var(--elmaslar-color-border);
}

.mobile-menu a {
	display: block;
	padding: 1rem 0;
	color: var(--elmaslar-color-charcoal);
	font-size: 1rem;
	font-weight: 500;
	text-decoration: none;
}

.mobile-menu a:hover,
.mobile-menu a:focus-visible {
	color: var(--elmaslar-color-deep-red);
}

.mobile-drawer__extras {
	margin-top: 2rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--elmaslar-color-border);
	display: grid;
	gap: 1rem;
}

.lang-switcher--stacked {
	display: grid;
	gap: 0.5rem;
	border: none;
	background: transparent;
	padding: 0;
}

.lang-switcher__label {
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--elmaslar-color-muted);
}

.lang-switcher__buttons {
	display: flex;
	gap: 0.5rem;
}

.lang-switcher__note {
	margin: 0.35rem 0 0;
	font-size: 0.75rem;
	color: var(--elmaslar-color-muted);
}

.lang-switcher--pending .lang-switcher__btn:not(.is-active),
.lang-switcher--fallback .lang-switcher__btn:not(.is-active) {
	opacity: 0.85;
}

.mobile-drawer__link {
	color: var(--elmaslar-color-charcoal);
	font-weight: 500;
	text-decoration: none;
}

.mobile-drawer__link:hover,
.mobile-drawer__link:focus-visible {
	color: var(--elmaslar-color-deep-red);
}

.mobile-drawer__link--muted {
	color: var(--elmaslar-color-muted);
}
