/**
 * Sælkerabúðin - Navigation Styles
 * Fixed header, scroll states, dropdowns, mobile slide-out
 */

/* ─── OPENING HOURS BANNER ────────────────────── */

/* ─── OPENING HOURS BANNER ────────────────────── */

.saelk-hours-banner {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 101;
	background: #1A1A1A;
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
	padding: 10px 0;
}

.saelk-hours-banner-inner {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	text-decoration: none;
	color: inherit;
}

.saelk-hours-text {
	font-family: var(--wp--preset--font-family--oswald);
	font-size: 0.875rem;
	font-weight: 500;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: white;
}

.saelk-hours-banner-inner svg {
	color: white;
	flex-shrink: 0;
	transition: transform 0.2s ease;
}

.saelk-hours-banner-inner:hover svg {
	transform: translateX(3px);
}

body:has(.saelk-hours-banner) .site-header {
	top: 37px;
}

body:has(.saelk-hours-banner) .wp-site-blocks {
	padding-top: 37px;
}

.admin-bar .saelk-hours-banner {
	top: 32px;
}

body.admin-bar:has(.saelk-hours-banner) .site-header {
	top: 69px;
}

@media (max-width: 782px) {
	.admin-bar .saelk-hours-banner {
		top: 46px;
	}
	body.admin-bar:has(.saelk-hours-banner) .site-header {
		top: 83px;
	}
}

/* ─── FIXED HEADER ─────────────────────────────── */

.site-header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 100;
	background-color: var(--wp--preset--color--cream-bg);
	transition: background-color 0.3s ease, backdrop-filter 0.3s ease, border-color 0.3s ease, padding 0.3s ease;
	border-bottom: none;
	color: #111;
}

.site-header--transparent,
.site-header--transparent.wp-block-group {
	background-color: transparent !important;
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
	border-bottom-color: transparent;
}


/* White header: invert logo to black */
.site-header .wp-block-site-logo img {
	filter: brightness(0);
	transition: filter 0.3s ease, max-height 0.3s ease, width 0.3s ease;
}

/* White header: dark text for top-level nav, icons */
.site-header .wp-block-navigation,
.site-header .wp-block-navigation-item__content,
.site-header .wp-block-navigation a {
	color: #111 !important;
}

/* Dropdown items always white on dark background */
.site-header .wp-block-navigation__submenu-container .wp-block-navigation-item__content,
.site-header .wp-block-navigation__submenu-container a,
.site-header .wp-block-navigation__submenu-container .wp-block-navigation-item__label {
	color: white !important;
}

.site-header .wp-block-navigation-item__content:hover {
	color: var(--wp--preset--color--caramel) !important;
}

.site-header .wp-block-navigation__submenu-icon path {
	stroke: #111;
}

.site-header .saelk-search-toggle,
.site-header .saelk-mobile-toggle,
.site-header .wp-block-woocommerce-customer-account,
.site-header .wp-block-woocommerce-customer-account a,
.site-header .wc-block-mini-cart__button {
	color: #111 !important;
}

.site-header .saelk-search-toggle:hover,
.site-header .wp-block-woocommerce-customer-account:hover,
.site-header .wc-block-mini-cart__button:hover {
	color: var(--wp--preset--color--caramel) !important;
}

/* Scrolled state — turns dark and shrinks vertically. Padding overrides
   inline values from the FSE template so we have to use !important. */
.site-header.nav-scrolled,
.site-header.nav-scrolled.wp-block-group {
	background-color: rgba(26, 26, 26, 0.95) !important;
	backdrop-filter: blur(12px) !important;
	-webkit-backdrop-filter: blur(12px) !important;
	border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
	color: white !important;
	padding-top: 8px !important;
	padding-bottom: 8px !important;
}

.site-header.nav-scrolled .wp-block-navigation,
.site-header.nav-scrolled .wp-block-navigation-item__content,
.site-header.nav-scrolled .wp-block-navigation a,
.site-header.nav-scrolled .saelk-search-toggle,
.site-header.nav-scrolled .saelk-mobile-toggle,
.site-header.nav-scrolled .wp-block-woocommerce-customer-account,
.site-header.nav-scrolled .wp-block-woocommerce-customer-account a,
.site-header.nav-scrolled .wc-block-mini-cart__button {
	color: white !important;
}

.site-header.nav-scrolled .wp-block-navigation__submenu-icon path {
	stroke: white;
}

.site-header.nav-scrolled .wp-block-site-logo img {
	filter: none !important;
	max-height: 56px;
	width: auto;
}

/* ─── DARK PAGES: force transparent header look ── */
/* WooCommerce account — dark background */
.woocommerce-account .site-header,
.woocommerce-account .site-header.wp-block-group {
	background-color: transparent !important;
	border-bottom: none !important;
}

.woocommerce-account .site-header .wp-block-navigation,
.woocommerce-account .site-header .wp-block-navigation-item__content,
.woocommerce-account .site-header .wp-block-navigation a,
.woocommerce-account .site-header .saelk-search-toggle,
.woocommerce-account .site-header .saelk-mobile-toggle,
.woocommerce-account .site-header .wp-block-woocommerce-customer-account,
.woocommerce-account .site-header .wp-block-woocommerce-customer-account a,
.woocommerce-account .site-header .wc-block-mini-cart__button {
	color: white !important;
}

.woocommerce-account .site-header .wp-block-navigation__submenu-icon path {
	stroke: white;
}

.woocommerce-account .site-header .wp-block-site-logo img {
	filter: none !important;
}

/* ─── TRANSPARENT HEADER (homepage/dark hero pages) ── */
/* Overrides the white header for pages that need transparent */
.site-header--transparent,
.site-header--transparent.wp-block-group {
	background-color: transparent !important;
	border-bottom: none !important;
}

.site-header--transparent .wp-block-navigation,
.site-header--transparent .wp-block-navigation-item__content,
.site-header--transparent .wp-block-navigation a,
.site-header--transparent .saelk-search-toggle,
.site-header--transparent .saelk-mobile-toggle,
.site-header--transparent .wp-block-woocommerce-customer-account,
.site-header--transparent .wp-block-woocommerce-customer-account a,
.site-header--transparent .wc-block-mini-cart__button {
	color: white !important;
}

.site-header--transparent .wp-block-navigation__submenu-icon path {
	stroke: white;
}

.site-header--transparent .wp-block-site-logo img {
	filter: none !important;
}

/* Transparent header scrolled — dark bg */
.site-header--transparent.nav-scrolled,
.site-header--transparent.nav-scrolled.wp-block-group {
	background-color: rgba(26, 26, 26, 0.92) !important;
	backdrop-filter: blur(12px) !important;
	-webkit-backdrop-filter: blur(12px) !important;
	border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

/* ─── NAV TEXT STYLING ──────────────────────────── */

.site-header .wp-block-navigation-item__content {
	font-size: 0.875rem !important;
	font-weight: 600 !important;
	letter-spacing: 0.16em !important;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* ─── NAVIGATION LINKS ─────────────────────────── */

.site-header .wp-block-navigation {
	gap: 2px;
}

.site-header .wp-block-navigation-item__content {
	padding: 8px 16px;
	position: relative;
	transition: color 0.3s ease;
}

.site-header .wp-block-navigation-item__content::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 50%;
	transform: translateX(-50%);
	width: 0;
	height: 2px;
	background-color: var(--wp--preset--color--caramel);
	transition: width 0.3s ease;
}

.site-header .wp-block-navigation-item__content:hover::after,
.site-header .wp-block-navigation-item--current .wp-block-navigation-item__content::after {
	width: 20px;
}

/* ─── DROPDOWN SUBMENUS ────────────────────────── */

.site-header .wp-block-navigation__submenu-container {
	background-color: #222222 !important;
	border: 1px solid rgba(255, 255, 255, 0.08) !important;
	border-radius: var(--wp--custom--border--radius);
	padding: 12px 0;
	min-width: 220px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
	animation: saelk-dropdown-in 0.2s ease;
}

.site-header .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	padding: 10px 24px;
	font-size: 0.8125rem;
	letter-spacing: 0.15em;
	color: white !important;
}

.site-header .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover {
	color: var(--wp--preset--color--caramel) !important;
	background-color: rgba(198, 134, 66, 0.08);
}

.site-header .wp-block-navigation__submenu-container .wp-block-navigation-item__content::after {
	display: none;
}

@keyframes saelk-dropdown-in {
	from {
		opacity: 0;
		transform: translateY(-8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ─── MOBILE NAVIGATION ────────────────────────── */

/* ─── THREE-ZONE HEADER LAYOUT ────────────────── */

.saelk-header-logo {
	flex-shrink: 0;
}

/* Desktop: LOGO | NAV | ICONS */
@media (min-width: 961px) {
	.saelk-header-logo {
		order: -1;
	}
}

/* Mobile: center logo between burger and icons */
@media (max-width: 960px) {
	.saelk-header-left {
		flex: 1;
		min-width: 0;
	}

	.saelk-header-icons {
		flex: 1;
		min-width: 0;
	}
}

/* Mobile toggle button */
.saelk-mobile-toggle {
	background: none;
	border: none;
	color: white;
	cursor: pointer;
	padding: 8px;
	min-width: 44px;
	min-height: 44px;
	display: none;
	align-items: center;
	justify-content: center;
	transition: color 0.3s ease;
}

.saelk-mobile-toggle:hover {
	color: var(--wp--preset--color--caramel);
}

/* Header icon sizes */
.saelk-header-icons .wc-block-mini-cart__button .wc-block-mini-cart__icon {
	width: 22px;
	height: 22px;
}

.saelk-header-icons .wp-block-woocommerce-customer-account svg {
	width: 22px;
	height: 22px;
}

@media (max-width: 960px) {
	.site-header .wp-block-navigation {
		display: none;
	}

	.saelk-mobile-toggle {
		display: flex;
	}

	/* Shrink logo on mobile */
	.site-header .wp-block-site-logo img {
		max-height: 44px;
		width: auto;
	}

	/* Tighter header padding */
	.site-header {
		padding-top: 10px !important;
		padding-bottom: 10px !important;
		padding-left: 16px !important;
		padding-right: 16px !important;
	}
}

@media (min-width: 961px) {
	.saelk-mobile-toggle {
		display: none !important;
	}
}

/* ─── MOBILE SLIDE-OUT PANEL ───────────────────── */

.saelk-mobile-nav {
	position: fixed;
	top: 0;
	left: 0;
	width: 85vw;
	max-width: 420px;
	height: 100vh;
	background-color: #111;
	z-index: 200;
	transform: translateX(-100%);
	transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
	overflow-y: auto;
	display: flex;
	flex-direction: column;
}

.saelk-mobile-nav.is-open {
	transform: translateX(0);
}

.saelk-mobile-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
	backdrop-filter: blur(4px);
	z-index: 199;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
}

.saelk-mobile-backdrop.is-visible {
	opacity: 1;
	pointer-events: auto;
}

/* ── Header: logo + close */
.saelk-mobile-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 24px 28px;
}

.saelk-mobile-logo {
	height: 32px;
	width: auto;
}

.saelk-mobile-close {
	background: none;
	border: none;
	color: var(--wp--preset--color--gray-400);
	cursor: pointer;
	padding: 8px;
	min-width: 44px;
	min-height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.3s ease;
}

.saelk-mobile-close:hover {
	color: white;
}

/* ── Swipe hint */
.saelk-mobile-hint {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 0 28px 16px;
	color: #666;
	font-family: var(--wp--preset--font-family--inter);
	font-size: 0.75rem;
}

.saelk-mobile-hint-line {
	display: block;
	width: 28px;
	height: 1px;
	background: #444;
}

/* ── Nav items */
.saelk-mobile-items {
	flex: 1;
	padding: 0 20px;
}

.saelk-mobile-nav-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 18px 12px;
	color: white;
	font-family: var(--wp--preset--font-family--bebas-neue);
	font-size: 1.375rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	text-decoration: none;
	border: none;
	background: none;
	width: 100%;
	cursor: pointer;
	transition: color 0.2s ease, background 0.2s ease;
	border-radius: 0.75rem;
}

.saelk-mobile-nav-item svg {
	color: #555;
	flex-shrink: 0;
	transition: color 0.2s ease;
}

.saelk-mobile-nav-item:hover {
	color: var(--wp--preset--color--caramel);
}

.saelk-mobile-nav-item:hover svg {
	color: var(--wp--preset--color--caramel);
}

/* Active/current page */
.saelk-mobile-nav-item.is-current {
	background: rgba(198, 134, 66, 0.12);
	color: var(--wp--preset--color--caramel);
}

.saelk-mobile-nav-item.is-current svg {
	color: var(--wp--preset--color--caramel);
}

/* Accordion chevron rotation */
.saelk-mobile-accordion-toggle .saelk-mobile-chevron {
	transition: transform 0.3s ease, color 0.2s ease;
}

.saelk-mobile-accordion-toggle.is-active .saelk-mobile-chevron {
	transform: rotate(180deg);
}

/* ── Submenu */
.saelk-mobile-submenu {
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.3s ease;
	padding-left: 16px;
}

.saelk-mobile-submenu.is-expanded {
	max-height: 500px;
}

.saelk-mobile-submenu a {
	display: block;
	padding: 10px 12px;
	color: #9CA3AF;
	font-family: var(--wp--preset--font-family--oswald);
	font-size: 0.875rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	text-decoration: none;
	border-radius: 0.5rem;
	transition: color 0.2s ease, background 0.2s ease;
}

.saelk-mobile-submenu a:hover {
	color: white;
	background: rgba(255, 255, 255, 0.04);
}

/* ── Divider */
.saelk-mobile-divider {
	height: 1px;
	background: #333;
	margin: 12px 28px;
}

/* ── Bottom section */
.saelk-mobile-bottom {
	padding: 8px 20px 32px;
}

.saelk-mobile-bottom-item {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 12px;
	color: #9CA3AF;
	font-family: var(--wp--preset--font-family--oswald);
	font-size: 0.9375rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	text-decoration: none;
	background: none;
	border: none;
	width: 100%;
	cursor: pointer;
	transition: color 0.2s ease;
	border-radius: 0.5rem;
}

.saelk-mobile-bottom-item:hover {
	color: white;
	background: rgba(255, 255, 255, 0.04);
}

.saelk-mobile-bottom-item svg {
	flex-shrink: 0;
	color: #666;
}

.saelk-mobile-kbd {
	margin-left: auto;
	background: #222;
	border: 1px solid #444;
	border-radius: 6px;
	padding: 2px 8px;
	font-family: var(--wp--preset--font-family--inter);
	font-size: 0.75rem;
	color: #666;
}

/* ── Small screens */
@media (max-width: 400px) {
	.saelk-mobile-nav-item {
		font-size: 1.2rem;
		padding: 14px 10px;
	}
	.saelk-mobile-items {
		padding: 0 12px;
	}
}
