/* ==========================================================================
   MAYA - tokens y navegacion movil
   Movil primero. Los breakpoints suben, nunca bajan.
   ========================================================================== */

:root {
	/* Marca - texto. Verdes oscuros que pasan AA sobre blanco. */
	--maya-green:          #1F6B42; /* 6.48:1 sobre blanco */
	--maya-teal:           #00796B; /* 5.32:1 sobre blanco */
	--maya-ink:            #1A3D2B; /* 5.27:1 sobre mostaza */

	/* Marca - acento. Solo titulos grandes, iconos, bordes y fondos. */
	--maya-green-bright:   #2D8A56;
	--maya-teal-bright:    #00A896;
	--maya-teal-vivid:     #02C39A;

	/* Superficies */
	--maya-white:          #FFFFFF;
	--maya-cream:          #FBF6EE;
	--maya-mint:           #E8F5E9;

	/* Llamadas a la accion */
	--maya-mustard:        #E09F3E;
	--maya-mustard-dark:   #C9862A;
	--maya-terracotta:     #E07A5F;

	/* Lineas y apoyos */
	--maya-line:           #E4DED2;
	--maya-muted:          #5B6B60;

	/* Medidas */
	--maya-tap:            44px;   /* minimo tactil */
	--maya-gutter:         16px;
	--maya-radius:         12px;
	--maya-radius-pill:    999px;
	--maya-header-h:       56px;
	--maya-bottomnav-h:    58px;

	/* Capas */
	--maya-z-header:       100;
	--maya-z-drawer:       200;
	--maya-z-bottomnav:    150;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

body {
	background: var(--maya-white);
	color: var(--maya-green);
	/* Deja aire para la barra inferior fija, incluido el area segura del iPhone. */
	padding-bottom: calc(var(--maya-bottomnav-h) + env(safe-area-inset-bottom, 0px));
}

body a { color: var(--maya-teal); }

h1, h2, h3, h4, h5, h6 { color: var(--maya-green); }

/* Nada debe provocar scroll horizontal en un telefono. */
html, body { overflow-x: hidden; }

img { max-width: 100%; height: auto; }

/* --------------------------------------------------------------------------
   Banner superior
   -------------------------------------------------------------------------- */

.maya-topbar {
	background: var(--maya-green);
	color: var(--maya-white);
	padding: 7px var(--maya-gutter);
	text-align: center;
}

.maya-topbar__text {
	margin: 0;
	font-size: 12px;
	line-height: 1.35;
	letter-spacing: .01em;
	font-weight: 500;
}

/* --------------------------------------------------------------------------
   Cabecera
   -------------------------------------------------------------------------- */

.maya-header {
	position: sticky;
	top: 0;
	z-index: var(--maya-z-header);
	background: var(--maya-white);
	border-bottom: 1px solid var(--maya-line);
}

.maya-header__row {
	display: grid;
	grid-template-columns: var(--maya-tap) var(--maya-tap) 1fr var(--maya-tap) var(--maya-tap);
	align-items: center;
	gap: 2px;
	height: var(--maya-header-h);
	padding: 0 6px;
}

.maya-header__logo {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
}

.maya-header__logo a {
	display: flex;
	align-items: center;
	justify-content: center;
	max-width: 100%;
	text-decoration: none;
}

/* El logo original medía ~330px de alto y se comía la primera pantalla. */
.maya-logo-img {
	display: block;
	width: auto;
	height: 34px;
	max-width: 100%;
	object-fit: contain;
}

.maya-logo-text {
	font-size: 19px;
	font-weight: 700;
	letter-spacing: .04em;
	color: var(--maya-green);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* --------------------------------------------------------------------------
   Botones de icono
   -------------------------------------------------------------------------- */

.maya-iconbtn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--maya-tap);
	height: var(--maya-tap);
	padding: 0;
	border: 0;
	border-radius: var(--maya-radius);
	background: transparent;
	color: var(--maya-green);
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.maya-iconbtn svg { width: 22px; height: 22px; }

/* El reset.css de Hello Elementor pinta TODO <button> de magenta (#CC3366)
   al enfocar o al pasar el cursor. Se neutraliza en cada componente propio;
   basta con cubrir :focus ademas de :focus-visible, que es lo que el reset usa. */
.maya-iconbtn:hover,
.maya-iconbtn:focus,
.maya-iconbtn:focus-visible {
	background: var(--maya-mint);
	color: var(--maya-green);
}

.maya-iconbtn:focus-visible {
	outline: 2px solid var(--maya-teal);
	outline-offset: -2px;
}

.maya-iconbtn:focus:not(:focus-visible) { outline: none; }

/* Burbuja del carrito */
.maya-cart-count {
	position: absolute;
	top: 4px;
	right: 2px;
	min-width: 17px;
	height: 17px;
	padding: 0 4px;
	border-radius: var(--maya-radius-pill);
	background: var(--maya-terracotta);
	color: var(--maya-white);
	font-size: 10px;
	font-weight: 700;
	line-height: 17px;
	text-align: center;
	display: none;
}

.maya-cart-count.is-filled { display: block; }

/* --------------------------------------------------------------------------
   Buscador desplegable
   -------------------------------------------------------------------------- */

.maya-search {
	border-top: 1px solid var(--maya-line);
	padding: 10px var(--maya-gutter);
	background: var(--maya-cream);
}

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

.maya-search__form {
	display: flex;
	align-items: center;
	gap: 6px;
	background: var(--maya-white);
	border: 1px solid var(--maya-line);
	border-radius: var(--maya-radius-pill);
	padding: 0 6px 0 14px;
}

.maya-search__field {
	flex: 1 1 auto;
	min-width: 0;
	border: 0;
	background: transparent;
	/* 16px evita que iOS haga zoom al enfocar el campo. */
	font-size: 16px;
	line-height: 1.2;
	padding: 11px 0;
	color: var(--maya-green);
}

.maya-search__field:focus { outline: none; }

.maya-search__submit {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 50%;
	background: var(--maya-green);
	color: var(--maya-white);
	cursor: pointer;
}

.maya-search__submit svg { width: 18px; height: 18px; }

.maya-search__submit:hover,
.maya-search__submit:focus {
	background: var(--maya-ink);
	color: var(--maya-white);
}

/* --------------------------------------------------------------------------
   Pildoras de categoria
   -------------------------------------------------------------------------- */

.maya-pills {
	border-top: 1px solid var(--maya-line);
	background: var(--maya-white);
}

.maya-pills__list {
	display: flex;
	gap: 8px;
	margin: 0;
	padding: 10px var(--maya-gutter);
	list-style: none;
	overflow-x: auto;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	scroll-snap-type: x proximity;
}

.maya-pills__list::-webkit-scrollbar { display: none; }

.maya-pills__item { flex: 0 0 auto; scroll-snap-align: start; }

.maya-pill {
	display: inline-flex;
	align-items: center;
	height: 36px;
	padding: 0 16px;
	border: 1px solid var(--maya-teal-bright);
	border-radius: var(--maya-radius-pill);
	background: var(--maya-white);
	color: var(--maya-teal);
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
	text-decoration: none;
}

.maya-pill.is-active,
.maya-pill:hover {
	background: var(--maya-teal);
	border-color: var(--maya-teal);
	color: var(--maya-white);
}

/* --------------------------------------------------------------------------
   Menu lateral
   -------------------------------------------------------------------------- */

.maya-drawer {
	position: fixed;
	inset: 0;
	z-index: var(--maya-z-drawer);
}

.maya-drawer[hidden] { display: none; }

.maya-drawer__scrim {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	padding: 0;
	background: rgba(26, 61, 43, .45);
	cursor: pointer;
	opacity: 0;
	transition: opacity .25s ease;
}

/* El velo es un <button>: sin esto el reset lo tenia de magenta al pasar el cursor. */
.maya-drawer__scrim:hover,
.maya-drawer__scrim:focus {
	background: rgba(26, 61, 43, .45);
	outline: none;
}

.maya-drawer__panel {
	position: absolute;
	top: 0;
	left: 0;
	bottom: 0;
	width: min(86vw, 340px);
	background: var(--maya-white);
	box-shadow: 0 0 40px rgba(26, 61, 43, .18);
	display: flex;
	flex-direction: column;
	overflow-y: auto;
	overscroll-behavior: contain;
	transform: translateX(-100%);
	transition: transform .28s cubic-bezier(.22, .61, .36, 1);
	z-index: 1;
	padding-bottom: env(safe-area-inset-bottom, 0px);
}

.maya-drawer.is-open .maya-drawer__panel { transform: translateX(0); }
.maya-drawer.is-open .maya-drawer__scrim { opacity: 1; }

.maya-drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 10px 8px 10px var(--maya-gutter);
	border-bottom: 1px solid var(--maya-line);
	position: sticky;
	top: 0;
	background: var(--maya-white);
}

.maya-drawer__title {
	font-size: 16px;
	font-weight: 700;
	color: var(--maya-green);
}

.maya-drawer__menu,
.maya-drawer__cats {
	list-style: none;
	margin: 0;
	padding: 6px 0;
}

.maya-drawer__menu a,
.maya-drawer__cats a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	min-height: var(--maya-tap);
	padding: 10px var(--maya-gutter);
	color: var(--maya-green);
	font-size: 15px;
	font-weight: 500;
	text-decoration: none;
}

.maya-drawer__menu a:hover,
.maya-drawer__cats a:hover { background: var(--maya-mint); }

.maya-drawer__section { border-top: 1px solid var(--maya-line); padding-top: 6px; }

.maya-drawer__label {
	margin: 10px var(--maya-gutter) 2px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .09em;
	text-transform: uppercase;
	color: var(--maya-muted);
}

.maya-drawer__count {
	font-size: 12px;
	font-weight: 600;
	color: var(--maya-muted);
	background: var(--maya-cream);
	border-radius: var(--maya-radius-pill);
	padding: 2px 9px;
}

body.maya-no-scroll { overflow: hidden; }

/* --------------------------------------------------------------------------
   Barra inferior fija
   -------------------------------------------------------------------------- */

.maya-bottomnav {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: var(--maya-z-bottomnav);
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	background: var(--maya-white);
	border-top: 1px solid var(--maya-line);
	padding-bottom: env(safe-area-inset-bottom, 0px);
	box-shadow: 0 -2px 14px rgba(26, 61, 43, .06);
}

.maya-bottomnav__item {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	min-height: var(--maya-bottomnav-h);
	padding: 7px 4px;
	color: var(--maya-muted);
	text-decoration: none;
	-webkit-tap-highlight-color: transparent;
}

.maya-bottomnav__icon { position: relative; display: inline-flex; }
.maya-bottomnav__icon svg { width: 22px; height: 22px; }

.maya-bottomnav__label {
	font-size: 10.5px;
	font-weight: 600;
	letter-spacing: .01em;
}

.maya-bottomnav__item.is-active { color: var(--maya-green); }

.maya-bottomnav__item.is-active .maya-bottomnav__label { font-weight: 700; }

.maya-bottomnav .maya-cart-count { top: -5px; right: -9px; }

/* --------------------------------------------------------------------------
   Accesibilidad
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.maya-drawer__panel,
	.maya-drawer__scrim {
		transition: none;
	}
}

/* --------------------------------------------------------------------------
   Tablet y escritorio
   -------------------------------------------------------------------------- */

@media (min-width: 900px) {
	:root { --maya-header-h: 68px; }

	body { padding-bottom: 0; }

	.maya-bottomnav { display: none; }

	.maya-header__row {
		grid-template-columns: var(--maya-tap) 1fr var(--maya-tap) var(--maya-tap);
		max-width: 1200px;
		margin: 0 auto;
		padding: 0 24px;
	}

	.maya-burger { display: none; }

	.maya-logo-img { height: 44px; }

	.maya-pills__list { max-width: 1200px; margin: 0 auto; justify-content: center; }
}
