/* Rainbow Art – header search + mobile menu */

:root {
	--ra-h-ink: #2f2f2f;
	--ra-h-muted: #5f6670;
	--ra-h-sage: #94a99f;
	--ra-h-sage-dark: #56705f;
	--ra-h-mauve-dark: #7a5b7a;
	--ra-h-line: #e8e3dc;
	--ra-h-soft: #f6f2ec;
	--ra-h-bg: #faf7f2;
}

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

.ra-hdr-tools {
	display: flex;
	align-items: center;
	gap: 2px;
}

.ra-hdr-btn {
	appearance: none;
	display: inline-grid !important;
	place-items: center;
	flex: none;
	width: 44px !important;
	min-width: 44px !important;
	height: 44px !important;
	margin: 0;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: transparent !important;
	box-shadow: none !important;
	color: var(--ra-h-sage-dark) !important;
	cursor: pointer;
	transition: background-color .15s ease;
}

@media (hover: hover) {
	.ra-hdr-btn:hover {
		background: rgba(148, 169, 159, .16) !important;
	}
}

.ra-hdr-btn:focus-visible,
.ra-menu-dialog a:focus-visible,
.ra-menu-dialog button:focus-visible,
.ra-hdr-results a:focus-visible {
	outline: 3px solid var(--ra-h-mauve-dark) !important;
	outline-offset: 2px;
}

.ra-hdr-ico {
	display: block;
	width: 24px;
	height: 24px;
}

.ra-hdr-menu-btn {
	color: var(--ra-h-ink) !important;
}

.ra-hdr-menu-btn .ra-hdr-ico {
	width: 30px;
	height: 30px;
	stroke-width: 2.4;
}

/* Desktop shows the regular menu; the menu button is for tablet/mobile. */
@media (min-width: 1025px) {
	.ra-hdr-btn.ra-hdr-menu-btn {
		display: none !important;
	}
}

/* ---------- Dialog basics ---------- */

html.ra-hdr-lock {
	overflow: hidden;
}

.ra-hdr-dialog {
	position: fixed;
	inset: 0;
	width: 100%;
	max-width: none;
	height: 100%;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--ra-h-ink);
	font-family: inherit;
}

.ra-hdr-dialog::backdrop {
	background: rgba(35, 30, 35, .42);
}

/* ---------- Search dialog ---------- */

.ra-search-dialog[open] {
	display: flex;
	justify-content: center;
	align-items: flex-start;
}

.ra-search-panel {
	width: min(760px, 100% - 24px);
	max-height: calc(100dvh - 48px);
	margin-top: 24px;
	padding: 16px;
	overflow-y: auto;
	border-radius: 20px;
	background: #fff;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .18);
	animation: ra-hdr-drop .22s ease-out;
}

@media (min-width: 768px) {
	.ra-search-panel {
		margin-top: 80px;
		padding: 20px;
	}
}

.ra-search-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.ra-search-head .ra-hdr-search {
	flex: 1;
}

/* Results go on their own row under the field. */
.ra-search-head .ra-hdr-results {
	flex-basis: 100%;
	order: 3;
	margin-top: 4px;
}

/* ---------- Search field ---------- */

.ra-hdr-search {
	position: relative;
	margin: 0;
}

.ra-hdr-search-ico {
	position: absolute;
	top: 50%;
	inset-inline-start: 16px;
	color: var(--ra-h-muted);
	transform: translateY(-50%);
	pointer-events: none;
}

.ra-hdr-search-ico .ra-hdr-ico {
	width: 20px;
	height: 20px;
}

.ra-hdr-search-input {
	width: 100%;
	height: 54px;
	margin: 0;
	padding: 0 16px !important;
	padding-inline-start: 48px !important;
	border: 1px solid var(--ra-h-line) !important;
	border-radius: 999px !important;
	background: var(--ra-h-soft) !important;
	box-shadow: none !important;
	color: var(--ra-h-ink);
	font: inherit;
	font-size: 17px; /* ≥16px so iOS doesn't zoom */
	text-align: right;
}

.ra-hdr-search-input:focus {
	border-color: var(--ra-h-sage-dark) !important;
	background: #fff !important;
	outline: none;
}

.ra-hdr-search-input::-webkit-search-cancel-button {
	cursor: pointer;
}

/* ---------- Live results ---------- */

.ra-hdr-results:empty {
	display: none;
}

.ra-hdr-results {
	margin-top: 12px;
}

.ra-hdr-group + .ra-hdr-group {
	margin-top: 10px;
}

.ra-hdr-group-label {
	margin: 0 0 4px;
	padding: 0 6px;
	color: var(--ra-h-muted);
	font-size: 13px;
	font-weight: 600;
}

.ra-hdr-result {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 6px;
	border-radius: 12px;
	color: var(--ra-h-ink) !important;
	text-decoration: none !important;
}

.ra-hdr-result:hover {
	background: var(--ra-h-soft);
}

.ra-hdr-result img,
.ra-hdr-result .ra-hdr-result-ph {
	flex: none;
	width: 48px;
	height: 48px;
	border-radius: 10px;
	background: var(--ra-h-soft);
	object-fit: cover;
}

.ra-hdr-result-text {
	display: flex;
	flex-direction: column;
	min-width: 0;
	line-height: 1.35;
}

.ra-hdr-result-title {
	overflow: hidden;
	font-weight: 600;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ra-hdr-result-meta {
	color: var(--ra-h-muted);
	font-size: 14px;
}

.ra-hdr-all {
	display: block;
	margin-top: 10px;
	padding: 12px;
	border-radius: 12px;
	background: var(--ra-h-sage-dark);
	color: #fff !important;
	font-weight: 700;
	text-align: center;
	text-decoration: none !important;
}

.ra-hdr-all:hover {
	background: #47604f;
}

.ra-hdr-note {
	margin: 8px 6px 0;
	color: var(--ra-h-muted);
}

/* ---------- Mobile menu ---------- */

.ra-menu-dialog::backdrop {
	background: rgba(35, 30, 35, .3);
}

.ra-menu-dialog[open] {
	display: flex;
	justify-content: flex-start; /* RTL: panel on the right */
}

.ra-menu-panel {
	display: flex;
	flex-direction: column;
	width: min(480px, 100%);
	height: 100%;
	padding: 14px 20px calc(20px + env(safe-area-inset-bottom));
	overflow-y: auto;
	overscroll-behavior: contain;
	background:
		radial-gradient(120% 60% at 100% 0%, rgba(233, 196, 106, .22), transparent 60%),
		radial-gradient(90% 50% at 0% 100%, rgba(186, 168, 186, .25), transparent 60%),
		var(--ra-h-bg);
	box-shadow: -10px 0 40px rgba(0, 0, 0, .12);
	animation: ra-hdr-slide .3s cubic-bezier(.2, .8, .2, 1);
}

.ra-menu-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 56px;
	margin-bottom: 14px;
}

.ra-menu-top .ra-hdr-close {
	color: var(--ra-h-ink) !important;
}

.ra-menu-home img,
.ra-menu-logo {
	display: block;
	width: auto;
	height: 44px;
}

.ra-menu-search {
	margin-bottom: 8px;
}

.ra-menu-panel .ra-hdr-results {
	padding: 8px;
	border-radius: 16px;
	background: #fff;
}

/* While searching, the results take the space of the menu. */
.ra-menu-panel.is-searching .ra-menu-nav,
.ra-menu-panel.is-searching .ra-menu-actions {
	display: none;
}

.ra-menu-list,
.ra-menu-list .sub-menu {
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

.ra-menu-list > li {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	margin: 0 !important;
	border-bottom: 1px solid var(--ra-h-line);
	animation: ra-hdr-item .35s ease-out both;
	animation-delay: calc(var(--i, 0) * 35ms + 80ms);
}

.ra-menu-list > li > a,
.ra-menu-sub-toggle--label {
	flex: 1;
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 58px;
	padding: 10px 2px !important;
	border: 0 !important;
	background: none !important;
	box-shadow: none !important;
	color: var(--ra-h-ink) !important;
	font-family: "Fredoka_Expanded", "Fredoka", sans-serif;
	font-size: 22px !important;
	font-weight: 600 !important;
	line-height: 1.2;
	text-align: start;
	text-decoration: none !important;
	cursor: pointer;
}

/* Current page: mauve text and a short bar before it. */
.ra-menu-list > li.current-menu-item > a,
.ra-menu-list > li.current-menu-ancestor > a,
.ra-menu-list > li.current-menu-ancestor > .ra-menu-sub-toggle--label {
	color: var(--ra-h-mauve-dark) !important;
}

.ra-menu-list > li.current-menu-item > a::before {
	content: "";
	flex: none;
	width: 4px;
	height: 22px;
	border-radius: 2px;
	background: var(--ra-h-mauve-dark);
}

.ra-menu-sub-toggle {
	appearance: none;
	display: inline-grid !important;
	place-items: center;
	flex: none;
	width: 44px !important;
	height: 44px !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: transparent !important;
	color: var(--ra-h-ink) !important;
	cursor: pointer;
}

.ra-menu-sub-toggle.ra-menu-sub-toggle--label {
	display: flex !important;
	flex: 1;
	width: auto !important;
	height: auto !important;
	border-radius: 0 !important;
	justify-content: space-between;
}

.ra-menu-sub-toggle .ra-hdr-ico {
	width: 22px;
	height: 22px;
	transition: transform .2s ease;
}

.ra-menu-sub-toggle[aria-expanded="true"] .ra-hdr-ico {
	transform: rotate(180deg);
}

.ra-menu-list .sub-menu {
	display: none;
	flex-basis: 100%;
	padding: 0 0 12px !important;
}

.ra-menu-list li.is-open > .sub-menu {
	display: block;
}

.ra-menu-list .sub-menu a {
	display: flex;
	align-items: center;
	min-height: 46px;
	padding: 6px 18px 6px 0 !important;
	border-inline-start: 2px solid var(--ra-h-line);
	color: var(--ra-h-muted) !important;
	font-size: 18px;
	font-weight: 500;
	text-decoration: none !important;
}

.ra-menu-list .sub-menu .current-menu-item > a {
	border-color: var(--ra-h-mauve-dark);
	color: var(--ra-h-mauve-dark) !important;
}

.ra-menu-actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin-top: auto;
	padding-top: 24px;
}

.ra-menu-action {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 84px;
	padding: 12px;
	border: 1px solid var(--ra-h-line);
	border-radius: 16px;
	background: #fff;
	color: var(--ra-h-ink) !important;
	font-weight: 600;
	text-decoration: none !important;
	transition: border-color .15s ease, background-color .15s ease;
}

@media (hover: hover) {
	.ra-menu-action:hover {
		border-color: var(--ra-h-sage-dark);
		background: #f2f6f3;
	}
}

.ra-menu-action .ra-hdr-ico {
	color: var(--ra-h-sage-dark);
	width: 26px;
	height: 26px;
}

.ra-menu-count {
	position: absolute;
	top: 10px;
	inset-inline-end: 14px;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border-radius: 999px;
	background: var(--ra-h-mauve-dark);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 22px;
	text-align: center;
}

/* ---------- Motion ---------- */

@keyframes ra-hdr-slide {
	from { transform: translateX(40px); opacity: 0; }
	to   { transform: none; opacity: 1; }
}

@keyframes ra-hdr-drop {
	from { transform: translateY(-12px); opacity: 0; }
	to   { transform: none; opacity: 1; }
}

@keyframes ra-hdr-item {
	from { transform: translateY(8px); opacity: 0; }
	to   { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.ra-menu-panel,
	.ra-search-panel,
	.ra-menu-list > li {
		animation: none;
	}
}

/* ---------- Header row: menu, search and cart on one line ---------- */

/* The icons' container never wraps, and takes the width it needs. */
.e-con:has(> .elementor-widget-shortcode .ra-hdr-tools) {
	flex-wrap: nowrap !important;
	flex: none !important;
	width: auto !important;
}

/* The header row (logo + icons) stays on one line; the logo gives way on narrow phones.
   Elementor puts boxed containers' children in an .e-con-inner wrapper, so match both. */
:is(.e-con, .e-con-inner):has(> .e-con > .elementor-widget-shortcode .ra-hdr-tools) {
	flex-wrap: nowrap !important;
}

:is(.e-con, .e-con-inner):has(> .e-con > .elementor-widget-shortcode .ra-hdr-tools) > .e-con:not(:has(.ra-hdr-tools)) {
	flex: 0 1 auto !important;
	min-width: 0 !important;
}

:is(.e-con, .e-con-inner):has(> .e-con > .elementor-widget-shortcode .ra-hdr-tools) > .e-con:not(:has(.ra-hdr-tools)) img {
	max-width: 100% !important;
	height: auto !important;
}

/* The header bar has a blur (backdrop-filter), which makes it its own layer: lift it above the
   page banner so the mini-cart window opens on top of the page, not under it. */
.e-con:has(> .e-con-inner > .e-con > .elementor-widget-woocommerce-menu-cart),
.e-con:has(> .e-con > .elementor-widget-woocommerce-menu-cart) {
	position: relative;
	z-index: 60;
}

/* ---------- Mini-cart window on tablet/mobile ----------
   Elementor anchors it to the cart icon, so on some phones it ran off the right edge.
   Here it is a fixed panel across the screen, always fully visible. */
@media (max-width: 1024px) {
	.elementor-widget-woocommerce-menu-cart .elementor-menu-cart__container {
		position: fixed !important;
		top: 76px !important;
		right: 12px !important;
		left: 12px !important;
		bottom: auto !important;
		width: auto !important;
		max-width: none !important;
		z-index: 9999;
	}

	/* Closed cart: hidden AND not clickable. Without this the invisible window sat over the top
	   of the page and swallowed taps (e.g. the product page tabs). */
	.elementor-widget-woocommerce-menu-cart:not(.elementor-menu-cart--shown) .elementor-menu-cart__container {
		visibility: hidden !important;
		pointer-events: none !important;
	}

	.elementor-widget-woocommerce-menu-cart .elementor-menu-cart__main {
		position: relative !important;
		left: auto !important;
		right: auto !important;
		width: 100% !important;
		max-width: 100% !important;
		max-height: calc(100dvh - 100px);
		overflow-y: auto;
		margin: 0 !important;
		border-radius: 16px;
		box-shadow: 0 16px 40px rgba(0, 0, 0, .16);
	}
}
