/**
 * ILAMURA — two-row header (Phase 4.1)
 */

.ilamura-header {
	position: sticky;
	top: 0;
	z-index: 100;
	width: 100%;
	background: #fff;
	border-bottom: 1px solid var(--ilamura-color-border);
	box-shadow: 0 1px 0 rgba(21, 63, 42, 0.04);
}

.ilamura-header__row--primary {
	background: #fff;
}

.ilamura-header__row--secondary {
	background: var(--ilamura-color-accent-soft);
	border-top: 1px solid rgba(21, 63, 42, 0.08);
}

.ilamura-header__inner {
	display: flex;
	align-items: center;
	gap: 1rem;
	width: 100%;
	max-width: none;
}

.ilamura-header__inner--primary {
	min-height: 4.25rem;
}

.ilamura-header__inner--secondary {
	min-height: 3.75rem;
	padding-block: 0.65rem;
	gap: 0.85rem;
	flex-wrap: wrap;
}

.ilamura-header__brand {
	flex-shrink: 0;
}

.ilamura-header__brand .custom-logo-link {
	display: inline-flex;
	align-items: center;
}

.ilamura-header__brand .custom-logo {
	width: auto;
	max-width: var(--ilamura-logo-width-mobile, 120px);
	max-height: none;
	height: auto;
}

.ilamura-site-title {
	font-family: var(--ilamura-font-display);
	font-size: clamp(1.25rem, 2vw, 1.65rem);
	font-weight: 500;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--ilamura-color-accent);
}

.ilamura-site-title:hover,
.ilamura-site-title:focus-visible {
	color: var(--ilamura-color-natural);
}

.ilamura-header__actions {
	margin-left: auto;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
}

/* Mobile nav toggle */
.ilamura-nav-toggle {
	display: inline-flex;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 2.75rem;
	height: 2.75rem;
	margin-left: auto;
	padding: 0;
	border: 1px solid var(--ilamura-color-border);
	border-radius: 10px;
	background: #fff;
	cursor: pointer;
}

.ilamura-header__actions {
	margin-left: 0;
}

.ilamura-nav-toggle__bar {
	display: block;
	width: 1.125rem;
	height: 1.5px;
	margin-inline: auto;
	background: var(--ilamura-color-accent);
}

.ilamura-nav--primary {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	z-index: 120;
	background: #fff;
	border-bottom: 1px solid var(--ilamura-color-border);
	padding: 1rem var(--ilamura-container-pad) 1.25rem;
	box-shadow: 0 12px 28px rgba(21, 63, 42, 0.08);
}

.ilamura-nav--primary.is-open {
	display: block;
}

.ilamura-header {
	position: sticky;
}

.ilamura-header__row--primary {
	position: relative;
}

.ilamura-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
}

.ilamura-menu a {
	text-decoration: none;
	color: var(--ilamura-color-text);
	font-size: 0.875rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.ilamura-menu a:hover,
.ilamura-menu a:focus-visible,
.ilamura-menu .current-menu-item > a {
	color: var(--ilamura-color-accent);
}

/* Search */
.ilamura-header-search {
	position: relative;
	flex: 1 1 100%;
	min-width: 0;
}

.ilamura-header-search__form {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	background: #fff;
	border: 1px solid rgba(21, 63, 42, 0.14);
	border-radius: 999px;
	padding: 0.2rem 0.35rem 0.2rem 1rem;
	min-height: 2.85rem;
}

.ilamura-header-search__input {
	flex: 1;
	min-width: 0;
	border: 0;
	background: transparent;
	font: inherit;
	font-size: 0.95rem;
	color: var(--ilamura-color-text);
	outline: none;
}

.ilamura-header-search__submit {
	width: 2.35rem;
	height: 2.35rem;
	border: 0;
	border-radius: 999px;
	background: var(--ilamura-color-accent);
	color: #fff;
	cursor: pointer;
	font-size: 1rem;
	line-height: 1;
}

.ilamura-header-search__submit:hover,
.ilamura-header-search__submit:focus-visible {
	background: var(--ilamura-color-accent-hover);
}

.ilamura-header-search__results {
	position: absolute;
	top: calc(100% + 0.4rem);
	left: 0;
	right: 0;
	z-index: 140;
	background: #fff;
	border: 1px solid var(--ilamura-color-border);
	border-radius: 16px;
	box-shadow: 0 16px 40px rgba(21, 63, 42, 0.12);
	max-height: min(22rem, 70vh);
	overflow: auto;
	padding: 0.4rem;
}

.ilamura-header-search__status {
	margin: 0;
	padding: 0.85rem 1rem;
	color: var(--ilamura-color-text-muted);
	font-size: 0.9rem;
}

.ilamura-header-search__item {
	display: grid;
	grid-template-columns: 3rem 1fr auto;
	gap: 0.75rem;
	align-items: center;
	width: 100%;
	padding: 0.55rem 0.65rem;
	border: 0;
	border-radius: 12px;
	background: transparent;
	text-align: left;
	cursor: pointer;
	color: inherit;
	font: inherit;
	text-decoration: none;
}

.ilamura-header-search__item:hover,
.ilamura-header-search__item:focus-visible,
.ilamura-header-search__item.is-active {
	background: var(--ilamura-color-accent-soft);
	outline: none;
}

.ilamura-header-search__thumb {
	width: 3rem;
	height: 3rem;
	border-radius: 10px;
	overflow: hidden;
	background: #f3f1ea;
}

.ilamura-header-search__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ilamura-header-search__name {
	margin: 0;
	font-size: 0.92rem;
	font-weight: 600;
	color: var(--ilamura-color-text);
}

.ilamura-header-search__sku {
	margin: 0.15rem 0 0;
	font-size: 0.75rem;
	color: var(--ilamura-color-text-muted);
}

.ilamura-header-search__price {
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--ilamura-color-accent);
	white-space: nowrap;
}

/* Quick links */
.ilamura-quick-nav {
	width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
}

.ilamura-quick-nav__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 0.55rem;
	min-width: max-content;
}

.ilamura-quick-nav__link {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.45rem 0.8rem;
	border-radius: 999px;
	background: #fff;
	border: 1px solid rgba(21, 63, 42, 0.1);
	text-decoration: none;
	color: var(--ilamura-color-accent);
	font-size: 0.8rem;
	font-weight: 600;
	white-space: nowrap;
}

.ilamura-quick-nav__link:hover,
.ilamura-quick-nav__link:focus-visible {
	border-color: var(--ilamura-color-accent);
	background: #fff;
}

.ilamura-quick-nav__icon {
	width: 1.5rem;
	height: 1.5rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.ilamura-quick-nav__icon img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

/* Checkout bare: no chrome */
body.ilamura-checkout-bare .ilamura-header,
body.ilamura-checkout-bare .ilamura-footer {
	display: none !important;
}

body.ilamura-checkout-bare {
	--ilamura-header-height: 0px;
}

@media (min-width: 768px) {
	.ilamura-nav-toggle {
		display: none;
	}

	.ilamura-header__actions {
		margin-left: auto;
	}

	.ilamura-nav--primary {
		display: block;
		position: static;
		border: 0;
		padding: 0;
		box-shadow: none;
		background: transparent;
	}

	.ilamura-menu {
		flex-direction: row;
		align-items: center;
		gap: 1.5rem;
	}

	.ilamura-header__brand .custom-logo {
		max-width: var(--ilamura-logo-width-desktop, 160px);
	}

	.ilamura-header__inner--secondary {
		flex-wrap: nowrap;
	}

	.ilamura-header-search {
		flex: 1 1 auto;
		max-width: 42rem;
	}

	.ilamura-quick-nav {
		width: auto;
		flex: 0 1 auto;
		max-width: 48%;
	}
}

@media (min-width: 1100px) {
	.ilamura-quick-nav {
		max-width: none;
		overflow: visible;
	}

	.ilamura-quick-nav__list {
		min-width: 0;
		flex-wrap: wrap;
		justify-content: flex-end;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ilamura-header,
	.ilamura-header-search__item,
	.ilamura-quick-nav__link {
		transition: none;
	}
}
