/* Barra inferior, menú móvil y buscador en capa. Ver assets/js/navegacion.js. */

.screen-reader-text {
	position: absolute; width: 1px; height: 1px; overflow: hidden;
	clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* Botón de menú: solo móvil y solo con JavaScript (sin JS no haría nada). */
.ph-menu-btn {
	display: none; width: var(--tap); height: var(--tap); flex: none; place-items: center;
	border: 0; border-radius: var(--r-pill); background: transparent; color: var(--hv-tinta); cursor: pointer;
}
.ph-menu-btn:hover, .ph-header .ph-search-btn:hover { background: var(--hv-barro-100); }
.ph-menu-btn:focus-visible, .ph-tabbar__item:focus-visible, .ph-capa button:focus-visible, .ph-capa a:focus-visible {
	outline: none; box-shadow: var(--focus);
}

/* ---------- Barra inferior ---------- */
.ph-tabbar { display: none; }

@media (max-width: 899px) {
	.ph-js .ph-menu-btn { display: grid; }

	body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }

	.ph-tabbar {
		display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
		background: rgba(255, 249, 240, .97); border-top: 1px solid var(--hv-linea);
		padding-bottom: calc(8px + env(safe-area-inset-bottom));
		-webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
	}
	.ph-tabbar__lista { list-style: none; margin: 0; padding: 4px 4px 0; display: grid; grid-template-columns: repeat(5, 1fr); }
	.ph-tabbar__item {
		display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 60px;
		border-radius: var(--r-md); text-decoration: none; color: var(--hv-tinta);
		font-size: 12.5px; font-weight: var(--fw-title); line-height: 1.1;
	}
	.ph-tabbar__icono { width: 52px; height: 30px; border-radius: var(--r-pill); display: grid; place-items: center; }
	.ph-tabbar__item[aria-current="page"] { color: var(--hv-barro-600); }
	.ph-tabbar__item[aria-current="page"] .ph-tabbar__icono { background: var(--hv-barro-100); }
	.ph-tabbar__item:hover { color: var(--hv-barro-600); }
}

/* ---------- Capas (<dialog>) ---------- */
.ph-capa-abierta { overflow: hidden; }

.ph-capa {
	padding: 0; border: 0; color: var(--hv-tinta); background: var(--hv-crema);
	font-family: var(--font); max-width: none; max-height: none;
}
.ph-capa::backdrop { background: rgba(31, 36, 48, .55); }

/* ---------- Menú móvil (hoja inferior) ---------- */
.ph-menu {
	position: fixed; inset: auto 0 0 0; margin: 0; width: 100%; max-height: 90dvh; overflow-y: auto;
	border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 10px 16px calc(24px + env(safe-area-inset-bottom));
	box-shadow: 0 -20px 50px -20px rgba(31, 36, 48, .5);
}
.ph-menu[open] { animation: ph-subir .22s ease-out; }
@keyframes ph-subir { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

.ph-menu__asa { width: 44px; height: 5px; border-radius: var(--r-pill); background: #D9C6AC; margin: 0 auto 6px; }
.ph-menu__cabeza { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.ph-menu__rotulo { font-size: 15px; font-weight: var(--fw-title); letter-spacing: .08em; text-transform: uppercase; color: var(--hv-tinta-2); }
.ph-menu__cerrar {
	width: var(--tap); height: var(--tap); border-radius: var(--r-pill); border: 0; cursor: pointer;
	background: var(--hv-barro-100); color: var(--hv-barro-600); display: grid; place-items: center;
}
.ph-menu__buscar {
	display: flex; align-items: center; gap: 10px; width: 100%; height: 56px; margin: 8px 0 14px; padding: 0 16px;
	border-radius: var(--r-pill); background: var(--hv-blanco); border: 2px solid var(--hv-linea); cursor: pointer;
	color: var(--hv-tinta-2); font: 700 17px var(--font); text-align: left;
}
.ph-menu__buscar svg { color: var(--hv-tinta); flex: none; }
.ph-menu__lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ph-menu__item {
	display: grid; grid-template-columns: 52px 1fr 20px; gap: 14px; align-items: center; min-height: 72px;
	padding: 10px 14px 10px 10px; border-radius: 22px; background: var(--hv-blanco); color: var(--hv-tinta); text-decoration: none;
}
.ph-menu__item:hover { color: var(--hv-tinta); box-shadow: var(--sh-1); }
.ph-menu__icono { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; }
.ph-menu__texto { line-height: 1.25; }
.ph-menu__texto b { display: block; font-size: 19px; font-weight: var(--fw-title); }
.ph-menu__texto span { font-size: 15px; color: var(--hv-tinta-2); font-weight: 600; }
.ph-menu__flecha { color: var(--hv-barro-600); }

/* ---------- Buscador ---------- */
.ph-buscador {
	position: fixed; inset: 0; margin: 0; width: 100%; height: 100dvh; overflow-y: auto;
}
.ph-buscador::backdrop { background: transparent; }

@media (min-width: 900px) {
	.ph-buscador {
		inset: 72px 0 auto; margin: 0 auto; width: min(720px, calc(100% - 48px)); height: auto; max-height: calc(100dvh - 144px);
		border-radius: 28px; box-shadow: var(--sh-3);
	}
	.ph-buscador::backdrop { background: rgba(31, 36, 48, .55); }
}

.ph-buscador__barra {
	position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 6px;
	padding: 10px 10px 10px 6px; background: var(--hv-crema); border-bottom: 1px solid var(--hv-linea);
}
.ph-buscador__volver {
	flex: none; width: var(--tap); height: var(--tap); border-radius: var(--r-pill); border: 0;
	background: transparent; color: var(--hv-tinta); display: grid; place-items: center; cursor: pointer;
}
.ph-buscador__campo {
	flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 6px 0 16px;
	border-radius: var(--r-pill); background: var(--hv-blanco); border: 2px solid var(--hv-barro-600);
}
.ph-buscador__campo input {
	flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
	font: 700 18px var(--font); color: var(--hv-tinta);
}
.ph-buscador__campo input::-webkit-search-cancel-button { display: none; }
.ph-buscador__borrar {
	flex: none; width: 40px; height: 40px; border-radius: var(--r-pill); border: 0;
	background: #F3E7D7; color: var(--hv-tinta); display: grid; place-items: center; cursor: pointer;
}
.ph-buscador__borrar[hidden] { display: none; }

.ph-buscador__cuerpo { padding: 16px 18px 28px; }
.ph-buscador__rotulo { margin: 0 0 10px; font-size: 15px; font-weight: var(--fw-title); letter-spacing: .08em; text-transform: uppercase; color: var(--hv-tinta-2); }
.ph-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ph-chip {
	min-height: var(--tap); padding: 0 16px; border-radius: var(--r-pill); border: 2px solid var(--hv-linea);
	background: var(--hv-blanco); color: var(--hv-tinta); font: 800 16px var(--font); cursor: pointer;
}
.ph-chip:hover { border-color: var(--hv-barro-600); }

.ph-buscador__estado { margin: 0 0 6px; font-size: 15px; font-weight: 700; color: var(--hv-tinta-2); }
.ph-buscador__estado:empty { display: none; }
.ph-buscador__resultados { list-style: none; margin: 0; padding: 0; }
.ph-buscador__resultados li { border-bottom: 1px solid var(--hv-linea); }
.ph-buscador__item { display: flex; flex-direction: column; gap: 2px; padding: 12px 0; color: var(--hv-tinta); text-decoration: none; line-height: 1.3; }
.ph-buscador__item:hover { color: var(--hv-barro-600); }
.ph-buscador__item .ph-kicker { font-size: 13px; }
.ph-buscador__titulo { font-size: 17px; font-weight: var(--fw-title); }

.ph-buscador__vacio { text-align: center; padding: 28px 6px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ph-buscador__vacio[hidden] { display: none; }
.ph-buscador__vacio h2 { margin: 0; font-size: 24px; line-height: 1.2; font-weight: var(--fw-title); text-wrap: balance; }
.ph-buscador__vacio p { margin: 0; color: #3A3F4C; }
.ph-buscador__vacio .ph-chips { justify-content: center; }
.ph-buscador__vacio-icono {
	width: 104px; height: 104px; border-radius: var(--r-pill); background: var(--hv-ocre);
	display: grid; place-items: center; font-size: 48px; font-weight: var(--fw-display); transform: rotate(-8deg);
}

@media (prefers-reduced-motion: reduce) {
	.ph-menu[open] { animation: none; }
}
