/*
 * Casetti phone bottom bar and categories sheets (template-parts/site/mobile-nav.php, mobile-nav.js). Loaded with
 * media="(max-width: 899.98px)": nothing here applies on a wide screen. The live mu-plugin casetti-mobile-nav.php and
 * snippet 757076 (proje/ENVANTER-KOD.md §4.1, §2.12): 5 tabs, upper-case labels, the shop tab in a gold circle.
 */
body {
	padding-bottom: calc(var(--casetti-mobile-nav-h) + env(safe-area-inset-bottom));
}

.c-mnav {
	position: fixed;
	z-index: 115;
	inset: auto 0 0;
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	padding: 6px 2px calc(6px + env(safe-area-inset-bottom));
	border-top: 1px solid rgba(20, 15, 6, 0.1);
	background: rgba(255, 255, 255, 0.9);
	box-shadow: 0 -6px 24px -18px rgba(20, 15, 6, 0.5);
	-webkit-backdrop-filter: saturate(1.5) blur(16px);
	backdrop-filter: saturate(1.5) blur(16px);
	-webkit-tap-highlight-color: transparent;
}

.c-mnav__tab {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3px;
	min-width: 0;
	padding: 6px 2px;
	border: 0;
	border-radius: 12px;
	background: none;
	color: #73695c; /* Live #8a8071: 3.9:1, below WCAG AA for 10 px text. */
	font: inherit;
	text-decoration: none;
	cursor: pointer;
	transition: color 0.18s, transform 0.1s;
}

.c-mnav__tab:hover {
	color: #73695c;
}

.c-mnav__tab:active {
	transform: scale(0.92);
}

.c-mnav__tab:focus-visible {
	outline: 2px solid var(--myco-color-accent);
	outline-offset: 2px;
}

.c-mnav__icon {
	position: relative;
	display: grid;
	place-items: center;
	width: 25px;
	height: 25px;
}

.c-mnav__icon .c-icon {
	width: 23px;
	height: 23px;
	stroke-width: 1.8;
}

.c-mnav__label {
	max-width: 100%;
	overflow: hidden;
	font-size: 10px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0.06em;
	text-overflow: ellipsis;
	text-transform: uppercase;
	white-space: nowrap;
}

button.c-mnav__tab .c-mnav__label {
	font-size: 9px;
	letter-spacing: 0.01em;
}

.c-mnav__tab.is-active {
	color: #8f6610; /* Live #b8861a: 3.3:1. */
}

.c-mnav__tab.is-active .c-mnav__icon::before {
	content: "";
	position: absolute;
	z-index: -1;
	inset: -6px -9px;
	border-radius: 11px;
	background: rgba(237, 185, 50, 0.16);
}

/* The shop tab: gold circle. */
.c-mnav__tab--shop .c-mnav__icon {
	width: 36px;
	height: 36px;
	border-radius: 999px;
	background: var(--myco-color-accent);
	box-shadow: 0 3px 10px rgba(237, 185, 50, 0.4);
	color: #20190f;
}

.c-mnav__tab--shop .c-mnav__icon .c-icon {
	width: 21px;
	height: 21px;
}

.c-mnav__tab--shop .c-mnav__label,
.c-mnav__tab--shop:hover .c-mnav__label {
	color: #8f6610;
}

.c-mnav__tab--shop.is-active .c-mnav__icon::before {
	display: none;
}

/* The cart count (the theme's span.myco-cart-count, filled by WooCommerce's fragments). */
.c-mnav .myco-cart-count {
	position: absolute;
	inset-block-start: -6px;
	inset-inline-end: -8px;
	min-width: 16px;
	height: 16px;
	padding: 0 4px;
	border-radius: 9px;
	background: var(--myco-color-accent);
	box-shadow: 0 0 0 2px var(--myco-color-white);
	color: #20190f;
	font: 700 10px/16px var(--myco-font-sans);
	font-variant-numeric: tabular-nums;
	text-align: center;
}

.c-mnav .myco-cart-count[hidden] {
	display: none;
}

/* Fixed bars at the bottom of the screen stand above the bottom bar (the product page's sticky add to cart). */
.myco-sticky-cart {
	inset-block-end: calc(var(--casetti-mobile-nav-h) + env(safe-area-inset-bottom));
	padding-bottom: var(--myco-space-sm);
}

html:not(.cookie-consent-pending):has(.myco-sticky-cart:not([hidden])) body {
	padding-bottom: calc(var(--casetti-mobile-nav-h) + env(safe-area-inset-bottom) + var(--myco-sticky-cart-height, 0px));
}

/* ---------- Sheets (<dialog>): from the bottom, rounded top, a handle ---------- */
.c-mnav-sheet {
	position: fixed;
	inset: 8px 0 0;
	width: 100%;
	max-width: none;
	height: auto;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 22px 22px 0 0;
	background: var(--myco-color-white);
	box-shadow: 0 -18px 50px -22px rgba(20, 15, 6, 0.5);
	color: #20190f;
	font-family: var(--myco-font-sans);
	overscroll-behavior: contain;
	transform: translateY(100%);
	transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), overlay 0.34s allow-discrete, display 0.34s allow-discrete;
	-webkit-tap-highlight-color: transparent;
}

.c-mnav-sheet[open] {
	display: flex;
	flex-direction: column;
	transform: none;
}

@starting-style {
	.c-mnav-sheet[open] {
		transform: translateY(100%);
	}
}

.c-mnav-sheet.is-dragging {
	transition: none;
	user-select: none;
}

.c-mnav-sheet::backdrop {
	background: rgba(20, 15, 6, 0.42);
}

html:has(.c-mnav-sheet[open]) {
	overflow: hidden;
}

.c-mnav-sheet__handle {
	position: relative;
	flex: 0 0 auto;
	width: 70px;
	height: 26px;
	margin: 2px auto 0;
	touch-action: none;
	cursor: grab;
}

.c-mnav-sheet__handle::before {
	content: "";
	position: absolute;
	inset: 50% auto auto 50%;
	width: 42px;
	height: 5px;
	border-radius: 99px;
	background: rgba(20, 15, 6, 0.18);
	transform: translate(-50%, -50%);
}

.c-mnav-sheet__head {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 8px 15px 12px;
	touch-action: none;
}

.c-mnav-sheet__lead {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.c-mnav-sheet .c-mnav-sheet__title {
	margin: 0;
	color: #20190f;
	font: 700 19px/1.15 var(--myco-font-sans);
	letter-spacing: -0.01em;
}

.c-mnav-sheet__title small {
	display: block;
	margin-top: 2px;
	color: #73695c;
	font-size: 11.5px;
	font-weight: 500;
	letter-spacing: 0;
}

.c-mnav-sheet__btn {
	display: grid;
	flex: 0 0 auto;
	place-items: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 1px solid rgba(20, 15, 6, 0.1);
	border-radius: 50%;
	background: #f4efe4;
	color: #20190f;
	cursor: pointer;
}

.c-mnav-sheet__btn:active {
	transform: scale(0.92);
}

.c-mnav-sheet__btn .c-icon {
	width: 18px;
	height: 18px;
	stroke-width: 2;
}

.c-mnav-sheet__field {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 9px;
	margin: 0 15px 12px;
	padding: 12px 14px;
	border: 1px solid rgba(20, 15, 6, 0.1);
	border-radius: 12px;
	background: #f4efe4;
	color: #73695c;
	transition: border-color 0.18s, box-shadow 0.18s, background-color 0.18s;
}

.c-mnav-sheet__field:focus-within {
	border-color: var(--myco-color-accent);
	background: var(--myco-color-white);
	box-shadow: 0 0 0 3px rgba(237, 185, 50, 0.18);
}

.c-mnav-sheet__field .c-icon {
	flex: 0 0 auto;
	width: 17px;
	height: 17px;
	stroke-width: 1.8;
}

.c-mnav-sheet__field input {
	width: 100%;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	outline: 0;
	background: transparent;
	box-shadow: none;
	color: #20190f;
	font: 400 16px/1.3 var(--myco-font-sans);
	-webkit-appearance: none;
	appearance: none;
}

.c-mnav-sheet__field input::placeholder {
	color: #73695c;
	opacity: 1;
}

.c-mnav-sheet__field input::-webkit-search-cancel-button {
	-webkit-appearance: none;
}

.c-mnav-sheet__body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 2px 15px calc(20px + env(safe-area-inset-bottom));
}

.c-mnav-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.c-mnav-grid > li {
	min-width: 0;
}

.c-mnav-grid > li[hidden] {
	display: none;
}

.c-mnav-cat {
	display: flex;
	flex-direction: column;
	gap: 6px;
	width: 100%;
	padding: 0;
	border: 0;
	border-radius: 12px;
	background: none;
	color: #20190f;
	font: inherit;
	text-align: start;
	text-decoration: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.c-mnav-cat:hover {
	color: #20190f;
}

.c-mnav-cat__img {
	position: relative;
	display: block;
	aspect-ratio: 1;
	overflow: hidden;
	border: 1px solid rgba(20, 15, 6, 0.1);
	border-radius: 13px;
	background: linear-gradient(135deg, #f6efe0, #eadfc7);
}

.c-mnav-cat:active .c-mnav-cat__img {
	transform: scale(0.96);
	transition: transform 0.1s;
}

.c-mnav-cat:focus-visible {
	outline: none;
}

.c-mnav-cat:focus-visible .c-mnav-cat__img {
	outline: 2px solid var(--myco-color-accent);
	outline-offset: 2px;
}

.c-mnav-cat__photo {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.c-mnav-cat__initial {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	color: #8f6610;
	font-size: 34px;
	font-weight: 700;
	opacity: 0.6;
}

.c-mnav-cat__more {
	position: absolute;
	inset: auto 6px 6px auto;
	display: grid;
	place-items: center;
	width: 22px;
	height: 22px;
	border-radius: 7px;
	background: rgba(255, 255, 255, 0.92);
	box-shadow: 0 2px 6px -2px rgba(20, 15, 6, 0.4);
	color: #8f6610;
}

.c-mnav-cat__name {
	font-size: 12px;
	font-weight: 600;
	line-height: 1.22;
}

.c-mnav-cat__count {
	color: #73695c;
	font-size: 10.5px;
	font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
	.c-mnav-sheet,
	.c-mnav__tab,
	.c-mnav-cat__img {
		transition: none;
	}
}
