/**
 * greencrops — estilos del header / navbar
 *
 * En la home la navbar es una píldora flotante con margen visible alrededor.
 * En el resto de páginas es una barra cuadrada que cubre el 100% del ancho.
 * El logo y el menú quedan SIEMPRE a la misma distancia del borde de la
 * pantalla en ambos casos: el hueco que flota alrededor de la píldora se
 * descuenta del padding interno de la píldora para compensarlo.
 */

:root {
	--nav-inset: 2.25rem;     /* antes 1.5rem — más aire a ambos lados del logo/botón */
	--nav-float-gap: 1rem;
}

#navbar-wrap {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 100;
}

#navbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	max-width: 1400px;
	margin: 0 auto;
	padding: 0.85rem var(--nav-inset);
}

/* Páginas que no son home: barra cuadrada, blanca, cubre el 100% del ancho.
   El fondo va en el WRAP (no en #navbar) para que llegue al borde real. */
#navbar-wrap:not(.is-home) {
	background: #fff;
	border-bottom: 1px solid #e8e8e8;
}

/* Home: píldora flotante. El hueco (--nav-float-gap) vive en el wrap, y se
   resta del padding propio de la píldora para que el logo quede exactamente
   en la misma posición que en el resto de páginas. */
#navbar-wrap.is-home {
	padding: 1.25rem var(--nav-float-gap) 0;
}
#navbar-wrap.is-home #navbar {
	padding-left: calc(var(--nav-inset) - var(--nav-float-gap));
	padding-right: calc(var(--nav-inset) - var(--nav-float-gap));
	background: #fff;
	border-radius: 9999px;
	border: 1px solid #e8e8e8;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* En páginas que no son la home, el menú fijo no debe tapar el contenido */
body:not(.home) #content {
	padding-top: 76px;
}

/* ─── Menú de navegación (WordPress, escritorio) ─── */
.menu {
	list-style: none;
}
.menu li {
	position: relative;
}
.menu > li > a {
	position: relative;
	display: inline-block;
	padding: 0.5rem 0.875rem;
	font-size: 0.875rem;
	font-weight: 500;
	color: #1a2e1f;
	text-decoration: none;
}

.menu > li > a::before {
	content: '';
	position: absolute;
	left: 0.875rem;
	right: 0.875rem;
	bottom: 2px;
	height: 2px;
	background-color: #f5d93f;
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.25s ease;
}
.menu > li > a:hover::before {
	transform: scaleX(1);
}

.menu .sub-menu {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 220px;
	padding: 0.5rem;
	background: #fff;
	border: 1px solid #e8e8e8;
	border-radius: 12px;
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
	z-index: 50;
	list-style: none;
}
.menu li:hover > .sub-menu,
.menu li:focus-within > .sub-menu {
	display: block;
}

.menu .sub-menu .sub-menu {
	top: 0;
	left: 100%;
}
.menu .sub-menu a {
	display: block;
	padding: 0.55rem 0.75rem;
	border-radius: 8px;
	font-size: 0.875rem;
	font-weight: 500;
	color: #1a2e1f;
	text-decoration: none;
	white-space: nowrap;
}
.menu .sub-menu a:hover {
	background-color: #f8f8f8;
	color: #32563c;
}

.menu li:has(> .sub-menu) > a::after {
	content: '';
	display: inline-block;
	width: 5px;
	height: 5px;
	margin-left: 6px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg) translateY(-2px);
}
.menu .sub-menu li:has(> .sub-menu) > a {
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.menu .sub-menu li:has(> .sub-menu) > a::after {
	transform: rotate(-45deg);
	margin-left: 1rem;
}

/* ─── Menú móvil (acordeón) ─── */
.mobile-menu {
	list-style: none;
}
.mobile-menu li {
	position: relative;
	border-bottom: 1px solid #f1f1f1;
}
.mobile-menu .sub-menu li:last-child,
.mobile-menu > li:last-child {
	border-bottom: none;
}
.mobile-menu a {
	display: block;
	padding: 0.65rem 2.25rem 0.65rem 0.75rem;
	font-size: 0.9rem;
	font-weight: 500;
	color: #1a2e1f;
	text-decoration: none;
}
.mobile-menu a:hover {
	color: #32563c;
}
.mobile-menu .sub-menu {
	display: none;
	list-style: none;
	padding-left: 1rem;
}
.mobile-menu li.is-open > .sub-menu {
	display: block;
}
.mobile-menu .submenu-toggle {
	position: absolute;
	right: 0.25rem;
	top: 0.3rem;
	width: 2rem;
	height: 2rem;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: none;
	cursor: pointer;
	color: #1a2e1f;
}
.mobile-menu .chevron {
	display: inline-block;
	width: 7px;
	height: 7px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg);
	transition: transform 0.2s ease;
}
.mobile-menu li.is-open > .submenu-toggle .chevron {
	transform: rotate(-135deg);
}